]> git.sesse.net Git - vlc/blobdiff - configure.ac
Implement tsearch functions for systems that does not know about it.
[vlc] / configure.ac
index d56b7358d7d08596a3df7000cf187709552109dc..cf50be368a5846c35918a19a66ed2a0c451557b6 100644 (file)
@@ -94,6 +94,24 @@ AS_IF([test -n "${with_binary_version}"],[
          [Binary specific version])
 ])
 
+dnl Check how we are asked to build
+AS_IF([test "${enable_shared}" = "no"], [
+  AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
+])
+
+AC_ARG_ENABLE(static-modules,
+   [  --enable-static-modules  Allow module to be linked statically. This produces a non working vlc.])  
+AS_IF([test "${enable_static_modules}" = yes], [
+   enable_shared="no"
+   enable_static="yes"
+   VLC_DEFAULT_PLUGIN_TYPE="builtin"
+   AS_IF([test "${enable_vlc}" != "no"],
+     [AC_MSG_WARN([Building modules as static. VLC will not work.])])
+], [
+   VLC_DEFAULT_PLUGIN_TYPE="plugin"
+])
+
+AC_SUBST(VLC_DEFAULT_PLUGIN_TYPE)
 
 dnl
 dnl  Check for the contrib directory
@@ -135,16 +153,9 @@ AS_IF([test "${with_contrib}" != "no"],[
     LDFLAGS="${LDFLAGS} -L${CONTRIB_DIR}/lib"
     LDFLAGS_save="${LDFLAGS_save} -L${CONTRIB_DIR}/lib"
 
-    if test -z "$with_mozilla_sdk_path"; then
-       with_mozilla_sdk_path="${CONTRIB_DIR}/gecko-sdk"
-    fi
-
     if test "${SYS}" = "darwin"; then
       export LD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$LD_LIBRARY_PATH"
       export DYLD_LIBRARY_PATH="${CONTRIB_DIR}/lib:$DYLD_LIBRARY_PATH"
-    elif test "${SYS}" = "beos"; then
-      export LIBRARY_PATH="${CONTRIB_DIR}/lib:$LIBRARY_PATH"
-      export BELIBRARIES="${CONTRIB_DIR}/lib:$BELIBRARIES"
     fi
   ],[
     AC_MSG_RESULT([no])
@@ -160,6 +171,7 @@ LDFLAGS_vlc="${LDFLAGS}"
 dnl
 dnl  Check the operating system
 dnl
+HAVE_WIN64="0"
 case "${host_os}" in
   "")
     SYS=unknown
@@ -316,7 +328,7 @@ case "${host_os}" in
         # add ws2_32 for closesocket, select, recv
         VLC_ADD_LIBS([libvlccore],[-lws2_32 -lnetapi32 -lwinmm])
         VLC_ADD_LDFLAGS([vlc],[-mwindows])
-        VLC_ADD_LIBS([activex mozilla win32text],[-lgdi32])
+        VLC_ADD_LIBS([win32text],[-lgdi32])
         VLC_ADD_LIBS([cdda vcdx sdl_image aout_sdl vout_sdl],[-lwinmm])
         VLC_ADD_LIBS([access_http access_mms access_udp access_tcp access_ftp access_rtmp access_output_udp access_output_shout access_output_rtmp sap oldhttp stream_out_standard stream_out_rtp stream_out_raop vod_rtsp access_realrtsp rtp oldrc netsync gnutls growl_udp flac ts audioscrobbler lua remoteosd zvbi audiobargraph_a netsync],[-lws2_32])
         VLC_ADD_LIBS([filesystem], [-lshlwapi])
@@ -331,6 +343,21 @@ case "${host_os}" in
         AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
         ac_default_prefix="`pwd`/_win32"
         DESTDIR="`pwd`/_win32/"
+
+        dnl
+        dnl NSIS Installer prefix and WIN64
+        dnl
+        case "${host}" in
+            amd64*|i686-w64*|x86_64*)
+                HAVE_WIN64="1"
+                PROGRAMFILES="PROGRAMFILES64"
+            ;;
+            *)
+                PROGRAMFILES="PROGRAMFILES"
+            ;;
+        esac
+        AC_SUBST(PROGRAMFILES)
+
     fi
     if test "${SYS}" = "mingwce"; then
         # add ws2 for closesocket, select, recv
@@ -350,30 +377,17 @@ case "${host_os}" in
   hpux*)
     SYS=hpux
     ;;
-  beos)
-    SYS=beos
-    CFLAGS_save="${CFLAGS_save} -Wno-multichar"; CFLAGS="${CFLAGS_save}"
-    CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar"; CXXFLAGS="${CXXFLAGS_save}"
-    VLC_ADD_CXXFLAGS([beos],[])
-    VLC_ADD_LIBS([vlc libvlccore logger],[-lbe])
-    VLC_ADD_LIBS([dvdnav dvdread],[-ldl])
-    VLC_ADD_LIBS([filesystem],[-lpoll])
-    LDFLAGS_save="${LDFLAGS_save} -lintl"; LDFLAGS="${LDFLAGS_save}"
-    dnl Check for BONE
-    if test -f /boot/beos/system/lib/libbind.so; then
-        VLC_ADD_LIBS([filesystem access_ftp access_mms access_output_udp netsync sap libvlccore growl_udp],[-lbind -lsocket])
-    else
-        VLC_ADD_LIBS([filesystem access_ftp access_mms access_output_udp netsync sap libvlccore growl_udp],[-lnet])
-    fi
+  symbian*)
+    SYS=symbian
     ;;
   *)
     SYS="${host_os}"
     ;;
 esac
