configure.in 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT
  3. AC_CONFIG_SRCDIR([src/file.c])
  4. AM_INIT_AUTOMAKE(file, 4.23)
  5. AM_CONFIG_HEADER([config.h])
  6. AM_MAINTAINER_MODE
  7. AC_MSG_CHECKING(for builtin ELF support)
  8. AC_ARG_ENABLE(elf,
  9. [ --disable-elf disable builtin ELF support],
  10. [if test "${enableval}" = yes; then
  11. AC_MSG_RESULT(yes)
  12. AC_DEFINE(BUILTIN_ELF)
  13. else
  14. AC_MSG_RESULT(no)
  15. fi], [
  16. # enable by default
  17. AC_MSG_RESULT(yes)
  18. AC_DEFINE(BUILTIN_ELF)
  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)
  26. else
  27. AC_MSG_RESULT(no)
  28. fi], [
  29. # enable by default
  30. AC_MSG_RESULT(yes)
  31. AC_DEFINE(ELFCORE)
  32. ])
  33. AC_MSG_CHECKING(for file formats in man section 5)
  34. AC_ARG_ENABLE(fsect-man5,
  35. [ --enable-fsect-man5 enable file formats in man section 5],
  36. [if test "${enableval}" = yes; then
  37. AC_MSG_RESULT(yes)
  38. fsect=5
  39. else
  40. AC_MSG_RESULT(no)
  41. fsect=4
  42. fi], [
  43. # disable by default
  44. AC_MSG_RESULT(no)
  45. fsect=4
  46. ])
  47. AC_SUBST(fsect)
  48. AM_CONDITIONAL(FSECT5, test x$fsect = x5)
  49. AC_GNU_SOURCE
  50. dnl Checks for programs.
  51. AC_PROG_CC
  52. AC_PROG_INSTALL
  53. AC_PROG_LN_S
  54. AC_PROG_LIBTOOL
  55. dnl Templates for autoheader
  56. AH_TEMPLATE([BUILTIN_ELF],
  57. [Use the builtin ELF recognition code])
  58. AH_TEMPLATE([ELFCORE],
  59. [Recognize ELF core files])
  60. AH_TEMPLATE([HAVE_DAYLIGHT], [])
  61. AH_TEMPLATE([HAVE_LONG_LONG], [])
  62. AH_TEMPLATE([HAVE_TM_ISDST], [])
  63. AH_TEMPLATE([SIZEOF_UINT16_T], [])
  64. AH_TEMPLATE([SIZEOF_UINT32_T], [])
  65. AH_TEMPLATE([SIZEOF_INT64_T], [])
  66. AH_TEMPLATE([SIZEOF_UINT64_T], [])
  67. AH_TEMPLATE([SIZEOF_UINT8_T], [])
  68. AH_TEMPLATE([int32_t], [])
  69. AH_TEMPLATE([uint16_t], [])
  70. AH_TEMPLATE([uint32_t], [])
  71. AH_TEMPLATE([int64_t], [])
  72. AH_TEMPLATE([uint64_t], [])
  73. AH_TEMPLATE([uint8_t], [])
  74. dnl Checks for headers
  75. AC_HEADER_STDC
  76. AC_HEADER_MAJOR
  77. AC_HEADER_SYS_WAIT
  78. AC_HEADER_STDINT
  79. AC_CHECK_HEADERS(fcntl.h locale.h stdint.h inttypes.h unistd.h getopt.h)
  80. AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
  81. AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
  82. AC_CHECK_HEADERS(zlib.h)
  83. dnl Checks for typedefs, structures, and compiler characteristics.
  84. AC_C_CONST
  85. AC_TYPE_OFF_T
  86. AC_TYPE_SIZE_T
  87. AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
  88. your code should no longer depend upon `HAVE_ST_RDEV', but
  89. `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
  90. the `AC_DEFINE' when you adjust the code.])
  91. AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
  92. [Define to 1 if your `struct stat' has `st_rdev'.
  93. Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
  94. instead.])])
  95. AC_STRUCT_TIMEZONE_DAYLIGHT
  96. AC_SYS_LARGEFILE
  97. AC_TYPE_MBSTATE_T
  98. AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
  99. AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
  100. AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
  101. AC_CHECK_TYPE_STDC(int32_t, int)
  102. AC_C_LONG_LONG
  103. if test $ac_cv_c_long_long = yes; then
  104. ulong64='unsigned long long';
  105. long64='long long';
  106. else
  107. ulong64='unsigned long';
  108. long64='long';
  109. fi
  110. dnl This needs a patch to autoconf 2.13 acgeneral.m4
  111. AC_CHECK_TYPE2_STDC(uint64_t, $ulong64)
  112. AC_CHECK_TYPE2_STDC(int64_t, $long64)
  113. AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0)
  114. AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0)
  115. AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
  116. AC_CHECK_SIZEOF_STDC_HEADERS(int64_t, 0)
  117. AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
  118. dnl Checks for functions
  119. AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf strtof)
  120. dnl Checks for libraries
  121. AC_CHECK_LIB(z,gzopen)
  122. dnl See if we are cross-compiling
  123. AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  124. AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])
  125. AC_OUTPUT