nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] add a configure flag to control libmagic linkage


From: Mike Frysinger
Subject: [Nano-devel] [PATCH] add a configure flag to control libmagic linkage
Date: Sun, 23 Mar 2014 17:03:33 -0400

Some people don't want to use libmagic as it makes for a fatter build.
Currently, there's no way (other than cache vars) to disable it, so add
an explicit configure flag.
---
 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5f2c63e..6f6c7e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,7 +50,7 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are 
placed to.])
 
 dnl Checks for header files.
 
-AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h 
wctype.h stdarg.h magic.h)
+AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h 
wctype.h stdarg.h)
 
 dnl Checks for options.
 
@@ -78,6 +78,8 @@ AC_ARG_ENABLE(tiny,
     AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable all text wrapping.])
 fi])
 
+AC_ARG_ENABLE(libmagic,
+AS_HELP_STRING([--disable-libmagic], [Disable detection of file types via 
libmagic]))
 
 AC_ARG_ENABLE(extra,
 [  --disable-extra          Disable extra features, currently only easter 
eggs],
@@ -630,7 +632,10 @@ AC_MSG_RESULT(yes),
 AC_MSG_RESULT(no),
 AC_MSG_WARN([*** Can't check for macro redefinability when cross-compiling]))
 
-AC_CHECK_LIB(magic, magic_open)
+AS_IF([test "x$enable_libmagic" != "xno"], [
+  AC_CHECK_HEADERS_ONCE([magic.h])
+  AC_CHECK_LIB(magic, magic_open)
+])
 
 # Check for groff html support
 AC_MSG_CHECKING([for HTML support in groff])
-- 
1.9.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]