--- trunk/xvidcore/build/generic/configure.in 2010/12/31 11:39:06 1938 +++ trunk/xvidcore/build/generic/configure.in 2011/08/19 16:15:21 2027 @@ -74,6 +74,19 @@ fi], [assembly="yes"]) +dnl pthread code +AC_ARG_ENABLE(pthread, + AC_HELP_STRING([--disable-pthread], + [Disable pthread dependent code]), + [if test "$enable_pthread" = "no" ; then + pthread="no" + else + if test "$enable_pthread" = "yes" ; then + pthread="yes" + fi + fi], + [pthread="yes"]) + dnl Build as a module not a shared lib on darwin AC_ARG_ENABLE(macosx_module, AC_HELP_STRING([--enable-macosx_module], @@ -128,6 +141,7 @@ dnl ========================================================================== AC_PROG_RANLIB +AC_CHECK_TOOL([AR], [ar], [ar-not-found]) dnl ========================================================================== dnl @@ -223,7 +237,7 @@ STATIC_EXTENSION="" OBJECT_EXTENSION="" case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*) + *bsd*|linux*|beos|irix*|solaris*|gnu*) AC_MSG_RESULT([.so .a .o]) STATIC_EXTENSION="a" SHARED_EXTENSION="so" @@ -267,7 +281,7 @@ ALTIVEC_CFLAGS="" PRE_SHARED_LIB="" case "$target_os" in - linux*|solaris*) + linux*|solaris*|gnu*) AC_MSG_RESULT([ok]) STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)" SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)" @@ -405,7 +419,7 @@ if test "$found_nasm_comp_prog" = "yes" ; then AC_MSG_CHECKING([for asm object format]) case "$target_os" in - *bsd*|linux*|beos|irix*|solaris*) + *bsd*|linux*|beos|irix*|solaris*|gnu*) if test "$ARCHITECTURE" = "X86_64" ; then AC_MSG_RESULT([elf64]) NASM_FORMAT="elf64" @@ -428,8 +442,13 @@ MARK_FUNCS="" ;; *darwin*) - AC_MSG_RESULT([macho]) - NASM_FORMAT="macho" + if test "$ARCHITECTURE" = "X86_64" ; then + AC_MSG_RESULT([macho64]) + NASM_FORMAT="macho64" + else + AC_MSG_RESULT([macho32]) + NASM_FORMAT="macho32" + fi PREFIX="-DPREFIX" MARK_FUNCS="" ;; @@ -586,15 +605,19 @@ dnl dnl ========================================================================== -AC_CHECK_HEADER( - pthread.h, - AC_CHECK_LIB( - pthread, - pthread_create, - SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" - SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread", - AC_MSG_WARN(Pthread not supported. No SMP support)), +if test x"$pthread" = x"yes" ; then + AC_CHECK_HEADER( + [pthread.h], + [AC_CHECK_LIB( + [pthread], + [pthread_create], + [SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DHAVE_PTHREAD" + SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS -lpthread"], + AC_MSG_WARN(Pthread not supported. No SMP support))], AC_MSG_WARN(Pthread not supported. No SMP support)) +else + AC_MSG_WARN(Pthread support disabled. No SMP support) +fi dnl ========================================================================== dnl @@ -684,11 +707,13 @@ AC_SUBST(ASSEMBLY_SOURCES) AC_SUBST(CC) AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) AC_SUBST(SPECIFIC_LDFLAGS) AC_SUBST(SPECIFIC_CFLAGS) AC_SUBST(DCT_IA64_SOURCES) AC_SUBST(PPC_ALTIVEC_SOURCES) AC_SUBST(RANLIB) +AC_SUBST(AR) AC_SUBST(API_MAJOR) AC_SUBST(API_MINOR) AC_SUBST(STATIC_LIB)