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