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 AC_USE_SYSTEM_EXTENSIONS
20 MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
21 AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
22 AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
23 AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
25 # Figure out what compiler warnings we can enable.
26 # See config/warnings.m4 for details.
28 ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
29 -Wmissing-format-attribute], [warn])
30 ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
31 -Wold-style-definition -Wc++-compat], [c_warn])
32 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
34 # Disable exceptions and RTTI if building with g++
35 ACX_PROG_CC_WARNING_OPTS(
36 m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
38 # Only enable with --enable-werror-always until existing warnings are
40 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
42 # Dependency checking.
45 AC_COMPILE_IFELSE([[int i;]], [],
46 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
48 ZW_PROG_COMPILER_DEPENDENCIES([CXX])
50 # Checks for header files.
54 AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
55 stdlib.h strings.h string.h sys/file.h unistd.h)
57 # Checks for typedefs, structures, and compiler characteristics.
66 AC_CHECK_TYPE(ptrdiff_t, int)
67 AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
68 AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
72 define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
73 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
74 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
75 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
76 putchar_unlocked putc_unlocked)
77 AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
78 AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
79 AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
81 # Checks for library functions.
85 ZW_GNU_GETTEXT_SISTER_DIR
87 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
89 #include <sys/types.h>
91 [if ((uchar *)0) return 0;
92 if (sizeof(uchar)) return 0;],
93 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
94 if test $ac_cv_type_uchar = yes; then
95 AC_DEFINE(HAVE_UCHAR, 1,
96 [Define if <sys/types.h> defines \`uchar'.])
99 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
105 # More defines and substitutions.
106 PACKAGE="$PACKAGE_TARNAME"
107 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
110 if test "x$enable_nls" != xno; then
111 USED_CATALOGS='$(CATALOGS)'
115 AC_SUBST(USED_CATALOGS)
117 AC_ARG_ENABLE(maintainer-mode,
118 [ --enable-maintainer-mode enable rules only needed by maintainers],,
119 enable_maintainer_mode=no)
121 if test "x$enable_maintainer_mode" = xno; then
128 # Enable expensive internal checks
130 if test -f $srcdir/../gcc/DEV-PHASE \
131 && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
135 AC_ARG_ENABLE(checking,
136 [AS_HELP_STRING([[--enable-checking[=LIST]]],
137 [enable expensive run-time checks. With LIST,
138 enable only specific categories of checks.
139 Categories are: yes,no,all,none,release.
140 Flags are: misc,valgrind or other strings])],
141 [ac_checking_flags="${enableval}"],[
142 # Determine the default checks.
143 if test x$is_release = x ; then
144 ac_checking_flags=yes
146 ac_checking_flags=release
148 IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
149 for check in release $ac_checking_flags
152 # these set all the flags to specific states
153 yes|all) ac_checking=1 ; ac_valgrind_checking= ;;
154 no|none|release) ac_checking= ; ac_valgrind_checking= ;;
155 # these enable particular checks
156 misc) ac_checking=1 ;;
157 valgrind) ac_valgrind_checking=1 ;;
164 if test x$ac_checking != x ; then
165 AC_DEFINE(ENABLE_CHECKING, 1,
166 [Define if you want more run-time sanity checks.])
169 if test x$ac_valgrind_checking != x ; then
170 AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
171 [Define if you want to workaround valgrind (a memory checker) warnings about
172 possible memory leaks because of libcpp use of interior pointers.])
175 AC_ARG_ENABLE(canonical-system-headers,
176 [ --enable-canonical-system-headers
177 enable or disable system headers canonicalization],
179 enable_canonical_system_headers=yes)
180 if test $enable_canonical_system_headers != no; then
181 AC_DEFINE(ENABLE_CANONICAL_SYSTEM_HEADERS,
182 1, [Define to enable system headers canonicalization.])
187 AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
188 [AC_DEFINE([HAVE_SSE4], [1],
189 [Define to 1 if you can assemble SSE4 insns.])])
192 # Enable --enable-host-shared.
193 AC_ARG_ENABLE(host-shared,
194 [AS_HELP_STRING([--enable-host-shared],
195 [build host code as shared libraries])],
196 [PICFLAG=-fPIC], [PICFLAG=])
201 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
202 AC_CONFIG_FILES(Makefile)