Fix linking of static libmagic with mingw

This commit is contained in:
Moritz Bunkus 2011-10-23 18:08:16 +02:00
parent 079939ea2a
commit dd099f0c99
3 changed files with 20 additions and 5 deletions

11
ac/gnurx.m4 Normal file
View File

@ -0,0 +1,11 @@
dnl
dnl Check for libgnurx on mingw
dnl
if test "x$ac_cv_mingw32" = "xyes"; then
AC_CHECK_LIB(gnurx, regexec, [ gnurx_found=yes ], [ gnurx_found=no ])
fi
if test "x$gnurx_found" = xyes ; then
GNURX_LIBS=-lgnurx
fi
AC_SUBST(GNURX_LIBS)

View File

@ -1,15 +1,18 @@
dnl dnl
dnl Check for libmagic dnl Check for libmagic
dnl dnl
AC_CHECK_LIB(magic, magic_open,
[ MAGIC_LIBS="-lmagic -lz" magic_mingw_libs=""
magic_found=yes ], if test "x$ac_cv_mingw32" = "xyes"; then
[ magic_found=no ], magic_mingw_libs="-lshlwapi"
-lz) fi
AC_CHECK_LIB(magic, magic_open, [ magic_found=yes ], [ magic_found=no ], [-lz $GNURX_LIBS $magic_mingw_libs])
if test "x$magic_found" = "xyes" ; then if test "x$magic_found" = "xyes" ; then
AC_CHECK_HEADERS([magic.h]) AC_CHECK_HEADERS([magic.h])
if test "x$ac_cv_header_magic_h" = "xyes" ; then if test "x$ac_cv_header_magic_h" = "xyes" ; then
MAGIC_LIBS="-lmagic -lz $GNURX_LIBS $magic_mingw_libs"
opt_features_yes="$opt_features_yes\n * libMagic file type detection" opt_features_yes="$opt_features_yes\n * libMagic file type detection"
else else
opt_features_no="$opt_features_no\n * libMagic file type detection" opt_features_no="$opt_features_no\n * libMagic file type detection"

View File

@ -40,6 +40,7 @@ m4_include(ac/lzo.m4)
m4_include(ac/bz.m4) m4_include(ac/bz.m4)
m4_include(ac/wxwidgets.m4) m4_include(ac/wxwidgets.m4)
m4_include(ac/qt4.m4) m4_include(ac/qt4.m4)
m4_include(ac/gnurx.m4)
m4_include(ac/magic.m4) m4_include(ac/magic.m4)
m4_include(ac/curl.m4) m4_include(ac/curl.m4)
m4_include(ac/ax_boost_base.m4) m4_include(ac/ax_boost_base.m4)