1 dnl Process this file with autoconf to produce a configure script.
3 AC_CONFIG_SRCDIR([src/file.c])
4 AM_INIT_AUTOMAKE(file, 4.23)
5 AM_CONFIG_HEADER([config.h])
8 AC_MSG_CHECKING(for builtin ELF support)
10 [ --disable-elf disable builtin ELF support],
11 [if test "${enableval}" = yes; then
13 AC_DEFINE(BUILTIN_ELF)
19 AC_DEFINE(BUILTIN_ELF)
22 AC_MSG_CHECKING(for ELF core file support)
23 AC_ARG_ENABLE(elf-core,
24 [ --disable-elf-core disable ELF core file support],
25 [if test "${enableval}" = yes; then
36 AC_MSG_CHECKING(for file formats in man section 5)
37 AC_ARG_ENABLE(fsect-man5,
38 [ --enable-fsect-man5 enable file formats in man section 5],
39 [if test "${enableval}" = yes; then
51 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
54 dnl Checks for programs.
60 dnl Templates for autoheader
61 AH_TEMPLATE([BUILTIN_ELF],
62 [Use the builtin ELF recognition code])
63 AH_TEMPLATE([ELFCORE],
64 [Recognize ELF core files])
65 AH_TEMPLATE([HAVE_DAYLIGHT], [])
66 AH_TEMPLATE([HAVE_LONG_LONG], [])
67 AH_TEMPLATE([HAVE_TM_ISDST], [])
68 AH_TEMPLATE([SIZEOF_UINT16_T], [])
69 AH_TEMPLATE([SIZEOF_UINT32_T], [])
70 AH_TEMPLATE([SIZEOF_INT64_T], [])
71 AH_TEMPLATE([SIZEOF_UINT64_T], [])
72 AH_TEMPLATE([SIZEOF_UINT8_T], [])
73 AH_TEMPLATE([int32_t], [])
74 AH_TEMPLATE([uint16_t], [])
75 AH_TEMPLATE([uint32_t], [])
76 AH_TEMPLATE([int64_t], [])
77 AH_TEMPLATE([uint64_t], [])
78 AH_TEMPLATE([uint8_t], [])
80 dnl Checks for headers
85 AC_CHECK_HEADERS(fcntl.h locale.h stdint.h inttypes.h unistd.h getopt.h)
86 AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
87 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
88 AC_CHECK_HEADERS(zlib.h)
90 dnl Checks for typedefs, structures, and compiler characteristics.
94 AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
95 your code should no longer depend upon `HAVE_ST_RDEV', but
96 `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
97 the `AC_DEFINE' when you adjust the code.])
98 AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
99 [Define to 1 if your `struct stat' has `st_rdev'.
100 Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
103 AC_STRUCT_TIMEZONE_DAYLIGHT
107 AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
108 AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
109 AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
110 AC_CHECK_TYPE_STDC(int32_t, int)
112 if test $ac_cv_c_long_long = yes; then
113 ulong64='unsigned long long';
116 ulong64='unsigned long';
119 dnl This needs a patch to autoconf 2.13 acgeneral.m4
120 AC_CHECK_TYPE2_STDC(uint64_t, $ulong64)
121 AC_CHECK_TYPE2_STDC(int64_t, $long64)
123 AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0)
124 AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0)
125 AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
126 AC_CHECK_SIZEOF_STDC_HEADERS(int64_t, 0)
127 AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
129 dnl Checks for functions
130 AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf strtof)
132 dnl Checks for libraries
133 AC_CHECK_LIB(z,gzopen)
135 dnl See if we are cross-compiling
136 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
138 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])