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