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