[svn] / trunk / xvidcore / build / generic / configure.in Repository:
ViewVC logotype

Diff of /trunk/xvidcore/build/generic/configure.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1382, Mon Mar 22 22:36:25 2004 UTC revision 1535, Sun Aug 22 11:46:10 2004 UTC
# Line 2  Line 2 
2  dnl  dnl
3  dnl Autoconf script for XviD  dnl Autoconf script for XviD
4  dnl  dnl
5  dnl Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr>  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6  dnl  dnl
7  dnl ==========================================================================  dnl ==========================================================================
8    
9  AC_INIT([XviD], [1.0.0 rc3], [xvid-devel@xvid.org])  AC_PREREQ([2.50])
10    
11    AC_INIT([XviD], [1.0.1], [xvid-devel@xvid.org])
12  AC_CONFIG_SRCDIR(configure.in)  AC_CONFIG_SRCDIR(configure.in)
13    
14  dnl Do not forget to increase that when needed.  dnl Do not forget to increase that when needed.
# Line 16  Line 18 
18  dnl NASM version requirement  dnl NASM version requirement
19  minimum_nasm_patch_version=34  minimum_nasm_patch_version=34
20  nasm_prog="nasm"  nasm_prog="nasm"
21    yasm_prog="yasm"
22    
23  dnl Default CFLAGS -- Big impact on overall speed  dnl Default CFLAGS -- Big impact on overall speed
24  our_cflags_defaults="-Wall"  our_cflags_defaults="-Wall"
# Line 162  Line 165 
165                  ;;                  ;;
166                  powerpc)                  powerpc)
167                  AC_MSG_RESULT(PowerPC)                  AC_MSG_RESULT(PowerPC)
168                  dnl ATM the ppc port is out of date                  ARCHITECTURE="PPC"
                 dnl ARCHITECTURE="PPC"  
                 ARCHITECTURE="GENERIC"  
169                  ;;                  ;;
170                  ia64)                  ia64)
171                  AC_MSG_RESULT(ia64)                  AC_MSG_RESULT(ia64)
# Line 328  Line 329 
329  if test "$ARCHITECTURE" = "IA32" ; then  if test "$ARCHITECTURE" = "IA32" ; then
330    
331     dnl     dnl
332     dnl Checking nasm existence     dnl Checking for nasm compatible programs
333       dnl yasm is preferred over nasm, because... i can use it
334       dnl to profile assembly code ;-)
335     dnl     dnl
336    
337       found_nasm_comp_prog="no"
338       chosen_asm_prog=""
339    
340       dnl Check for yasm first
341       AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])
342       if test "$ac_yasm" = "yes" ; then
343         found_nasm_comp_prog="yes"
344         chosen_asm_prog="$yasm_prog"
345       fi
346    
347       dnl if yasm hasn't been found, then check for nasm (not buggy version)
348       if test "$found_nasm_comp_prog" = "no" ; then
349     AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])     AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])
350     if test "$ac_nasm" = "yes" ; then     if test "$ac_nasm" = "yes" ; then
   
