configure.ac 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. AC_PREREQ(2.64)
  2. AC_INIT(fixincludes, [ ])
  3. AC_CONFIG_SRCDIR(inclhack.def)
  4. AC_CONFIG_AUX_DIR(..)
  5. m4_sinclude(../libtool.m4)
  6. AC_CANONICAL_SYSTEM
  7. AC_PROG_CC
  8. AC_USE_SYSTEM_EXTENSIONS
  9. AC_PROG_SED
  10. # Figure out what compiler warnings we can enable.
  11. # See config/warnings.m4 for details.
  12. ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
  13. -Wmissing-prototypes -Wold-style-definition \
  14. -Wmissing-format-attribute -Wno-overlength-strings])
  15. ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
  16. # Only enable with --enable-werror-always until existing warnings are
  17. # corrected.
  18. ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
  19. # Determine the noncanonical target name, for directory use.
  20. ACX_NONCANONICAL_TARGET
  21. # Specify the local prefix
  22. local_prefix=
  23. AC_ARG_WITH(local-prefix,
  24. [ --with-local-prefix=DIR specifies directory to put local include],
  25. [case "${withval}" in
  26. yes) AC_MSG_ERROR(bad value ${withval} given for local include directory prefix) ;;
  27. no) ;;
  28. *) local_prefix=$with_local_prefix ;;
  29. esac])
  30. # Default local prefix if it is empty
  31. if test x$local_prefix = x; then
  32. local_prefix=/usr/local
  33. fi
  34. # Choose one or two-process fix methodology. Systems that cannot handle
  35. # bi-directional pipes must use the two process method.
  36. #
  37. AC_ARG_ENABLE([twoprocess],
  38. [ --enable-twoprocess Use a separate process to apply the fixes],
  39. [if test "x$enable_twoprocess" = xyes; then
  40. TARGET=twoprocess
  41. else
  42. TARGET=oneprocess
  43. fi],
  44. [case $host in
  45. i?86-*-msdosdjgpp* | \
  46. i?86-*-mingw32* | \
  47. x86_64-*-mingw32* | \
  48. *-*-beos* | \
  49. *-*-*vms*)
  50. TARGET=twoprocess
  51. ;;
  52. * )
  53. TARGET=oneprocess
  54. ;;
  55. esac])
  56. AC_SUBST(TARGET)
  57. if test $TARGET = twoprocess; then
  58. AC_DEFINE(SEPARATE_FIX_PROC, 1,
  59. [Define if testing and fixing are done by separate process])
  60. fi
  61. case $host in
  62. vax-dec-bsd* )
  63. AC_DEFINE(exit, xexit, [Define to xexit if the host system does not support atexit])
  64. AC_DEFINE(atexit, xatexit, [Define to xatexit if the host system does not support atexit])
  65. ;;
  66. esac
  67. AC_DEFINE_UNQUOTED([EXE_EXT], "$ac_exeext",
  68. [Defined to the executable file extension on the host system])
  69. # Checks for header files.
  70. AC_HEADER_STDC
  71. AC_CHECK_HEADERS([stddef.h stdlib.h strings.h unistd.h fcntl.h sys/file.h \
  72. sys/stat.h])
  73. define(fixincludes_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
  74. ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
  75. fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
  76. fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
  77. putchar_unlocked putc_unlocked)
  78. AC_CHECK_FUNCS(fixincludes_UNLOCKED_FUNCS)
  79. AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, vasprintf])
  80. AC_CHECK_DECLS(m4_split(m4_normalize(fixincludes_UNLOCKED_FUNCS)))
  81. # Checks for typedefs, structures, and compiler characteristics.
  82. AC_C_CONST
  83. # Checks for library functions.
  84. GCC_AC_FUNC_MMAP_BLACKLIST
  85. AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
  86. AC_ARG_ENABLE(maintainer-mode,
  87. [ --enable-maintainer-mode enable make rules and dependencies not useful
  88. (and sometimes confusing) to the casual installer],
  89. USE_MAINTAINER_MODE=$enableval,
  90. USE_MAINTAINER_MODE=no)
  91. AC_MSG_RESULT($USE_MAINTAINER_MODE)
  92. if test "$USE_MAINTAINER_MODE" = yes; then
  93. MAINT=
  94. else
  95. MAINT='#'
  96. fi
  97. AC_SUBST(MAINT)
  98. AC_DEFINE_UNQUOTED([SED_PROGRAM], "${SED}",
  99. [Defined to the best working sed program on the host system])
  100. AC_CONFIG_HEADERS(config.h, [echo timestamp > stamp-h])
  101. AC_CONFIG_FILES(Makefile mkheaders.almost:mkheaders.in)
  102. AC_OUTPUT