[svn] / branches / release-1_3-branch / xvidcore / build / generic / configure.in Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/build/generic/configure.in

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

revision 1535, Sun Aug 22 11:46:10 2004 UTC revision 1878, Mon Oct 5 09:55:46 2009 UTC
# Line 1  Line 1 
1  dnl ==========================================================================  dnl ==========================================================================
2  dnl  dnl
3  dnl Autoconf script for XviD  dnl Autoconf script for Xvid
4  dnl  dnl
5  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>  dnl Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6  dnl  dnl
# Line 8  Line 8 
8    
9  AC_PREREQ([2.50])  AC_PREREQ([2.50])
10    
11  AC_INIT([XviD], [1.0.1], [xvid-devel@xvid.org])  AC_INIT([Xvid], [1.3.0], [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.
15  API_MAJOR="4"  API_MAJOR="4"
16  API_MINOR="0"  API_MINOR="3"
17    
18  dnl NASM version requirement  dnl NASM/YASM version requirement
19  minimum_nasm_patch_version=34  minimum_yasm_minor_version=8
20    minimum_nasm_minor_version=0
21    minimum_nasm_major_version=2
22  nasm_prog="nasm"  nasm_prog="nasm"
23  yasm_prog="yasm"  yasm_prog="yasm"
24    
# Line 25  Line 27 
27  our_cflags_defaults="$our_cflags_defaults -O2"  our_cflags_defaults="$our_cflags_defaults -O2"
28  our_cflags_defaults="$our_cflags_defaults -fstrength-reduce"  our_cflags_defaults="$our_cflags_defaults -fstrength-reduce"
29  our_cflags_defaults="$our_cflags_defaults -finline-functions"  our_cflags_defaults="$our_cflags_defaults -finline-functions"
 our_cflags_defaults="$our_cflags_defaults -freduce-all-givs"  
30  our_cflags_defaults="$our_cflags_defaults -ffast-math"  our_cflags_defaults="$our_cflags_defaults -ffast-math"
31  our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer"  our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer"
32    
# Line 163  Line 164 
164            AC_MSG_RESULT(ia32)            AC_MSG_RESULT(ia32)
165                  ARCHITECTURE="IA32"                  ARCHITECTURE="IA32"
166                  ;;                  ;;
167              x86_64)
168                    AC_MSG_RESULT(x86_64)
169                    ARCHITECTURE="X86_64"
170                    ;;
171                  powerpc)                  powerpc)
172                  AC_MSG_RESULT(PowerPC)                  AC_MSG_RESULT(PowerPC)
173                  ARCHITECTURE="PPC"                  ARCHITECTURE="PPC"
# Line 195  Line 200 
200          BUS="64BIT"          BUS="64BIT"
201          ;;          ;;
202       *)       *)
203          AC_MSG_ERROR([XviD supports only 32/64 bit architectures])          AC_MSG_ERROR([Xvid supports only 32/64 bit architectures])
204          ;;          ;;
205  esac  esac
206    
# Line 259  Line 264 
264  AC_MSG_CHECKING(for platform specific LDFLAGS/CFLAGS)  AC_MSG_CHECKING(for platform specific LDFLAGS/CFLAGS)
265  SPECIFIC_LDFLAGS=""  SPECIFIC_LDFLAGS=""
266  SPECIFIC_CFLAGS=""  SPECIFIC_CFLAGS=""
267    ALTIVEC_CFLAGS=""
268  PRE_SHARED_LIB=""  PRE_SHARED_LIB=""
269  case "$target_os" in  case "$target_os" in
270       *bsd*|linux*|irix*|solaris*)       linux*|solaris*)
271            AC_MSG_RESULT([ok])
272            STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
273            SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
274            SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -Wl,--version-script=libxvidcore.ld -lc -lm"
275            SPECIFIC_CFLAGS="-fPIC"
276            ;;
277         *bsd*|irix*)
278          AC_MSG_RESULT([ok])          AC_MSG_RESULT([ok])
279          STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"          STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
280          SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"          SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
# Line 281  Line 294 
294          if test x"$macosx_module" = x"no"; then          if test x"$macosx_module" = x"no"; then
295             AC_MSG_RESULT([dylib options])             AC_MSG_RESULT([dylib options])
296             SHARED_LIB="libxvidcore.\$(API_MAJOR).\$(SHARED_EXTENSION)"             SHARED_LIB="libxvidcore.\$(API_MAJOR).\$(SHARED_EXTENSION)"
297             SPECIFIC_LDFLAGS="-dynamiclib -flat_namespace -compatibility_version \$(API_MAJOR) -current_version \$(API_MAJOR).\$(API_MINOR) -install_name \$(libdir)/\$(SHARED_LIB)"             SPECIFIC_LDFLAGS="-Wl,-read_only_relocs,suppress -dynamiclib -flat_namespace -compatibility_version \$(API_MAJOR) -current_version \$(API_MAJOR).\$(API_MINOR) -install_name \$(libdir)/\$(SHARED_LIB)"
298          else          else
299             AC_MSG_RESULT([module options])             AC_MSG_RESULT([module options])
300             PRE_SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)-temp.o"             PRE_SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)-temp.o"
# Line 326  Line 339 
339  dnl IA32  dnl IA32
340  dnl  dnl
341    
342  if test "$ARCHITECTURE" = "IA32" ; then  if test "$ARCHITECTURE" = "IA32" -o "$ARCHITECTURE" = "X86_64" ; then
343    
344     dnl     dnl
345     dnl Checking for nasm compatible programs     dnl Checking for nasm compatible programs
    dnl yasm is preferred over nasm, because... i can use it  
    dnl to profile assembly code ;-)  