351        dnl        dnl
352        dnl Checking nasm patch version        dnl Checking nasm patch version
353        dnl        dnl
354        AC_MSG_CHECKING([for nasm patch version])        AC_MSG_CHECKING([for nasm patch version])
355        nasm_patch=`nasm -r | cut -d '.' -f 3 | cut -d ' ' -f 1`             nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1`
356        if test -z $nasm_patch ; then        if test -z $nasm_patch ; then
357          nasm_patch=-1          nasm_patch=-1
358        fi        fi
# Line 345  Line 360 
360    
361    
362        if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then        if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then
363          AC_MSG_WARN([nasm patch version too old - Compiling generic sources only])                 AC_MSG_WARN([nasm patch version is too old])
         ARCHITECTURE="GENERIC"  
364        else        else
365                   found_nasm_comp_prog="yes"
366                           chosen_asm_prog="$nasm_prog"
367               fi
368           fi
369       fi
370    
371           dnl           dnl
372           dnl Checking nasm format - win32 or elf     dnl Ok now sort what object format we must use
373           dnl           dnl
374           AC_MSG_CHECKING([for nasm object format])     if test "$found_nasm_comp_prog" = "yes" ; then
375           AC_MSG_CHECKING([for asm object format])
376           case "$target_os" in           case "$target_os" in
377                *bsd*|linux*|beos|irix*|solaris*)                *bsd*|linux*|beos|irix*|solaris*)
378                    AC_MSG_RESULT([elf])                    AC_MSG_RESULT([elf])
379                    NASM_FORMAT="elf"                    NASM_FORMAT="elf"
380                   MARK_FUNCS="-DMARK_FUNCS"
381                    PREFIX=""                    PREFIX=""
382                    ;;                    ;;
383                [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)                [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)
384                    AC_MSG_RESULT([win32])                    AC_MSG_RESULT([win32])
385                    NASM_FORMAT="win32"                    NASM_FORMAT="win32"
386                    PREFIX="-DPREFIX"                    PREFIX="-DPREFIX"
387                   MARK_FUNCS=""
388                    ;;                    ;;
389            esac            esac
390    
391            AS=nasm         AS="$chosen_asm_prog"
392            AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX"         AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"
393            ASSEMBLY_EXTENSION="asm"            ASSEMBLY_EXTENSION="asm"
394            ASSEMBLY_SOURCES="SRC_IA32"            ASSEMBLY_SOURCES="SRC_IA32"
        fi  
   
395     else     else
396          AC_MSG_WARN([nasm not found - Compiling generic sources only])         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])
397          ARCHITECTURE="GENERIC"          ARCHITECTURE="GENERIC"
398     fi     fi
   
399  fi  fi
400    
401  dnl  dnl
402  dnl PPC  dnl PPC
403  dnl  dnl
404    dnl With the PPC platform we do not use assembly language, we better keep with
405    dnl intrinsic altivec functions and types as they are supported by both Apple
406    dnl and GNU gcc with very slight changes to code which can be sumed up by:
407    dnl
408    dnl Apple:
409    dnl  - compile with the option -faltivec
410    dnl  - define vectors with parentheses vec = (0,0,0,0)
411    dnl GNU
412    dnl  - compile with -maltivec -mabi=altivec
413    dnl  - include <altivec.h> before using intrincic
414    dnl  - define vectors with vec = {0,0,0,0}
415    dnl
416    dnl * The compile time option will be "injected" into SPECIFIC_CFLAGS variable
417    dnl * The need for altivec.h will also be injected into SPECIFIC_CFLAGS through
418    dnl   a -DHAVE_ALTIVEC_H
419    dnl * The vector definition is handled in portab.h thx to
420    dnl   HAVE_PARENTHESES/BRACES_ALTIVEC_DECL
421    dnl
422    PPC_ALTIVEC_SOURCES=""
423  if test "$ARCHITECTURE" = "PPC" ; then  if test "$ARCHITECTURE" = "PPC" ; then
424     AS="\$(CC)"     AS="\$(CC)"
425     AFLAGS="-c"     AFLAGS=""
426     ASSEMBLY_EXTENSION="s"     ASSEMBLY_EXTENSION=".s"
427     ASSEMBLY_SOURCES="SRC_PPC"     ASSEMBLY_SOURCES=""
428     AC_MSG_CHECKING([for Altivec support])  
429     cat > conftest.S << EOF     AC_MSG_CHECKING([for altivec.h])
430           .text  cat > conftest.c << EOF
431           vxor 0,0,0  #include <altivec.h>
432    int main() { return(0); }
433  EOF  EOF
434     if $CC -c conftest.S 2>/dev/null 1>/dev/null ; then     if $CC -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \
435          $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
436          AC_MSG_RESULT(yes)          AC_MSG_RESULT(yes)
437          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DARCH_IS_PPC_ALTIVEC"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"
438          ASSEMBLY_SOURCES="SRC_ALTIVEC"          TEMP_ALTIVEC="-DHAVE_ALTIVEC_H"
439     else     else
440          AC_MSG_RESULT(no)          AC_MSG_RESULT(no)
441            TEMP_ALTIVEC=""
442     fi     fi
443    
444       AC_MSG_CHECKING([for Altivec compiler support])
445    cat > conftest.c << EOF
446    #ifdef HAVE_ALTIVEC_H
447    #include <altivec.h>
448    #endif
449    
450    int main()
451    {
452      vector unsigned int vartest2 = (vector unsigned int)(0);
453      vector unsigned int vartest3 = (vector unsigned int)(1);
454      vartest2 = vec_add(vartest2, vartest3);
455      return(0);
456    }
457    EOF
458       if $CC $TEMP_ALTIVEC -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then
459            AC_MSG_RESULT([yes (Apple)])
460            SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"
461            PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
462       else
463    cat > conftest.c << EOF
464    #ifdef HAVE_ALTIVEC_H
465    #include <altivec.h>
466    #endif
467    
468    int main()
469    {
470      vector unsigned int vartest2 = (vector unsigned int){0};
471      vector unsigned int vartest3 = (vector unsigned int){1};
472      vartest2 = vec_add(vartest2, vartest3);
473      return(0);
474    }
475    EOF
476       if $CC $TEMP_ALTIVEC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
477            AC_MSG_RESULT([yes (GNU)])
478            SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -maltivec -mabi=altivec -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC"
479            PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
480       else
481            AC_MSG_RESULT([no (ppc support won't be compiled in)])
482            dnl Only C code can be compiled :-(
483            ARCHITECTURE="GENERIC"
484       fi
485       fi
486    
487     rm -f conftest.*     rm -f conftest.*
488  fi  fi
489    
# Line 439  Line 523 
523  AC_CHECK_HEADERS(  AC_CHECK_HEADERS(
524          stdio.h \          stdio.h \
525          signal.h \          signal.h \
526            stdlib.h \
527            string.h \
528            assert.h \
529            math.h \
530          , , AC_MSG_ERROR(Missing header file))          , , AC_MSG_ERROR(Missing header file))
531    
532  dnl ==========================================================================  dnl ==========================================================================
# Line 490  Line 578 
578  AC_SUBST(SPECIFIC_LDFLAGS)  AC_SUBST(SPECIFIC_LDFLAGS)
579  AC_SUBST(SPECIFIC_CFLAGS)  AC_SUBST(SPECIFIC_CFLAGS)
580  AC_SUBST(DCT_IA64_SOURCES)  AC_SUBST(DCT_IA64_SOURCES)
581    AC_SUBST(PPC_ALTIVEC_SOURCES)
582  AC_SUBST(RANLIB)  AC_SUBST(RANLIB)
583  AC_SUBST(API_MAJOR)  AC_SUBST(API_MAJOR)
584  AC_SUBST(API_MINOR)  AC_SUBST(API_MINOR)

Legend:
Removed from v.1382  
changed lines
  Added in v.1535

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4