summaryrefslogtreecommitdiff
blob: 1fe3e6c7c34b1cc1a88afdd562cb7ad0721fdafc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 92ecfec7b0a9c1f8d952d20e8a0cde5930f9264f Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@gentoo.org>
Date: Sun, 6 Jan 2013 15:09:26 -0500
Subject: [PATCH] add a configure flag to control xml behavior

The default behavior (autodetection) is unchanged.
This adds a knob for distros to control directly.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 configure.ac | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9980c5a..e973733 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,11 +5,15 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AC_CONFIG_HEADERS(config.h)
 AC_PROG_CC
 AC_PROG_INSTALL
+PKG_PROG_PKG_CONFIG
 
-PKG_CHECK_MODULES(XML, libxml-2.0, [HAVE_LIBXML=yes], [HAVE_LIBXML=no])
-if test x$HAVE_LIBXML = "xno"; then
-    AC_MSG_WARN([libxml headers not available. Cannot build evtest-capture.])
-fi
+AC_ARG_ENABLE([xml], [AS_HELP_STRING([--disable-xml], [Disable support for xml (evtest-capture)])])
+AS_IF([test "x$enable_xml" != "xno"], [
+	PKG_CHECK_MODULES(XML, libxml-2.0, [HAVE_LIBXML=yes], [HAVE_LIBXML=no])
+	AS_IF([test "x$enable_xml$HAVE_LIBXML" = "xyesno"], [
+		AC_MSG_ERROR([libxml headers not available. Cannot build evtest-capture.])
+	])
+])
 AM_CONDITIONAL(HAVE_LIBXML, [test "x$HAVE_LIBXML" = "xyes"])
 
 AC_PATH_PROG(XSLTPROC, [xsltproc])
-- 
1.8.0.2