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