2 # Process this file with autoconf to produce a configure script.
5 AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6 AC_CONFIG_SRCDIR(ucnid.h)
7 AC_CONFIG_MACRO_DIR(../config)
10 # Checks for programs.
17 # See if we are building gcc with C++.
18 # Do this early so setting lang to C++ affects following tests
19 AC_ARG_ENABLE(build-with-cxx,
20 [ --enable-build-with-cxx build with C++ compiler instead of C compiler],
21 ENABLE_BUILD_WITH_CXX=$enableval,
22 ENABLE_BUILD_WITH_CXX=no)
23 AC_SUBST(ENABLE_BUILD_WITH_CXX)
25 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
26 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
27 AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
28 AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
30 # Figure out what compiler warnings we can enable.
31 # See config/warnings.m4 for details.
33 ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings \
34 -Wmissing-format-attribute], [warn])
35 ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
36 -Wold-style-definition -Wc++-compat], [c_warn])
37 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
39 # Only enable with --enable-werror-always until existing warnings are
41 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
43 # Dependency checking.
45 if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
46 ZW_PROG_COMPILER_DEPENDENCIES([CC])
49 AC_COMPILE_IFELSE([[int i;]], [],
50 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
52 ZW_PROG_COMPILER_DEPENDENCIES([CXX])
55 # Checks for header files.
59 # AC_CHECK_HEADERS is repeated to work around apparent autoconf 2.59 bug. If
60 # AC_CHECK_HEADERS comes after the if clause, the last AC_LANG call gets used,
61 # no matter which branch is taken.
62 if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
64 AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
65 stdlib.h strings.h string.h sys/file.h unistd.h)
68 AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
69 stdlib.h strings.h string.h sys/stat.h sys/file.h unistd.h)
72 # Checks for typedefs, structures, and compiler characteristics.
78 AC_CHECK_TYPE(ssize_t, int)
82 define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
83 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
84 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
85 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
86 putchar_unlocked putc_unlocked)
87 AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
88 AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
89 AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
91 # Checks for library functions.
95 ZW_GNU_GETTEXT_SISTER_DIR
97 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
99 #include <sys/types.h>
101 [if ((uchar *)0) return 0;
102 if (sizeof(uchar)) return 0;],
103 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
104 if test $ac_cv_type_uchar = yes; then
105 AC_DEFINE(HAVE_UCHAR, 1,
106 [Define if <sys/types.h> defines \`uchar'.])
111 # More defines and substitutions.
112 PACKAGE="$PACKAGE_TARNAME"
113 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
116 if test "x$enable_nls" != xno; then
117 USED_CATALOGS='$(CATALOGS)'
121 AC_SUBST(USED_CATALOGS)
123 AC_ARG_ENABLE(maintainer-mode,
124 [ --enable-maintainer-mode enable rules only needed by maintainers],,
125 enable_maintainer_mode=no)
127 if test "x$enable_maintainer_mode" = xno; then
134 AC_ARG_ENABLE(checking,
135 [ --enable-checking enable expensive run-time checks],,
138 if test $enable_checking != no ; then
139 AC_DEFINE(ENABLE_CHECKING, 1,
140 [Define if you want more run-time sanity checks.])
147 arm*-*-symbianelf* | \
151 i[34567]86-*-darwin* | \
152 i[34567]86-*-solaris2.1[0-9]* | \
153 i[34567]86-w64-mingw* | \
161 sh[123456789lbe]*-*-* | sh-*-*)
162 need_64bit_hwint=yes ;;
164 if test "x$enable_targets" = xall; then
171 need_64bit_hwint=no ;;
174 case $need_64bit_hwint:$ac_cv_sizeof_long in
175 *:8 | no:*) host_wide_int=long ;;
176 *) host_wide_int='long long' ;;
180 AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
181 [Define to the widest efficient host integer type at least
182 as wide as the target's size_t type.])
186 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
187 AC_CONFIG_FILES(Makefile)