-AM_CONDITIONAL(HAVE_BEOS, test "${SYS}" = "beos")
 AM_CONDITIONAL(HAVE_DARWIN, test "${SYS}" = "darwin")
 AM_CONDITIONAL(HAVE_LINUX, [test "${SYS}" = "linux"])
 AM_CONDITIONAL(HAVE_WIN32, test "${SYS}" = "mingw32")
+AM_CONDITIONAL(HAVE_WIN64, test "${HAVE_WIN64}" = "1")
 AM_CONDITIONAL(HAVE_WINCE, test "${SYS}" = "mingwce")
 AM_CONDITIONAL(USE_PEFLAGS, [test "${enable_peflags}" = "yes"])
 
@@ -414,10 +428,6 @@ m4_defun([AC_DEPLIBS_CHECK_METHOD],[])
 
 lt_cv_deplibs_check_method=pass_all
 
-AS_IF([test "${enable_shared}" = "no"], [
-  AC_MSG_ERROR([VLC is based on plugins. Shared libraries cannot be disabled.])
-])
-
 dnl
 dnl Gettext stuff
 dnl
@@ -516,11 +526,10 @@ AC_PREPROC_IFELSE([
   AC_MSG_RESULT([not present])
 ], [
   AC_MSG_RESULT([found])
-  AS_IF([test "x${enable_nls}" != "xno" || test "x${enable_mozilla}" != "xno"], [
+  AS_IF([test "x${enable_nls}" != "xno"], [
     AC_MSG_ERROR([Buggy GNU/libc (version 2.5 - 2.7) present. VLC would crash; there is no viable
 work-around for this. Check with your distribution vendor on how to update the
-glibc run-time. Alternatively, build with --disable-nls --disable-mozilla and
-be sure to not use LibVLC from other applications/wrappers.])
+glibc run-time. Alternatively, build with --disable-nls.])
   ], [
     AC_DEFINE(DISABLE_BUGGY_GLIBC_CHECK, 1, [Disables runtime check for buggy glibc.])
   ])
@@ -537,19 +546,20 @@ dnl Check for system libs needed
 need_libc=false
 
 dnl Check for usual libc functions
-AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign openat posix_fadvise posix_madvise posix_memalign setenv setlocale stricmp strnicmp tdestroy uselocale])
-AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
+AC_CHECK_FUNCS([daemon fcntl fdopendir fstatvfs fork getenv getpwuid_r gettimeofday isatty lstat memalign mmap openat posix_fadvise posix_madvise posix_memalign setenv setlocale stricmp strnicmp uselocale])
+AC_REPLACE_FUNCS([asprintf atof atoll getcwd getdelim getpid gmtime_r lldiv localtime_r nrand48 rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab tdelete tdestroy tfind tsearch twalk vasprintf])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
 
