diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index a5a48210..85da74cd 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1195,12 +1195,36 @@ then | |||
1195 | fi | 1195 | fi |
1196 | AM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"]) | 1196 | AM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"]) |
1197 | 1197 | ||
1198 | mhd_have_magic_open='no' | 1198 | mhd_have_libmagic="no" |
1199 | AC_CHECK_HEADERS([magic.h], | 1199 | SAVE_LIBS="$LIBS" |
1200 | [ AC_CHECK_LIB([[magic]], [[magic_open]], [[mhd_have_magic_open='yes']]) ],[], | 1200 | LIBS="$LIBS -lmagic" |
1201 | [AC_INCLUDES_DEFAULT]) | 1201 | AC_MSG_CHECKING([[for suitable libmagic]]) |
1202 | 1202 | AC_LINK_IFELSE( | |
1203 | AM_CONDITIONAL([HAVE_MAGIC], [[test "x$mhd_have_magic_open" = "xyes"]]) | 1203 | [AC_LANG_PROGRAM( |
1204 | [[ | ||
1205 | #include <magic.h> | ||
1206 | ]], | ||
1207 | [[ | ||
1208 | char var_data[256]; | ||
1209 | const char *var_mime; | ||
1210 | magic_t var_magic = magic_open (MAGIC_MIME_TYPE); | ||
1211 | (void)magic_load (var_magic, NULL); | ||
1212 | var_data[0] = 0; | ||
1213 | var_mime = magic_buffer (var_magic, var_data, 1); | ||
1214 | magic_close (var_magic); | ||
1215 | ]] | ||
1216 | ) | ||
1217 | ], | ||
1218 | [ | ||
1219 | AC_DEFINE([HAVE_LIBMAGIC], [1], [Define to 1 if you have suitable libmagic.]) | ||
1220 | mhd_have_libmagic="yes" | ||
1221 | AC_MSG_RESULT([[yes]]) | ||
1222 | ], | ||
1223 | [AC_MSG_RESULT([[no]]) | ||
1224 | ] | ||
1225 | ) | ||
1226 | LIBS="$SAVE_LIBS" | ||
1227 | AM_CONDITIONAL([HAVE_LIBMAGIC], [[test "x$mhd_have_libmagic" = "xyes"]]) | ||
1204 | 1228 | ||
1205 | # large file support (> 4 GB) | 1229 | # large file support (> 4 GB) |
1206 | AC_SYS_LARGEFILE | 1230 | AC_SYS_LARGEFILE |