Patchwork [1/4] petitboot: Add --with-twin config option

login
register
mail settings
Submitter Geoff Levand
Date Feb. 8, 2009, 4:35 a.m.
Message ID <20090208043550.755762324@am.sony.com>
Download mbox | patch
Permalink /patch/22561/
State Accepted
Delegated to: Jeremy Kerr
Headers show

Comments

Geoff Levand - Feb. 8, 2009, 4:35 a.m.
Make the build of the GUI components conditional on the installation
of libtwin.  Also, add options --with-twin and --without-twin to allow the
user to override the default.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 configure.ac |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

Patch

--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,23 @@  fi
 AC_PROG_CC
 AC_PROG_INSTALL
 
-PKG_CHECK_MODULES([twin], [libtwin])
+AC_ARG_WITH([twin],
+	[AS_HELP_STRING([--with-twin],
+		[build GUI versions using the twin window system])],
+	[],
+	[with_twin=check])
+
+LIBTWIN=
+AS_IF([test "x$with_twin" != xno],
+	[AC_CHECK_LIB([twin], [main],
+		[AC_SUBST([LIBTWIN], ["-ltwin"])
+			AC_DEFINE([HAVE_LIBTWIN], [1], [Define if you have libtwin])
+			PKG_CHECK_MODULES([twin], [libtwin]) ],
+		[if test "x$with_twin" != xcheck; then
+			AC_MSG_FAILURE([--with-twin was given, but test for twin failed])
+		fi],
+		[])])
+
 
 mkdir -p discover ui/test ui/common lib/talloc lib/pb-protocol lib/list \
 	      lib/waiter lib/log