]> git.sesse.net Git - vlc/blobdiff - configure.ac
Use VLC_OBJECT's to pass to msg_* functions otherwise all hell breaks lose.
[vlc] / configure.ac
index b1c1d090a3f1d5f02bee3b94b93a9fea2232f067..2217bed4c84faa5fe0392789496b56a7e707d757 100644 (file)
@@ -129,7 +129,7 @@ case "${target_os}" in
     VLC_ADD_LDFLAGS([mp4], [-framework IOKit -framework CoreFoundation])
     VLC_ADD_CFLAGS([libvlc],[-x objective-c])
     VLC_ADD_CFLAGS([vlc],[-x objective-c])
-    VLC_ADD_LDFLAGS([vlc],[-Wl,-multiply_defined,suppress])
+    VLC_ADD_LDFLAGS([vlc],[-Wl,-m -Wl,-multiply_defined -Wl,suppress])
     ;;
   *mingw32* | *cygwin* | *wince* | *mingwce* | *pe*)
     AC_CHECK_TOOL(WINDRES, windres, :)
@@ -975,24 +975,29 @@ dnl
 dnl  default modules
 dnl
 VLC_ADD_PLUGINS([dummy logger memcpy])
-VLC_ADD_PLUGINS([mpgv mpga m4v m4a h264 ps pva avi asf aac mp4 rawdv nsv real aiff mjpeg demuxdump])
-VLC_ADD_PLUGINS([cvdsub svcdsub spudec subsdec dvbsub mpeg_audio lpcm a52 dts cinepak])
-VLC_ADD_PLUGINS([deinterlace invert adjust wall transform distort clone crop motionblur motiondetect])
-VLC_ADD_PLUGINS([float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32 audio_format])
-VLC_ADD_PLUGINS([trivial_resampler ugly_resampler linear_resampler bandlimited_resampler])
-VLC_ADD_PLUGINS([trivial_channel_mixer simple_channel_mixer headphone_channel_mixer normvol])
-VLC_ADD_PLUGINS([trivial_mixer spdif_mixer float32_mixer])
-VLC_ADD_PLUGINS([aout_file equalizer])
-VLC_ADD_PLUGINS([i420_rgb i420_yuy2 i422_yuy2 i420_ymga])
+VLC_ADD_PLUGINS([mpgv mpga m4v m4a h264 ps pva avi asf aac mp4 rawdv nsv real aiff mjpeg demuxdump flac])
+VLC_ADD_PLUGINS([cvdsub svcdsub spudec subsdec dvbsub mpeg_audio lpcm a52 dts cinepak flacdec])
+VLC_ADD_PLUGINS([deinterlace invert adjust transform distort motionblur])
+VLC_ADD_PLUGINS([fixed32tos16 s16tofixed32 u8tofixed32])
+VLC_ADD_PLUGINS([trivial_resampler ugly_resampler])
+VLC_ADD_PLUGINS([trivial_channel_mixer trivial_mixer])
 VLC_ADD_PLUGINS([id3 playlist export sgimb m3u xtag])
-VLC_ADD_PLUGINS([rawvideo blend scale image logo])
-VLC_ADD_PLUGINS([picture mosaic])
-VLC_ADD_PLUGINS([wav araw subtitle vobsub adpcm a52sys dtssys au])
-VLC_ADD_PLUGINS([access_file access_udp access_tcp access_http access_mms])
-VLC_ADD_PLUGINS([access_ftp ipv4])
+VLC_ADD_PLUGINS([i420_rgb rawvideo blend scale image logo])
+VLC_ADD_PLUGINS([wav araw subtitle vobsub adpcm a52sys dtssys au voc xa])
+VLC_ADD_PLUGINS([access_directory access_file access_udp access_tcp])
+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
+  VLC_ADD_PLUGINS([access_fake])
   VLC_ADD_PLUGINS([gestures rc telnet hotkeys netsync showintf time marq sap])
+  VLC_ADD_PLUGINS([picture mosaic wall motiondetect clone crop])
+  VLC_ADD_PLUGINS([i420_yuy2 i422_yuy2 i420_ymga])
+  VLC_ADD_PLUGINS([aout_file linear_resampler bandlimited_resampler])
+  VLC_ADD_PLUGINS([float32_mixer spdif_mixer simple_channel_mixer])
+  VLC_ADD_PLUGINS([headphone_channel_mixer normvol equalizer])
+  VLC_ADD_PLUGINS([fixed32tofloat32 float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32 audio_format])
 fi
 
 dnl
