--- trunk/xvidcore/build/generic/configure.in 2004/05/21 14:40:15 1451 +++ trunk/xvidcore/build/generic/configure.in 2005/05/17 15:55:24 1615 @@ -8,16 +8,17 @@ AC_PREREQ([2.50]) -AC_INIT([XviD], [1.0.0], [xvid-devel@xvid.org]) +AC_INIT([XviD], [1.1.0-beta2], [xvid-devel@xvid.org]) AC_CONFIG_SRCDIR(configure.in) dnl Do not forget to increase that when needed. API_MAJOR="4" -API_MINOR="0" +API_MINOR="1" dnl NASM version requirement minimum_nasm_patch_version=34 nasm_prog="nasm" +yasm_prog="yasm" dnl Default CFLAGS -- Big impact on overall speed our_cflags_defaults="-Wall" @@ -161,6 +162,10 @@ i[[3456]]86) AC_MSG_RESULT(ia32) ARCHITECTURE="IA32" + ;; + x86_64) + AC_MSG_RESULT(x86_64) + ARCHITECTURE="X86_64" ;; powerpc) AC_MSG_RESULT(PowerPC) @@ -297,7 +302,7 @@ ;; *) AC_MSG_RESULT([Unknown Platform (Using default -shared -lc -lm)]) - STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" SPECIFIC_LDFLAGS="" SPECIFIC_CFLAGS="" @@ -325,58 +330,79 @@ dnl IA32 dnl -if test "$ARCHITECTURE" = "IA32" ; then +if test "$ARCHITECTURE" = "IA32" -o "$ARCHITECTURE" = "X86_64" ; then dnl - dnl Checking nasm existence + dnl Checking for nasm compatible programs + dnl yasm is preferred over nasm, because... i can use it + dnl to profile assembly code ;-) dnl - AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes]) - if test "$ac_nasm" = "yes" ; then - - dnl - dnl Checking nasm patch version - dnl - AC_MSG_CHECKING([for nasm patch version]) - nasm_patch=`nasm -r | cut -d '.' -f 3 | cut -d ' ' -f 1` - if test -z $nasm_patch ; then - nasm_patch=-1 - fi - AC_MSG_RESULT([$nasm_patch]) + found_nasm_comp_prog="no" + chosen_asm_prog="" - if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then - AC_MSG_WARN([nasm patch version too old - Compiling generic sources only]) - ARCHITECTURE="GENERIC" - else + 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" + fi - dnl - dnl Checking nasm format - win32 or elf - dnl - AC_MSG_CHECKING([for nasm object format]) - case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*) - AC_MSG_RESULT([elf]) - NASM_FORMAT="elf" - PREFIX="" - ;; - [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*) - AC_MSG_RESULT([win32]) - NASM_FORMAT="win32" - PREFIX="-DPREFIX" - ;; - esac - - AS=nasm - AFLAGS="-I\$(= 3.4.0 +dnl ========================================================================== + +if test "$GCC" = "yes" ; then +cat << EOF > test.c +#include +int main(int argc, char **argv) +{ + if (*argv[[1]] == 'M') { + printf("%d", __GNUC__); + } + if (*argv[[1]] == 'm') { + printf("%d", __GNUC_MINOR__); + } + return 0; +} +EOF + $CC -o gcc-ver test.c + + GCC_MAJOR=`./gcc-ver M` + GCC_MINOR=`./gcc-ver m` + + rm -f test.c + rm -f gcc-ver + + # GCC 4.x + if test $GCC_MAJOR -gt 3 ; then + CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g` + CFLAGS=`echo $CFLAGS | sed s,'-freduce-all-givs','',g` + CFLAGS=`echo $CFLAGS | sed s,'-fmove-all-movables','',g` + CFLAGS=`echo $CFLAGS | sed s,'-fnew-ra','',g` + CFLAGS=`echo $CFLAGS | sed s,'-fwritable-strings','',g` + fi + + # GCC 3.4.x + if test $GCC_MAJOR -eq 3 && $GCC_MINOR -gt 3 ; then + CFLAGS=`echo $CFLAGS | sed s,"-mcpu","-mtune",g` + fi +fi + + +dnl ========================================================================== dnl dnl Substitions dnl