summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-04-17 15:19:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-04-26 21:00:52 +1000
commit080caee95c46bb471d1442dcab246460cad8c7be (patch)
tree4d83acc9aadd1b31dfc64d386a5730702ddf6e90
parentb56ab7e0140c8fa7dcc58f6b8a087f7d6bece04f (diff)
Only build synclient/syndaemon if property support is available.
Separate dependencies for driver and synclient/syndaemon. Add option --enable-tools to explicitly build the tools (default: auto) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--configure.ac22
-rw-r--r--tools/Makefile.am9
2 files changed, 26 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 4280fff..38dd2a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,9 +96,25 @@ CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
AC_SUBST([CFLAGS])
# Checks for libraries.
-PKG_CHECK_MODULES(XLIB, x11) # needed for syndaemon
-PKG_CHECK_MODULES(XRECORD, xtst, AC_DEFINE([HAVE_XRECORD],[],[Use XRecord]), true)
-PKG_CHECK_MODULES(XI, xi);
+AC_ARG_ENABLE(tools,
+ AC_HELP_STRING([--enable-tools], [Build synclient and syndaemon [[default=auto]]]),
+ [build_tools="$enableval"],
+ [build_tools="auto"])
+
+if test "x$build_tools" != "xno"; then
+ PKG_CHECK_MODULES(XRECORD, xtst, AC_DEFINE([HAVE_XRECORD],[],[Use XRecord]), true)
+ PKG_CHECK_MODULES(XI, x11 [xi >= 1.2] [xorg-server >= 1.6],
+ BUILD_TOOLS="yes"; AC_DEFINE(BUILD_TOOLS, 1, "Build synclient and syndaemon"),
+ BUILD_TOOLS="no";
+ if test "x$build_tools" = "xyes"; then
+ AC_MSG_ERROR([Dependencies failed for synclient and syndaemon.])
+ else
+ AC_MSG_WARN([Not building synclient and syndaemon.])
+ fi
+ )
+fi
+AM_CONDITIONAL(BUILD_TOOLS, [ test "$BUILD_TOOLS" = "yes" ])
+AC_SUBST(BUILD_TOOLS)
# Checks for header files.
AC_HEADER_STDC
diff --git a/tools/Makefile.am b/tools/Makefile.am
index b5b12b1..35c04a1 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -18,6 +18,7 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+if BUILD_TOOLS
bin_PROGRAMS = \
synclient \
syndaemon
@@ -25,7 +26,11 @@ bin_PROGRAMS = \
INCLUDES=-I$(top_srcdir)/include/
synclient_SOURCES = synclient.c
-synclient_LDFLAGS = -lm $(XLIB_LIBS) $(XI_LIBS)
+synclient_LDFLAGS = -lm $(XI_LIBS)
syndaemon_SOURCES = syndaemon.c
-syndaemon_LDFLAGS = $(XLIB_LIBS) $(XRECORD_LIBS) $(XI_LIBS)
+syndaemon_LDFLAGS = $(XRECORD_LIBS) $(XI_LIBS)
+else
+all:
+ @echo "Not building syndaemon and synclient."
+endif