From f8e00b68beba41c45361d842c608647af6c72cbe Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 21 Jul 2015 16:41:30 +0200 Subject: [PATCH] build system: add configure option for disabling libmagic --- ac/magic.m4 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ac/magic.m4 b/ac/magic.m4 index 93bada4e1..db1b67578 100644 --- a/ac/magic.m4 +++ b/ac/magic.m4 @@ -2,12 +2,18 @@ dnl dnl Check for libmagic dnl -magic_mingw_libs="" -if test "x$ac_cv_mingw32" = "xyes"; then - magic_mingw_libs="-lshlwapi" -fi +AC_ARG_ENABLE([magic], + AC_HELP_STRING([--enable-magic],[file type detection via libmagic (yes)]), + [],[enable_magic=yes]) -AC_CHECK_LIB(magic, magic_open, [ magic_found=yes ], [ magic_found=no ], [-lz $GNURX_LIBS $magic_mingw_libs]) +if test x"$enable_magic" = xyes; then + magic_mingw_libs="" + if test "x$ac_cv_mingw32" = "xyes"; then + magic_mingw_libs="-lshlwapi" + fi + + AC_CHECK_LIB(magic, magic_open, [ magic_found=yes ], [ magic_found=no ], [-lz $GNURX_LIBS $magic_mingw_libs]) +fi if test "x$magic_found" = "xyes" ; then AC_CHECK_HEADERS([magic.h])