configure.in 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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.15)
  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)
  77. AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h)
  78. AC_CHECK_HEADERS(stdint.h inttypes.h)
  79. AC_CHECK_HEADERS(unistd.h)
  80. AC_CHECK_HEADERS(getopt.h)
  81. AC_CHECK_HEADERS(locale.h)
  82. AC_CHECK_HEADERS(utime.h)
  83. AC_CHECK_HEADERS(sys/utime.h)
  84. AC_CHECK_HEADERS(wchar.h)
  85. dnl Checks for typedefs, structures, and compiler characteristics.
  86. AC_C_CONST
  87. AC_TYPE_OFF_T
  88. AC_TYPE_SIZE_T
  89. AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV:
  90. your code should no longer depend upon `HAVE_ST_RDEV', but
  91. `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and
  92. the `AC_DEFINE' when you adjust the code.])
  93. AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1,
  94. [Define to 1 if your `struct stat' has `st_rdev'.
  95. Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV'
  96. instead.])])
  97. AC_STRUCT_TIMEZONE_DAYLIGHT
  98. AC_SYS_LARGEFILE
  99. AC_TYPE_MBSTATE_T
  100. AC_CHECK_TYPE_STDC(uint8_t, unsigned char)
  101. AC_CHECK_TYPE_STDC(uint16_t, unsigned short)
  102. AC_CHECK_TYPE_STDC(uint32_t, unsigned int)
  103. AC_CHECK_TYPE_STDC(int32_t, int)
  104. AC_C_LONG_LONG
  105. if test $ac_cv_c_long_long = yes; then
  106. long64='unsigned long long';
  107. else
  108. long64='unsigned long';
  109. fi
  110. dnl This needs a patch to autoconf 2.13 acgeneral.m4
  111. AC_CHECK_TYPE2_STDC(uint64_t, $long64)
  112. AC_CHECK_SIZEOF_STDC_HEADERS(uint8_t, 0)
  113. AC_CHECK_SIZEOF_STDC_HEADERS(uint16_t, 0)
  114. AC_CHECK_SIZEOF_STDC_HEADERS(uint32_t, 0)
  115. AC_CHECK_SIZEOF_STDC_HEADERS(uint64_t, 0)
  116. dnl Checks for functions
  117. AC_CHECK_FUNCS(mmap strerror strtoul mbrtowc mkstemp getopt_long utimes utime wcwidth snprintf vsnprintf)
  118. dnl Checks for libraries
  119. AC_CHECK_LIB(z,gzopen)
  120. dnl See if we are cross-compiling
  121. AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  122. AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile doc/Makefile python/Makefile])
  123. AC_OUTPUT