OSDN Git Service

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