@@ -1011,7 +1016,7 @@ dnl
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
     VLC_ADD_PLUGINS([screensaver])
 elif test "${SYS}" != "mingwce"; then
-    VLC_ADD_PLUGINS([ntservice smb dmo])
+    VLC_ADD_PLUGINS([ntservice access_smb dmo])
     VLC_ADD_LDFLAGS([dmo],[-lole32])
 fi
 
@@ -1172,6 +1177,15 @@ then
     VLC_ADD_BUILTINS([${ACCEL_MODULES}])
 fi
 
+dnl
+dnl  Memory usage
+dnl
+AC_ARG_ENABLE(optimize-memory,
+[  --enable-optimize-memory      optimize memory usage over performance])
+if test "${enable_optimize_memory}" = "yes"; then
+  AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
+fi
+
 dnl
 dnl  Enable/disable optimizations
 dnl
@@ -1212,8 +1226,6 @@ if test "${enable_sout}" != "no"
 then
   VLC_ADD_PLUGINS([access_output_dummy access_output_udp access_output_file access_output_http])
   VLC_ADD_PLUGINS([mux_ps mux_avi mux_mp4 mux_asf mux_dummy mux_wav mux_mpjpeg])
-  VLC_ADD_PLUGINS([packetizer_mpegvideo packetizer_h264])
-  VLC_ADD_PLUGINS([packetizer_mpeg4video packetizer_mpeg4audio])
   VLC_ADD_PLUGINS([packetizer_copy])
 
   VLC_ADD_PLUGINS([stream_out_dummy stream_out_standard stream_out_es stream_out_rtp stream_out_description vod_rtsp])
@@ -1248,8 +1260,33 @@ dnl
 dnl TLS/SSL
 dnl
 AC_ARG_ENABLE(gnutls,
-  [  --enable-gnutls         gnutls TLS/SSL support (default disabled)])
-AS_IF([test "${enable_gnutls}" == "yes"], VLC_ADD_PLUGINS([gnutls]))
+  [  --enable-gnutls         gnutls TLS/SSL support (default enabled)])
+AS_IF([test "${enable_gnutls}" != "no"], [
+
+  gcrypt_LIBS="-lgpg-error"
+  AS_IF([test "${SYS}" = "mingw32"],
+    [gcrypt_LIBS="${gcrypt_LIBS} -lws2_32"
+     VLC_ADD_LDFLAGS([gnutls],[-lws2_32])]
+  )
+
+  gnutls_LIBS="-lgcrypt ${gcrypt_LIBS}"
+
+  AC_CHECK_HEADER(gcrypt.h,
+    [AC_CHECK_LIB(gcrypt, gcry_control,
+      [AC_CHECK_HEADER(gnutls/gnutls.h,
+        [AC_CHECK_LIB(gnutls, gnutls_certificate_verify_peers2,
+         [have_gnutls="yes"],[old_gnutls="yes"], ${gnutls_LIBS})])],,
+     ${gcrypt_LIBS})])
+
+  AS_IF([test "${have_gnutls}" = "yes"], [
+    VLC_ADD_PLUGINS([gnutls])
+    VLC_ADD_LDFLAGS([gnutls], [-lgnutls -lgcrypt -lgpg-error])
+  ], [
+    AS_IF([test "${enable_gnutls}" = "yes"], [
+      AC_MSG_ERROR([gnutls not present or too old (version 1.0.17 required)])]
+    )]
+  )]
+)
 
 
 dnl
@@ -1439,7 +1476,7 @@ then
       AC_CHECK_HEADERS(dshow.h,
       [ VLC_ADD_PLUGINS([dshow])
         VLC_ADD_CXXFLAGS([dshow],[])
-        VLC_ADD_LDFLAGS([dshow],[-lole32 -loleaut32]) ])
+        VLC_ADD_LDFLAGS([dshow],[-lole32 -loleaut32 -luuid]) ])
   fi
 fi
 
