]> git.sesse.net Git - vlc/blobdiff - configure.in
* ./src/misc/modules.c: restored plugins hiding as the problem is fixed.
[vlc] / configure.in
index e78061d9906f225fdc9ea6904b5586d06b874219..e3a96c24604bf3cc54c3b604d455b3c1eb33c8c7 100644 (file)
@@ -4,7 +4,7 @@ AC_CONFIG_HEADER(include/defs.h)
 AC_CANONICAL_SYSTEM
 
 PACKAGE="vlc"
-VERSION="0.3.1"
+VERSION="0.4.0"
 CODENAME=Ourumov
 
 dnl Save CFLAGS and LDFLAGS
@@ -79,6 +79,7 @@ case x"${target_os}" in
     vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
     vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
     ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
+    ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
     rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
     ;;
   x*nto*)
@@ -111,7 +112,7 @@ dnl The -DSYS_FOO flag
 save_CFLAGS="${save_CFLAGS} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"
 
 dnl Check for system libs needed
-AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty usleep vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
+AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2)
 
 AC_CHECK_FUNC(connect,,[
   AC_CHECK_LIB(socket,connect,
@@ -124,10 +125,12 @@ AC_CHECK_FUNC(gethostbyname,,[
 AC_CHECK_FUNC(gethostbyname,,[
   AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
 ])
-AC_CHECK_FUNC(nanosleep,,[
-  AC_CHECK_LIB(rt,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lrt",[
-    AC_CHECK_LIB(posix4,nanosleep,vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4")
-  ])
+AC_CHECK_FUNCS(nanosleep,,[
+  AC_CHECK_LIB(rt,nanosleep,
+    [vlc_LDFLAGS="${vlc_LDFLAGS} -lrt"],
+    [AC_CHECK_LIB(posix4,nanosleep,
+        [vlc_LDFLAGS="${vlc_LDFLAGS} -lposix4"])]
+  )
 ])
 AC_CHECK_FUNC(inet_aton,,[
   AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
@@ -193,6 +196,18 @@ AC_CHECK_HEADERS(linux/version.h)
 
 AC_HEADER_TIME
 
+dnl Mac OS X and other OSes don't have declaration for nanosleep
+AC_EGREP_HEADER(nanosleep,time.h,[
+  AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
+            Define if <time.h> defines nanosleep.)
+])
+
+dnl Make sure we have timespecs
+AC_EGREP_HEADER(timespec,sys/time.h,[
+  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
+            Define if <sys/time.h> defines struct timespec.)
+])
+
 dnl Check for threads library
 AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
 
@@ -331,6 +346,20 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
     plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
 fi
         
+dnl Check for variadic macros
+AC_CACHE_CHECK([for variadic cpp macros],
+    [ac_cv_cpp_variadic_macros],
+    [CFLAGS="${save_CFLAGS}"
+     AC_TRY_COMPILE(
+         [#include <stdio.h>
+          #define a(b,c...) printf(b,##c)],
+         [a("foo");a("%s","bar");a("%s%s","baz","quux");],
+         ac_cv_cpp_variadic_macros=yes,
+         ac_cv_cpp_variadic_macros=no)])
+if test x"$ac_cv_cpp_variadic_macros" != x"no"; then
+    AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
+fi
+
 dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
     [ac_cv_c_attribute_aligned],
@@ -392,7 +421,7 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
+PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts mpeg_audio file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort filter_clone fx_scope"
 
 dnl
 dnl  Accelerated modules
@@ -687,6 +716,8 @@ AC_ARG_ENABLE(dvbpsi,
 [  --enable-dvbpsi        dvbpsi ts demux module (default disabled)])
 if test "x$enable_dvbpsi" != "xno"
 then
+  AC_ARG_WITH(dvbpsi, 
+  [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
   if test "x$with_dvbpsi" = x
   then
     test_LDFLAGS=""
@@ -696,14 +727,14 @@ then
     test_CFLAGS="-I${with_dvbpsi}/include"
   fi
   CPPFLAGS="$save_CPPFLAGS $test_CFLAGS"
-  AC_CHECK_HEADER([dvbpsi/dvbpsi.h],[
+  AC_CHECK_HEADER([dvbpsi/dr.h],[
     PLUGINS="${PLUGINS} mpeg_ts_dvbpsi"
     mpeg_ts_dvbpsi_LDFLAGS="${mpeg_ts_dvbpsi_LDFLAGS} ${test_LDFLAGS} -ldvbpsi"
     mpeg_ts_dvbpsi_CFLAGS="${mpeg_ts_dvbpsi_CFLAGS} ${test_CFLAGS}"
     ],[
     if test "x$enable_dvbpsi" != x
     then
-      AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org])
+      AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
     fi
   ])
   CPPFLAGS="$save_CPPFLAGS"
@@ -713,14 +744,19 @@ dnl
 dnl  VCD module
 dnl
 AC_ARG_ENABLE(vcd,
-  [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
+  [  --enable-vcd            VCD support for Linux, FreeBSD and MacOS X (default enabled)])
 
 if test x$enable_vcd != xno
 then
   AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
     PLUGINS="${PLUGINS} vcd"
   ])
-
+  
+  AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
+    PLUGINS="${PLUGINS} vcd"
+    AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
+  ])
+  
   if test "x${SYS}" = "xbsdi"
   then
     PLUGINS="${PLUGINS} vcd"
@@ -728,7 +764,7 @@ then
 
   if test "x${SYS}" = "xdarwin"
   then
-    PLUGINS="${PLUGINS} vcd"
+    # No need to add vcd to PLUGINS, Darwin is already based on FreeBSD
     vcd_LDFLAGS="${vcd_LDFLAGS} -framework IOKit -framework CoreFoundation" 
   fi
 fi
@@ -744,9 +780,18 @@ AC_ARG_ENABLE(satellite,
     fi])
 
 dnl
-dnl  ipv6 plugin
+dnl  ipv6 plugin - not for QNX yet
 dnl
-AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
+if test x$SYS != xnto && test "x$SYS" != "xmingw32"
+then
+  AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
+fi
+if test "x$SYS" = "xmingw32"
+then
+  AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
+  AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
+    PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
+fi
 
 dnl
 dnl  AVI demux plugin
@@ -771,29 +816,58 @@ AC_ARG_ENABLE(mad,
   [  --enable-mad            libmad module (default disabled)])
 if test x$enable_mad = xyes
 then
-  PLUGINS="${PLUGINS} mad"
-  mad_LDFLAGS="${mad_LDFLAGS} -lmad"
   AC_ARG_WITH(mad,
-    [    --with-mad=PATH       path to libmad],
-    [ if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
-      then
-        mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
-        mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
-      fi ])
-  save_CFLAGS=$CFLAGS
-  save_LDFLAGS=$LDFLAGS
-  CFLAGS="$CFLAGS $mad_CFLAGS"
-  LDFLAGS="$LDFLAGS $mad_LDFLAGS"
-  AC_CHECK_HEADERS(mad.h, ,
-  [ echo "Cannot find development headers for libmad..."
-    exit 1
-  ])
-  AC_CHECK_LIB(mad, mad_bit_init, ,
-  [ echo "Cannot find libmad library..."
-    exit 1
-  ])
-  CFLAGS=$save_CFLAGS
-  LDFLAGS=$save_LDFLAGS
+    [    --with-mad=PATH       path to libmad],[],[])
+  if test "x$with_mad" != "xno" -a "x$with_mad" != "x"
+  then
+    mad_CFLAGS="${mad_CFLAGS} -I$with_mad/include"
+    mad_LDFLAGS="${mad_LDFLAGS} -L$with_mad/lib"
+  fi
+
+  AC_ARG_WITH(mad-tree,
+    [    --with-mad-tree=PATH  mad tree for static linking],[],[])
+  if test "x$with_mad_tree" != "xno" -a "x$with_mad_tree" != "x"
+  then
+    real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
+    if test "x$real_mad_tree" = x
+    then
+      dnl  The given directory can't be found
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
+    fi
+    dnl  Use a custom libmad
+    AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
+    if test -f ${real_mad_tree}/libmad/mad.h
+    then
+      AC_MSG_RESULT(yes)
+      mad_CFLAGS="${mad_CFLAGS} -I${real_mad_tree}/libmad"
+      mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
+      save_LDFLAGS=$LDFLAGS
+      LDFLAGS=$mad_LDFLAGS
+      AC_CHECK_LIB(mad, mad_bit_init, [
+        BUILTINS="${BUILTINS} mad"
+        mad_LDFLAGS="${mad_LDFLAGS} -lmad"
+        ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
+      ],[])
+      LDFLAGS=$save_LDFLAGS
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([the specified tree doesn't have mad.h])
+    fi
+  else
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CFLAGS="$CFLAGS $mad_CFLAGS"
+    LDFLAGS="$LDFLAGS $mad_LDFLAGS"
+    AC_CHECK_HEADERS(mad.h, ,
+      [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
+    AC_CHECK_LIB(mad, mad_bit_init, [
+      PLUGINS="${PLUGINS} mad"
+      mad_LDFLAGS="${mad_LDFLAGS} -lmad" ],
+      [ AC_MSG_ERROR([Cannot find libmad library...]) ])
+    CFLAGS=$save_CFLAGS
+    LDFLAGS=$save_LDFLAGS
+  fi
 fi
 
 dnl
@@ -803,12 +877,18 @@ AC_ARG_ENABLE(ffmpeg,
 [  --enable-ffmpeg         ffmpeg codec (default disabled)])
 if test "x$enable_ffmpeg" = "xyes"
 then
+  AC_ARG_WITH(ffmpeg,
+    [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
+  if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"
+  then
+    ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I$with_ffmpeg/include/libffmpeg"
+    ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -L$with_ffmpeg/lib"
+  fi
+
   AC_ARG_WITH(ffmpeg-tree, 
   [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
-  if test "x$with_ffmpeg_tree" = x
+  if test "x$with_ffmpeg_tree" != "x"
   then
-    AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
-  else
     AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x$real_ffmpeg_tree" = x
@@ -822,13 +902,24 @@ then
       dnl  Use a custom libffmpeg
       AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
       BUILTINS="${BUILTINS} ffmpeg"
-      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} ${real_ffmpeg_tree}/libavcodec/libavcodec.a -lm"
       ffmpeg_CFLAGS="${ffmpeg_CFLAGS} -I${real_ffmpeg_tree}/libavcodec"
     else
       dnl  The given libavcodec wasn't built
       AC_MSG_RESULT(no)
       AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
     fi
+  else
+    save_CFLAGS=$CFLAGS
+    save_LDFLAGS=$LDFLAGS
+    CFLAGS="$CFLAGS $ffmpeg_CFLAGS"
+    LDFLAGS="$LDFLAGS $ffmpeg_LDFLAGS -lm"
+    AC_CHECK_LIB(avcodec, avcodec_init, [
+      BUILTINS="${BUILTINS} ffmpeg"
+      ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lavcodec -lm" ],
+      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
+    CFLAGS=$save_CFLAGS
+    LDFLAGS=$save_LDFLAGS
   fi
 fi
 
@@ -844,12 +935,54 @@ dnl  a52 AC3 decoder plugin
 dnl
 AC_ARG_ENABLE(a52,
   [  --enable-a52            AC3 support with liba52 (default enabled)])
-if test "x$enable_a52" != "xno" -a x$SYS != xmingw32
+if test "x$enable_a52" != "xno"
+then
+  AC_ARG_WITH(a52-tree,
+    [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
+  if test "x$with_a52_tree" != "xno" -a "x$with_a52_tree" != "x"
   then
+    real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
+    if test "x$real_a52_tree" = x
+    then
+      dnl  The given directory can't be found
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
+    fi
+    dnl  Use a custom a52dec
+    AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
+    if test -f ${real_a52_tree}/include/a52.h
+    then
+      AC_MSG_RESULT(yes)
+      a52_CFLAGS="${a52_CFLAGS} -I${real_a52_tree}"
+      a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
+      save_LDFLAGS=$LDFLAGS
+      LDFLAGS="$a52_LDFLAGS $LDFLAGS"
+      AC_CHECK_LIB(a52, a52_free, [
+        BUILTINS="${BUILTINS} a52"
+        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS} -DUSE_A52DEC_TREE"
+        ],[
+        if test -f ${real_a52_tree}/liba52/.libs/liba52.a
+        then
+          AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
+        else
+          AC_MSG_ERROR([the specified tree hasn't been compiled])
+        fi
+      ],[-lm])
+      LDFLAGS=$save_LDFLAGS
+    else
+      AC_MSG_RESULT(no)
+      AC_MSG_ERROR([the specified tree doesn't have a52.h])
+    fi
+  else dnl  no with args
     AC_CHECK_HEADERS(a52dec/a52.h, [
-      BUILTINS="${BUILTINS} a52"
-      a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
-     ],[])
+      AC_CHECK_LIB(a52, a52_free, [
+        BUILTINS="${BUILTINS} a52"
+        a52_LDFLAGS="${a52_LDFLAGS} -la52 -lm"
+        a52_CFLAGS="${a52_CFLAGS}"
+      ],[],[-lm])
+    ])
+  fi
 fi
 
 dnl
@@ -938,9 +1071,9 @@ then
   SDL_PATH=$PATH
   AC_ARG_WITH(sdl-config-path,
     [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
-    [ if test "x$with_sdl" != "xno"
+    [ if test "x$with_sdl_config_path" != "xno"
       then
-        SDL_PATH="$with_sdl:$PATH"
+        SDL_PATH="$with_sdl_config_path:$PATH"
       fi ])
   AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
   SDL_CONFIG=${SDL12_CONFIG}
@@ -1184,9 +1317,9 @@ then
   GTK_PATH=$PATH
   AC_ARG_WITH(gtk-config-path,
     [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
-    [ if test "x$with_gtk" != "xno"
+    [ if test "x$with_gtk_config_path" != "xno"
       then
-        GTK_PATH="$with_gtk:$PATH"
+        GTK_PATH="$with_gtk_config_path:$PATH"
       fi ])
   # look for gtk-config
   AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
@@ -1289,15 +1422,11 @@ AC_ARG_ENABLE(macosx,
   [if test x$enable_macosx = xyes
    then
      BUILTINS="${BUILTINS} macosx"
-     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
-     LDFLAGS="${LDFLAGS} -ObjC"
+     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
    fi],
   [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
      BUILTINS="${BUILTINS} macosx"
-     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc"
-     macosx_CFLAGS="${macosx_CFLAGS} -ObjC"
-     LDFLAGS="${LDFLAGS} -ObjC"
+     macosx_LDFLAGS="${macosx_LDFLAGS} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework AGL -framework QuickTime -lobjc -ObjC"
    )])
 
 dnl
@@ -1529,6 +1658,7 @@ AC_SUBST(vlc_CFLAGS)
 AC_SUBST(plugins_CFLAGS)
 AC_SUBST(builtins_CFLAGS)
 
+AC_SUBST(a52_CFLAGS)
 AC_SUBST(arts_CFLAGS)
 AC_SUBST(dvd_CFLAGS)
 AC_SUBST(dvdread_CFLAGS)
@@ -1577,6 +1707,7 @@ AC_SUBST(imdct_LDFLAGS)
 AC_SUBST(imdct3dn_LDFLAGS)
 AC_SUBST(imdctsse_LDFLAGS)
 AC_SUBST(ipv4_LDFLAGS)
+AC_SUBST(ipv6_LDFLAGS)
 AC_SUBST(kde_LDFLAGS)
 AC_SUBST(lirc_LDFLAGS)
 AC_SUBST(macosx_LDFLAGS)
@@ -1594,7 +1725,7 @@ AC_SUBST(waveout_LDFLAGS)
 AC_SUBST(x11_LDFLAGS)
 AC_SUBST(xvideo_LDFLAGS)
 
-AC_OUTPUT([Makefile.opts po/Makefile.in])
+AC_OUTPUT([Makefile.config Makefile.opts po/Makefile.in])
 
 echo "
 vlc configuration