2008-08-27 20:38:55 +00:00
|
|
|
dnl
|
|
|
|
dnl Check for libmagic
|
|
|
|
dnl
|
2011-10-23 16:08:16 +00:00
|
|
|
|
2015-07-21 14:41:30 +00:00
|
|
|
AC_ARG_ENABLE([magic],
|
|
|
|
AC_HELP_STRING([--enable-magic],[file type detection via libmagic (yes)]),
|
|
|
|
[],[enable_magic=yes])
|
|
|
|
|
|
|
|
if test x"$enable_magic" = xyes; then
|
|
|
|
magic_mingw_libs=""
|
|
|
|
if test "x$ac_cv_mingw32" = "xyes"; then
|
|
|
|
magic_mingw_libs="-lshlwapi"
|
|
|
|
fi
|
2011-10-23 16:08:16 +00:00
|
|
|
|
2015-07-21 14:41:30 +00:00
|
|
|
AC_CHECK_LIB(magic, magic_open, [ magic_found=yes ], [ magic_found=no ], [-lz $GNURX_LIBS $magic_mingw_libs])
|
|
|
|
fi
|
2008-08-27 20:38:55 +00:00
|
|
|
|
|
|
|
if test "x$magic_found" = "xyes" ; then
|
|
|
|
AC_CHECK_HEADERS([magic.h])
|
|
|
|
if test "x$ac_cv_header_magic_h" = "xyes" ; then
|
2011-10-23 16:08:16 +00:00
|
|
|
MAGIC_LIBS="-lmagic -lz $GNURX_LIBS $magic_mingw_libs"
|
2008-08-27 20:38:55 +00:00
|
|
|
opt_features_yes="$opt_features_yes\n * libMagic file type detection"
|
|
|
|
else
|
|
|
|
opt_features_no="$opt_features_no\n * libMagic file type detection"
|
|
|
|
fi
|
2011-10-23 11:46:28 +00:00
|
|
|
else
|
|
|
|
opt_features_no="$opt_features_no\n * libMagic file type detection"
|
2008-08-27 20:38:55 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(MAGIC_LIBS)
|