[vlc-devel] [RFC, PATCH] configure: Do not stop configure if component is not found.

Georgi Chorbadzhiyski gf at unixsol.org
Thu Dec 1 02:32:44 CET 2011


I'm compiling vlc on a server with only minimal needed components
(libav, decklink, a52, x264) and without adding bunch of --disable-xxx
options configure stops with error on several occasions. IMHO if
component is not requested via --enable-xxx the configure should
mark it as not found and go on. The attached patch does this for
the components that I do not have but are generating errors.

If the approach is acceptable I'll try look for more of these
in configure.ac

Note: This is my first crack at autoconf so I may have made a mess
out of it.

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
-------------- next part --------------
From 882688db5826446626f32a839424835e71babae2 Mon Sep 17 00:00:00 2001
From: Georgi Chorbadzhiyski <gf at unixsol.org>
Date: Thu, 1 Dec 2011 03:22:06 +0200
Subject: [PATCH] configure: Do not stop configure if component is not found.

Configure should not exit with error when dbus-control, lua,
a52, alsa and xcb are not found. It should just disable the
component.
---
 configure.ac |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index 09766ac..d831e55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -778,8 +778,8 @@ then
       VLC_ADD_CFLAGS([libvlccore],[$DBUS_CFLAGS])
       dnl Check for dbus control interface
         AC_ARG_ENABLE(dbus-control,
-          [AS_HELP_STRING([--disable-dbus-control],
-            [D-Bus control interface (default enabled)])])
+          [AS_HELP_STRING([--enable-dbus-control],
+            [D-Bus control interface (default auto)])])
         if test "${enable_dbus_control}" != "no"
         then
           VLC_ADD_PLUGIN([dbus])
@@ -799,7 +799,9 @@ then
         VLC_ADD_LIBS([inhibit],[$DBUS_LIBS])
         VLC_ADD_CFLAGS([inhibit],[$DBUS_CFLAGS])
     ],
+    [AS_IF([test "${enable_dbus_control}" = "yes"],
     [AC_MSG_ERROR([${DBUS_PKG_ERRORS}.])]
+    )]
   )
 fi
 ;;
@@ -1541,8 +1543,8 @@ AM_CONDITIONAL(ENABLE_SOUT, [test "${enable_sout}" != "no"])
 
 dnl Lua modules
 AC_ARG_ENABLE(lua,
-  [AS_HELP_STRING([--disable-lua],
-    [disable LUA scripting support (default enabled)])])
+  [AS_HELP_STRING([--enable-lua],
+    [enable LUA scripting support (default auto)])])
 if test "${enable_lua}" != "no"
 then
   PKG_CHECK_MODULES(LUA, lua5.1,
@@ -1573,12 +1575,16 @@ then
      VLC_ADD_LIBS([lua],[$LUA_LIBS])
      VLC_ADD_CFLAGS([lua],[$LUA_CFLAGS])
   else
+      AS_IF([test "${enable_lua}" = "yes"],[
       AC_MSG_ERROR([Could not find lua. Lua is needed for some interfaces (rc, telnet, http) as well as many other custom scripts. Use --disable-lua to ignore this error.])
+      ])
   fi
   AC_ARG_VAR([LUAC], [LUA byte compiler])
   AC_PATH_PROGS(LUAC,[${LUAC} luac], [false])
   AS_IF([test "${LUAC}" = "false"], [
+    AS_IF([test "${enable_lua}" = "yes"],[
     AC_MSG_ERROR([Could not find the LUA byte compiler.])
+    ])
   ])
 fi
 AM_CONDITIONAL(BUILD_LUA, [test "${have_lua}" = "yes"])
@@ -2639,7 +2645,7 @@ dnl
 dnl A52/AC3 decoder plugin
 dnl
 AC_ARG_ENABLE(a52,
-  [  --enable-a52            A/52 support with liba52 (default enabled)])
+  [  --enable-a52            A/52 support with liba52 (default auto)])
 if test "${enable_a52}" != "no"
 then
   AC_ARG_WITH(a52,
@@ -2698,10 +2704,14 @@ then
         VLC_ADD_LIBS([a52tofloat32],[${LDFLAGS_test} -la52])
         VLC_ADD_CPPFLAGS([a52tofloat32],[${CPPFLAGS_test}])
       ],[
+        AS_IF([test "${enable_a52}" = "yes"],[
         AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
+        ])
         ], [$LIBM])
     ],[
+      AS_IF([test "${enable_a52}" = "yes"],[
       AC_MSG_ERROR([Could not find liba52 on your system: you may get it from http://liba52.sf.net/. Alternatively you can use --disable-a52 to disable the a52 plugin.])
+      ])
     ])
     VLC_RESTORE_FLAGS
   fi
@@ -2985,7 +2995,7 @@ dnl
 dnl  X C Bindings modules
 dnl
 AC_ARG_ENABLE(xcb,
-  [  --enable-xcb            X11 support with XCB (default enabled)],, [
+  [  --enable-xcb            X11 support with XCB (default auto)],, [
   AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin" -a "${SYS}" != "symbian"], [
     enable_xcb="yes"
   ], [
@@ -3004,8 +3014,15 @@ AC_ARG_ENABLE(glx,
 have_xcb="no"
 AS_IF([test "${enable_xcb}" != "no"], [
   dnl libxcb
-  PKG_CHECK_MODULES(XCB, [xcb >= 1.6])
-  have_xcb="yes"
+
+  PKG_CHECK_MODULES(XCB, [xcb >= 1.6], [
+     have_xcb="yes"
+  ], [
+      AC_MSG_WARN([$XCB_PKG_ERRORS])
+  ])
+
+  AS_IF([test "${have_xcb}" != "no"], [
+
   PKG_CHECK_MODULES(XCB_SHM, [xcb-shm])
   PKG_CHECK_MODULES(XCB_COMPOSITE, [xcb-composite])
 
@@ -3044,6 +3061,8 @@ AS_IF([test "${enable_xcb}" != "no"], [
       AC_MSG_ERROR([${XLIB_XCB_PKG_ERRORS}. Pass --disable-glx if you do not need OpenGL X11 support.])
     ])
   ])
+
+  ])
 ])
 AM_CONDITIONAL([HAVE_XCB], [test "${have_xcb}" = "yes"])
 
@@ -3432,8 +3451,8 @@ AS_IF([test "${enable_alsa}" != "no"], [
   PKG_CHECK_MODULES([ALSA], [alsa >= 1.0.16], [
     have_alsa="yes"
   ], [
-    AS_IF([test "x${enable_alsa}" != "x"], [
-      AC_MSG_ERROR([$ALSA_PKG_ERRORS. alsa-lib 1.0.16 or later required.])
+    AS_IF([test "${enable_alsa}" = "yes"],[
+      AC_MSG_WARN([$ALSA_PKG_ERRORS. alsa-lib 1.0.16 or is not found.])
     ])
   ])
 ])
-- 
1.7.5.1



More information about the vlc-devel mailing list