--- trunk/xvidcore/build/generic/configure.in 2003/02/09 23:08:56 827 +++ branches/dev-api-4/xvidcore/build/generic/configure.in 2003/05/04 23:58:10 1006 @@ -6,9 +6,13 @@ dnl dnl ========================================================================== -AC_INIT([XviD], [0.9.1 (wip)], [xvid-devel@xvid.org]) +AC_INIT([XviD], [1.0.0 cvs-snapshot], [xvid-devel@xvid.org]) AC_CONFIG_SRCDIR(configure.in) +dnl Do not forget to increase that when needed. +API_MAJOR="3" +API_MINOR="0" + dnl NASM version requirement minimum_nasm_patch_version=34 nasm_prog="nasm" @@ -16,7 +20,6 @@ dnl Default CFLAGS -- Big impact on overall speed our_cflags_defaults="-Wall" our_cflags_defaults="$our_cflags_defaults -O2" -our_cflags_defaults="$our_cflags_defaults -fPIC" our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer" our_cflags_defaults="$our_cflags_defaults -ffast-math" our_cflags_defaults="$our_cflags_defaults -funroll-loops" @@ -29,6 +32,8 @@ FEATURES="" DIVX4COMPAT_SOURCES="" +DIVX4_ENCORE="" +DIVX4_DECORE="" dnl BIGLUT aka old VLC code AC_ARG_ENABLE(oldvlc, @@ -54,6 +59,15 @@ FEATURES="$FEATURES -D_PROFILING_" fi]) +dnl GNU Profiling options +AC_ARG_ENABLE(gnuprofile, + AC_HELP_STRING([--enable-gnuprofile], + [Enable profiling informations for gprof]), + [if test "$enable_gnuprofile" = "yes" ; then + GNU_PROF_CFLAGS="-pg -fprofile-arcs -ftest-coverage" + GNU_PROF_LDFLAGS="-pg" + fi]) + dnl Assembly code AC_ARG_ENABLE(assembly, AC_HELP_STRING([--disable-assembly], @@ -73,9 +87,10 @@ [Enable DivX4 compatibility API]), [if test "$enable_divx4compat" = "yes" ; then DIVX4COMPAT_SOURCES="SRC_DIVX4COMPAT" + DIVX4_ENCORE="encore;" + DIVX4_DECORE="decore;" fi]) - dnl ========================================================================== dnl Default install prefix and checks build type dnl ========================================================================== @@ -99,7 +114,6 @@ AC_MSG_CHECKING(whether to use default CFLAGS) if test x"$CFLAGS" = x"" ; then force_default_cc_options="yes" - CFLAGS="$our_cflags_defaults" AC_MSG_RESULT([yes]) else force_default_cc_options="no" @@ -116,6 +130,12 @@ AC_PROG_INSTALL dnl ========================================================================== +dnl Check for the ranlib program to generate static library index +dnl ========================================================================== + +AC_PROG_RANLIB + +dnl ========================================================================== dnl dnl This part looks for: dnl @@ -214,8 +234,8 @@ OBJECT_EXTENSION="o" ;; [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks) - AC_MSG_RESULT([.dll .lib .obj]) - STATIC_EXTENSION="lib" + AC_MSG_RESULT([.dll .a .obj]) + STATIC_EXTENSION="a" SHARED_EXTENSION="dll" OBJECT_EXTENSION="obj" ;; @@ -233,36 +253,58 @@ ;; esac +dnl ========================================================================== +dnl +dnl Determines best options for CC and LD +dnl - STATIC_LIB, SHARED_LIB, SPECIFIC_CFLAGS, SPECIFIC_LDLAGS +dnl +dnl ========================================================================== + AC_MSG_CHECKING(for platform specific LDFLAGS/CFLAGS) -OS_LDFLAGS="" +SPECIFIC_LDFLAGS="" +SPECIFIC_CFLAGS="" case "$target_os" in *bsd*|linux*|irix*|solaris*) - AC_MSG_RESULT([-shared -lc -lm]) - OS_LDFLAGS="-shared -lc -lm" + AC_MSG_RESULT([ok]) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" + SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR) -shared -lc -lm" + SPECIFIC_CFLAGS="-fPIC" ;; [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks) - AC_MSG_RESULT([-shared -Wl,--dll,--out-implib,\$@.a]) - OS_LDFLAGS="-shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" - CFLAGS="$CFLAGS -mno-cygwin" + AC_MSG_RESULT([ok]) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" + SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def" + SPECIFIC_CFLAGS="-mno-cygwin" ;; darwin*|raphsody*) - AC_MSG_RESULT([-dynamiclib]) - OS_LDFLAGS="-dynamiclib" - CFLAGS="$CFLAGS -fno-common" + AC_MSG_RESULT([ok]) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="libxvidcore.\$(API_MAJOR).\$(SHARED_EXTENSION)" + SPECIFIC_LDFLAGS="-dynamiclib -flat_namespace -compatibility_version \$(API_MAJOR) -current_version \$(API_MINOR) -install_name \$(libdir)/\$(SHARED_LIB)" + SPECIFIC_CFLAGS="-fPIC -fno-common -no-cpp-precomp" ;; beos) - AC_MSG_RESULT([-nostart]) - OS_LDFLAGS="-nostart" + AC_MSG_RESULT([ok]) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" + SPECIFIC_LDFLAGS="-nostart" + SPECIFIC_CFLAGS="-fPIC" ;; *) - AC_MSG_RESULT([Unknown OS - -shared -lc -lm]) - OS_LDFLAGS="" + AC_MSG_RESULT([Unknown Platform (Using default -shared -lc -lm)]) + STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" + SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)" + SPECIFIC_LDFLAGS="" + SPECIFIC_CFLAGS="" ;; esac dnl ========================================================================== dnl -dnl Assembler stuff - AS, AFLAGS, ASSEMBLY_EXTENSION, SOURCES +dnl Assembler stuff +dnl - AS, AFLAGS, ASSEMBLY_EXTENSION, SOURCES dnl dnl ========================================================================== @@ -342,7 +384,7 @@ EOF if $CC -c conftest.S 2>/dev/null 1>/dev/null ; then AC_MSG_RESULT(yes) - CFLAGS="$CFLAGS -DARCH_IS_PPC_ALTIVEC" + SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DARCH_IS_PPC_ALTIVEC" ASSEMBLY_SOURCES="SRC_ALTIVEC" else AC_MSG_RESULT(no) @@ -359,6 +401,22 @@ AFLAGS="-c" ASSEMBLY_EXTENSION="s" ASSEMBLY_SOURCES="SRC_IA64" + + case `basename $CC` in + *ecc*) + DCT_IA64_SOURCES="idct_ia64_ecc.s" + + dnl If the compiler is ecc, then i don't know its options + dnl fallback to "no options" + if test "$force_default_cc_options" = "yes" ; then + our_cflags_defaults="" + fi + ;; + *) + DCT_IA64_SOURCES="idct_ia64_gcc.s" + ;; + esac + fi dnl ========================================================================== @@ -374,6 +432,31 @@ dnl ========================================================================== dnl +dnl Now we can set CFLAGS if needed +dnl +dnl ========================================================================== + +if test "$force_default_cc_options" = "yes" ; then + CFLAGS="$our_cflags_defaults" +fi + +dnl ========================================================================== +dnl +dnl Profiling stuff goes here +dnl - adds options to SPECIFIC_CFLAGS, SPECIFIC_LDLAGS +dnl - removes incompatible options from CFLAGS +dnl +dnl ========================================================================== + +SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS $GNU_PROF_LDFLAGS" +SPECIFIC_CFLAGS="$SPECIFIC_CFLAG $GNU_PROF_CFLAGS" + +if test "$enable_gnuprofile" = "yes" ; then + CFLAGS=`echo $CFLAGS | sed s/'-fomit-frame-pointer'/''/` +fi + +dnl ========================================================================== +dnl dnl Substitions dnl dnl ========================================================================== @@ -393,8 +476,17 @@ AC_SUBST(ASSEMBLY_SOURCES) AC_SUBST(CC) AC_SUBST(CFLAGS) -AC_SUBST(OS_LDFLAGS) +AC_SUBST(SPECIFIC_LDFLAGS) +AC_SUBST(SPECIFIC_CFLAGS) AC_SUBST(DIVX4COMPAT_SOURCES) +AC_SUBST(DCT_IA64_SOURCES) +AC_SUBST(DIVX4_ENCORE) +AC_SUBST(DIVX4_DECORE) +AC_SUBST(RANLIB) +AC_SUBST(API_MAJOR) +AC_SUBST(API_MINOR) +AC_SUBST(STATIC_LIB) +AC_SUBST(SHARED_LIB) dnl ========================================================================== dnl @@ -403,5 +495,6 @@ dnl ========================================================================== AC_CONFIG_FILES(platform.inc) +AC_CONFIG_FILES(libxvidcore.def) AC_OUTPUT