From: Benno Schulenberg Date: Mon, 24 Mar 2014 13:47:37 +0000 (+0000) Subject: Adding a configure flag to disable the use of the fattening libmagic. X-Git-Tag: v2.3.3~256 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=eaff14f3205d5fff20294cda0072b3bc48755088;p=nano.git Adding a configure flag to disable the use of the fattening libmagic. Patch by Mike Frysinger. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4674 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 5d022f75..f24b1a91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,8 @@ * configure.ac - Newer ncurses installs include pkg-config files which tell us the right -I/-L paths we need, so default to that before trying the legacy ways. Patch by Mike Frysinger. + * configure.ac - Add a configure flag to disable the use of the + fattening libmagic. Patch by Mike Frysinger. 2014-03-23 Benno Schulenberg * src/rcfile.c (parse_keybinding, parse_unbinding) - Improve a diff --git a/configure.ac b/configure.ac index 5f2c63e0..6f6c7e60 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])