configure.in 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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.19)
  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. dnl Checks for programs.
  50. AC_PROG_CC
  51. AC_PROG_INSTALL
  52. AC_PROG_LN_S
  53. AC_PROG_LIBTOOL
  54. dnl Templates for autoheader
  55. AH_TEMPLATE([BUILTIN_ELF],
  56. [Use the builtin ELF recognition code])
  57. AH_TEMPLATE([ELFCORE],
  58. [Recognize ELF core files])
  59. AH_TEMPLATE([HAVE_DAYLIGHT], [])
  60. AH_TEMPLATE([HAVE_LONG_LONG], [])
  61. AH_TEMPLATE([HAVE_TM_ISDST], [])
  62. AH_TEMPLATE([SIZEOF_UINT16_T], [])
  63. AH_TEMPLATE([SIZEOF_UINT32_T], [])
  64. AH_TEMPLATE([SIZEOF_UINT64_T], [])
  65. AH_TEMPLATE([SIZEOF_UINT8_T], [])
  66. AH_TEMPLATE([int32_t], [])
  67. AH_TEMPLATE([uint16_t], [])
  68. AH_TEMPLATE([uint32_t], [])
  69. AH_TEMPLATE([uint64_t], [])
  70. AH_TEMPLATE([uint8_t], [])
  71. dnl Checks for headers
  72. AC_HEADER_STDC
  73. AC_HEADER_MAJOR
  74. AC_HEADER_SYS_WAIT
  75. AC_HEADER_STDINT
  76. AC_CHECK_HEADERS(fcntl.h locale.h stdint.h inttypes.h unistd.h getopt.h)
  77. AC_CHECK_HEADERS(utime.h wchar.h wctype.h)
  78. AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h)
  79. dnl Checks for typedefs, structures, and compiler characteristics.
  80. AC_C_CONST
  81. AC_TYPE_OFF_T
  82. AC_TYPE_SIZE_T
  83. AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
  84. your code should no longer depend upon `HAVE_ST_RDEV', but
  85. `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
  86. the `AC_DEFINE' when you adjust the code.])
  87. AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
  88. [Define to 1 if your `struct stat' has `st_rdev'.
  89. Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
  90. instead.])])
  91. AC_STRUCT_TIMEZONE_DAYLIGHT
  92. AC_SYS_LARGEFILE
  93. AC_TYPE_MBSTATE_T
  94. AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
  95. AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
  96. AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
  97. AC_CHECK_TYPE_STDC(int32_t, int)
  98. AC_C_LONG_LONG
  99. if test $ac_cv_c_long_long = yes; then
  100. long64='unsigned long long';
  101. else
  102. long64='unsigned long';
  103. fi
  104. dnl This needs a patch to autoconf 2.13 acgeneral.m4
  105. AC_CHECK_TYPE2_STDC(uint64_t, $long64)
  106. AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0)
  107. AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0)
  108. AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
  109. AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
  110. dnl Checks for functions
  111. AC_CHECK_FUNCS(mmap strerror strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf)
  112. dnl Checks for libraries
  113. AC_CHECK_LIB(z,gzopen)
  114. dnl See if we are cross-compiling
  115. AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  116. AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])
  117. AC_OUTPUT