configure.ac 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT(file, 4.24, 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. AC_PROG_INSTALL
  51. AC_PROG_LN_S
  52. AC_PROG_LIBTOOL
  53. dnl Checks for headers
  54. AC_HEADER_STDC
  55. AC_HEADER_MAJOR
  56. AC_HEADER_SYS_WAIT
  57. AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
  58. AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
  59. AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
  60. AC_CHECK_HEADERS(zlib.h)
  61. dnl Checks for typedefs, structures, and compiler characteristics.
  62. AC_C_CONST
  63. AC_TYPE_OFF_T
  64. AC_TYPE_SIZE_T
  65. AC_CHECK_MEMBERS([struct stat.st_rdev])
  66. AC_STRUCT_TIMEZONE_DAYLIGHT
  67. AC_SYS_LARGEFILE
  68. AC_FUNC_FSEEKO
  69. AC_TYPE_MBSTATE_T
  70. AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
  71. AC_CHECK_SIZEOF(long long)
  72. AH_BOTTOM([
  73. #ifndef HAVE_UINT8_T
  74. typedef unsigned char uint8_t;
  75. #endif
  76. #ifndef HAVE_UINT16_T
  77. typedef unsigned short uint16_t;
  78. #endif
  79. #ifndef HAVE_UINT32_T
  80. typedef unsigned int uint32_t;
  81. #endif
  82. #ifndef HAVE_INT32_T
  83. typedef int int32_t;
  84. #endif
  85. #ifndef HAVE_UINT64_T
  86. #if SIZEOF_LONG_LONG == 8
  87. typedef unsigned long long uint64_t;
  88. #else
  89. typedef unsigned long uint64_t;
  90. #endif
  91. #endif
  92. #ifndef HAVE_INT64_T
  93. #if SIZEOF_LONG_LONG == 8
  94. typedef long long int64_t;
  95. #else
  96. typedef long int64_t;
  97. #endif
  98. #endif
  99. ])
  100. dnl Checks for functions
  101. AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof)
  102. dnl Provide implementation of some required functions if necessary
  103. AC_REPLACE_FUNCS(getopt_long asprintf vasprintf)
  104. dnl Checks for libraries
  105. AC_CHECK_LIB(z,gzopen)
  106. dnl See if we are cross-compiling
  107. AM_CONDITIONAL(IS_CROSS_COMPILE, test "$cross_compiling" = yes)
  108. AC_CONFIG_FILES([Makefile src/Makefile magic/Makefile tests/Makefile doc/Makefile python/Makefile])
  109. AC_OUTPUT