1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(file, 5.00, christos@astron.com)
4 AM_CONFIG_HEADER(config.h)
6 AC_MSG_CHECKING(for builtin ELF support)
8 [ --disable-elf disable builtin ELF support],
9 [if test "${enableval}" = yes; then
11 AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
17 AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
20 AC_MSG_CHECKING(for ELF core file support)
21 AC_ARG_ENABLE(elf-core,
22 [ --disable-elf-core disable ELF core file support],
23 [if test "${enableval}" = yes; then
25 AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
31 AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
34 AC_MSG_CHECKING(for file formats in man section 5)
35 AC_ARG_ENABLE(fsect-man5,
36 [ --enable-fsect-man5 enable file formats in man section 5],
37 [if test "${enableval}" = yes; then
50 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
55 dnl Checks for programs.
62 dnl Checks for headers
66 AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
67 AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
68 AC_CHECK_HEADERS(getopt.h err.h)
69 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
70 AC_CHECK_HEADERS(zlib.h)
72 dnl Checks for typedefs, structures, and compiler characteristics.
76 AC_CHECK_MEMBERS([struct stat.st_rdev])
79 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone])
80 AC_STRUCT_TIMEZONE_DAYLIGHT
85 AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
86 AC_CHECK_SIZEOF(long long)
89 typedef unsigned char uint8_t;
92 typedef unsigned short uint16_t;
95 typedef unsigned int uint32_t;
100 #ifndef HAVE_UINT64_T
101 #if SIZEOF_LONG_LONG == 8
102 typedef unsigned long long uint64_t;
104 typedef unsigned long uint64_t;
108 #if SIZEOF_LONG_LONG == 8
109 typedef long long int64_t;
111 typedef long int64_t;
116 AC_MSG_CHECKING(for gcc compiler warnings)
117 AC_ARG_ENABLE(warnings,
118 [ --disable-warnings disable compiler warnings],
119 [if test "${enableval}" = no -o $GCC = no; then
124 WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
125 -Wmissing-declarations -Wredundant-decls -Wnested-externs \
126 -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
127 -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
129 if test $GCC = no; then
134 WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
135 -Wmissing-declarations -Wredundant-decls -Wnested-externs \
136 -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
137 -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
140 dnl Checks for functions
141 AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)
143 dnl Provide implementation of some required functions if necessary
144 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat)
146 dnl Checks for libraries
147 AC_CHECK_LIB(z,gzopen)
149 dnl See if we are cross-compiling
150 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
152 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])