]> gcc.gnu.org Git - gcc.git/blame - libcpp/configure.ac
rtl-optimization/116550 - Add test cases.
[gcc.git] / libcpp / configure.ac
CommitLineData
4f4e53dd
PB
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4f4e53dd
PB
4AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
5AC_CONFIG_SRCDIR(ucnid.h)
88fa57d7 6AC_CONFIG_MACRO_DIR(../config)
4f4e53dd 7AC_CANONICAL_SYSTEM
4f4e53dd
PB
8
9# Checks for programs.
018a4785
ZW
10AC_PROG_MAKE_SET
11AC_PROG_INSTALL
4f4e53dd 12AC_PROG_CC
f1bf410c 13AC_PROG_CXX
4f4e53dd 14AC_PROG_RANLIB
731c4ce0 15AC_CHECK_TOOL(AR, ar)
4f4e53dd 16
0e1a989c 17AC_USE_SYSTEM_EXTENSIONS
480767a9
ILT
18AC_SYS_LARGEFILE
19
078e3ffe
PB
20MISSING=`cd $ac_aux_dir && ${PWDCMD-pwd}`/missing
21AC_CHECK_PROGS([ACLOCAL], [aclocal], [$MISSING aclocal])
22AC_CHECK_PROGS([AUTOCONF], [autoconf], [$MISSING autoconf])
23AC_CHECK_PROGS([AUTOHEADER], [autoheader], [$MISSING autoheader])
24
909b30a1
EG
25if test -z "$ETAGS"; then
26 ETAGS=etags
27fi
28AC_SUBST([ETAGS])
29
018a4785
ZW
30# Figure out what compiler warnings we can enable.
31# See config/warnings.m4 for details.
32
25339f10 33ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wno-narrowing -Wwrite-strings \
f1bf410c
JQ
34 -Wmissing-format-attribute], [warn])
35ACX_PROG_CC_WARNING_OPTS([-Wstrict-prototypes -Wmissing-prototypes \
36 -Wold-style-definition -Wc++-compat], [c_warn])
018a4785
ZW
37ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
38
e9411247
MM
39# Disable exceptions and RTTI if building with g++
40ACX_PROG_CC_WARNING_OPTS(
41 m4_quote(m4_do([-fno-exceptions -fno-rtti])), [noexception_flags])
42
018a4785
ZW
43# Only enable with --enable-werror-always until existing warnings are
44# corrected.
45ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
46
f610dd5f
ZW
47# Dependency checking.
48ZW_CREATE_DEPDIR
ff5dfc48 49AC_LANG_PUSH([C++])
22e05272 50AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])], [],
ff5dfc48
JR
51 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
52AC_LANG_POP([C++])
f1bf410c 53ZW_PROG_COMPILER_DEPENDENCIES([CXX])
f610dd5f 54
4f4e53dd
PB
55# Checks for header files.
56AC_HEADER_TIME
57ACX_HEADER_STRING
f1bf410c 58
0e1a989c 59AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
f1bf410c 60 stdlib.h strings.h string.h sys/file.h unistd.h)
4f4e53dd
PB
61
62# Checks for typedefs, structures, and compiler characteristics.
246a2fcb 63AC_C_BIGENDIAN
4f4e53dd
PB
64AC_C_CONST
65AC_C_INLINE
66AC_FUNC_OBSTACK
67AC_TYPE_OFF_T
68AC_TYPE_SIZE_T
246a2fcb
RH
69AC_TYPE_SSIZE_T
70AC_TYPE_UINTPTR_T
71AC_CHECK_TYPE(ptrdiff_t, int)
edf6ddf6
RB
72AC_TYPE_UINT64_T
73if test x"$ac_cv_c_uint64_t" = x"no"; then
74 AC_MSG_ERROR([uint64_t not found])
75fi
4f4e53dd
PB
76AC_STRUCT_TM
77AC_CHECK_SIZEOF(int)
78AC_CHECK_SIZEOF(long)
0d667716
KG
79define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
80 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
81 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
82 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
83 putchar_unlocked putc_unlocked)
84AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
c3f247f4
RW
85AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
86AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
4f4e53dd
PB
87
88# Checks for library functions.
89AC_FUNC_ALLOCA
90AC_HEADER_STDC
91AM_LANGINFO_CODESET
92ZW_GNU_GETTEXT_SISTER_DIR
93
94AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
95[AC_TRY_COMPILE([
f78ce0c2 96#include <sys/types.h>
4f4e53dd
PB
97],
98[if ((uchar *)0) return 0;
99 if (sizeof(uchar)) return 0;],
100ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
101if test $ac_cv_type_uchar = yes; then
102 AC_DEFINE(HAVE_UCHAR, 1,
103 [Define if <sys/types.h> defines \`uchar'.])
104fi
105
14e0d832
CC
106AC_CHECK_SIZEOF(ino_t)
107AC_CHECK_SIZEOF(dev_t)
108
5b6d595b
RO
109# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
110# iconv() prototype.
0823efed
DN
111AC_LANG_PUSH([C++])
112AM_ICONV
113AC_LANG_POP([C++])
078e3ffe
PB
114
115# More defines and substitutions.
39b8ce7f 116PACKAGE="$PACKAGE_TARNAME"
078e3ffe
PB
117AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
118AC_SUBST(PACKAGE)
119
120if test "x$enable_nls" != xno; then
121 USED_CATALOGS='$(CATALOGS)'
122else
123 USED_CATALOGS=
124fi
125AC_SUBST(USED_CATALOGS)
126
127AC_ARG_ENABLE(maintainer-mode,
128[ --enable-maintainer-mode enable rules only needed by maintainers],,
129enable_maintainer_mode=no)
130
131if test "x$enable_maintainer_mode" = xno; then
132 MAINT='#'
133else
134 MAINT=
135fi
136AC_SUBST(MAINT)
137
1a80db97
JJ
138# Enable expensive internal checks
139is_release=
140if test -f $srcdir/../gcc/DEV-PHASE \
141 && test x"`cat $srcdir/../gcc/DEV-PHASE`" != xexperimental; then
142 is_release=yes
143fi
4f4e53dd 144
1a80db97
JJ
145AC_ARG_ENABLE(checking,
146[AS_HELP_STRING([[--enable-checking[=LIST]]],
147 [enable expensive run-time checks. With LIST,
148 enable only specific categories of checks.
149 Categories are: yes,no,all,none,release.
150 Flags are: misc,valgrind or other strings])],
151[ac_checking_flags="${enableval}"],[
152# Determine the default checks.
153if test x$is_release = x ; then
154 ac_checking_flags=yes
155else
156 ac_checking_flags=release
157fi])
158IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
159for check in release $ac_checking_flags
160do
161 case $check in
162 # these set all the flags to specific states
3549e181
JJ
163 yes|all) ac_checking=1 ; ac_assert_checking=1 ; ac_valgrind_checking= ;;
164 no|none) ac_checking= ; ac_assert_checking= ; ac_valgrind_checking= ;;
165 release) ac_checking= ; ac_assert_checking=1 ; ac_valgrind_checking= ;;
1a80db97 166 # these enable particular checks
3549e181 167 assert) ac_assert_checking=1 ;;
1a80db97
JJ
168 misc) ac_checking=1 ;;
169 valgrind) ac_valgrind_checking=1 ;;
170 # accept
171 *) ;;
172 esac
173done
174IFS="$ac_save_IFS"
175
176if test x$ac_checking != x ; then
7ec491c0
MM
177 AC_DEFINE(CHECKING_P, 1,
178[Define to 1 if you want more run-time sanity checks.])
179else
180 AC_DEFINE(CHECKING_P, 0)
4f4e53dd
PB
181fi
182
3549e181
JJ
183if test x$ac_assert_checking != x ; then
184 AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
185[Define if you want assertions enabled. This is a cheap check.])
186fi
187
5dc99c46
SB
188AC_ARG_ENABLE(canonical-system-headers,
189[ --enable-canonical-system-headers
190 enable or disable system headers canonicalization],
191[],
192enable_canonical_system_headers=yes)
193if test $enable_canonical_system_headers != no; then
194 AC_DEFINE(ENABLE_CANONICAL_SYSTEM_HEADERS,
195 1, [Define to enable system headers canonicalization.])
196fi
197
6f173e52
RH
198case $target in
199 i?86-* | x86_64-*)
20a5b482
AM
200 AC_TRY_COMPILE([], [asm ("pshufb %xmm0, %xmm1")],
201 [AC_DEFINE([HAVE_SSSE3], [1],
202 [Define to 1 if you can assemble SSSE3 insns.])])
6f173e52
RH
203esac
204
459260ec
DM
205# Enable --enable-host-shared.
206AC_ARG_ENABLE(host-shared,
207[AS_HELP_STRING([--enable-host-shared],
b6cb10af
MP
208 [build host code as shared libraries])])
209AC_SUBST(enable_host_shared)
210
211# Enable --enable-host-pie.
212AC_ARG_ENABLE(host-pie,
213[AS_HELP_STRING([--enable-host-pie],
214 [build host code as PIE])])
215AC_SUBST(enable_host_pie)
216
217if test x$enable_host_shared = xyes; then
218 PICFLAG=-fPIC
219elif test x$enable_host_pie = xyes; then
220 PICFLAG=-fPIE
221else
222 PICFLAG=
223fi
224
459260ec
DM
225AC_SUBST(PICFLAG)
226
051da742
L
227# Enable Intel CET on Intel CET enabled host if jit is enabled.
228GCC_CET_HOST_FLAGS(CET_HOST_FLAGS)
229case x$enable_languages in
230*jit*)
231 ;;
232*)
233 CET_HOST_FLAGS=
234 ;;
235esac
236AC_SUBST(CET_HOST_FLAGS)
237
ceb17928
ML
238AC_ARG_ENABLE(valgrind-annotations,
239[AS_HELP_STRING([--enable-valgrind-annotations],
240 [enable valgrind runtime interaction])], [],
241[enable_valgrind_annotations=no])
242if test x$enable_valgrind_annotations != xno \
243 || test x$ac_valgrind_checking != x; then
ab78426a
AM
244 AC_DEFINE(ENABLE_VALGRIND_WORKAROUNDS, 1,
245[Define if you want to workaround Valgrind warnings about
246 possible memory leaks because of libcpp use of interior pointers.])
ceb17928
ML
247fi
248
078e3ffe
PB
249# Output.
250
251AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
4f4e53dd
PB
252AC_CONFIG_FILES(Makefile)
253AC_OUTPUT
This page took 1.743925 seconds and 6 git commands to generate.