]> granicus.if.org Git - file/commitdiff
new configure.ac from rrt@
authorChristos Zoulas <christos@zoulas.com>
Fri, 8 Feb 2008 13:19:56 +0000 (13:19 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 8 Feb 2008 13:19:56 +0000 (13:19 +0000)
configure.ac

index 7d644081f2f0eeab48e2f38d10ab1547f7404217..76869e7b0c2c54167f53a1238005a3b4e80ee904 100644 (file)
-dnl Process this file with autoconf to produce a configure script.
-AC_INIT(file, 4.23, christos@astron.com)
-AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER([config.h])
-
-AC_MSG_CHECKING(for builtin ELF support)
-AC_ARG_ENABLE(elf,
-[  --disable-elf            disable builtin ELF support],
-[if test "${enableval}" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(BUILTIN_ELF)
-else
-  AC_MSG_RESULT(no)
-fi], [
-  # enable by default
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(BUILTIN_ELF)
-])
-
-AC_MSG_CHECKING(for ELF core file support)
-AC_ARG_ENABLE(elf-core,
-[  --disable-elf-core       disable ELF core file support],
-[if test "${enableval}" = yes; then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(ELFCORE)
-else
-  AC_MSG_RESULT(no)
-fi], [
-  # enable by default
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(ELFCORE)
-])
-
-AC_MSG_CHECKING(for file formats in man section 5)
-AC_ARG_ENABLE(fsect-man5,
-[  --enable-fsect-man5      enable file formats in man section 5],
-[if test "${enableval}" = yes; then
-  AC_MSG_RESULT(yes)
-  fsect=5
-else
-  AC_MSG_RESULT(no)
-  fsect=4
-fi], [
-  # disable by default
-  AC_MSG_RESULT(no)
-  fsect=4
-])
-AC_SUBST(fsect)
-AM_CONDITIONAL(FSECT5, test x$fsect = x5)
-AC_GNU_SOURCE
-
-dnl Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_LIBTOOL
-
-dnl Templates for autoheader
-AH_TEMPLATE([BUILTIN_ELF],
-           [Use the builtin ELF recognition code])
-AH_TEMPLATE([ELFCORE],
-           [Recognize ELF core files])
-AH_TEMPLATE([HAVE_DAYLIGHT], [])
-AH_TEMPLATE([HAVE_LONG_LONG], [])
-AH_TEMPLATE([HAVE_TM_ISDST], [])
-AH_TEMPLATE([SIZEOF_UINT16_T], [])
-AH_TEMPLATE([SIZEOF_UINT32_T], [])
-AH_TEMPLATE([SIZEOF_INT64_T], [])
-AH_TEMPLATE([SIZEOF_UINT64_T], [])
-AH_TEMPLATE([SIZEOF_UINT8_T], [])
-AH_TEMPLATE([int32_t], [])
-AH_TEMPLATE([uint16_t], [])
-AH_TEMPLATE([uint32_t], [])
-AH_TEMPLATE([int64_t], [])
-AH_TEMPLATE([uint64_t], [])
-AH_TEMPLATE([uint8_t], [])
-
-dnl Checks for headers
-AC_HEADER_STDC
-AC_HEADER_MAJOR
-AC_HEADER_SYS_WAIT
-AC_HEADER_STDINT
-AC_CHECK_HEADERS(fcntl.h locale.h stdint.h inttypes.h unistd.h getopt.h)
-AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
-AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
-AC_CHECK_HEADERS(zlib.h)
-
-dnl Checks for typedefs, structures, and compiler characteristics.
-AC_C_CONST
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
-       your code should no longer depend upon `HAVE_ST_RDEV', but
-       `HAVE_STRUCT_STAT_ST_RDEV'.  Remove this warning and
-       the `AC_DEFINE' when you adjust the code.])
-AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
-                           [Define to 1 if your `struct stat' has `st_rdev'.
-                            Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
-                            instead.])])
-
-AC_STRUCT_TIMEZONE_DAYLIGHT
-AC_SYS_LARGEFILE
-AC_TYPE_MBSTATE_T
-
-AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
-AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
-AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
-AC_CHECK_TYPE_STDC(int32_t, int)
-AC_C_LONG_LONG
-if test $ac_cv_c_long_long = yes; then
-  ulong64='unsigned long long';
-  long64='long long';
-else
-  ulong64='unsigned long';
-  long64='long';
-fi
-dnl This needs a patch to autoconf 2.13 acgeneral.m4
-AC_CHECK_TYPE2_STDC(uint64_t, $ulong64)
-AC_CHECK_TYPE2_STDC(int64_t, $long64)
-
-AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0)
-AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0)
-AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
-AC_CHECK_SIZEOF_STDC_HEADERS(int64_t, 0)
-AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
-
-dnl Checks for functions
-AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf strtof)
-
-dnl Checks for libraries
-AC_CHECK_LIB(z,gzopen)
-
-dnl See if we are cross-compiling
-AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
-
-AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])
-AC_OUTPUT
+dnl Process this file with autoconf to produce a configure script.\r
+AC_INIT(file, 4.23, christos@astron.com)\r
+AM_INIT_AUTOMAKE\r
+AM_CONFIG_HEADER(config.h)\r
+\r
+AC_MSG_CHECKING(for builtin ELF support)\r
+AC_ARG_ENABLE(elf,\r
+[  --disable-elf            disable builtin ELF support],\r
+[if test "${enableval}" = yes; then\r
+  AC_MSG_RESULT(yes)\r
+  AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])\r
+else\r
+  AC_MSG_RESULT(no)\r
+fi], [\r
+  # enable by default\r
+  AC_MSG_RESULT(yes)\r
+  AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])\r
+])\r
+\r
+AC_MSG_CHECKING(for ELF core file support)\r
+AC_ARG_ENABLE(elf-core,\r
+[  --disable-elf-core       disable ELF core file support],\r
+[if test "${enableval}" = yes; then\r
+  AC_MSG_RESULT(yes)\r
+  AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])\r
+else\r
+  AC_MSG_RESULT(no)\r
+fi], [\r
+  # enable by default\r
+  AC_MSG_RESULT(yes)\r
+  AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])\r
+])\r
+\r
+AC_MSG_CHECKING(for file formats in man section 5)\r
+AC_ARG_ENABLE(fsect-man5,\r
+[  --enable-fsect-man5      enable file formats in man section 5],\r
+[if test "${enableval}" = yes; then\r
+  AC_MSG_RESULT(yes)\r
+  fsect=5\r
+else\r
+  AC_MSG_RESULT(no)\r
+  fsect=4\r
+fi], [\r
+  # disable by default\r
+  AC_MSG_RESULT(no)\r
+  fsect=4\r
+])\r
+AC_SUBST(fsect)\r
+AM_CONDITIONAL(FSECT5, test x$fsect = x5)\r
+AC_GNU_SOURCE\r
+\r
+dnl Checks for programs.\r
+AC_PROG_CC\r
+AC_PROG_INSTALL\r
+AC_PROG_LN_S\r
+AC_PROG_LIBTOOL\r
+\r
+dnl Checks for headers\r
+AC_HEADER_STDC\r
+AC_HEADER_MAJOR\r
+AC_HEADER_SYS_WAIT\r
+AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)\r
+AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)\r
+AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)\r
+AC_CHECK_HEADERS(zlib.h)\r
+\r
+dnl Checks for typedefs, structures, and compiler characteristics.\r
+AC_C_CONST\r
+AC_TYPE_OFF_T\r
+AC_TYPE_SIZE_T\r
+AC_CHECK_MEMBERS([struct stat.st_rdev])\r
+\r
+AC_STRUCT_TIMEZONE_DAYLIGHT\r
+AC_SYS_LARGEFILE\r
+AC_FUNC_FSEEKO\r
+AC_TYPE_MBSTATE_T\r
+\r
+AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])\r
+AC_CHECK_SIZEOF(long long)\r
+AH_BOTTOM([\r
+#ifndef HAVE_UINT8_T\r
+typedef unsigned char uint8_t;\r
+#endif\r
+#ifndef HAVE_UINT16_T\r
+typedef unsigned short uint16_t;\r
+#endif\r
+#ifndef HAVE_UINT32_T\r
+typedef unsigned int uint32_t;\r
+#endif\r
+#ifndef HAVE_INT32_T\r
+typedef int int32_t;\r
+#endif\r
+#ifndef HAVE_UINT64_T\r
+#if SIZEOF_LONG_LONG == 8\r
+typedef unsigned long long uint64_t;\r
+#else\r
+typedef unsigned long uint64_t;\r
+#endif\r
+#endif\r
+#ifndef HAVE_INT64_T\r
+#if SIZEOF_LONG_LONG == 8\r
+typedef long long int64_t;\r
+#else\r
+typedef long int64_t;\r
+#endif\r
+#endif\r
+])\r
+\r
+dnl Checks for functions\r
+AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth snprintf vsnprintf strtof)\r
+\r
+dnl Provide implementation of some required functions if necessary\r
+AC_REPLACE_FUNCS(getopt_long)\r
+\r
+dnl Checks for libraries\r
+AC_CHECK_LIB(z,gzopen)\r
+\r
+dnl See if we are cross-compiling\r
+AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)\r
+\r
+AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])\r
+AC_OUTPUT\r