+# Windows CE doesn't have strcoll()
+AC_FUNC_STRCOLL
+
 dnl Check for non-standard system calls
 AC_CHECK_FUNCS([accept4 dup3 eventfd vmsplice sched_getaffinity])
 
 AH_BOTTOM([#include <vlc_fixups.h>])
 
-AC_CHECK_FUNCS(mmap, [VLC_ADD_PLUGIN([access_mmap])])
-
 SOCKET_LIBS=""
 AC_CHECK_FUNCS(connect,,[
   AC_CHECK_LIB(socket,connect,[
@@ -710,14 +720,6 @@ if test "${ac_cv_have_plugins}" = "no"; then
   fi
 fi
 
-# BeOS style
-if test "${ac_cv_have_plugins}" = "no"; then
-  AC_CHECK_HEADERS(image.h)
-  AC_CHECK_FUNCS(load_add_on,
-   [AC_DEFINE(HAVE_DL_BEOS, 1, [Define if you have the BeOS dl])
-    ac_cv_have_plugins=yes])
-fi
-
 # Only test for dlopen() if the others didn't work
 LIBDL=""
 if test "${ac_cv_have_plugins}" = "no" -o "${SYS}" = "darwin"; then
@@ -793,6 +795,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
   AC_MSG_RESULT(no)])
 
 dnl Check for headers
+AC_CHECK_HEADERS([search.h])
 AC_CHECK_HEADERS(getopt.h strings.h locale.h xlocale.h)
 AC_CHECK_HEADERS(fcntl.h sys/time.h sys/ioctl.h sys/stat.h)
 AC_CHECK_HEADERS([arpa/inet.h netinet/in.h netinet/udplite.h sys/eventfd.h])
@@ -876,7 +879,7 @@ AC_CHECK_HEADERS(zlib.h, [ have_zlib=yes ], [ have_zlib=no ])
 AM_CONDITIONAL(HAVE_ZLIB, [ test "${have_zlib}" = "yes" ])
 if test "${have_zlib}" = "yes"
 then
-  VLC_ADD_LIBS([access_http gme mp4 skins2 sap mkv unzip zip],[-lz])
+  VLC_ADD_LIBS([access_http mp4 skins2 sap mkv unzip zip],[-lz])
   PKG_CHECK_MODULES([MINIZIP], [minizip] , [ have_minizip=yes ], [
     AC_CHECK_HEADERS([unzip.h], [ 
       have_minizip=yes
@@ -1031,16 +1034,12 @@ if test "${ac_cv_c_fast_math}" != "no"; then
 fi
 
 dnl Check for -funroll-loops
-dnl Disabled on BeOS because BeOS' gcc is buggy and may crash with it
-if test "${SYS}" != "beos"
-then
-  AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
-      [ac_cv_c_unroll_loops],
-      [CFLAGS="${CFLAGS_save} -funroll-loops"
-       AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
-  if test "${ac_cv_c_unroll_loops}" != "no"; then
-      CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -funroll-loops"
-  fi
+AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
+    [ac_cv_c_unroll_loops],
+    [CFLAGS="${CFLAGS_save} -funroll-loops"
+     AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
+if test "${ac_cv_c_unroll_loops}" != "no"; then
+    CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -funroll-loops"
 fi
 
 dnl Check for -fomit-frame-pointer
@@ -1745,12 +1744,12 @@ if test "${enable_live555}" != "no"; then
          #endif
          #endif],
         [AC_MSG_RESULT([no])
-          if test "${enable_live555}" == "yes"; then
-            AC_MSG_ERROR([Your version of liveMedia is too old: you may get a more recent one from http://www.live555.com/liveMedia.
-lternatively you can use --disable-live555 to disable the liveMedia plugin.])
-          else
-            AC_MSG_WARN([Your version of liveMedia is too old: you may get a more recent one from http://www.live555.com/liveMedia.])
-          fi
+          AC_MSG_WARN([The installed liveMedia version is too old:
+Version 2010.05.29 or later is required to proceed.
+You can get an updated one from http://www.live555.com/liveMedia .])
+          AS_IF([test "${enable_live555}" == "yes"], [
+            AC_MSG_ERROR([Update live555 or pass --disable-live555 to disable the plugin.])
+          ])
         ],[
           AC_MSG_RESULT([yes])
           other_libs="-lgroupsock -lBasicUsageEnvironment -lUsageEnvironment"
@@ -1847,7 +1846,7 @@ dnl
 dnl dvdread module: check for libdvdread
 dnl
 dnl prepend -ldvdcss on OS that need it
-AS_CASE(["${SYS}"], [mingw32|darwin|beos], [VLC_ADD_LIBS([dvdread], [-ldvdcss])])
+AS_CASE(["${SYS}"], [mingw32|darwin], [VLC_ADD_LIBS([dvdread], [-ldvdcss])])
 PKG_ENABLE_MODULES_VLC([DVDREAD], [], [dvdread], [dvdread input module], [auto])
 
 dnl
@@ -1858,28 +1857,19 @@ AC_ARG_ENABLE(dvdnav,
 if test "${enable_dvdnav}" != "no"
 then
   dnl prepend -ldvdcss on OS that need it
-  AS_CASE(["${SYS}"], [mingw32|darwin|beos], [VLC_ADD_LIBS([dvdnav], [-ldvdcss])])
+  AS_CASE(["${SYS}"], [mingw32|darwin], [VLC_ADD_LIBS([dvdnav], [-ldvdcss])])
 
-  DVDNAV_PATH="${PATH}"
-  AC_ARG_WITH(dvdnav-config-path,
-    [  --with-dvdnav-config-path=PATH dvdnav-config path (default search in \$PATH)],
-    [ if test "${with_dvdnav_config_path}" != "no"
-      then
-        DVDNAV_PATH="${with_dvdnav_config_path}:${PATH}"
-      fi ])
-  AC_PATH_PROG(DVDNAV_CONFIG, dvdnav-config, no, ${DVDNAV_PATH})
-  if test "${DVDNAV_CONFIG}" != "no"
-  then
+  PKG_CHECK_MODULES(DVDNAV, dvdnav, [
     VLC_ADD_PLUGIN([dvdnav])
-    VLC_ADD_CFLAGS([dvdnav],[`${DVDNAV_CONFIG} --cflags`])
-    VLC_ADD_LIBS([dvdnav],[`${DVDNAV_CONFIG} --libs`])
+    VLC_ADD_CFLAGS([dvdnav],[${DVDNAV_CFLAGS}])
+    VLC_ADD_LIBS([dvdnav],[${DVDNAV_LIBS}])
     AC_CHECK_LIB(dvdnav, dvdnav_get_video_resolution,
-               AC_DEFINE(HAVE_DVDNAV_GET_VIDEO_RESOLUTION, 1, [Define if you have dvdnav_get_video_resolution.]),
-               [], [${LIBS_dvdnav}])
+      AC_DEFINE(HAVE_DVDNAV_GET_VIDEO_RESOLUTION, 1, [Define if you have dvdnav_get_video_resolution.]),
+        [], [${LIBS_dvdnav}])
     AC_CHECK_LIB(dvdnav, dvdnav_describe_title_chapters,
-               AC_DEFINE(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS, 1, [Define if you have dvdnav_describe_title_chapters.]),
-               [], [${LIBS_dvdnav}])
-  fi
+      AC_DEFINE(HAVE_DVDNAV_DESCRIBE_TITLE_CHAPTERS, 1, [Define if you have dvdnav_describe_title_chapters.]),
+        [], [${LIBS_dvdnav}])],
+      [AC_MSG_WARN(dvdnav library not found)])
 fi
 
 dnl
@@ -1921,7 +1911,7 @@ fi
 dnl
 dnl  Blu-ray Disc Support with libbluray
 dnl
-PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray], (libbluray for Blu-ray disc support ) )
+PKG_ENABLE_MODULES_VLC([BLURAY], [libbluray], [libbluray >= 0.2 ], (libbluray for Blu-ray disc support ) )
 
 dnl
 dnl  OpenCV wrapper and example filters
@@ -2132,6 +2122,29 @@ then
   fi
 fi
 
+dnl
+dnl special access module for Blackmagic SDI cards
+dnl
+AC_ARG_ENABLE(decklink,
+  [  --enable-decklink       Blackmagic DeckLink SDI access module (default enabled)])
+if test "${enable_decklink}" != "no"
+then
+  AC_ARG_WITH(decklink_sdk,
+    [  --with-decklink-sdk=DIR      Location of Blackmagic DeckLink SDI SDK],[],[])
+  if test "${with_decklink_sdk}" != "no" -a -n "${with_decklink_sdk}"
+  then
+    VLC_ADD_CPPFLAGS([decklink],[-I${with_decklink_sdk}/include])
+  fi
+  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_decklink}"
+  AC_LANG_PUSH(C++)
+  AC_CHECK_HEADERS(DeckLinkAPIDispatch.cpp, [
+    VLC_ADD_PLUGIN([decklink])
+  ],[AC_MSG_WARN(Blackmagic DeckLink SDI include files not found, decklink disabled)])
+  AC_LANG_POP(C++)
+  CPPFLAGS="${CPPFLAGS_save}"
+fi
+
+
 dnl
 dnl  gnomeVFS access module
 dnl
@@ -2260,10 +2273,6 @@ if test "${enable_screen}" != "no"; then
     VLC_ADD_LIBS([screen],[-lgdi32])
   elif test "${SYS}" = "mingwce"; then
     CPPFLAGS="${CPPFLAGS_save}"
-  elif test "${SYS}" = "beos"; then
-    VLC_ADD_PLUGIN([screen])
-    VLC_ADD_CXXFLAGS([screen],[])
-    VLC_ADD_LIBS([screen],[-lbe])
   fi
 fi
 
@@ -2283,6 +2292,23 @@ AC_CHECK_FUNCS(inet_ntop,[
   AC_DEFINE(HAVE_INET_NTOP, 1, [Define to 1 if you have inet_ntop().])])
 
 
+dnl
+dnl  GME demux plugin
+dnl
+AC_ARG_ENABLE(gme,
+  [  --enable-gme            Game Music Emu support (default auto)])
+AS_IF([test "${enable_gme}" != "no"], [
+  AC_CHECK_HEADER([gme/gme.h], [
+    VLC_ADD_LIBS([gme], [-lgme])
+    VLC_ADD_PLUGIN([gme])
+  ], [
+    AS_IF([test "x${enable_gme}" != "x"], [
+      AC_MSG_ERROR([GME cannot be found. Please install the development files.])
+    ])
+  ])
+])
+
+
 dnl
 dnl  ogg demux plugin
 dnl
@@ -2382,44 +2408,6 @@ then
     VLC_ADD_LIBS([mpc],[-lmpcdec])])])
 fi
 
-dnl
-dnl  game music emu demux plugin
-dnl
-AC_ARG_ENABLE(gme,
-  [  --enable-gme            Game Music Emu demux support (default enabled)])
-if test "${enable_gme}" != "no" -a "${CXX}" != "";
-then
-  AC_LANG_PUSH(C++)
-  AC_ARG_WITH(gme-tree,
-  [  --with-gme-tree=PATH    gme tree for static linking])
-  if test -n "${with_gme_tree}"
-  then
-    AC_MSG_CHECKING(for libgme.a in ${with_mod_tree})
-    real_gme_tree="`cd ${with_gme_tree} 2>/dev/null && pwd`"
-    if test -z "${real_gme_tree}"
-    then
-      dnl  The given directory can't be found
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot cd to ${with_gme_tree}])
-    fi
-    if test -f "${real_gme_tree}/gme/libgme.a"
-    then
-      dnl  Use a custom gme
-      AC_MSG_RESULT(${real_gme_tree}/gme/libgme.a)
-      VLC_ADD_PLUGIN([gme])
-      VLC_ADD_LIBS([gme],[${real_gme_tree}/gme/libgme.a])
-      VLC_ADD_CXXFLAGS([gme],[-I${real_gme_tree}/gme])
-    else
-      dnl  The given gme wasn't built
-      AC_MSG_RESULT(no)
-      AC_MSG_ERROR([cannot find ${real_mod_tree}/gme/libgme.a, make sure you compiled gme in ${with_gme_tree}])
-    fi
-  else
-      AC_MSG_WARN([only static linking is available, you must provide a gme-tree])
-  fi
-  AC_LANG_POP(C++)
-fi
-
 dnl
 dnl  Codec plugins
 dnl
@@ -2657,7 +2645,7 @@ then
       VLC_SAVE_FLAGS
       CPPFLAGS="${CPPFLAGS} ${AVFORMAT_CFLAGS}"
       CFLAGS="${CFLAGS} ${AVFORMAT_CFLAGS}"
-      AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h)
+      AC_CHECK_HEADERS(libavformat/avformat.h ffmpeg/avformat.h libavformat/avio.h)
       AC_CHECK_HEADERS(libavutil/avutil.h ffmpeg/avutil.h)
       AS_IF([test "$enable_merge_ffmpeg" = "no"], [
         VLC_ADD_PLUGIN([avformat access_avio])
@@ -3161,7 +3149,7 @@ dnl  X C Bindings modules
 dnl
 AC_ARG_ENABLE(xcb,
   [  --enable-xcb            X11 support with XCB (default enabled)],, [
-  AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin"], [
+  AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin" -a "${SYS}" != "symbian"], [
     enable_xcb="yes"
   ], [
     enable_xcb="no"
@@ -3173,11 +3161,12 @@ AC_ARG_ENABLE(xvideo,
 ])
 
 need_xid_provider="no"
+have_xcb="no"
 AS_IF([test "${enable_xcb}" != "no"], [
   dnl libxcb
   PKG_CHECK_MODULES(XCB, [xcb])
+  have_xcb="yes"
   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
-  VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_window xcb_screen xcb_apps])
 
   AS_IF([test "${enable_xvideo}" != "no"], [
     PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [
@@ -3219,8 +3208,8 @@ AS_IF([test "${enable_xcb}" != "no"], [
     VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}])
     VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS])
   ])
-  VLC_ADD_PLUGIN([xdg_screensaver])
 ])
+AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
 
 AC_ARG_ENABLE(glx,
   [  --enable-glx            X11 OpenGL (GLX) support (default enabled)],, [
@@ -3241,6 +3230,18 @@ AS_IF([test "${enable_glx}" != "no"], [
 AC_SUBST([GL_CFLAGS])
 AC_SUBST([GL_LIBS])
 
+dnl
+dnl  EGL
+dnl
+AC_ARG_ENABLE(egl,
+  [  --enable-egl            EGL support (default disabled)],, [
+  enable_egl="no"
+])
+AS_IF([test "${enable_egl}" != "no"], [
+  PKG_CHECK_MODULES(EGL, [egl])
+  VLC_ADD_PLUGIN([egl])
+])
+
 dnl
 dnl  SDL module
 dnl
@@ -3346,6 +3347,30 @@ then
   VLC_ADD_PLUGIN([snapshot])
 fi
 
+dnl
+dnl  iOS vout module
+dnl
+AC_ARG_ENABLE(ios-vout,
+  [  --enable-ios-vout    iOS video output module (default disabled)])
+if test "${enable_ios_vout}" = "yes"
+then
+  VLC_ADD_PLUGIN([vout_ios])
+  VLC_ADD_CFLAGS([vout_ios], [-DUSE_OPENGL_ES=1])
+  VLC_ADD_LDFLAGS([vout_ios], [-Wl,-framework,OpenGLES,-framework,QuartzCore,-framework,UIKit,-framework,Foundation])
+fi
+
+dnl
+dnl  QuartzText vout module (iOS/Mac OS)
+dnl
+AC_ARG_ENABLE(macosx-quartztext,
+  [  --enable-macosx-quartztext   Mac OS X quartz text module (default enabled on Mac OS X)])
+if test "x${enable_macosx_quartztext}" != "xno" &&
+  (test "${SYS}" = "darwin" || test "${enable_macosx_quartztext}" = "yes")
+then
+  VLC_ADD_PLUGIN([quartztext])
+  VLC_ADD_LDFLAGS([quartztext],[-Wl,-framework,ApplicationServices])
+fi
+
 dnl
 dnl  Windows DirectX module
 dnl
@@ -3361,6 +3386,7 @@ if test "${enable_directx}" != "no"
 then
   if test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"
   then
+      VLC_ADD_LIBS([directx],[-luser32])
       AC_CHECK_HEADERS(ddraw.h,
       [ VLC_ADD_PLUGIN([directx aout_directx])
         VLC_ADD_LIBS([directx],[-lgdi32])
@@ -3541,15 +3567,7 @@ fi
 dnl
 dnl  Pulseaudio module
 dnl
-AS_IF([test "${no_x}" = "yes"], [
-  AS_IF([test "${enable_pulse}" = "yes"], [
-    AC_MSG_ERROR([Xlib is required for VLC PulseAudio support
-(see http://www.pulseaudio.org/ticket/799 for further reference).])
-  ])
-], [
-  PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.11], [Pulseaudio support], [auto])
-  VLC_ADD_LIBS([pulse], [${X_LIBS} ${X_PRE_LIBS} -lX11])
-])
+PKG_ENABLE_MODULES_VLC([PULSE], [], [libpulse >= 0.9.22], [PulseAudio support], [auto])
 
 dnl
 dnl  Portaudio module
@@ -3651,10 +3669,10 @@ dnl Skins2 module
 dnl
 AC_ARG_ENABLE(skins2,
   [AS_HELP_STRING([--enable-skins2],[Skins2 interface module (default
-   enabled except on MacOSX, BeOS and WinCE)])])
-if test "${enable_skins2}" = "yes" ||
-  (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
-   test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no"); then
+   enabled except on MacOSX and WinCE)])])
+if test "${enable_skins2}" != "no" ||
+  (test "${SYS}" != "darwin" &&
+   test "${SYS}" != "mingwce" && test "${enable_skins2}" == "yes"); then
 
   dnl test for the required libraries
   skins2_missing_lib="no"
@@ -3672,7 +3690,7 @@ if test "${enable_skins2}" = "yes" ||
     ALIASES="${ALIASES} svlc"
     VLC_ADD_CPPFLAGS([skins2],[-U_OFF_T_ -U_off_t -Imodules/gui/skins2 -DWIN32_SKINS])
     VLC_ADD_CXXFLAGS([skins2],[-O2 -fno-rtti])
-    VLC_ADD_LIBS([skins2],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32])
+    VLC_ADD_LIBS([skins2],[-loleaut32 -lwinspool -lwinmm -lshell32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lcomdlg32 -lole32 -luuid -lcomctl32  -lmsimg32 -luser32])
 
   else if test "${skins2_missing_lib}" = "no" && (test "${SYS}" = "darwin"); then
     VLC_ADD_PLUGIN([skins2])
@@ -3691,7 +3709,7 @@ if test "${enable_skins2}" = "yes" ||
   fi fi fi
 fi
 AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes" ||
-        (test "${SYS}" != "darwin" && test "${SYS}" != "beos" &&
+        (test "${SYS}" != "darwin" &&
          test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no")])
 
 dnl
@@ -3760,6 +3778,9 @@ AS_IF([test "${enable_qt4}" != "no"], [
     AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
         VLC_ADD_LIBS([qt4],[-lole32])
     ])
+    AS_IF([test "${SYS}" = "darwin" ],[
+         VLC_ADD_LDFLAGS([qt4], [-Wl,-framework,Cocoa])
+    ])
     AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
     AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
     AC_PATH_PROGS(UIC, [uic-qt4 uic], uic,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
@@ -3866,32 +3887,22 @@ AC_ARG_ENABLE(ncurses,
         [VLC_ADD_PLUGIN([ncurses])
         VLC_ADD_LIBS([ncurses],[-lncursesw])
         ALIASES="${ALIASES} nvlc"
-        AC_DEFINE([HAVE_NCURSESW], 1, [Define to 1 if you have libncursesw.])
         AC_CHECK_LIB(ncursesw, tgetent, [],
           AC_CHECK_LIB(tinfow, tgetent, [VLC_ADD_LIBS([ncurses],[-ltinfow])],
             [AC_CHECK_LIB(tinfo, tgetent, [VLC_ADD_LIBS([ncurses],[-ltinfo])],
-              [AS_IF([test "x${enable_ncurses}" != "x"],
+              [AS_IF([test "${enable_ncurses}" = "yes"],
                 [AC_MSG_ERROR([tgetent not found in ncursesw tinfow tinfo]
                )])])
             ]
           )
         )
         ],
-        [AC_CHECK_LIB( ncurses, mvprintw,
-          [VLC_ADD_PLUGIN([ncurses])
-          ALIASES="${ALIASES} nvlc"
-          VLC_ADD_LIBS([ncurses],[-lncurses])
-          AC_CHECK_LIB(ncurses, tgetent, [],
-            [AC_CHECK_LIB(tinfo, tgetent, [VLC_ADD_LIBS([ncurses],[-ltinfo])],
-              [AS_IF([test "x${enable_ncurses}" != "x"],
-                [AC_MSG_ERROR([tgetent not found in ncurses tinfo])])]
-            )]
-          )],
-          [AS_IF([test "x${enable_ncurses}" != "x"], [
-            AC_MSG_ERROR([libncurses not found])])]
-        )]
-      )]
-    )
+          [AS_IF([test "${enable_ncurses}" = "yes"], [
+            AC_MSG_ERROR([libncursesw not found])])]
+        )],
+        [AS_IF([test "${enable_ncurses}" = "yes"], [
+          AC_MSG_ERROR([ncurses.h not found])])]
+        )
   fi]
 )
 
@@ -4164,6 +4175,23 @@ else
 fi
 AM_CONDITIONAL([HAVE_SQLITE], [test "${enable_sqlite}" != "no"])
 
+dnl
+dnl media library
+dnl
+AC_ARG_ENABLE(media-library, [--enable-media-library media library (default auto)])
+if test "${enable_media_library}" != "no"; then
+    if test "${enable_sqlite}" != "yes"; then
+        if test "${enable_media_library}" == "yes"; then
+            AC_MSG_ERROR([SQLite module is required for the media library])
+        else
+            AC_MSG_WARN([SQLite module is required for the media library])
+        fi
+    else
+       AC_DEFINE([MEDIA_LIBRARY], 1, [Define if you want to use the VLC media library])
+       VLC_ADD_CPPFLAGS([qt4],"-DMEDIA_LIBRARY")
+       VLC_ADD_PLUGIN([media_library])
+    fi
+fi
 
 dnl
 dnl  Endianness check
@@ -4230,226 +4258,6 @@ AC_ARG_ENABLE(vlc,
   [  --enable-vlc            build the VLC media player (default enabled)])
 AM_CONDITIONAL(BUILD_VLC, [test "${enable_vlc}" != "no"])
 
-dnl
-dnl  Microsoft ActiveX support
-dnl
-activex=false
-AC_ARG_ENABLE(activex,
-  AS_HELP_STRING([--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"
-  then
-    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
-       WIDL=no
-    fi
-    AC_LANG_PUSH(C++)
-    AC_CHECK_HEADERS(ole2.h,
-      [AC_CHECK_HEADERS(olectl.h,
-        [ VLC_ADD_CPPFLAGS([activex],[-DUNICODE -D_UNICODE -D_MIDL_USE_GUIDDEF_])
-          VLC_ADD_CXXFLAGS([activex],[-fno-exceptions])
-          VLC_ADD_LIBS([activex],[-lole32 -loleaut32 -luuid -lshlwapi])
-          AC_CHECK_HEADERS(objsafe.h,
-            VLC_ADD_CXXFLAGS([activex],[-DHAVE_OBJSAFE_HEADER]),,
-            [
-             #if HAVE_OLE2_H
-             #   include <ole2.h>
-             #endif
-            ]
-          )
-          activex=:
-          PLUGINS_BINDINGS="${PLUGINS_BINDINGS} activex"
-        ],
-        [ AC_MSG_ERROR([required OLE headers are missing from your system]) ]
-      )],
-      [ AC_MSG_ERROR([required OLE headers are missing from your system]) ]
-    )
-    AC_LANG_POP(C++)
-  fi
-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
-dnl  Mozilla plugin
-dnl
-mozilla=false
-AC_ARG_ENABLE(mozilla,
-  AS_HELP_STRING([--enable-mozilla],[build a vlc-based Firefox/Mozilla plugin
-                 (default disabled)]))
-AC_ARG_WITH(mozilla-sdk-path,
-  [  --with-mozilla-sdk-path=PATH path to mozilla sdk])
-AC_ARG_WITH(mozilla-pkg,
-  [  --with-mozilla-pkg=PKG  look for PKG.pc to build the mozilla plugin.])
-AC_LANG_PUSH(C++)
-if test "${enable_mozilla}" = "yes"
-then
-  AS_IF([test "${with_mozilla_sdk_path}" = "" -o "${with_mozilla_sdk_path}" = "no"],
-    [
-    dnl pkg-config
-    dnl As we want to do a loop due to the number of name possible for the .pc
-    dnl we can't use the pkg-config macros.
-
-    AC_ARG_VAR([MOZILLA_CFLAGS], [C compiler flags for Mozilla, overriding pkg-config])
-    AC_ARG_VAR([MOZILLA_LIBS], [linker flags for Mozilla, overriding pkg-config])
-    AC_MSG_NOTICE([Checking for Mozilla])
-    found=0
-    if test -n "$MOZILLA_CFLAGS" -o -n "$MOZILLA_LIBS"
-    then
-      found=1
-    else
-      if test -n "$PKG_CONFIG"; then
-        for i in "${with_mozilla_pkg}" libxul {seamonkey,iceape,xulrunner,firefox,iceweasel,mozilla}-plugin; do
-          if test -n "$i"
-          then
-            echo "Trying to find $i package" >&AS_MESSAGE_LOG_FD
-            AC_MSG_CHECKING([for $i >= 1.9.2])
-            if $PKG_CONFIG --exists --print-errors "$i >= 1.9.2" 2>&AS_MESSAGE_LOG_FD
-            then
-              echo "Using $i pkg-config package." >&AS_MESSAGE_LOG_FD
-              echo "Using $i package." >&AS_MESSAGE_FD
-              found=1
-              MOZILLA_CFLAGS=$(eval $PKG_CONFIG --cflags "$i" )
-              MOZILLA_LIBS=$(eval $PKG_CONFIG --libs "$i" )
-              AC_MSG_RESULT([yes])
-              break
-            fi
-            AC_MSG_RESULT([no])
-          fi
-        done
-      fi
-    fi
-    AS_IF( [test $found = 1],[
-        CPPFLAGS="${CPPFLAGS_save} ${MOZILLA_CFLAGS}"
-        MOZILLA_REQUIRED_HEADERS=1
-        AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
-        AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
-          [#if HAVE_NPAPI_H
-           # include <npapi.h>
-           #endif
-          ])
-        if test "${MOZILLA_REQUIRED_HEADERS}" = "0"; then
-            AC_MSG_ERROR([Please install the Firefox development tools; plugin/npapi.h and/or plugin/npruntime.h were not found.])
-        fi
-        MOZILLA_REQUIRED_HEADERS=
-        mozilla=:
-        AS_IF([ test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"],[
-           VLC_ADD_CPPFLAGS([mozilla],[-DXP_UNIX])
-           AS_IF([ test "${SYS}" != "darwin"],[
-             PKG_CHECK_MODULES(XPM, [xpm xt],[
-                VLC_ADD_CPPFLAGS([mozilla],[-DMOZ_X11])
-             ],[
-                AC_MSG_ERROR([Please install the libXpm and libXt development files.])
-             ])
-             AS_IF([test "${have_xcb_keysyms}" != "yes"], [
-               AC_MSG_ERROR([Please install xcb-keysyms from xcb-utils.])
-             ])
-          ])
-        ])
-        VLC_ADD_CPPFLAGS([mozilla],[${CPPFLAGS} ${XPM_CFLAGS}])
-        VLC_ADD_LIBS([mozilla],[${MOZILLA_LIBS} ${XPM_LIBS}])
-        VLC_ADD_PLUGIN([mozilla])
-        PLUGINS_BINDINGS="${PLUGINS_BINDINGS} mozilla"
-        MOZILLA_CONFIG=
-        CPPFLAGS="${CPPFLAGS_save}"
-          ],
-          [
-            AC_PATH_PROGS(MOZILLA_CONFIG,
-            [mozilla-config seamonkey-config xulrunner-config],
-        [no])
-            test "${MOZILLA_CONFIG}" = "no" && AC_MSG_ERROR([Please install the Mozilla development tools (version 1.9.2 or higher) or use --disable-mozilla.])
-          ]
-        )
-    dnl pkg-config failed but we might have found a mozilla-config
-    AS_IF( [test ! -z "${MOZILLA_CONFIG}"],[
-      if ${MOZILLA_CONFIG} --defines | grep -q 'MOZ_X11=1'; then
-        LDFLAGS="${LDFLAGS_save} ${X_LIBS} ${X_PRE_LIBS}"
-        AC_CHECK_LIB(Xt,XtStrings,
-         [
-           VLC_ADD_CPPFLAGS([mozilla],[${X_CFLAGS}])
-           VLC_ADD_LIBS([mozilla],[${X_LIBS} ${X_PRE_LIBS} -lXt -lX11 -lSM -lICE -lXpm])
-         ],
-         [],
-         [[${X_LIBS} ${X_PRE_LIBS} -lX11 -lSM -lICE -lXpm]
-        ])
-        AC_CHECK_HEADERS(X11/xpm.h,,AC_MSG_ERROR([Please install libXpm-devel library for required X11/xpm.h]))
-        AS_IF([test "${have_xcb_keysyms}" != "yes"], [
-          AC_MSG_ERROR([Please install xcb-keysyms from xcb-utils.])
-        ])
-        LDFLAGS="${LDFLAGS_save}"
-      fi
-
-      mozilla=:
-      PLUGINS_BINDINGS="${PLUGINS_BINDINGS} mozilla"
-      VLC_ADD_CPPFLAGS([mozilla],[[`${MOZILLA_CONFIG} --cflags plugin java`]])
-      VLC_ADD_LIBS([mozilla],[`${MOZILLA_CONFIG} --libs plugin`])
-      CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mozilla}"
-      MOZILLA_REQUIRED_HEADERS=1
-      AC_CHECK_HEADERS(mozilla-config.h,,MOZILLA_REQUIRED_HEADERS=0)
-      AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
-      AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
-        [#if HAVE_NPAPI_H
-         # include <npapi.h>
-         #endif
-        ])
-      if test "${MOZILLA_REQUIRED_HEADERS}" = "0"
-      then
-        AC_MSG_ERROR([Please install the Mozilla development tools, required headers were not found.])
-      fi
-      MOZILLA_REQUIRED_HEADERS=
-      CPPFLAGS="${CPPFLAGS_save}"
-      MOZILLA_SDK_PATH="`${MOZILLA_CONFIG} --prefix`"
-    ])
-    dnl End of moz_sdk = ""
-  ],[
-    dnl special case for mingw32
-    if test "${SYS}" = "mingw32"
-    then
-      AC_CHECK_TOOL(CYGPATH, cygpath, "")
-      dnl latest gecko sdk does not have an xpcom directory
-      if test -d "${with_mozilla_sdk_path}/xpcom"; then
-          mozilla_sdk_xpcom="/xpcom"
-      fi
-    fi
-
-    real_mozilla_sdk="`cd ${with_mozilla_sdk_path} 2>/dev/null && pwd`"
-    CPPFLAGS="${CPPFLAGS_save} -I${real_mozilla_sdk}/include"
-    MOZILLA_REQUIRED_HEADERS=1
-    AC_CHECK_HEADERS(npapi.h,,MOZILLA_REQUIRED_HEADERS=0)
-    AC_CHECK_HEADERS(npruntime.h,,MOZILLA_REQUIRED_HEADERS=0,
-        [#if HAVE_NPAPI_H
-          #include <npapi.h>
-          #endif
-        ])
-    if test "${MOZILLA_REQUIRED_HEADERS}" = "0"
-    then
-        AC_MSG_ERROR([Please install the Mozilla development tools, required headers were not found.])
-    fi
-    MOZILLA_REQUIRED_HEADERS=
-    mozilla=:
-    PLUGINS_BINDINGS="${PLUGINS_BINDINGS} mozilla"
-    VLC_ADD_CPPFLAGS([mozilla],[-DXPCOM_GLUE -DHAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX -I${real_mozilla_sdk}/include])
-    MOZILLA_SDK_PATH="${real_mozilla_sdk}"
-
-    if test -n "${CYGPATH}"; then
-      real_mozilla_sdk="`${CYGPATH} -w ${real_mozilla_sdk}`"
-    fi
-    CPPFLAGS="${CPPFLAGS_save}"
- ])
-fi
-AC_LANG_POP(C++)
-AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
 
 dnl
 dnl  Plugin and builtin checks
@@ -4539,7 +4347,6 @@ AC_SUBST(MOC)
 AC_SUBST(RCC)
 AC_SUBST(UIC)
 AC_SUBST(WINDRES)
-AC_SUBST(MOZILLA_SDK_PATH)
 AC_SUBST(WINE_SDK_PATH)
 AC_SUBST(LIBEXT)
 AC_SUBST(AM_CPPFLAGS)
@@ -4552,13 +4359,11 @@ VLC_OUTPUT_VLC_CONFIG_IN
 
 AC_CONFIG_FILES([
   Makefile
-  projects/activex/Makefile
   doc/Makefile
   libs/loader/Makefile
   libs/srtp/Makefile
   libs/unzip/Makefile
   modules/Makefile
-  projects/mozilla/Makefile
   m4/Makefile
   po/Makefile.in
   share/Makefile
@@ -4622,6 +4427,7 @@ AC_CONFIG_FILES([
   modules/misc/osd/Makefile
   modules/misc/stats/Makefile
   modules/misc/xml/Makefile
+  modules/media_library/Makefile
   modules/mux/Makefile
   modules/mux/mpeg/Makefile
   modules/packetizer/Makefile
@@ -4644,43 +4450,17 @@ AC_CONFIG_FILES([
   modules/arm_neon/Makefile
 ])
 
-AM_COND_IF([BUILD_MOZILLA], [
-  AC_CONFIG_FILES([
-    projects/mozilla/install.js
-    projects/mozilla/install.rdf
-    projects/mozilla/manifest.json
-  ])
-])
-
 AM_COND_IF([HAVE_WIN32], [
   AC_CONFIG_FILES([
     extras/package/win32/spad.nsi
     extras/package/win32/vlc.win32.nsi
   ])
-  AM_COND_IF([BUILD_ACTIVEX], [
-    AC_CONFIG_FILES([
-      projects/activex/axvlc.inf
-      projects/activex/axvlc_rc.rc
-    ])
-  ])
-  AM_COND_IF([BUILD_MOZILLA], [
-    AC_CONFIG_FILES([
-      projects/mozilla/npvlc_rc.rc
-    ])
-  ])
 ])
 
 AM_COND_IF([HAVE_DARWIN], [
   AC_CONFIG_FILES([
     extras/package/macosx/Info.plist
     extras/package/macosx/Resources/English.lproj/InfoPlist.strings
-    extras/package/macosx/plugin/Info.plist
-    extras/package/macosx/plugin/InstallerInfo.plist
-  ])
-  AM_COND_IF([BUILD_MOZILLA], [
-    AC_CONFIG_FILES([
-      projects/mozilla/vlc.r
-    ])
   ])
 ])