xref: /OK3568_Linux_fs/buildroot/package/cwiid/0002-configure-make-wmgui-build-optional.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From dbb578450974db5decc24560da4aeaed838849a1 Mon Sep 17 00:00:00 2001
2From: Samuel Martin <s.martin49@gmail.com>
3Date: Thu, 2 Jan 2014 14:03:07 +0100
4Subject: [PATCH 2/2] configure: make wmgui build optional
5
6So, make gtk-2 and glib2 dependencies optional (only needed by wmgui)
7
8Signed-off-by: Samuel Martin <s.martin49@gmail.com>
9---
10 Makefile.in  |  2 +-
11 configure.ac | 17 +++++++++++++----
12 2 files changed, 14 insertions(+), 5 deletions(-)
13
14diff --git a/Makefile.in b/Makefile.in
15index 6d3ac98..3d2fb45 100644
16--- a/Makefile.in
17+++ b/Makefile.in
18@@ -3,7 +3,7 @@
19 include @top_builddir@/defs.mak
20
21 LIB_DIRS = libcwiid
22-BIN_DIRS = wmgui wminput lswm
23+BIN_DIRS = @WMGUI@ wminput lswm
24 DOC_DIRS = man doc
25 ifdef PYTHON
26 BIND_DIRS = python
27diff --git a/configure.ac b/configure.ac
28index 82ca3e1..d146cb6 100644
29--- a/configure.ac
30+++ b/configure.ac
31@@ -15,6 +15,11 @@ if test "$YACC" != "bison -y"; then
32 	AC_MSG_ERROR([bison not found])
33 fi
34
35+AC_ARG_ENABLE(
36+	[wmgui],
37+	[AS_HELP_STRING([--disable-wmgui],[Do not build wmgui binary (also drop the gtk-2/glib2 dependency)])],
38+	[ENABLE_WMGUI="$enableval"],[ENABLE_WMGUI=yes])
39+
40 AC_ARG_WITH(
41 	[python],
42 	[AS_HELP_STRING([--without-python],[compile without python support])],
43@@ -98,10 +103,14 @@ else
44 fi
45 AC_SUBST(LDCONFIG)
46
47-pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0"
48-PKG_CHECK_MODULES([GTK], [$pkg_modules])
49-AC_SUBST(GTK_CFLAGS)
50-AC_SUBST(GTK_LIBS)
51+AS_IF(
52+	[test "x$ENABLE_WMGUI" = xyes],
53+	[pkg_modules="gtk+-2.0 >= 2.0.0 gthread-2.0" ;
54+	PKG_CHECK_MODULES([GTK], [$pkg_modules])
55+	AC_SUBST(GTK_CFLAGS)
56+	AC_SUBST(GTK_LIBS)
57+	AC_SUBST(WMGUI, wmgui)]
58+)
59
60 AC_OUTPUT(
61 	[Makefile]
62--
631.8.5.2
64
65