]> gcc.gnu.org Git - gcc.git/blame - libcpp/configure.ac
i386.md: Use {} for multi-line preparation statements.
[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
42# Only enable with --enable-werror-always until existing warnings are
43# corrected.
44ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
45
f610dd5f
ZW
46# Dependency checking.
47ZW_CREATE_DEPDIR
2b69c841 48if test "$ENABLE_BUILD_WITH_CXX" = "no"; then
f610dd5f 49ZW_PROG_COMPILER_DEPENDENCIES([CC])
f1bf410c 50else
ff5dfc48
JR
51AC_LANG_PUSH([C++])
52AC_COMPILE_IFELSE([[int i;]], [],
53 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
54AC_LANG_POP([C++])
f1bf410c
JQ
55ZW_PROG_COMPILER_DEPENDENCIES([CXX])
56fi
f610dd5f 57
4f4e53dd
PB
58# Checks for header files.
59AC_HEADER_TIME
60ACX_HEADER_STRING
f1bf410c 61
0e1a989c 62AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
f1bf410c 63 stdlib.h strings.h string.h sys/file.h unistd.h)
4f4e53dd
PB
64
65# Checks for typedefs, structures, and compiler characteristics.
246a2fcb 66AC_C_BIGENDIAN
4f4e53dd
PB
67AC_C_CONST
68AC_C_INLINE
69AC_FUNC_OBSTACK
70AC_TYPE_OFF_T
71AC_TYPE_SIZE_T
246a2fcb
RH
72AC_TYPE_SSIZE_T
73AC_TYPE_UINTPTR_T
74AC_CHECK_TYPE(ptrdiff_t, int)
4f4e53dd
PB
75AC_STRUCT_TM
76AC_CHECK_SIZEOF(int)
77AC_CHECK_SIZEOF(long)
0d667716
KG
78define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
79 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
80 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
81 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
82 putchar_unlocked putc_unlocked)
83AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
c3f247f4
RW
84AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
85AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
4f4e53dd
PB
86
87# Checks for library functions.
88AC_FUNC_ALLOCA
89AC_HEADER_STDC
90AM_LANGINFO_CODESET
91ZW_GNU_GETTEXT_SISTER_DIR
92
93AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
94[AC_TRY_COMPILE([
f78ce0c2 95#include <sys/types.h>
4f4e53dd
PB
96],
97[if ((uchar *)0) return 0;
98 if (sizeof(uchar)) return 0;],
99ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
100if test $ac_cv_type_uchar = yes; then
101 AC_DEFINE(HAVE_UCHAR, 1,
102 [Define if <sys/types.h> defines \`uchar'.])
103fi
104
5b6d595b
RO
105# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
106# iconv() prototype.
107AS_IF([test "$ENABLE_BUILD_WITH_CXX" = "yes"],
108 [AC_LANG_PUSH([C++])
109 AM_ICONV
110 AC_LANG_POP([C++])],
111 [AM_ICONV])
078e3ffe
PB
112
113# More defines and substitutions.
39b8ce7f 114PACKAGE="$PACKAGE_TARNAME"
078e3ffe
PB
115AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
116AC_SUBST(PACKAGE)
117
118if test "x$enable_nls" != xno; then
119 USED_CATALOGS='$(CATALOGS)'
120else
121 USED_CATALOGS=
122fi
123AC_SUBST(USED_CATALOGS)
124
125AC_ARG_ENABLE(maintainer-mode,
126[ --enable-maintainer-mode enable rules only needed by maintainers],,
127enable_maintainer_mode=no)
128
129if test "x$enable_maintainer_mode" = xno; then
130 MAINT='#'
131else
132 MAINT=
133fi
134AC_SUBST(MAINT)
135
4f4e53dd
PB
136AC_ARG_ENABLE(checking,
137[ --enable-checking enable expensive run-time checks],,
138enable_checking=no)
139
140if test $enable_checking != no ; then
141 AC_DEFINE(ENABLE_CHECKING, 1,
142[Define if you want more run-time sanity checks.])
143fi
144
963e23c5 145m4_changequote(,)
4f4e53dd
PB
146case $target in
147 alpha*-*-* | \
077fc835 148 arm*-*-*eabi* | \
b3f8d95d 149 arm*-*-symbianelf* | \
4f4e53dd
PB
150 x86_64-*-* | \
151 ia64-*-* | \
cd985f66 152 hppa*64*-*-* | \
5e9627ca 153 i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \
4f4e53dd
PB
154 mips*-*-* | \
155 mmix-*-* | \
156 powerpc*-*-* | \
157 rs6000*-*-* | \
158 s390*-*-* | \
5f7ca34b 159 sparc*-*-* | \
85d9c13c 160 spu-*-* | \
a1fcb9a1 161 sh[123456789lbe]*-*-* | sh-*-*)
4f4e53dd
PB
162 need_64bit_hwint=yes ;;
163 *)
164 need_64bit_hwint=no ;;
165esac
166
167case $need_64bit_hwint:$ac_cv_sizeof_long in
168 *:8 | no:*) host_wide_int=long ;;
169 *) host_wide_int='long long' ;;
170esac
963e23c5 171m4_changequote([,])
4f4e53dd
PB
172
173AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
174[Define to the widest efficient host integer type at least
175 as wide as the target's size_t type.])
176
6f173e52
RH
177case $target in
178 i?86-* | x86_64-*)
179 AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
180 [AC_DEFINE([HAVE_SSE4], [1],
181 [Define to 1 if you can assemble SSE4 insns.])])
182esac
183
078e3ffe
PB
184# Output.
185
186AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
4f4e53dd
PB
187AC_CONFIG_FILES(Makefile)
188AC_OUTPUT
This page took 0.507797 seconds and 5 git commands to generate.