"Fossies" - the Fresh Open Source Software Archive

Member "file-5.35/configure.ac" (18 Oct 2018, 5267 Bytes) of package /linux/misc/file-5.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 5.34_vs_5.35.

    1 dnl Process this file with autoconf to produce a configure script.
    2 AC_INIT([file],[5.35],[christos@astron.com])
    3 AM_INIT_AUTOMAKE([subdir-objects foreign])
    4 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
    5 
    6 AC_CONFIG_HEADERS([config.h])
    7 AC_CONFIG_MACRO_DIR([m4])
    8 
    9 AC_MSG_CHECKING(for builtin ELF support)
   10 AC_ARG_ENABLE(elf,
   11 [  --disable-elf            disable builtin ELF support],
   12 [if test "${enableval}" = yes; then
   13   AC_MSG_RESULT(yes)
   14   AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
   15 else
   16   AC_MSG_RESULT(no)
   17 fi], [
   18   # enable by default
   19   AC_MSG_RESULT(yes)
   20   AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
   21 ])
   22 
   23 AC_MSG_CHECKING(for ELF core file support)
   24 AC_ARG_ENABLE(elf-core,
   25 [  --disable-elf-core       disable ELF core file support],
   26 [if test "${enableval}" = yes; then
   27   AC_MSG_RESULT(yes)
   28   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
   29 else
   30   AC_MSG_RESULT(no)
   31 fi], [
   32   # enable by default
   33   AC_MSG_RESULT(yes)
   34   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
   35 ])
   36 
   37 AC_MSG_CHECKING(for zlib support)
   38 AC_ARG_ENABLE(zlib,
   39 [AS_HELP_STRING([--disable-zlib], [disable zlib compression support @<:@default=auto@:>@])])
   40 AC_MSG_RESULT($enable_zlib)
   41 
   42 AC_MSG_CHECKING(for libseccomp support)
   43 AC_ARG_ENABLE(libseccomp,
   44 [AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])])
   45 AC_MSG_RESULT($enable_libseccomp)
   46 
   47 AC_MSG_CHECKING(for file formats in man section 5)
   48 AC_ARG_ENABLE(fsect-man5,
   49 [  --enable-fsect-man5      enable file formats in man section 5],
   50 [if test "${enableval}" = yes; then
   51   AC_MSG_RESULT(yes)
   52   fsect=5
   53 else
   54   AC_MSG_RESULT(no)
   55   fsect=4
   56 fi], [
   57   # disable by default
   58   AC_MSG_RESULT(no)
   59   fsect=4
   60 ])
   61 
   62 AC_CANONICAL_HOST
   63 case "$host_os" in
   64    mingw32*)
   65       MINGW=1
   66       ;;
   67    *)
   68       MINGW=0
   69       ;;
   70 esac
   71 AC_SUBST(MINGW)
   72 AM_CONDITIONAL(MINGW, test "$MINGW" = 1)
   73 
   74 AC_SUBST([pkgdatadir], ['$(datadir)/misc'])
   75 AC_SUBST(fsect)
   76 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
   77 
   78 AC_SUBST(WARNINGS)
   79 
   80 dnl Checks for programs.
   81 AC_PROG_CC_STDC
   82 AC_USE_SYSTEM_EXTENSIONS
   83 AM_PROG_CC_C_O
   84 AC_C_BIGENDIAN
   85 AC_PROG_INSTALL
   86 AC_PROG_LN_S
   87 LT_INIT([disable-static pic-only])
   88 gl_VISIBILITY
   89 dnl Checks for headers
   90 AC_HEADER_STDC
   91 AC_HEADER_MAJOR
   92 AC_HEADER_SYS_WAIT
   93 AC_CHECK_HEADERS(stdint.h fcntl.h stdint.h inttypes.h unistd.h)
   94 AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
   95 AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
   96 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
   97 if test "$enable_zlib" != "no"; then
   98   AC_CHECK_HEADERS(zlib.h)
   99 fi
  100 AC_CHECK_TYPE([sig_t],[AC_DEFINE([HAVE_SIG_T],1,[Have sig_t type])],,[#include <signal.h>])
  101 
  102 dnl Checks for typedefs, structures, and compiler characteristics.
  103 AC_C_CONST
  104 AC_TYPE_OFF_T
  105 AC_TYPE_SIZE_T
  106 AC_CHECK_MEMBERS([struct stat.st_rdev])
  107 
  108 AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
  109 AC_STRUCT_TIMEZONE
  110 AC_STRUCT_TIMEZONE_DAYLIGHT
  111 AC_SYS_LARGEFILE
  112 AC_FUNC_FSEEKO
  113 AC_TYPE_MBSTATE_T
  114 
  115 AC_STRUCT_OPTION_GETOPT_H
  116 AC_TYPE_PID_T
  117 AC_TYPE_UINT8_T
  118 AC_TYPE_UINT16_T
  119 AC_TYPE_UINT32_T
  120 AC_TYPE_INT32_T
  121 AC_TYPE_UINT64_T
  122 AC_TYPE_INT64_T
  123 AC_TYPE_INTPTR_T
  124 AC_TYPE_UINTPTR_T
  125 AC_FUNC_MMAP
  126 AC_FUNC_FORK
  127 AC_FUNC_MBRTOWC
  128 
  129 AC_MSG_CHECKING(for gcc compiler warnings)
  130 AC_ARG_ENABLE(warnings,
  131 [  --disable-warnings	disable compiler warnings],
  132 [if test "${enableval}" = no -o "$GCC" = no; then
  133    AC_MSG_RESULT(no)
  134    WARNINGS=
  135 else
  136    AC_MSG_RESULT(yes)
  137    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
  138        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
  139        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
  140        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
  141 fi], [
  142 if test "$GCC" = yes; then
  143    AC_MSG_RESULT(yes)
  144    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
  145        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
  146        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
  147        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
  148 else
  149    WARNINGS=
  150    AC_MSG_RESULT(no)
  151 fi])
  152 
  153 dnl Checks for functions
  154 AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
  155 
  156 dnl Provide implementation of some required functions if necessary
  157 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf)
  158 
  159 dnl Checks for libraries
  160 if test "$enable_zlib" != "no"; then
  161   AC_CHECK_LIB(z, gzopen)
  162 fi
  163 if test "$enable_libseccomp" != "no"; then
  164     AC_CHECK_LIB(seccomp, seccomp_init)
  165 fi
  166 if test "$MINGW" = 1; then
  167   AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW]))
  168 fi
  169 
  170 dnl See if we are cross-compiling
  171 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  172 
  173 dnl Final sanity checks
  174 if test "$enable_zlib" = "yes"; then
  175   if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then
  176     AC_MSG_ERROR([zlib support requested but not found])
  177   fi
  178 elif  test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then
  179   AC_DEFINE([ZLIBSUPPORT], 1, [Enable zlib compression support])
  180 fi
  181 
  182 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
  183 AC_OUTPUT