@@ -1531,7 +1568,7 @@ then
     AC_CHECK_HEADERS([dvbpsi/dr.h],[
       VLC_ADD_PLUGINS([ts])
       if test "${enable_sout}" != "no"; then
-        VLC_ADD_BUILTINS([mux_ts])
+        VLC_ADD_PLUGINS([mux_ts])
       fi
       VLC_ADD_CPPFLAGS([mux_ts ts dvb],[${CPPFLAGS_test}])
       VLC_ADD_LDFLAGS([mux_ts ts dvb],[${LDFLAGS_test} -ldvbpsi])
@@ -1626,12 +1663,18 @@ fi
 
 if test "${enable_vcdx}" = "yes"
 then
-  PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.71,
+  PKG_CHECK_MODULES(LIBCDIO, libcdio >= 0.72,
    [VLC_ADD_LDFLAGS([vcdx],[$LIBCDIO_LIBS])
     VLC_ADD_CFLAGS([vcdx],[$LIBCDIO_CFLAGS])],
     [AC_MSG_WARN(libcdio library not found)
     HAVE_VCDX=no])
 
+  PKG_CHECK_MODULES(LIBCDIO, libiso9660 >= 0.72,
+   [VLC_ADD_LDFLAGS([vcdx],[$LIBISO9660_LIBS])
+    VLC_ADD_CFLAGS([vcdx],[$LIBISO9660_CFLAGS])],
+    [AC_MSG_WARN(libiso9660 library not found)
+    HAVE_VCDX=no])
+
   PKG_CHECK_MODULES(VCDINFO, libvcdinfo >= 0.7.21,
    [AC_DEFINE(HAVE_VCDX, [], 
     [Define for the VCD plugin using libcdio/libvcdinfo])
@@ -1684,7 +1727,8 @@ then
   if test "${SYS}" = "darwin"
   then
     VLC_ADD_PLUGINS([vcd cdda])
-    VLC_ADD_LDFLAGS([vcd vcdx cdda],[-framework IOKit -framework CoreFoundation])
+    VLC_ADD_LDFLAGS([vcd vcdx cdda cddax],[-framework IOKit -framework CoreFoundation])
+    VLC_ADD_LDFLAGS([vcdx cddax],[-liconv])
   fi
 fi
 
@@ -1953,7 +1997,10 @@ then
     AC_CHECK_HEADERS(ffmpeg/avcodec.h)
     AC_CHECK_HEADERS(postproc/postprocess.h)
     VLC_ADD_PLUGINS([ffmpeg])
-    VLC_ADD_CFLAGS([ffmpeg],[`${FFMPEG_CONFIG} --cflags`])
+    if test "${enable_sout}" != "no"; then
+        VLC_ADD_PLUGINS([stream_out_switcher])
+    fi
+    VLC_ADD_CFLAGS([ffmpeg stream_out_switcher],[`${FFMPEG_CONFIG} --cflags`])
     VLC_ADD_LDFLAGS([ffmpeg],[`${FFMPEG_CONFIG} --plugin-libs avcodec avformat postproc`])
   else
     AC_ARG_WITH(ffmpeg-mp3lame,
@@ -1989,6 +2036,9 @@ then
       AC_CHECK_HEADERS(postproc/postprocess.h, [], [AC_MSG_ERROR([Missing header file postproc/postprocess.h.])] )
       AC_CHECK_LIB(avcodec, avcodec_init, [
         VLC_ADD_BUILTINS([ffmpeg])
+        if test "${enable_sout}" != "no"; then
+            VLC_ADD_BUILTINS([stream_out_switcher])
+        fi
         VLC_ADD_LDFLAGS([ffmpeg],[-lavcodec])],
          [ AC_MSG_ERROR([Could not find ffmpeg on your system: you may get it from http://ffmpeg.sf.net/ (cvs version is recommended). Alternatively you can use --disable-ffmpeg to disable the ffmpeg plugins.]) ])
       AC_CHECK_LIB(avformat, av_open_input_stream, [
@@ -2054,13 +2104,16 @@ then
       fi
 
       VLC_ADD_BUILTINS([ffmpeg])
+      if test "${enable_sout}" != "no"; then
+          VLC_ADD_BUILTINS([stream_out_switcher])
+      fi
       VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavcodec ${real_ffmpeg_tree}/libavcodec/libavcodec.a])
-      VLC_ADD_CPPFLAGS([ffmpeg],[-I${real_ffmpeg_tree}/libavcodec])
+      VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec])
 
       if test -f "${real_ffmpeg_tree}/libavformat/libavformat.a"; then
         AC_DEFINE(HAVE_LIBAVFORMAT, 1, [Define if you have ffmpeg's libavformat.])
         VLC_ADD_LDFLAGS([ffmpeg],[-L${real_ffmpeg_tree}/libavformat ${real_ffmpeg_tree}/libavformat/libavformat.a])
-        VLC_ADD_CPPFLAGS([ffmpeg],[-I${real_ffmpeg_tree}/libavformat])
+        VLC_ADD_CPPFLAGS([ffmpeg stream_out_switcher],[-I${real_ffmpeg_tree}/libavformat])
       fi
     fi
   fi
@@ -2103,6 +2156,8 @@ then
       VLC_ADD_LDFLAGS([ffmpegaltivec],[-L${real_ffmpeg_tree}/libavformat -lavformataltivec -lz])
       VLC_ADD_CPPFLAGS([ffmpegaltivec],[-I${real_ffmpeg_tree}/libavformat])
     fi
+    VLC_ADD_LDFLAGS([stream_out_switcher],[-L${real_ffmpeg_tree}/libavcodec])
+    VLC_ADD_CPPFLAGS([stream_out_switcher],[-I${real_ffmpeg_tree}/libavcodec -I${real_ffmpeg_tree}/libavformat])
   fi
 fi
 
@@ -2178,7 +2233,7 @@ then
       dnl  Use a custom toolame
       AC_MSG_RESULT(${real_toolame_tree}/libtoolame/libtoolame.a)
       VLC_ADD_BUILTINS([toolame])
-      VLC_ADD_LDFLAGS([toolame],[${real_faad_tree}/libtoolame/libtoolame.a])
+      VLC_ADD_LDFLAGS([toolame],[${real_toolame_tree}/libtoolame/libtoolame.a])
       VLC_ADD_CPPFLAGS([toolame],[-I${real_toolame_tree}/libtoolame])
     else
       dnl  The given libtoolame wasn't built
@@ -2382,7 +2437,6 @@ AC_ARG_ENABLE(flac,
 if test "${enable_flac}" = "yes"
 then
   AC_CHECK_HEADERS(FLAC/stream_decoder.h, [
-    VLC_ADD_PLUGINS([flac flacdec])
     VLC_ADD_LDFLAGS([flacdec],[-lFLAC])
    ],[])
 fi
@@ -3586,7 +3640,7 @@ dnl
 dnl  WinCE GUI module
 dnl
 if test "${SYS}" = "mingwce"; then
-  VLC_ADD_PLUGINS([wince])
+  VLC_ADD_BUILTINS([wince])
   VLC_ADD_CXXFLAGS([wince],[])
   VLC_ADD_LDFLAGS([wince],[-lcommctrl -lcommdlg -laygshell])
   dnl Gross hack
@@ -3941,45 +3995,6 @@ AM_CONDITIONAL(ENABLE_CORBA, test "$enablecorba" = "true")
 
 AC_ARG_WITH(,[Misc options:])
 
-dnl
-dnl GnuTLS-based TLS/SSL support
-dnl
-AC_ARG_WITH(libgnutls-prefix,
-          [    --with-libgnutls-prefix=PREFIX set prefix where libgnutls is installed],
-          libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
-
-AS_IF([test x$libgnutls_config_prefix != x],
-  AS_IF([test x${LIBGNUTLS_CONFIG+set} != xset],
-    LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
-  )
-)
-
-if test "x$enable_gnutls" == "xyes"; then
-  AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
-  no_libgnutls=""
-
-  AC_MSG_CHECKING(for libgnutls - version >= 1.0.0)
-  AS_IF([test "$LIBGNUTLS_CONFIG" = "no"],
-    no_libgnutls=yes
-    ,
-    LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
-    LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
-    libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
-  )
-
-  AS_IF([test "x$no_libgnutls" = x],
-    AC_MSG_RESULT(yes)
-    VLC_ADD_CFLAGS([gnutls], [$LIBGNUTLS_CFLAGS])
-    VLC_ADD_LDFLAGS([gnutls], [$LIBGNUTLS_LIBS])
-    AC_DEFINE(HAVE_GNUTLS, 1, Define to 1 if you have libgnutls)
-    ,
-    AC_MSG_RESULT(no)
-    LIBGNUTLS_CFLAGS=""
-    LIBGNUTLS_LIBS=""
-    AC_MSG_ERROR(gnutls TLS/SSL support cannot be compiled)
-  )
-fi
-
 dnl
 dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
 dnl