configure.ac revision 1.3.2.3
1dnl Process this file with autoconf to produce a configure script. 2AC_INIT([file],[5.16],[christos@astron.com]) 3AM_INIT_AUTOMAKE([subdir-objects foreign]) 4AM_MAINTAINER_MODE(disable) 5m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 6 7AC_CONFIG_HEADERS([config.h]) 8AC_CONFIG_MACRO_DIR([m4]) 9 10AC_MSG_CHECKING(for builtin ELF support) 11AC_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]) 16else 17 AC_MSG_RESULT(no) 18fi], [ 19 # enable by default 20 AC_MSG_RESULT(yes) 21 AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used]) 22]) 23 24AC_MSG_CHECKING(for ELF core file support) 25AC_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]) 30else 31 AC_MSG_RESULT(no) 32fi], [ 33 # enable by default 34 AC_MSG_RESULT(yes) 35 AC_DEFINE([ELFCORE], 1, [Define for ELF core file support]) 36]) 37 38AC_MSG_CHECKING(for file formats in man section 5) 39AC_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 44else 45 AC_MSG_RESULT(no) 46 fsect=4 47fi], [ 48 # disable by default 49 AC_MSG_RESULT(no) 50 fsect=4 51]) 52 53AC_CANONICAL_HOST 54case "$host_os" in 55 mingw32*) 56 MINGW=1 57 ;; 58 *) 59 MINGW=0 60 ;; 61esac 62AC_SUBST(MINGW) 63AM_CONDITIONAL(MINGW, test "$MINGW" = 1) 64 65AC_SUBST([pkgdatadir], ['$(datadir)/misc']) 66AC_SUBST(fsect) 67AM_CONDITIONAL(FSECT5, test x$fsect = x5) 68 69AC_SUBST(WARNINGS) 70 71dnl Checks for programs. 72AC_PROG_CC_STDC 73AC_USE_SYSTEM_EXTENSIONS 74AM_PROG_CC_C_O 75AC_C_BIGENDIAN 76AC_PROG_INSTALL 77AC_PROG_LN_S 78LT_INIT([disable-static pic-only]) 79gl_VISIBILITY 80dnl Checks for headers 81AC_HEADER_STDC 82AC_HEADER_MAJOR 83AC_HEADER_SYS_WAIT 84AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h) 85AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h) 86AC_CHECK_HEADERS(getopt.h err.h) 87AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h) 88AC_CHECK_HEADERS(zlib.h) 89 90dnl Checks for typedefs, structures, and compiler characteristics. 91AC_C_CONST 92AC_TYPE_OFF_T 93AC_TYPE_SIZE_T 94AC_CHECK_MEMBERS([struct stat.st_rdev]) 95 96AC_CHECK_MEMBERS([struct tm.tm_gmtoff]) 97AC_STRUCT_TIMEZONE 98AC_STRUCT_TIMEZONE_DAYLIGHT 99AC_SYS_LARGEFILE 100AC_FUNC_FSEEKO 101AC_TYPE_MBSTATE_T 102 103AC_STRUCT_OPTION_GETOPT_H 104AC_TYPE_PID_T 105AC_TYPE_UINT8_T 106AC_TYPE_UINT16_T 107AC_TYPE_UINT32_T 108AC_TYPE_INT32_T 109AC_TYPE_UINT64_T 110AC_TYPE_INT64_T 111AC_FUNC_MMAP 112AC_FUNC_FORK 113AC_FUNC_MBRTOWC 114 115AC_MSG_CHECKING(for gcc compiler warnings) 116AC_ARG_ENABLE(warnings, 117[ --disable-warnings disable compiler warnings], 118[if test "${enableval}" = no -o "$GCC" = no; then 119 AC_MSG_RESULT(no) 120 WARNINGS= 121else 122 AC_MSG_RESULT(yes) 123 WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \ 124 -Wmissing-declarations -Wredundant-decls -Wnested-externs \ 125 -Wsign-compare -Wreturn-type -Wswitch -Wshadow \ 126 -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2" 127fi], [ 128if test "$GCC" = yes; then 129 AC_MSG_RESULT(yes) 130 WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \ 131 -Wmissing-declarations -Wredundant-decls -Wnested-externs \ 132 -Wsign-compare -Wreturn-type -Wswitch -Wshadow \ 133 -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2" 134else 135 WARNINGS= 136 AC_MSG_RESULT(no) 137fi]) 138 139dnl Checks for functions 140AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof) 141 142dnl Provide implementation of some required functions if necessary 143AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread) 144 145dnl Checks for libraries 146AC_CHECK_LIB(z,gzopen) 147if test "$MINGW" = 1; then 148 AC_CHECK_LIB(gnurx,regexec,,AC_MSG_ERROR([libgnurx is required to build file(1) with MinGW])) 149fi 150 151dnl See if we are cross-compiling 152AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes) 153 154AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile]) 155AC_OUTPUT 156