| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 | dnl Process this file with autoconf to produce a configure script.AC_INIT([file],[5.45],[christos@astron.com])AM_INIT_AUTOMAKE([subdir-objects foreign])m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])AC_CONFIG_HEADERS([config.h])AC_CONFIG_MACRO_DIR([m4])AC_MSG_CHECKING(for builtin ELF support)AC_ARG_ENABLE(elf,[  --disable-elf            disable builtin ELF support],[if test "${enableval}" = yes; then  AC_MSG_RESULT(yes)  AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])else  AC_MSG_RESULT(no)fi], [  # enable by default  AC_MSG_RESULT(yes)  AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])])AC_MSG_CHECKING(for ELF core file support)AC_ARG_ENABLE(elf-core,[  --disable-elf-core       disable ELF core file support],[if test "${enableval}" = yes; then  AC_MSG_RESULT(yes)  AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])else  AC_MSG_RESULT(no)fi], [  # enable by default  AC_MSG_RESULT(yes)  AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])])AC_MSG_CHECKING(for zlib support)AC_ARG_ENABLE([zlib],[AS_HELP_STRING([--disable-zlib], [disable zlib compression support @<:@default=auto@:>@])])AC_MSG_RESULT($enable_zlib)AC_MSG_CHECKING(for bzlib support)AC_ARG_ENABLE([bzlib],[AS_HELP_STRING([--disable-bzlib], [disable bz2lib compression support @<:@default=auto@:>@])])AC_MSG_RESULT($enable_bzlib)AC_MSG_CHECKING(for xzlib support)AC_ARG_ENABLE([xzlib],[AS_HELP_STRING([--disable-xzlib], [disable liblzma/xz compression support @<:@default=auto@:>@])])AC_MSG_RESULT($enable_xzlib)AC_MSG_CHECKING(for zstdlib support)AC_ARG_ENABLE([zstdlib],[AS_HELP_STRING([--disable-zstdlib], [disable zstdlib compression support @<:@default=auto@:>@])])AC_MSG_RESULT($enable_zstdlib)AC_MSG_CHECKING(for lzlib support)AC_ARG_ENABLE([lzlib],[AS_HELP_STRING([--disable-lzlib], [disable liblz (lzip) compression support @<:@default=auto@:>@])])AC_MSG_RESULT($enable_lzlib)AC_MSG_CHECKING(for libseccomp support)AC_ARG_ENABLE([libseccomp],[AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])])AC_MSG_RESULT($enable_libseccomp)AC_MSG_CHECKING(for file formats in man section 5)AC_ARG_ENABLE(fsect-man5,[  --enable-fsect-man5      enable file formats in man section 5],[if test "${enableval}" = yes; then  AC_MSG_RESULT(yes)  fsect=5else  AC_MSG_RESULT(no)  fsect=4fi], [  # disable by default  AC_MSG_RESULT(no)  fsect=4])AC_CANONICAL_HOSTcase "$host_os" in   mingw32*)      MINGW=1      ;;   *)      MINGW=0      ;;esacAC_SUBST(MINGW)AM_CONDITIONAL(MINGW, test "$MINGW" = 1)AC_SUBST([pkgdatadir], ['$(datadir)/misc'])AC_SUBST(fsect)AM_CONDITIONAL(FSECT5, test x$fsect = x5)AC_SUBST(WARNINGS)dnl Checks for programs.AC_PROG_CCAC_USE_SYSTEM_EXTENSIONSAM_PROG_CC_C_OAC_C_BIGENDIANAC_PROG_INSTALLAC_PROG_LN_SLT_INIT([disable-static pic-only])gl_VISIBILITYdnl Checks for headersAC_HEADER_MAJORAC_HEADER_SYS_WAITAC_CHECK_HEADERS(stdint.h fcntl.h inttypes.h unistd.h byteswap.h)AC_CHECK_HEADERS(spawn.h utime.h wchar.h wctype.h)AC_CHECK_HEADERS(getopt.h err.h xlocale.h)AC_CHECK_HEADERS(sys/bswap.h sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h sys/sysmacros.h sys/ioctl.h)if test "$enable_zlib" != "no"; then  AC_CHECK_HEADERS(zlib.h)fiif test "$enable_bzlib" != "no"; then  AC_CHECK_HEADERS(bzlib.h)fiif test "$enable_xzlib" != "no"; then  AC_CHECK_HEADERS(lzma.h)fiif test "$enable_zstdlib" != "no"; then  AC_CHECK_HEADERS(zstd.h zstd_errors.h)fiif test "$enable_lzlib" != "no"; then  AC_CHECK_HEADERS(lzlib.h)fiAC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[#include <signal.h>])dnl Checks for typedefs, structures, and compiler characteristics.AC_TYPE_OFF_TAC_TYPE_SIZE_TAC_CHECK_MEMBERS([struct stat.st_rdev])AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])AC_STRUCT_TIMEZONEAC_STRUCT_TIMEZONE_DAYLIGHTAC_SYS_LARGEFILEAC_FUNC_FSEEKOAC_TYPE_MBSTATE_TAC_STRUCT_OPTION_GETOPT_HAC_TYPE_PID_TAC_TYPE_UINT8_TAC_TYPE_UINT16_TAC_TYPE_UINT32_TAC_TYPE_INT32_TAC_TYPE_UINT64_TAC_TYPE_INT64_TAC_TYPE_INTPTR_TAC_TYPE_UINTPTR_TAC_FUNC_MMAPAC_FUNC_FORKAC_FUNC_MBRTOWCAC_MSG_CHECKING(for gcc compiler warnings)AC_ARG_ENABLE(warnings,[  --disable-warnings	disable compiler warnings],[if test "${enableval}" = no -o "$GCC" = no; then   AC_MSG_RESULT(no)   WARNINGS=else   AC_MSG_RESULT(yes)   WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \       -Wmissing-declarations -Wredundant-decls -Wnested-externs \       -Wsign-compare -Wreturn-type -Wswitch -Wshadow \       -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"fi], [if test "$GCC" = yes; then   AC_MSG_RESULT(yes)   WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \       -Wmissing-declarations -Wredundant-decls -Wnested-externs \       -Wsign-compare -Wreturn-type -Wswitch -Wshadow \       -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"else   WARNINGS=   AC_MSG_RESULT(no)fi])dnl Checks for functionsAC_CHECK_FUNCS(strndup mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale memmem pipe2 posix_spawnp)dnl Provide implementation of some required functions if necessaryAC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf)dnl Checks for librariesif test "$enable_zlib" != "no"; then  AC_CHECK_LIB(z, gzopen)fiif test "$enable_bzlib" != "no"; then  AC_CHECK_LIB(bz2, BZ2_bzCompressInit)fiif test "$enable_xzlib" != "no"; then  AC_CHECK_LIB(lzma, lzma_stream_decoder)fiif test "$enable_zstdlib" != "no"; then  AC_CHECK_LIB(zstd, ZSTD_createDStream)fiif test "$enable_lzlib" != "no"; then  AC_CHECK_LIB(lz, LZ_decompress_open)fiif test "$enable_libseccomp" != "no"; then    AC_CHECK_LIB(seccomp, seccomp_init)fiif test "$MINGW" = 1; then  AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW]))fidnl See if we are cross-compilingAM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)dnl Final sanity checksif test "$enable_zlib" = "yes"; then  if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then    AC_MSG_ERROR([zlib support requested but not found])  fifiif  test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then  AC_DEFINE([ZLIBSUPPORT], 1, [Enable zlib compression support])fiif test "$enable_bzlib" = "yes"; then  if test "$ac_cv_header_bzlib_h$ac_cv_lib_bz2_BZ2_bzCompressInit" != "yesyes"; then    AC_MSG_ERROR([bzlib support requested but not found])  fifiif  test "$ac_cv_header_bzlib_h$ac_cv_lib_bz2_BZ2_bzCompressInit" = "yesyes"; then  AC_DEFINE([BZLIBSUPPORT], 1, [Enable bzlib compression support])fiif test "$enable_xzlib" = "yes"; then  if test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_stream_decoder" != "yesyes"; then    AC_MSG_ERROR([xzlib support requested but not found])  fifiif  test "$ac_cv_header_lzma_h$ac_cv_lib_lzma_lzma_stream_decoder" = "yesyes"; then  AC_DEFINE([XZLIBSUPPORT], 1, [Enable xzlib compression support])fiif test "$enable_zstdlib" = "yes"; then  if test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" != "yesyes"; then    AC_MSG_ERROR([zstdlib support requested but not found])  fifiif  test "$ac_cv_header_zstd_h$ac_cv_lib_zstd_ZSTD_createDStream" = "yesyes"; then  AC_DEFINE([ZSTDLIBSUPPORT], 1, [Enable zstdlib compression support])fiif test "$enable_lzlib" = "yes"; then  if test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" != "yesyes"; then    AC_MSG_ERROR([lzlib support requested but not found])  fifiif  test "$ac_cv_header_lzlib_h$ac_cv_lib_lz_LZ_decompress_open" = "yesyes"; then  AC_DEFINE([LZLIBSUPPORT], 1, [Enable lzlib compression support])fiAC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile libmagic.pc])AC_OUTPUT
 |