]> git.ipfire.org Git - thirdparty/gcc.git/blob - libcpp/configure.ac
AArch64 [7/10]
[thirdparty/gcc.git] / libcpp / configure.ac
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.64)
5 AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
6 AC_CONFIG_SRCDIR(ucnid.h)
7 AC_CONFIG_MACRO_DIR(../config)
8 AC_CANONICAL_SYSTEM
9
10 # Checks for programs.
11 AC_PROG_MAKE_SET
12 AC_PROG_INSTALL
13 AC_PROG_CC
14 AC_PROG_CXX
15 AC_PROG_RANLIB
16
17 AC_USE_SYSTEM_EXTENSIONS
18 AC_SYS_LARGEFILE
19
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])
24
25 # Figure out what compiler warnings we can enable.
26 # See config/warnings.m4 for details.
27
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])
33
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])
37
38 # Only enable with --enable-werror-always until existing warnings are
39 # corrected.
40 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])
41
42 # Dependency checking.
43 ZW_CREATE_DEPDIR
44 AC_LANG_PUSH([C++])
45 AC_COMPILE_IFELSE([[int i;]], [],
46 [AC_MSG_ERROR([C++ compiler missing or inoperational])])
47 AC_LANG_POP([C++])
48 ZW_PROG_COMPILER_DEPENDENCIES([CXX])
49
50 # Checks for header files.
51 AC_HEADER_TIME
52 ACX_HEADER_STRING
53
54 AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \
55 stdlib.h strings.h string.h sys/file.h unistd.h)
56
57 # Checks for typedefs, structures, and compiler characteristics.
58 AC_C_BIGENDIAN
59 AC_C_CONST
60 AC_C_INLINE
61 AC_FUNC_OBSTACK
62 AC_TYPE_OFF_T
63 AC_TYPE_SIZE_T
64 AC_TYPE_SSIZE_T
65 AC_TYPE_UINTPTR_T
66 AC_CHECK_TYPE(ptrdiff_t, int)
67 AC_STRUCT_TM
68 AC_CHECK_SIZEOF(int)
69 AC_CHECK_SIZEOF(long)
70 define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
71 ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked dnl
72 fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked dnl
73 fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
74 putchar_unlocked putc_unlocked)
75 AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
76 AC_CHECK_DECLS([abort, asprintf, basename(char *), errno, getopt, vasprintf])
77 AC_CHECK_DECLS(m4_split(m4_normalize(libcpp_UNLOCKED_FUNCS)))
78
79 # Checks for library functions.
80 AC_FUNC_ALLOCA
81 AC_HEADER_STDC
82 AM_LANGINFO_CODESET
83 ZW_GNU_GETTEXT_SISTER_DIR
84
85 AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
86 [AC_TRY_COMPILE([
87 #include <sys/types.h>
88 ],
89 [if ((uchar *)0) return 0;
90 if (sizeof(uchar)) return 0;],
91 ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
92 if test $ac_cv_type_uchar = yes; then
93 AC_DEFINE(HAVE_UCHAR, 1,
94 [Define if <sys/types.h> defines \`uchar'.])
95 fi
96
97 # g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different
98 # iconv() prototype.
99 AC_LANG_PUSH([C++])
100 AM_ICONV
101 AC_LANG_POP([C++])
102
103 # More defines and substitutions.
104 PACKAGE="$PACKAGE_TARNAME"
105 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define to the name of this package.])
106 AC_SUBST(PACKAGE)
107
108 if test "x$enable_nls" != xno; then
109 USED_CATALOGS='$(CATALOGS)'
110 else
111 USED_CATALOGS=
112 fi
113 AC_SUBST(USED_CATALOGS)
114
115 AC_ARG_ENABLE(maintainer-mode,
116 [ --enable-maintainer-mode enable rules only needed by maintainers],,
117 enable_maintainer_mode=no)
118
119 if test "x$enable_maintainer_mode" = xno; then
120 MAINT='#'
121 else
122 MAINT=
123 fi
124 AC_SUBST(MAINT)
125
126 AC_ARG_ENABLE(checking,
127 [ --enable-checking enable expensive run-time checks],,
128 enable_checking=no)
129
130 if test $enable_checking != no ; then
131 AC_DEFINE(ENABLE_CHECKING, 1,
132 [Define if you want more run-time sanity checks.])
133 fi
134
135 m4_changequote(,)
136 case $target in
137 aarch64*-*-* | \
138 alpha*-*-* | \
139 arm*-*-*eabi* | \
140 arm*-*-symbianelf* | \
141 x86_64-*-* | \
142 ia64-*-* | \
143 hppa*64*-*-* | \
144 i[34567]86-*-* | x86_64-*-solaris2.1[0-9]* | \
145 mips*-*-* | \
146 mmix-*-* | \
147 powerpc*-*-* | \
148 rs6000*-*-* | \
149 s390*-*-* | \
150 sparc*-*-* | \
151 spu-*-* | \
152 sh[123456789lbe]*-*-* | sh-*-* | \
153 tilegx-*-* | tilepro-*-* )
154 need_64bit_hwint=yes ;;
155 *)
156 need_64bit_hwint=no ;;
157 esac
158
159 case $need_64bit_hwint:$ac_cv_sizeof_long in
160 *:8 | no:*) host_wide_int=long ;;
161 *) host_wide_int='long long' ;;
162 esac
163 m4_changequote([,])
164
165 AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
166 [Define to the widest efficient host integer type at least
167 as wide as the target's size_t type.])
168
169 case $target in
170 i?86-* | x86_64-*)
171 AC_TRY_COMPILE([], [asm ("pcmpestri %0, %%xmm0, %%xmm1" : : "i"(0))],
172 [AC_DEFINE([HAVE_SSE4], [1],
173 [Define to 1 if you can assemble SSE4 insns.])])
174 esac
175
176 # Output.
177
178 AC_CONFIG_HEADERS(config.h:config.in, [echo timestamp > stamp-h1])
179 AC_CONFIG_FILES(Makefile)
180 AC_OUTPUT