configure.ac 3.5 KB

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