vm: merge i386 and arm pagetable code
[minix.git] / external / bsd / file / dist / configure.ac
blob5814cff9df6902fb35883c280c1757ee4544693d
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(file, 5.09, christos@astron.com)
3 AM_INIT_AUTOMAKE()
4 AM_MAINTAINER_MODE(disable)
5 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
7 AM_CONFIG_HEADER(config.h)
8 AC_CONFIG_MACRO_DIR([m4])
10 AC_MSG_CHECKING(for builtin ELF support)
11 AC_ARG_ENABLE(elf,
12 [  --disable-elf            disable builtin ELF support],
13 [if test "${enableval}" = yes; then
14   AC_MSG_RESULT(yes)
15   AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
16 else
17   AC_MSG_RESULT(no)
18 fi], [
19   # enable by default
20   AC_MSG_RESULT(yes)
21   AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
24 AC_MSG_CHECKING(for ELF core file support)
25 AC_ARG_ENABLE(elf-core,
26 [  --disable-elf-core       disable ELF core file support],
27 [if test "${enableval}" = yes; then
28   AC_MSG_RESULT(yes)
29   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
30 else
31   AC_MSG_RESULT(no)
32 fi], [
33   # enable by default
34   AC_MSG_RESULT(yes)
35   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
38 AC_MSG_CHECKING(for file formats in man section 5)
39 AC_ARG_ENABLE(fsect-man5,
40 [  --enable-fsect-man5      enable file formats in man section 5],
41 [if test "${enableval}" = yes; then
42   AC_MSG_RESULT(yes)
43   fsect=5
44 else
45   AC_MSG_RESULT(no)
46   fsect=4
47 fi], [
48   # disable by default
49   AC_MSG_RESULT(no)
50   fsect=4
53 AC_CANONICAL_HOST
54 case "$host_os" in
55    mingw32*)
56       MINGW=1
57       ;;
58    *)
59       MINGW=0
60       ;;
61 esac
62 AC_SUBST(MINGW)
63 AM_CONDITIONAL(MINGW, test "$MINGW" = 1)
65 AC_SUBST([pkgdatadir], ['$(datadir)/misc'])
66 AC_SUBST(fsect)
67 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
69 AC_SUBST(WARNINGS)
70 AC_GNU_SOURCE
72 dnl Checks for programs.
73 AC_PROG_CC
74 AM_PROG_CC_C_O
75 AC_PROG_INSTALL
76 AC_PROG_LN_S
77 AC_PROG_LIBTOOL
79 dnl Checks for headers
80 AC_HEADER_STDC
81 AC_HEADER_MAJOR
82 AC_HEADER_SYS_WAIT
83 AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
84 AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
85 AC_CHECK_HEADERS(getopt.h err.h)
86 AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
87 AC_CHECK_HEADERS(zlib.h)
89 dnl Checks for typedefs, structures, and compiler characteristics.
90 AC_C_CONST
91 AC_TYPE_OFF_T
92 AC_TYPE_SIZE_T
93 AC_CHECK_MEMBERS([struct stat.st_rdev])
95 AC_STRUCT_TM
96 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone])
97 AC_STRUCT_TIMEZONE_DAYLIGHT
98 AC_SYS_LARGEFILE
99 AC_FUNC_FSEEKO
100 AC_TYPE_MBSTATE_T
102 AC_STRUCT_OPTION_GETOPT_H
104 AC_CHECK_TYPES([pid_t, uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
105 AC_CHECK_SIZEOF(long long)
106 AH_BOTTOM([
107 #ifndef HAVE_UINT8_T
108 typedef unsigned char uint8_t;
109 #endif
110 #ifndef HAVE_UINT16_T
111 typedef unsigned short uint16_t;
112 #endif
113 #ifndef HAVE_UINT32_T
114 typedef unsigned int uint32_t;
115 #endif
116 #ifndef HAVE_INT32_T
117 typedef int int32_t;
118 #endif
119 #ifndef HAVE_UINT64_T
120 #if SIZEOF_LONG_LONG == 8
121 typedef unsigned long long uint64_t;
122 #else
123 typedef unsigned long uint64_t;
124 #endif
125 #endif
126 #ifndef HAVE_INT64_T
127 #if SIZEOF_LONG_LONG == 8
128 typedef long long int64_t;
129 #else
130 typedef long int64_t;
131 #endif
132 #endif
135 AC_MSG_CHECKING(for gcc compiler warnings)
136 AC_ARG_ENABLE(warnings,
137 [  --disable-warnings   disable compiler warnings],
138 [if test "${enableval}" = no -o "$GCC" = no; then
139    AC_MSG_RESULT(no)
140    WARNINGS=
141 else
142    AC_MSG_RESULT(yes)
143    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
144        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
145        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
146        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
147 fi], [
148 if test "$GCC" = yes; then
149    AC_MSG_RESULT(yes)
150    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
151        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
152        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
153        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
154 else
155    WARNINGS=
156    AC_MSG_RESULT(no)
157 fi])
159 dnl Checks for functions
160 AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof fork)
162 dnl Provide implementation of some required functions if necessary
163 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline)
165 dnl Checks for libraries
166 AC_CHECK_LIB(z,gzopen)
167 if test "$MINGW" = 1; then
168   AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW]))
171 dnl See if we are cross-compiling
172 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
174 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
175 AC_OUTPUT