summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-11-09 15:59:40 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-11-10 10:52:12 +0000
commita0b4caa0821b759de01361b7019c9c9c9607027d (patch)
tree7cfb0b243ddce5d19f518a8f040c28692907a0fa /configure.ac
parentec63875f9cd7277cf2d49827684bba936add7ce2 (diff)
downloadlibguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.tar.gz
libguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.tar.xz
libguestfs-a0b4caa0821b759de01361b7019c9c9c9607027d.zip
lib: Make pcre, libmagic and hivex libraries optional.
This change makes these libraries optional. If they are not available at compile time then certain core API features will be disabled (see below). This also changes PCRE detection to use pkg-config instead of the ad hoc autoconf checks. The large inspect.c file has been split out into separate function-specific files. file-architecture: requires pcre & libmagic inspection: requires pcre & hivex
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac45
1 files changed, 23 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 4458d498..e7761c99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,15 +188,6 @@ AC_ARG_ENABLE([appliance],
AM_CONDITIONAL([ENABLE_APPLIANCE],[test "x$enable_appliance" = "xyes"])
AC_MSG_RESULT([$enable_appliance])
-dnl Check for PCRE.
-AC_CHECK_LIB([pcre],[pcre_compile],
- [AC_SUBST([LIBPCRE], ["-lpcre"])],
- [AC_MSG_FAILURE(
- [Perl Compatible Regular Expressions library (PCRE) is required])])
-AC_CHECK_HEADER([pcre.h],[],
- [AC_MSG_FAILURE(
- [Perl Compatible Regular Expressions library (PCRE) header file pcre.h is required])])
-
dnl Check for rpcgen and XDR library. rpcgen is optional.
AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no])
AM_CONDITIONAL([HAVE_RPCGEN],[test "x$RPCGEN" != "xno"])
@@ -445,33 +436,43 @@ dnl For i18n.
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
-dnl libmagic (required)
-AC_CHECK_LIB([magic],[magic_file],[
- AC_SUBST([LIBMAGIC], ["-lmagic"])
- ],[
- AC_MSG_FAILURE([libmagic is required])
- ])
-AC_CHECK_HEADER([magic.h],[],[
- AC_MSG_FAILURE([magic.h header file is required])
- ])
+dnl libmagic (highly recommended)
+AC_CHECK_LIB([magic],[magic_file],
+ [AC_CHECK_HEADER([magic.h],
+ [AC_SUBST([MAGIC_LIBS], ["-lmagic"])
+ AC_DEFINE([HAVE_LIBMAGIC],[1],[libmagic found at compile time.])
+ ], [])
+ ],
+ [AC_MSG_WARN([libmagic not found, some core features will be disabled])])
dnl libvirt (required)
PKG_CHECK_MODULES([LIBVIRT], [libvirt])
AC_SUBST([LIBVIRT_CFLAGS])
AC_SUBST([LIBVIRT_LIBS])
+dnl Check for PCRE (highly recommended)
+PKG_CHECK_MODULES([PCRE], [libpcre],
+ [AC_SUBST([PCRE_CFLAGS])
+ AC_SUBST([PCRE_LIBS])
+ AC_DEFINE([HAVE_PCRE],[1],[PCRE found at compile time.])
+ ],
+ [AC_MSG_WARN([PCRE not found, some core features will be disabled])])
+
dnl libxml2 (required)
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0])
AC_SUBST([LIBXML2_CFLAGS])
AC_SUBST([LIBXML2_LIBS])
-dnl hivex library (required)
+dnl hivex library (highly recommended)
dnl This used to be a part of libguestfs, but was spun off into its
dnl own separate upstream project in libguestfs 1.0.85.
-PKG_CHECK_MODULES([HIVEX], [hivex])
-AC_SUBST([HIVEX_CFLAGS])
-AC_SUBST([HIVEX_LIBS])
+PKG_CHECK_MODULES([HIVEX], [hivex],
+ [AC_SUBST([HIVEX_CFLAGS])
+ AC_SUBST([HIVEX_LIBS])
+ AC_DEFINE([HAVE_HIVEX],[1],[hivex library found at compile time.])
+ ],
+ [AC_MSG_WARN([hivex not found, some core features will be disabled])])
dnl FUSE is optional to build the FUSE module.
AC_ARG_ENABLE([fuse],