346     dnl     dnl
347    
348     found_nasm_comp_prog="no"     found_nasm_comp_prog="no"
# Line 340  Line 351 
351     dnl Check for yasm first     dnl Check for yasm first
352     AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])     AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes])
353     if test "$ac_yasm" = "yes" ; then     if test "$ac_yasm" = "yes" ; then
354           dnl
355           dnl Checking yasm version
356           dnl
357           AC_MSG_CHECKING([for yasm version])
358           yasm_minor=`$yasm_prog --version | cut -d '.' -f 2 | cut -d ' ' -f 1`
359           if test -z $yasm_minor ; then
360              yasm_minor=-1
361           fi
362           AC_MSG_RESULT([$yasm_minor])
363    
364           dnl Actually, yasm >= 0.7.99.2161 should be ok
365           dnl But I'm too lazy to check also the patch version...
366           if test "$yasm_minor" -lt "$minimum_yasm_minor_version" ; then
367             AC_MSG_WARN([yasm version is too old])
368           else
369       found_nasm_comp_prog="yes"       found_nasm_comp_prog="yes"
370       chosen_asm_prog="$yasm_prog"       chosen_asm_prog="$yasm_prog"
371     fi     fi
372       fi
373    
374     dnl if yasm hasn't been found, then check for nasm (not buggy version)     dnl Check for nasm (not buggy version)
375     if test "$found_nasm_comp_prog" = "no" ; then     if test "$found_nasm_comp_prog" = "no" ; then
376         AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])         AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])
377         if test "$ac_nasm" = "yes" ; then         if test "$ac_nasm" = "yes" ; then
378             dnl             dnl
379             dnl Checking nasm patch version             dnl Checking nasm version
380             dnl             dnl
381             AC_MSG_CHECKING([for nasm patch version])             AC_MSG_CHECKING([for nasm version])
382             nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1`             nasm_minor=`$nasm_prog -v | cut -d '.' -f 2 | cut -d ' ' -f 1`
383             if test -z $nasm_patch ; then             nasm_major=`$nasm_prog -v | cut -d '.' -f 1 | cut -d ' ' -f 3`
384                nasm_patch=-1             if test -z $nasm_minor ; then
385             fi                nasm_minor=-1
386             AC_MSG_RESULT([$nasm_patch])             fi
387               if test -z $nasm_major ; then
388                  nasm_major=-1
389             if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then             fi
390                 AC_MSG_WARN([nasm patch version is too old])             AC_MSG_RESULT([$nasm_major])
391    
392               dnl need nasm 2.x for SSE3/4 and X86_64
393               if test "$nasm_major" -lt "$minimum_nasm_major_version" ; then
394                 AC_MSG_WARN([nasm version is too old])
395             else             else
396                 found_nasm_comp_prog="yes"                 found_nasm_comp_prog="yes"
397                         chosen_asm_prog="$nasm_prog"                         chosen_asm_prog="$nasm_prog"
# Line 375  Line 406 
406         AC_MSG_CHECKING([for asm object format])         AC_MSG_CHECKING([for asm object format])
407         case "$target_os" in         case "$target_os" in
408             *bsd*|linux*|beos|irix*|solaris*)             *bsd*|linux*|beos|irix*|solaris*)
409                   if test "$ARCHITECTURE" = "X86_64" ; then
410                       AC_MSG_RESULT([elf64])
411                       NASM_FORMAT="elf64"
412                   else
413                 AC_MSG_RESULT([elf])                 AC_MSG_RESULT([elf])
414                 NASM_FORMAT="elf"                 NASM_FORMAT="elf"
415                   fi
416                 MARK_FUNCS="-DMARK_FUNCS"                 MARK_FUNCS="-DMARK_FUNCS"
417                     PREFIX=""                     PREFIX=""
418                 ;;                 ;;
419             [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)             [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)
420                   if test "$ARCHITECTURE" = "X86_64" ; then
421                       AC_MSG_RESULT([win64])
422                       NASM_FORMAT="win64"
423                   else
424                 AC_MSG_RESULT([win32])                 AC_MSG_RESULT([win32])
425                 NASM_FORMAT="win32"                 NASM_FORMAT="win32"
426                   fi
427                   PREFIX="-DWINDOWS"
428                   MARK_FUNCS=""
429                   ;;
430               *darwin*)
431                   AC_MSG_RESULT([macho])
432                   NASM_FORMAT="macho"
433                 PREFIX="-DPREFIX"                 PREFIX="-DPREFIX"
434                 MARK_FUNCS=""                 MARK_FUNCS=""
435                 ;;                 ;;
436         esac         esac
437    
438         AS="$chosen_asm_prog"         AS="$chosen_asm_prog"
        AFLAGS="-I\$(<D)/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"  
439         ASSEMBLY_EXTENSION="asm"         ASSEMBLY_EXTENSION="asm"
440         ASSEMBLY_SOURCES="SRC_IA32"         AFLAGS="-I\$(<D)/ -I../../src/ -f $NASM_FORMAT $PREFIX $MARK_FUNCS"
441           ASSEMBLY_SOURCES="SRC_${ARCHITECTURE}"
442           if test "$ARCHITECTURE" = "X86_64" ; then
443                   AFLAGS=${AFLAGS}" -DARCH_IS_X86_64"
444           fi
445     else     else
446         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])         AC_MSG_WARN([no correct assembler was found - Compiling generic sources only])
447         ARCHITECTURE="GENERIC"         ARCHITECTURE="GENERIC"
# Line 406  Line 456 
456  dnl and GNU gcc with very slight changes to code which can be sumed up by:  dnl and GNU gcc with very slight changes to code which can be sumed up by:
457  dnl  dnl
458  dnl Apple:  dnl Apple:
459  dnl  - compile with the option -faltivec  dnl  - compile with the option -arch ppc -faltivec
460  dnl  - define vectors with parentheses vec = (0,0,0,0)  dnl  - define vectors with parentheses vec = (0,0,0,0)
461  dnl GNU  dnl GNU
462  dnl  - compile with -maltivec -mabi=altivec  dnl  - compile with -maltivec -mabi=altivec
# Line 431  Line 481 
481  #include <altivec.h>  #include <altivec.h>
482  int main() { return(0); }  int main() { return(0); }
483  EOF  EOF
484     if $CC -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \     if $CC -arch ppc -faltivec -c conftest.c 2>/dev/null 1>/dev/null || \
485        $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then        $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
486          AC_MSG_RESULT(yes)          AC_MSG_RESULT(yes)
487          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H"
# Line 455  Line 505 
505    return(0);    return(0);
506  }  }
507  EOF  EOF
508     if $CC $TEMP_ALTIVEC -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then     if $CC $TEMP_ALTIVEC -arch ppc -faltivec -c conftest.c 2>/dev/null 1>/dev/null ; then
509          AC_MSG_RESULT([yes (Apple)])          AC_MSG_RESULT([yes (Apple)])
510          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -arch ppc -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC"
511          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
512     else     else
513  cat > conftest.c << EOF  cat > conftest.c << EOF
# Line 475  Line 525 
525  EOF  EOF
526     if $CC $TEMP_ALTIVEC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then     if $CC $TEMP_ALTIVEC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then
527          AC_MSG_RESULT([yes (GNU)])          AC_MSG_RESULT([yes (GNU)])
528          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -maltivec -mabi=altivec -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC"          SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC"
529          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"          PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC"
530            ALTIVEC_CFLAGS="-maltivec -mabi=altivec"
531     else     else
532          AC_MSG_RESULT([no (ppc support won't be compiled in)])          AC_MSG_RESULT([no (ppc support won't be compiled in)])
533          dnl Only C code can be compiled :-(          dnl Only C code can be compiled :-(
# Line 531  Line 582 
582    
583  dnl ==========================================================================  dnl ==========================================================================
584  dnl  dnl
585    dnl Check for pthread
586    dnl
587    dnl ==========================================================================
588    
589    AC_CHECK_HEADER(
590            pthread.h,
591            AC_CHECK_LIB(
592                    pthread,
593                    pthread_create,
594                    SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD"
595                    SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread",
596                    AC_MSG_WARN(Pthread not supported. No SMP support)),
597            AC_MSG_WARN(Pthread not supported. No SMP support))
598    
599    dnl ==========================================================================
600    dnl
601  dnl Now we can set CFLAGS if needed  dnl Now we can set CFLAGS if needed
602  dnl  dnl
603  dnl ==========================================================================  dnl ==========================================================================
# Line 555  Line 622 
622  fi  fi
623    
624  dnl ==========================================================================  dnl ==========================================================================
625    dnl Some gcc flags can't be used for gcc >= 3.4.0
626    dnl ==========================================================================
627    
628    if test "$GCC" = "yes" ; then
629    cat << EOF > test.c
630    #include <stdio.h>
631    int main(int argc, char **argv)
632    {
633            if (*argv[[1]] == 'M') {
634                    printf("%d", __GNUC__);
635            }
636            if (*argv[[1]] == 'm') {
637                    printf("%d", __GNUC_MINOR__);
638            }
639            return 0;
640    }
641    EOF
642            $CC -o gcc-ver test.c
643    
644            GCC_MAJOR=`./gcc-ver M`
645            GCC_MINOR=`./gcc-ver m`
646    
647            rm -f test.c
648            rm -f gcc-ver
649    
650            # GCC 4.x
651            if test "${GCC_MAJOR}" -gt 3 ; then
652                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
653                    CFLAGS=`echo $CFLAGS | sed s,'-freduce-all-givs','',g`
654                    CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g`
655                    CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g`
656                    CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g`
657            fi
658    
659            # GCC 3.4.x
660            if test "${GCC_MAJOR}" -eq 3 && test "${GCC_MINOR}" -gt 3 ; then
661                    CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g`
662            fi
663    fi
664    
665    
666    dnl ==========================================================================
667  dnl  dnl
668  dnl Substitions  dnl Substitions
669  dnl  dnl
# Line 585  Line 694 
694  AC_SUBST(STATIC_LIB)  AC_SUBST(STATIC_LIB)
695  AC_SUBST(PRE_SHARED_LIB)  AC_SUBST(PRE_SHARED_LIB)
696  AC_SUBST(SHARED_LIB)  AC_SUBST(SHARED_LIB)
697    AC_SUBST(ALTIVEC_CFLAGS)
698    
699  dnl ==========================================================================  dnl ==========================================================================
700  dnl  dnl

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

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