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