]> CyberLeo.Net >> Repos - FreeBSD/releng/9.3.git/blob - contrib/file/configure.ac
Update base system file(1) to 5.22 to address multiple denial of
[FreeBSD/releng/9.3.git] / contrib / file / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([file],[5.22],[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 file formats in man section 5)
38 AC_ARG_ENABLE(fsect-man5,
39 [  --enable-fsect-man5      enable file formats in man section 5],
40 [if test "${enableval}" = yes; then
41   AC_MSG_RESULT(yes)
42   fsect=5
43 else
44   AC_MSG_RESULT(no)
45   fsect=4
46 fi], [
47   # disable by default
48   AC_MSG_RESULT(no)
49   fsect=4
50 ])
51
52 AC_CANONICAL_HOST
53 case "$host_os" in
54    mingw32*)
55       MINGW=1
56       ;;
57    *)
58       MINGW=0
59       ;;
60 esac
61 AC_SUBST(MINGW)
62 AM_CONDITIONAL(MINGW, test "$MINGW" = 1)
63
64 AC_SUBST([pkgdatadir], ['$(datadir)/misc'])
65 AC_SUBST(fsect)
66 AM_CONDITIONAL(FSECT5, test x$fsect = x5)
67
68 AC_SUBST(WARNINGS)
69
70 dnl Checks for programs.
71 AC_PROG_CC_STDC
72 AC_USE_SYSTEM_EXTENSIONS
73 AM_PROG_CC_C_O
74 AC_C_BIGENDIAN
75 AC_PROG_INSTALL
76 AC_PROG_LN_S
77 LT_INIT([disable-static pic-only])
78 gl_VISIBILITY
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(stddef.h utime.h wchar.h wctype.h limits.h)
85 AC_CHECK_HEADERS(getopt.h err.h xlocale.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)
88
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])
94
95 AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
96 AC_STRUCT_TIMEZONE
97 AC_STRUCT_TIMEZONE_DAYLIGHT
98 AC_SYS_LARGEFILE
99 AC_FUNC_FSEEKO
100 AC_TYPE_MBSTATE_T
101
102 AC_STRUCT_OPTION_GETOPT_H
103 AC_TYPE_PID_T
104 AC_TYPE_UINT8_T
105 AC_TYPE_UINT16_T
106 AC_TYPE_UINT32_T
107 AC_TYPE_INT32_T
108 AC_TYPE_UINT64_T
109 AC_TYPE_INT64_T
110 AC_TYPE_INTPTR_T
111 AC_TYPE_UINTPTR_T
112 AC_FUNC_MMAP
113 AC_FUNC_FORK
114 AC_FUNC_MBRTOWC
115
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
120    AC_MSG_RESULT(no)
121    WARNINGS=
122 else
123    AC_MSG_RESULT(yes)
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 -Wformat=2"
128 fi], [
129 if test "$GCC" = yes; then
130    AC_MSG_RESULT(yes)
131    WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
132        -Wmissing-declarations -Wredundant-decls -Wnested-externs \
133        -Wsign-compare -Wreturn-type -Wswitch -Wshadow \
134        -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
135 else
136    WARNINGS=
137    AC_MSG_RESULT(no)
138 fi])
139
140 dnl Checks for functions
141 AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
142
143 dnl Provide implementation of some required functions if necessary
144 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)
145
146 dnl Checks for libraries
147 AC_CHECK_LIB(z,gzopen)
148 if test "$MINGW" = 1; then
149   AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW]))
150 fi
151
152 dnl See if we are cross-compiling
153 AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
154
155 AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
156 AC_OUTPUT