]> git.sesse.net Git - vlc/blobdiff - configure.in
* Fixed a warning in input_es.c ;
[vlc] / configure.in
index 6981997f7bc509579fa73b24710f2b75984955ab..8894f52433e1c048a19e3bced1c0a7291ccad1da 100644 (file)
@@ -56,7 +56,7 @@ AC_CHECK_FUNC(inet_aton,,[
 ])
 AC_CHECK_FUNCS(vasprintf)
 AC_CHECK_FUNCS(swab)
-AC_CHECK_FUNCS(memalign)
+AC_CHECK_FUNCS([memalign valloc])
 
 AC_CHECK_FUNCS(sigrelse)
 
@@ -112,52 +112,68 @@ dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
 dnl Check for ntohl, etc.
-CFLAGS="${save_CFLAGS} -Wall -Werror"
-AC_MSG_CHECKING([for ntohl in sys/param.h])
-AC_TRY_COMPILE([#include <sys/param.h>
-void foo() { int meuh; ntohl(meuh); }],,
- AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+AC_CACHE_CHECK([for ntohl in sys/param.h],
+    [ac_cv_c_ntohl_sys_param_h],
+    [CFLAGS="${save_CFLAGS} -Wall -Werror"
+     AC_TRY_COMPILE([#include <sys/param.h>],
+        [void foo() { int meuh; ntohl(meuh); }],
+        ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
+if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
+    AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
+fi
 
 dnl Check for inline function size limit
-CFLAGS="${save_CFLAGS} -finline-limit-20000"
-AC_MSG_CHECKING([if \$CC accepts -finline-limit])
-AC_TRY_COMPILE([],,
- save_CFLAGS="${save_CFLAGS} -finline-limit-20000"; AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+AC_CACHE_CHECK([if \$CC accepts -finline-limit],
+    [ac_cv_c_inline_limit],
+    [CFLAGS="${save_CFLAGS} -finline-limit-30000"
+     AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
+if test x"$ac_cv_c_inline_limit" != x"no"; then
+    save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
+fi
 
 dnl Check for Darwin plugin linking flags
-CFLAGS="${save_CFLAGS} -bundle -undefined suppress"
-AC_MSG_CHECKING([if \$CC accepts -bundle -undefined suppress])
-AC_TRY_COMPILE([],,
- PLCFLAGS="${PLCFLAGS} -bundle -undefined suppress"; AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
+AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
+    [ac_cv_ld_darwin],
+    [CFLAGS="${save_CFLAGS} -bundle -undefined error"
+     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
+if test x"$ac_cv_ld_darwin" != x"no"; then
+    PLCFLAGS="${PLCFLAGS} -bundle -undefined error"
+fi
 
 dnl Check for standard plugin linking flags
-CFLAGS="${save_CFLAGS} -shared"
-AC_MSG_CHECKING([if \$CC accepts -shared])
-AC_TRY_COMPILE([],,
- PLCFLAGS="${PLCFLAGS} -shared"; AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
-
-dnl Check for standard soname setting
-if test x"${SOFLAGS}" = x; then
-  try_SOFLAGS="-Wl,-soname -Wl,"
-  LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-  AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0])
-  AC_TRY_LINK([],,
-   SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes),
-   AC_MSG_RESULT(no))
+AC_CACHE_CHECK([if \$CC accepts -shared],
+    [ac_cv_ld_plugins],
+    [CFLAGS="${save_CFLAGS} -shared"
+     AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
+if test x"$ac_cv_ld_plugins" != x"no"; then
+    PLCFLAGS="${PLCFLAGS} -shared"
 fi
-
-dnl Check for SunOS soname setting
+        
+dnl Check for soname setting
 if test x"${SOFLAGS}" = x; then
-  try_SOFLAGS="-Wl,-h -Wl,"
-  LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
-  AC_MSG_CHECKING([if linker accepts ${try_SOFLAGS}foo.so.0])
-  AC_TRY_LINK([],,
-   SOFLAGS="${try_SOFLAGS}"; AC_MSG_RESULT(yes),
-   AC_MSG_RESULT(no))
+    AC_CACHE_CHECK([for soname setting],
+        [ac_cv_ld_soname],
+        [
+        # Standard
+        try_SOFLAGS="-Wl,-soname -Wl,"
+        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+        AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
+            # SunOS
+            try_SOFLAGS="-Wl,-h -Wl,"
+            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
+            AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
+                ac_cv_ld_soname=none)
+        ])])
+    if test x"$ac_cv_ld_soname" != x"none"; then
+        SOFLAGS=$ac_cv_ld_soname
+    else
+        echo "
+------------
+Your system doesn't seem to have support for dynamic linking. You may
+have problems using libdvdcss.
+------------
+"
+       fi
 fi
 
 dnl End of the bizarre compilation tests
@@ -165,21 +181,29 @@ CFLAGS="${save_CFLAGS}"
 LDFLAGS="${save_LDFLAGS}"
 
 dnl Check for boolean_t
-AC_MSG_CHECKING([for boolean_t in sys/types.h])
-AC_TRY_COMPILE([#include <sys/types.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-AC_MSG_CHECKING([for boolean_t in pthread.h])
-AC_TRY_COMPILE([#include <pthread.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
-AC_MSG_CHECKING([for boolean_t in cthreads.h])
-AC_TRY_COMPILE([#include <cthreads.h>
-void quux() { boolean_t foo; }],,
- AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
- AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
+AC_CACHE_CHECK([for boolean_t in sys/types.h],
+    [ac_cv_c_boolean_t_sys_types_h],
+    [AC_TRY_COMPILE([#include <sys/types.h>], [void quux() { boolean_t foo; }],
+     ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
+if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
+fi
+
+AC_CACHE_CHECK([for boolean_t in pthread.h],
+    [ac_cv_c_boolean_t_pthread_h],
+    [AC_TRY_COMPILE([#include <pthread.h>], [void quux() { boolean_t foo; }],
+     ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
+if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
+fi
+
+AC_CACHE_CHECK([for boolean_t in cthreads.h],
+    [ac_cv_c_boolean_t_cthreads_h],
+    [AC_TRY_COMPILE([#include <cthreads.h>], [void quux() { boolean_t foo; }],
+     ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
+if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
+    AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
+fi
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -221,7 +245,7 @@ ALTIVEC_MODULES="idctaltivec motionaltivec"
 
 AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
     [ac_cv_mmx_inline],
-    [AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],,
+    [AC_TRY_COMPILE(,[void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],
        ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
 if test x"$ac_cv_mmx_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
@@ -229,7 +253,7 @@ fi
 
 AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
     [ac_cv_mmxext_inline],
-    [AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
+    [AC_TRY_COMPILE(,[void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],
        ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
 if test x"$ac_cv_mmxext_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
@@ -237,7 +261,7 @@ fi
 
 AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
     [ac_cv_3dnow_inline],
-    [AC_TRY_COMPILE([void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}],,
+    [AC_TRY_COMPILE(,[void quux(){void *p;asm("pfadd %%mm1,%%mm2"::"r"(p));}],
        ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
 if test x"$ac_cv_3dnow_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
@@ -245,7 +269,7 @@ fi
 
 AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
     [ac_cv_sse_inline],
-    [AC_TRY_COMPILE([void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],,
+    [AC_TRY_COMPILE(,[void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],
        ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
 if test x"$ac_cv_sse_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
@@ -253,12 +277,49 @@ fi
 
 AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
     [ac_cv_altivec_inline],
-    [AC_TRY_COMPILE([void quux(){asm("mtspr 256,%0"::"r"(-1));}],,
-       ac_cv_altivec_inline=yes, ac_cv_altivec_inline=no)])
+    [AC_TRY_COMPILE(,[void quux(){asm("mtspr 256,%0"::"r"(-1));}],
+         ac_cv_altivec_inline=yes,
+         [save_CFLAGS=$CFLAGS
+          CFLAGS="$CFLAGS -Wa,-m7400"
+          AC_TRY_COMPILE(,[void quux(){asm("mtspr 256,%0"::"r"(-1));}],
+            [ac_cv_altivec_inline=yes; CFLAGS_ALTIVEC="-Wa,-m7400"],
+               ac_cv_altivec_inline=no)
+          CFLAGS=$save_CFLAGS
+         ])])
 if test x"$ac_cv_altivec_inline" != x"no"; then
   ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
 fi
 
+AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
+    [ac_cv_c_altivec],
+    [save_CFLAGS=$CFLAGS
+     CFLAGS="$CFLAGS -faltivec"
+     # Darwin test
+     AC_TRY_COMPILE(,[void quux(){vec_mtvscr((vector unsigned int)(0));}],
+        ac_cv_c_altivec=-faltivec, [
+        # Linux/PPC test
+        CFLAGS="$save_CFLAGS $CFLAGS_ALTIVEC -fvec"
+        AC_TRY_COMPILE(,[void quux(){vec_mtvscr((vector unsigned int)(0));}],
+            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
+        ])
+     CFLAGS=$save_CFLAGS
+    ])
+if test x"$ac_cv_c_altivec" != x"no"; then
+  AC_DEFINE(HAVE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
+  CFLAGS_ALTIVEC="$CFLAGS_ALTIVEC $ac_cv_c_altivec"
+fi
+
+AC_CACHE_CHECK([if linker needs -framework vecLib],
+    [ac_cv_ld_altivec],
+    [save_LDFLAGS=$LDFLAGS
+     LDFLAGS="$LDFLAGS -framework vecLib"
+     AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
+     LDFLAGS=$save_LDFLAGS
+    ])
+if test x"$ac_cv_ld_altivec" != x"no"; then
+  LIB_ALTIVEC="-framework vecLib"
+fi
+
 dnl
 dnl  libdvdcss: check for DVD ioctls
 dnl
@@ -348,7 +409,7 @@ AC_CHECK_HEADERS(sys/ioctl.h,[
 dnl
 dnl  Check the operating system
 dnl
-case ${_os} in
+case ${target_os} in
   bsdi*)
     SYS=bsdi
     ;;
@@ -361,12 +422,19 @@ case ${_os} in
 esac
 
 dnl
-dnl  PentiumPro acceleration
+dnl  Special arch tuning
 dnl
-AC_ARG_ENABLE(ppro,
-  [  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
-[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
-[ if test x$ARCH = xi686; then ARCH="${ARCH} ppro"; fi ])
+AC_ARG_WITH(tuning,
+[  --with-tuning=[arch]    Enable special tuning for an architecture
+                          (default i686 on IA-32 and 750 on PPC)])
+if test "x$withval" != "x"; then
+    TUNING=$withval
+else
+    if test x$ARCH = xi686; then TUNING="pentiumpro"
+    else
+        if test x$ARCH = ppc; then TUNING="750"; fi
+    fi
+fi
 
 dnl
 dnl  MMX acceleration
@@ -396,14 +464,6 @@ AC_ARG_ENABLE(debug,
 [  --enable-debug          Enable debug mode (default disabled)],
 [ if test x$enableval = xyes; then DEBUG=1; fi ])
 
-dnl
-dnl  Enable/disable statistics
-dnl
-STATS=0
-AC_ARG_ENABLE(stats,
-[  --enable-stats          Enable printing of statistics (default disabled)],
-[ if test x$enableval = xyes; then STATS=1; fi ])
-
 dnl
 dnl  Trace mode
 dnl
@@ -461,7 +521,10 @@ NEED_LIBDVDCSS=0
 STATIC_LIBDVDCSS=0
 DUMMY_LIBDVDCSS=0
 AC_ARG_WITH(dvdcss,
-  [  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no', or 'local-static', 'local-shared', or a path to another libdvdcss such as '/usr/local' (default 'local-static')],
+  [  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no',
+                          or 'local-static', 'local-shared', or a path to
+                          another libdvdcss such as '/usr/local'
+                          (default 'local-static')],
   [ case "x${withval}" in
     xlocal-static|xyes)
       # local libdvdcss, statically linked
@@ -603,7 +666,7 @@ dnl
 dnl  Darwin module
 dnl
 AC_ARG_ENABLE(darwin,
-  [  --enable-darwin         Darwin sound support (default disabled)],
+  [  --enable-darwin         Darwin sound support (default enabled on MacOS X)],
   [if test x$enable_darwin = xyes; then
      PLUGINS="${PLUGINS} darwin"
      LIB_DARWIN="-framework CoreAudio"
@@ -613,7 +676,7 @@ dnl
 dnl  MacOS X module
 dnl
 AC_ARG_ENABLE(macosx,
-  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
+  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
   [if test x$enable_macosx = xyes
    then
      BUILTINS="${BUILTINS} macosx"
@@ -632,7 +695,7 @@ dnl
 dnl  QNX RTOS module
 dnl
 AC_ARG_ENABLE(qnx,
-  [  --disable-qnx           QNX RTOS support (default enabled in QNX RTOS)])
+  [  --disable-qnx           QNX RTOS support (default enabled on QNX RTOS)])
     if test x$enable_qnx != xno
     then
       AC_CHECK_HEADERS(Ph.h, [
@@ -908,7 +971,8 @@ dnl
 dnl  ALSA module
 dnl
 AC_ARG_ENABLE(alsa,
-  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
+  [  --enable-alsa           Alsa sound drivers support (Only for linux)
+                          (default disabled)],
   [if test x$enable_alsa = xyes
    then
      AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
@@ -933,12 +997,12 @@ AC_SUBST(ALIASES)
 AC_SUBST(DEFINE)
 AC_SUBST(INCLUDE)
 AC_SUBST(DEBUG)
-AC_SUBST(STATS)
 AC_SUBST(ASM)
 AC_SUBST(TRACE)
 AC_SUBST(CPROF)
 AC_SUBST(GPROF)
 AC_SUBST(OPTIMS)
+AC_SUBST(TUNING)
 AC_SUBST(NEED_GETOPT)
 AC_SUBST(MOC)
 AC_SUBST(WINDRES)
@@ -949,6 +1013,7 @@ AC_SUBST(SOFLAGS)
 
 AC_SUBST(LIB)
 AC_SUBST(LIB_ALSA)
+AC_SUBST(LIB_ALTIVEC)
 AC_SUBST(LIB_BEOS)
 AC_SUBST(LIB_DARWIN)
 AC_SUBST(LIB_DVD)
@@ -972,6 +1037,7 @@ AC_SUBST(LIB_XVIDEO)
 AC_SUBST(LIB_YUV)
 
 AC_SUBST(CFLAGS_VLC)
+AC_SUBST(CFLAGS_ALTIVEC)
 AC_SUBST(CFLAGS_DVD)
 AC_SUBST(CFLAGS_LIBDVDCSS)
 AC_SUBST(CFLAGS_GTK)
@@ -990,7 +1056,8 @@ global configuration
 --------------------
 system                : ${SYS}
 architecture          : ${ARCH}
-optimizations         : ${OPTIMS}"
+optimizations         : ${OPTIMS}
+tuning:               : ${TUNING}"
 
 if test x${HAVE_VLC} = x1
 then
@@ -999,7 +1066,6 @@ vlc configuration
 -----------------
 vlc version           : ${VLC_VERSION}
 debug mode            : ${DEBUG}
-statistics            : ${STATS}
 trace mode            : ${TRACE}
 cprof/gprof support   : ${CPROF}/${GPROF}
 need builtin getopt   : ${NEED_GETOPT}