]> gcc.gnu.org Git - gcc.git/blame - libcpp/configure.ac
Daily bump.
[gcc.git] / libcpp / configure.ac
CommitLineData
4f4e53dd
PB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
df58e648 4AC_PREREQ(2.64)
4f4e53dd
PB
5AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6AC_CONFIG_SRCDIR(ucnid.h)
88fa57d7 7AC_CONFIG_MACRO_DIR(../config)
4f4e53dd 8AC_CANONICAL_SYSTEM
4f4e53dd
PB
9
10# Checks for programs.
018a4785
ZW
11AC_PROG_MAKE_SET
12AC_PROG_INSTALL
4f4e53dd 13AC_PROG_CC
f1bf410c 14AC_PROG_CXX
4f4e53dd
PB
15AC_PROG_RANLIB
16
0e1a989c 17AC_USE_SYSTEM_EXTENSIONS
480767a9
ILT
18AC_SYS_LARGEFILE
19
f1bf410c
JQ
20# See if we are building gcc with C++.
21# Do this early so setting lang to C++ affects following tests
22AC_ARG_ENABLE(build-with-cxx,
23[ --enable-build-with-cxx build with C++ compiler instead of C compiler],
24ENABLE_BUILD_WITH_CXX=$enableval,
25ENABLE_BUILD_WITH_CXX=no)
26AC_SUBST(ENABLE_BUILD_WITH_CXX)
27
078e3ffe
PB
28MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
29AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
30AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
31AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
32
018a4785
ZW
33# Figure out what compiler warnings we can enable.
34# See config/warnings.m4 for details.
35
25339f10 36ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
f1bf410c
JQ
37 -Wmissing-format-attribute], [warn])
38ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
39 -Wold-style-definition -Wc++-compat], [c_warn])
018a4785
ZW
40ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
41
e9411247
MM
42# Disable exceptions and RTTI if building with g++
43ACX_PROG_CC_WARNING_OPTS(
44 m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
45
018a4785
ZW
46# Only enable with --enable-werror-always until existing warnings are
47# corrected.
48ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
49
f610dd5f
ZW
50# Dependency checking.
51ZW_CREATE_DEPDIR
2b69c841 52if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
f610dd5f 53ZW_PROG_COMPILER_DEPENDENCIES([CC])
f1bf410c 54else
ff5dfc48
JR
55AC_LANG_PUSH([C++])
56AC_COMPILE_IFELSE([[int i;]], [],
57 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
58AC_LANG_POP([C++])
f1bf410c
JQ
59ZW_PROG_COMPILER_DEPENDENCIES([CXX])
60fi
f610dd5f 61
4f4e53dd
PB
62# Checks for header files.
63AC_HEADER_TIME
64ACX_HEADER_STRING
f1bf410c 65
0e1a989c 66AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
f1bf410c 67 stdlib.h strings.h string.h sys/file.h unistd.h)
4f4e53dd
PB
68
69# Checks for typedefs, structures, and compiler characteristics.
246a2fcb 70AC_C_BIGENDIAN
4f4e53dd
PB
71AC_C_CONST
72AC_C_INLINE
73AC_FUNC_OBSTACK
74AC_TYPE_OFF_T
75AC_TYPE_SIZE_T
246a2fcb
RH
76AC_TYPE_SSIZE_T
77AC_TYPE_UINTPTR_T
78AC_CHECK_TYPE(ptrdiff_t, int)
4f4e53dd
PB
79AC_STRUCT_TM
80AC_CHECK_SIZEOF(int)
81AC_CHECK_SIZEOF(long)
0d667716
KG
82define(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)
87AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
c3f247f4
RW
88AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
89AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
4f4e53dd
PB
90
91# Checks for library functions.
92AC_FUNC_ALLOCA
93AC_HEADER_STDC
94AM_LANGINFO_CODESET
95ZW_GNU_GETTEXT_SISTER_DIR
96
97AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
98[AC_TRY_COMPILE([
f78ce0c2 99#include <sys/types.h>
4f4e53dd
PB
100],
101[if ((uchar *)0) return 0;
102 if (sizeof(uchar)) return 0;],
103ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
104if test $ac_cv_type_uchar = yes; then
105 AC_DEFINE(HAVE_UCHAR, 1,
106 [Define if <sys/types.h> defines \`uchar'.])
107fi
108
5b6d595b
RO
109# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
110# iconv() prototype.
111AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"],
112 [AC_LANG_PUSH([C++])
113 AM_ICONV
114 AC_LANG_POP([C++])],
115 [AM_ICONV])
078e3ffe
PB
116
117# More defines and substitutions.
39b8ce7f 118PACKAGE="$PACKAGE_TARNAME"
078e3ffe
PB
119AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
120AC_SUBST(PACKAGE)
121
122if test "x$enable_nls" != xno; then
123 USED_CATALOGS='$(CATALOGS)'
124else
125 USED_CATALOGS=
126fi
127AC_SUBST(USED_CATALOGS)
128
129AC_ARG_ENABLE(maintainer-mode,
130[ --enable-maintainer-mode enable rules only needed by maintainers],,
131enable_maintainer_mode=no)
132
133if test "x$enable_maintainer_mode" = xno; then
134 MAINT='#'
135else
136 MAINT=
137fi
138AC_SUBST(MAINT)
139
4f4e53dd
PB
140AC_ARG_ENABLE(checking,
141[ --enable-checking enable expensive run-time checks],,
142enable_checking=no)
143
144if test $enable_checking != no ; then
145 AC_DEFINE(ENABLE_CHECKING, 1,
146[Define if you want more run-time sanity checks.])
147fi
148
963e23c5 149m4_changequote(,)
4f4e53dd
PB
150case $target in
151 alpha*-*-* | \
077fc835 152 arm*-*-*eabi* | \
b3f8d95d 153 arm*-*-symbianelf* | \
4f4e53dd
PB
154 x86_64-*-* | \
155 ia64-*-* | \
cd985f66 156 hppa*64*-*-* | \
5e9627ca 157 i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \
4f4e53dd
PB
158 mips*-*-* | \
159 mmix-*-* | \
160 powerpc*-*-* | \
161 rs6000*-*-* | \
162 s390*-*-* | \
5f7ca34b 163 sparc*-*-* | \
85d9c13c 164 spu-*-* | \
dd552284
WL
165 sh[123456789lbe]*-*-* | sh-*-* | \
166 tilegx-*-* | tilepro-*-* )
4f4e53dd
PB
167 need_64bit_hwint=yes ;;
168 *)
169 need_64bit_hwint=no ;;
170esac
171
172case $need_64bit_hwint:$ac_cv_sizeof_long in
173 *:8 | no:*) host_wide_int=long ;;
174 *) host_wide_int='long long' ;;
175esac
963e23c5 176m4_changequote([,])
4f4e53dd
PB
177
178AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
179[Define to the widest efficient host integer type at least
180 as wide as the target's size_t type.])
181
6f173e52
RH
182case $target in
183 i?86-* | x86_64-*)
184 AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
185 [AC_DEFINE([HAVE_SSE4], [1],
186 [Define to 1 if you can assemble SSE4 insns.])])
187esac
188
078e3ffe
PB
189# Output.
190
191AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
4f4e53dd
PB
192AC_CONFIG_FILES(Makefile)
193AC_OUTPUT
This page took 0.62523 seconds and 5 git commands to generate.