[PATCH] configure.ac: Do not make missing colord or libunwind a hard failure

Ossama Othman ossama.othman at intel.com
Mon Jun 3 11:41:41 PDT 2013


Both colord and libunwind are optional dependencies.  As such, the
configure script should not exit with a failure if they are missing.
Issue warnings instead if either colord or libunwind is missing and
wasn't found.

This also allows "make distcheck" to succeed on platforms that don't
have colord and libunwind installed since configure script command
line flags are not passed down to the "distcheck" target without
AM_DISTCHECK_CONFIGURE_FLAGS and DISTCHECK_CONFIGURE_FLAGS - use of
which is discouraged.

Signed-off-by: Ossama Othman <ossama.othman at intel.com>
---
 configure.ac |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 323bd87..3046a16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -292,11 +292,15 @@ AC_ARG_ENABLE(colord,
               AS_HELP_STRING([--disable-colord],
                              [do not build colord CMS support]),,
 	      enable_colord=yes)
-AM_CONDITIONAL(ENABLE_COLORD,
-	       test "x$enable_colord" = "xyes")
 if test x$enable_colord = xyes; then
-  PKG_CHECK_MODULES(COLORD, colord >= 0.1.27)
+  PKG_CHECK_MODULES([COLORD],
+                    [colord >= 0.1.27],
+		    [],
+		    [enable_colord=no
+                     AC_MSG_WARN([Colord support won't be enabled.  Desired version not found.])])
 fi
+AM_CONDITIONAL(ENABLE_COLORD,
+	       test "x$enable_colord" = "xyes")
 
 AC_ARG_ENABLE(wcap-tools, [  --disable-wcap-tools],, enable_wcap_tools=yes)
 AM_CONDITIONAL(BUILD_WCAP_TOOLS, test x$enable_wcap_tools = xyes)
@@ -323,8 +327,11 @@ AC_ARG_ENABLE(libunwind, AS_HELP_STRING([  --disable-libunwind],
                                         [Disable libunwind usage for backtraces]),,
               enable_libunwind=yes)
 if test "x$enable_libunwind" = xyes; then
-    PKG_CHECK_MODULES(LIBUNWIND, libunwind)
-    AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
+    PKG_CHECK_MODULES([LIBUNWIND],
+                      [libunwind],
+		      [AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])],
+		      [enable_libunwind=no
+                       AC_MSG_WARN([Libunwind support won't be enabled since it was not found.])])
 fi
 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$enable_libunwind" = xyes])
 
-- 
1.7.10.4



More information about the wayland-devel mailing list