]> git.sesse.net Git - vlc/blobdiff - configure.ac
Revert lame revert from [16628].
[vlc] / configure.ac
index 799ffe2b419443980451460b8fe17fad2e43ddab..c27cb7f5c9dcf9872be499ba548e0be8c806f705 100644 (file)
@@ -9,7 +9,7 @@ VERSION_EXTRA="svn"
 CONFIGURE_LINE="$0 $*"
 CODENAME="Janus"
 
-AC_PREREQ(2.50)
+AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR(src/libvlc.c)
 AC_CONFIG_AUX_DIR(autotools)
 AC_CANONICAL_SYSTEM
@@ -37,9 +37,8 @@ VLC_SAVE_FLAGS
 dnl
 dnl Check for tools
 dnl
-AC_PROG_CC
+AC_PROG_CC_C99
 AM_PROG_CC_C_O
-AC_PROG_CPP
 AC_PROG_CXX
 eval "${CXX} --version" >/dev/null 2>&1 || CXX=""
 if test "${CXX}" != ""; then
@@ -74,6 +73,7 @@ AC_CHECK_TOOL(LD, ld, :)
 dnl Check for compiler properties
 AC_C_CONST
 AC_C_INLINE
+AC_C_RESTRICT
 
 dnl
 dnl  Check for the contrib directory
@@ -328,7 +328,7 @@ AS_IF([test "${nls_cv_force_use_gnu_gettext}" = "yes"], [
   ])
 ])
 AC_SUBST(INCLUDED_LIBINTL)
-XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS"
+XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS" 
 
 dnl
 dnl Iconv stuff
@@ -784,6 +784,8 @@ fi # end "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"
 
 AC_HEADER_TIME
 
+AC_SEARCH_LIBS(poll, [poll], [AC_DEFINE(HAVE_POLL, 1, [Define to 1 if the OS is usabl... err, has poll().])])
+
 dnl Check for dirent
 need_dirent=false
 AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
@@ -1143,6 +1145,7 @@ VLC_ADD_PLUGINS([access_http access_mms access_ftp ipv4])
 VLC_ADD_PLUGINS([packetizer_mpegvideo packetizer_h264])
 VLC_ADD_PLUGINS([packetizer_mpeg4video packetizer_mpeg4audio])
 
+
 if test "${SYS}" != "mingwce"; then
 dnl  VLC_ADD_PLUGINS([externrun])
   VLC_ADD_PLUGINS([access_fake access_filter_timeshift access_filter_record])
@@ -1340,7 +1343,9 @@ if test "${ac_cv_c_altivec}" != "no"; then
   VLC_ADD_CFLAGS([vlc],[${ac_cv_c_altivec}])
   VLC_ADD_CFLAGS([idctaltivec motionaltivec],[${ac_cv_c_altivec}])
   VLC_ADD_CFLAGS([i420_yuy2_altivec memcpyaltivec deinterlace],[${ac_cv_c_altivec} ${ac_cv_c_altivec_abi}])
