configure.ac 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(file, 4.25, christos@astron.com)
  3. AM_INIT_AUTOMAKE
  4. AM_CONFIG_HEADER(config.h)
  5. AC_MSG_CHECKING(for builtin ELF support)
  6. AC_ARG_ENABLE(elf,
  7. [ --disable-elf disable builtin ELF support],
  8. [if test "${enableval}" = yes; then
  9. AC_MSG_RESULT(yes)
  10. AC_DEFINE([BUILTIN_ELF], 1, [Define if built-in ELF support is used])
  11. else
  12. AC_MSG_RESULT(no)
  13. fi], [
  14. # enable by default
  15. AC_MSG_RESULT(yes)
  16. AC_DEFINE([BUILTIN_ELF], 1, [Define in built-in ELF support is used])
  17. ])
  18. AC_MSG_CHECKING(for ELF core file support)
  19. AC_ARG_ENABLE(elf-core,
  20. [ --disable-elf-core disable ELF core file support],
  21. [if test "${enableval}" = yes; then
  22. AC_MSG_RESULT(yes)
  23. AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
  24. else
  25. AC_MSG_RESULT(no)
  26. fi], [
  27. # enable by default
  28. AC_MSG_RESULT(yes)
  29. AC_DEFINE([ELFCORE], 1, [Define for ELF core file support])
  30. ])
  31. AC_MSG_CHECKING(for file formats in man section 5)
  32. AC_ARG_ENABLE(fsect-man5,
  33. [ --enable-fsect-man5 enable file formats in man section 5],
  34. [if test "${enableval}" = yes; then
  35. AC_MSG_RESULT(yes)
  36. fsect=5
  37. else
  38. AC_MSG_RESULT(no)
  39. fsect=4
  40. fi], [
  41. # disable by default
  42. AC_MSG_RESULT(no)
  43. fsect=4
  44. ])
  45. AC_SUBST(fsect)
  46. AM_CONDITIONAL(FSECT5, test x$fsect = x5)
  47. AC_GNU_SOURCE
  48. dnl Checks for programs.
  49. AC_PROG_CC
  50. AM_PROG_CC_C_O
  51. AC_PROG_INSTALL
  52. AC_PROG_LN_S
  53. AC_PROG_LIBTOOL
  54. dnl Checks for headers
  55. AC_HEADER_STDC
  56. AC_HEADER_MAJOR
  57. AC_HEADER_SYS_WAIT
  58. AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
  59. AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
  60. AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
  61. AC_CHECK_HEADERS(zlib.h)
  62. dnl Checks for typedefs, structures, and compiler characteristics.
  63. AC_C_CONST
  64. AC_TYPE_OFF_T
  65. AC_TYPE_SIZE_T
  66. AC_CHECK_MEMBERS([struct stat.st_rdev])
  67. AC_STRUCT_TIMEZONE_DAYLIGHT
  68. AC_SYS_LARGEFILE
  69. AC_FUNC_FSEEKO
  70. AC_TYPE_MBSTATE_T
  71. AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
  72. AC_CHECK_SIZEOF(long long)
  73. AH_BOTTOM([
  74. #ifndef HAVE_UINT8_T
  75. typedef unsigned char uint8_t;
  76. #endif
  77. #ifndef HAVE_UINT16_T
  78. typedef unsigned short uint16_t;
  79. #endif
  80. #ifndef HAVE_UINT32_T
  81. typedef unsigned int uint32_t;
  82. #endif
  83. #ifndef HAVE_INT32_T
  84. typedef int int32_t;
  85. #endif
  86. #ifndef HAVE_UINT64_T
  87. #if SIZEOF_LONG_LONG == 8
  88. typedef unsigned long long uint64_t;
  89. #else
  90. typedef unsigned long uint64_t;
  91. #endif
  92. #endif
  93. #ifndef HAVE_INT64_T
  94. #if SIZEOF_LONG_LONG == 8
  95. typedef long long int64_t;
  96. #else
  97. typedef long int64_t;
  98. #endif
  99. #endif
  100. ])
  101. dnl Checks for functions
  102. AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)
  103. dnl Provide implementation of some required functions if necessary
  104. AC_REPLACE_FUNCS(getopt_long asprintf vasprintf)
  105. dnl Checks for libraries
  106. AC_CHECK_LIB(z,gzopen)
  107. dnl See if we are cross-compiling
  108. AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  109. AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
  110. AC_OUTPUT