]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/file/configure.ac
Record that base/vendor/file/dist@186675 was merged.
[FreeBSD/FreeBSD.git] / contrib / file / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(file, 4.26, christos@astron.com)
3 AM_INIT_AUTOMAKE
4 AM_CONFIG_HEADER(config.h)
5
6 AC_MSG_CHECKING(for builtin ELF support)
7 AC_ARG_ENABLE(elf,
8 [  --disable-elf            disable builtin ELF support],
9 [if test "${enableval}" = yes; then
10   AC_MSG_RESULT(yes)
11   AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
12 else
13   AC_MSG_RESULT(no)
14 fi], [
15   # enable by default
16   AC_MSG_RESULT(yes)
17   AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
18 ])
19
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
24   AC_MSG_RESULT(yes)
25   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
26 else
27   AC_MSG_RESULT(no)
28 fi], [
29   # enable by default
30   AC_MSG_RESULT(yes)
31   AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
32 ])
33
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
38   AC_MSG_RESULT(yes)
39   fsect=5
40 else
41   AC_MSG_RESULT(no)
42   fsect=4
43 fi], [
44   # disable by default
45   AC_MSG_RESULT(no)
46   fsect=4
47 ])
48
49 AC_SUBST(fsect)
50 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
51
52 AC_SUBST(WARNINGS)
53 AC_GNU_SOURCE
54
55 dnl Checks for programs.
56 AC_PROG_CC
57 AM_PROG_CC_C_O
58 AC_PROG_INSTALL
59 AC_PROG_LN_S
60 AC_PROG_LIBTOOL
61
62 dnl Checks for headers
63 AC_HEADER_STDC
64 AC_HEADER_MAJOR
65 AC_HEADER_SYS_WAIT
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)
71
72 dnl Checks for typedefs, structures, and compiler characteristics.
73 AC_C_CONST
74 AC_TYPE_OFF_T
75 AC_TYPE_SIZE_T
76 AC_CHECK_MEMBERS([struct stat.st_rdev])
77
78 AC_STRUCT_TIMEZONE_DAYLIGHT
79 AC_SYS_LARGEFILE
80 AC_FUNC_FSEEKO
81 AC_TYPE_MBSTATE_T
82
83 AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
84 AC_CHECK_SIZEOF(long long)
85 AH_BOTTOM([
86 #ifndef HAVE_UINT8_T
87 typedef unsigned char uint8_t;
88 #endif
89 #ifndef HAVE_UINT16_T
90 typedef unsigned short uint16_t;
91 #endif
92 #ifndef HAVE_UINT32_T
93 typedef unsigned int uint32_t;
94 #endif
95 #ifndef HAVE_INT32_T
96 typedef int int32_t;
97 #endif
98 #ifndef HAVE_UINT64_T
99 #if SIZEOF_LONG_LONG == 8
100 typedef unsigned long long uint64_t;
101 #else
102 typedef unsigned long uint64_t;
103 #endif
104 #endif
105 #ifndef HAVE_INT64_T
106 #if SIZEOF_LONG_LONG == 8
107 typedef long long int64_t;
108 #else
109 typedef long int64_t;
110 #endif
111 #endif
112 ])
113
114 AC_MSG_CHECKING(for gcc compiler warnings)
115 AC_ARG_ENABLE(warnings,
116 [  --disable-warnings   disable compiler warnings],
117 [if test "${enableval}" = no -o $GCC = no; then
118    AC_MSG_RESULT(no)
119    WARNINGS=
120 else
121    AC_MSG_RESULT(yes)
122    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
123        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
124        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
125        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
126 fi], [
127 if test $GCC = no; then
128    WARNINGS=
129    AC_MSG_RESULT(no)
130 else
131    AC_MSG_RESULT(yes)
132    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
133        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
134        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
135        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter"
136 fi])
137
138 dnl Checks for functions
139 AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)
140
141 dnl Provide implementation of some required functions if necessary
142 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf)
143
144 dnl Checks for libraries
145 AC_CHECK_LIB(z,gzopen)
146
147 dnl See if we are cross-compiling
148 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
149
150 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
151 AC_OUTPUT