--- trunk/xvidcore/build/generic/configure.in 2007/11/23 10:44:11 1788 +++ trunk/xvidcore/build/generic/configure.in 2009/06/09 07:48:57 1875 @@ -1,6 +1,6 @@ dnl ========================================================================== dnl -dnl Autoconf script for XviD +dnl Autoconf script for Xvid dnl dnl Copyright(C) 2003-2004 Edouard Gomez dnl @@ -8,16 +8,16 @@ AC_PREREQ([2.50]) -AC_INIT([XviD], [1.1.0-beta2], [xvid-devel@xvid.org]) +AC_INIT([Xvid], [1.3.0], [xvid-devel@xvid.org]) AC_CONFIG_SRCDIR(configure.in) dnl Do not forget to increase that when needed. API_MAJOR="4" -API_MINOR="1" +API_MINOR="3" -dnl NASM version requirement -minimum_nasm_patch_version=34 -minimum_nasm_minor_version=99 +dnl NASM/YASM version requirement +minimum_yasm_minor_version=8 +minimum_nasm_minor_version=0 minimum_nasm_major_version=2 nasm_prog="nasm" yasm_prog="yasm" @@ -27,7 +27,6 @@ our_cflags_defaults="$our_cflags_defaults -O2" our_cflags_defaults="$our_cflags_defaults -fstrength-reduce" our_cflags_defaults="$our_cflags_defaults -finline-functions" -our_cflags_defaults="$our_cflags_defaults -freduce-all-givs" our_cflags_defaults="$our_cflags_defaults -ffast-math" our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer" @@ -201,7 +200,7 @@ BUS="64BIT" ;; *) - AC_MSG_ERROR([XviD supports only 32/64 bit architectures]) + AC_MSG_ERROR([Xvid supports only 32/64 bit architectures]) ;; esac @@ -265,6 +264,7 @@ AC_MSG_CHECKING(for platform specific LDFLAGS/CFLAGS) SPECIFIC_LDFLAGS="" SPECIFIC_CFLAGS="" +ALTIVEC_CFLAGS="" PRE_SHARED_LIB="" case "$target_os" in linux*|solaris*) @@ -294,7 +294,7 @@ if test x"$macosx_module" = x"no"; then AC_MSG_RESULT([dylib options]) SHARED_LIB="libxvidcore.\$(API_MAJOR).\$(SHARED_EXTENSION)" - 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)" else AC_MSG_RESULT([module options]) PRE_SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)-temp.o" @@ -343,8 +343,6 @@ dnl dnl Checking for nasm compatible programs - dnl yasm is preferred over nasm, because... i can use it - dnl to profile assembly code ;-) dnl found_nasm_comp_prog="no" @@ -353,47 +351,50 @@ dnl Check for yasm first AC_CHECK_PROG([ac_yasm], [$yasm_prog], [yes], [no], , [yes]) if test "$ac_yasm" = "yes" ; then - found_nasm_comp_prog="yes" - chosen_asm_prog="$yasm_prog" + dnl + dnl Checking yasm version + dnl + AC_MSG_CHECKING([for yasm version]) + yasm_minor=`$yasm_prog --version | cut -d '.' -f 2 | cut -d ' ' -f 1` + if test -z $yasm_minor ; then + yasm_minor=-1 + fi + AC_MSG_RESULT([$yasm_minor]) + + dnl Actually, yasm >= 0.7.99.2161 should be ok + dnl But I'm too lazy to check also the patch version... + if test "$yasm_minor" -lt "$minimum_yasm_minor_version" ; then + AC_MSG_WARN([yasm version is too old]) + else + found_nasm_comp_prog="yes" + chosen_asm_prog="$yasm_prog" + fi fi - dnl if yasm hasn't been found, then check for nasm (not buggy version) - if test "$found_nasm_comp_prog" = "no" -a "$ARCHITECTURE" != "X86_64" ; then + dnl Check for nasm (not buggy version) + if test "$found_nasm_comp_prog" = "no" ; then AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes]) if test "$ac_nasm" = "yes" ; then dnl - dnl Checking nasm patch version + dnl Checking nasm version dnl - AC_MSG_CHECKING([for nasm patch version]) - nasm_patch=`$nasm_prog -r | cut -d '.' -f 3 | cut -d ' ' -f 1` + AC_MSG_CHECKING([for nasm version]) nasm_minor=`$nasm_prog -v | cut -d '.' -f 2 | cut -d ' ' -f 1` nasm_major=`$nasm_prog -v | cut -d '.' -f 1 | cut -d ' ' -f 3` - if test -z $nasm_patch ; then - nasm_patch=-1 - fi if test -z $nasm_minor ; then nasm_minor=-1 fi if test -z $nasm_major ; then nasm_major=-1 fi - AC_MSG_RESULT([$nasm_patch]) + AC_MSG_RESULT([$nasm_major]) - if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then - if test "$nasm_minor" -lt "$minimum_nasm_minor_version" ; then - if test "$nasm_major" -lt "$minimum_nasm_major_version" ; then - AC_MSG_WARN([nasm version is too old]) - else - found_nasm_comp_prog="yes" - chosen_asm_prog="$nasm_prog" - fi - else - found_nasm_comp_prog="yes" - chosen_asm_prog="$nasm_prog" - fi + dnl need nasm 2.x for SSE3/4 and X86_64 + if test "$nasm_major" -lt "$minimum_nasm_major_version" ; then + AC_MSG_WARN([nasm version is too old]) else - found_nasm_comp_prog="yes" - chosen_asm_prog="$nasm_prog" + found_nasm_comp_prog="yes" + chosen_asm_prog="$nasm_prog" fi fi fi @@ -405,15 +406,25 @@ AC_MSG_CHECKING([for asm object format]) case "$target_os" in *bsd*|linux*|beos|irix*|solaris*) - AC_MSG_RESULT([elf]) - NASM_FORMAT="elf" + if test "$ARCHITECTURE" = "X86_64" ; then + AC_MSG_RESULT([elf64]) + NASM_FORMAT="elf64" + else + AC_MSG_RESULT([elf]) + NASM_FORMAT="elf" + fi MARK_FUNCS="-DMARK_FUNCS" PREFIX="" ;; [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*) - AC_MSG_RESULT([win32]) - NASM_FORMAT="win32" - PREFIX="-DPREFIX" + if test "$ARCHITECTURE" = "X86_64" ; then + AC_MSG_RESULT([win64]) + NASM_FORMAT="win64" + else + AC_MSG_RESULT([win32]) + NASM_FORMAT="win32" + fi + PREFIX="-DWINDOWS" MARK_FUNCS="" ;; *darwin*) @@ -426,10 +437,10 @@ AS="$chosen_asm_prog" ASSEMBLY_EXTENSION="asm" - AFLAGS="-I\$( int main() { return(0); } EOF - 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 || \ $CC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then AC_MSG_RESULT(yes) SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_H" @@ -494,9 +505,9 @@ return(0); } EOF - 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 AC_MSG_RESULT([yes (Apple)]) - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC" + SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -arch ppc -faltivec -DHAVE_ALTIVEC_PARENTHESES_DECL $TEMP_ALTIVEC" PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC" else cat > conftest.c << EOF @@ -514,8 +525,9 @@ EOF if $CC $TEMP_ALTIVEC -maltivec -mabi=altivec -c conftest.c 2>/dev/null 1>/dev/null ; then AC_MSG_RESULT([yes (GNU)]) - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -maltivec -mabi=altivec -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC" + SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_ALTIVEC_BRACES_DECL $TEMP_ALTIVEC" PPC_ALTIVEC_SOURCES="SRC_PPC_ALTIVEC" + ALTIVEC_CFLAGS="-maltivec -mabi=altivec" else AC_MSG_RESULT([no (ppc support won't be compiled in)]) dnl Only C code can be compiled :-( @@ -686,6 +698,7 @@ AC_SUBST(STATIC_LIB) AC_SUBST(PRE_SHARED_LIB) AC_SUBST(SHARED_LIB) +AC_SUBST(ALTIVEC_CFLAGS) dnl ========================================================================== dnl