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