-  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
+  if test "${ac_cv_altivec_inline}" = "no"; then
+    ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
+  fi
 fi
 
 AC_CACHE_CHECK([if linker needs -framework vecLib],
@@ -1473,6 +1478,9 @@ then
   AC_DEFINE(ENABLE_SOUT, 1, Define if you want the stream output support)
 fi
 
+AC_ARG_ENABLE(switcher,
+  [  --enable-switcher       Stream-out switcher plugin (default disabled)])    
+
 dnl Check for libshout
 AC_ARG_ENABLE(shout,
   [  --enable-shout          libshout output plugin (default disabled)])
@@ -1873,6 +1881,45 @@ then
   fi
 fi
 
+
+dnl
+dnl  OpenCV wrapper and example filters
+dnl
+AC_ARG_ENABLE(opencv,
+  [  --enable-opencv            OpenCV (computer vision) filter (default disabled)])
+if test "${enable_opencv}" = "yes" -a "${CXX}" != "";
+then
+  AC_ARG_WITH(opencv-tree,
+  [    --with-opencv-tree=PATH opencv tree for linking])
+  if test -n "${with_opencv_tree}"
+  then
+    if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
+    then
+         AC_MSG_CHECKING(for opencv in ${with_opencv_tree})
+         if test -f ${with_opencv_tree}/cv/include/cv.h -a -f ${with_opencv_tree}/cxcore/include/cxcore.h \
+           -a -f ${with_opencv_tree}/cvaux/include/cvaux.h -a -f ${with_opencv_tree}/otherlibs/highgui/highgui.h
+      then
+        AC_MSG_RESULT(yes)
+        VLC_ADD_PLUGINS([opencv_wrapper])
+        VLC_ADD_LDFLAGS([opencv_wrapper],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
+        VLC_ADD_CFLAGS([opencv_wrapper],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
+        AC_LANG_PUSH(C++)
+        VLC_ADD_PLUGINS([opencv_example])
+        VLC_ADD_LDFLAGS([opencv_example],[-L${with_opencv_tree}/lib -lcv -lcxcore -lcvaux -lhighgui])
+        VLC_ADD_CXXFLAGS([opencv_example],[-I${with_opencv_tree}/cv/include -I${with_opencv_tree}/cxcore/include -I${with_opencv_tree}/cvaux/include -I${with_opencv_tree}/otherlibs/highgui])
+        AC_LANG_POP(C++)        
+         else
+        dnl  No opencv could be found, sorry
+        AC_MSG_RESULT(no)
+        AC_MSG_ERROR([cannot find opencv in ${with_opencv_tree}])
+         fi
+    else
+         AC_MSG_WARN([--enable-opencv currently only works on windows])
+    fi
+  fi  
+fi
+
+
 dnl
 dnl  libsmbclient plugin
 dnl
@@ -2688,7 +2735,7 @@ dnl Those options have to be here because the .pc can be bogus for ffmpeg previo
    fi
 
    VLC_ADD_BUILTINS([ffmpeg])
-   if test "${enable_sout}" != "no"; then
+   if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes" ; then
      VLC_ADD_BUILTINS([stream_out_switcher])
    fi
 
@@ -2724,7 +2771,7 @@ dnl Look for a ffmpeg-config (we are on debian )
     AC_CHECK_HEADERS(ffmpeg/avutil.h)
     AC_CHECK_HEADERS(postproc/postprocess.h)
     VLC_ADD_PLUGINS([ffmpeg])
-    if test "${enable_sout}" != "no"; then
+    if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
         VLC_ADD_PLUGINS([stream_out_switcher])
     fi
     VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --cflags`])
@@ -2739,12 +2786,20 @@ dnl Trying with pkg-config
      AC_CHECK_HEADERS(ffmpeg/avformat.h)
      AC_CHECK_HEADERS(ffmpeg/avutil.h)
      AC_CHECK_HEADERS(postproc/postprocess.h)
-     VLC_ADD_BUILTINS([ffmpeg])
-     if test "${enable_sout}" != "no"; then
-         VLC_ADD_BUILTINS([stream_out_switcher])
+     if test "${SYS}" = "darwin"; then
+        VLC_ADD_BUILTINS([ffmpeg])
+     else
+        VLC_ADD_PLUGINS([ffmpeg])
+     fi
+     if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
+        if test "${SYS}" = "darwin"; then
+            VLC_ADD_BUILTINS([stream_out_switcher])
+        else
+            VLC_ADD_PLUGINS([stream_out_switcher])
+        fi
      fi
      VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_CFLAGS}])
-     VLC_ADD_LDFLAGS([ffmpeg],[${FFMPEG_LIBS}])
+     VLC_ADD_LDFLAGS([ffmpeg stream_out_switcher],[${FFMPEG_LIBS}])
      dnl newer ffmpeg have a separate libpostproc
      PKG_CHECK_MODULES(POSTPROC, libpostproc,[
        VLC_ADD_LDFLAGS([ffmpeg],[${POSTPROC_LIBS}]) 
@@ -2771,7 +2826,7 @@ dnl Trying with pkg-config
       AC_CHECK_LIB(avcodec, avcodec_init, [
         VLC_ADD_BUILTINS([ffmpeg])
         VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])
-        if test "${enable_sout}" != "no"; then
+        if test "${enable_sout}" != "no" -a "${enable_switcher}" = "yes"; then
             VLC_ADD_BUILTINS([stream_out_switcher])
         fi],
          [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (svn version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ], [$LDAVUTIL])
@@ -5023,7 +5078,7 @@ AC_ARG_ENABLE(gnutls,
   [  --enable-gnutls         gnutls TLS/SSL support (default enabled)])
 
 AS_IF([test "${enable_gnutls}" != "no"], [
-  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.0.17], [have_gnutls="yes"], [have_gnutls="no"])
+  PKG_CHECK_MODULES(GNUTLS, [gnutls >= 1.2.9], [have_gnutls="yes"], [have_gnutls="no"])
 
   AS_IF([test "${have_gnutls}" = "yes"], [
     VLC_ADD_PLUGINS([gnutls])
@@ -5031,7 +5086,7 @@ AS_IF([test "${enable_gnutls}" != "no"], [
     VLC_ADD_LDFLAGS([gnutls], [$GNUTLS_LIBS])
   ], [
     AS_IF([test "${enable_gnutls}" = "yes"], [
-      AC_MSG_ERROR([gnutls not present or too old (version 1.0.17 required)])
+      AC_MSG_ERROR([gnutls not present or too old (version 1.2.9 required)])
     ])
   ])
 ])
@@ -5119,11 +5174,24 @@ dnl
 activex=false
 AC_ARG_ENABLE(activex,
   [  --enable-activex        build a vlc-based ActiveX control (default enabled on Win32)])
+AC_ARG_WITH(wine-sdk-path,
+  [    --with-wine-sdk-path=PATH path to wine sdk])
 if test "${enable_activex}" != "no"
 then
   if test "${SYS}" = "mingw32" -o "${SYS}" = "cygwin"
   then
-    AC_CHECK_PROGS(MIDL, [midl widl], no)
+    AC_CHECK_PROGS(MIDL, [midl], no)
+    if test "${with_wine_sdk_path}" != ""
+    then
+       WINE_SDK_PATH=${with_wine_sdk_path}
+       AC_PATH_PROG(WIDL, widl, no, [$WINE_SDK_PATH/bin:$WINE_SDK_PATH/tools/widl])
+    else
+       AC_CHECK_PROGS(WIDL, [widl], no)
+       if test "${WIDL}" != "no"
+       then
+          WINE_SDK_PATH="`dirname ${WIDL}`"/..
+       fi
+    fi
     AC_LANG_PUSH(C++)
     AC_CHECK_HEADERS(ole2.h olectl.h,
       [ VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
@@ -5143,6 +5211,8 @@ then
 fi
 AC_ARG_VAR(MIDL, [Microsoft IDL compiler (Win32 platform only)])
 AM_CONDITIONAL(HAS_MIDL_COMPILER, test "${MIDL}" != "no")
+AC_ARG_VAR(WIDL, [Wine IDL compiler (requires Wine SDK)])
+AM_CONDITIONAL(HAS_WIDL_COMPILER, test "${WIDL}" != "no")
 AM_CONDITIONAL(BUILD_ACTIVEX,${activex})
 
 dnl
@@ -5163,13 +5233,19 @@ then
     AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
     if test "${MOZILLA_CONFIG}" = "no"
     then
-      AC_PATH_PROG(XULRUNNER_CONFIG, xulrunner-config, no)
-      if test "${XULRUNNER_CONFIG}" = "no"
+      AC_PATH_PROG(SEAMONKEY_CONFIG, seamonkey-config, no)
+      if test "${SEAMONKEY_CONFIG}" = "no"
       then
-        AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
+        AC_PATH_PROG(XULRUNNER_CONFIG, xulrunner-config, no)
+        if test "${XULRUNNER_CONFIG}" = "no"
+        then
+          AC_MSG_ERROR([Please install the Mozilla development tools, mozilla-config was not found.])
+        else
+          have_xul=true
+          MOZILLA_CONFIG="${XULRUNNER_CONFIG}"
+        fi
       else
-        have_xul=true
-       MOZILLA_CONFIG="${XULRUNNER_CONFIG}"
+        MOZILLA_CONFIG="${SEAMONKEY_CONFIG}"
       fi
     fi
     
@@ -5408,19 +5484,6 @@ AS_IF([test "${enable_shared_libvlc}" != "no" || test "${enable_libtool}" != "no
   AC_DEFINE(HAVE_SHARED_LIBVLC, 1, [Define to 1 if libvlc is built as a shared library.])
   FILE_LIBVLC_DLL="!define LIBVLC_DLL libvlc.dll"],
   FILE_LIBVLC_DLL="" )
-dnl
-dnl we need pic on amd64 fo the mozilla plugin
-
-case "${target_cpu}" in
-     x86_64)
-       pic=pic
-       ;;
-     *)
-       pic=""
-       ;;
-esac
-AC_SUBST(pic)
-
 
 dnl Import conditional variables generated by bootstrap
 VLC_CONDITIONALS
@@ -5485,6 +5548,7 @@ AC_SUBST(RCC)
 AC_SUBST(UIC)
 AC_SUBST(WINDRES)
 AC_SUBST(MOZILLA_SDK_PATH)
+AC_SUBST(WINE_SDK_PATH)
 AC_SUBST(XPIDL)
 AC_SUBST(XPIDL_INCL)
 AC_SUBST(LIBEXT)