]>
Commit | Line | Data |
---|---|---|
3a24bf5d | 1 | # Process this file with autoreconf to produce a configure script. |
b2dad0e3 | 2 | |
fbe057bb | 3 | AC_INIT(package-unused, version-unused,, libstdc++) |
8bae34da | 4 | AC_CONFIG_SRCDIR(src/shared/hashtable-aux.cc) |
ff66d28f | 5 | AC_CONFIG_HEADER(config.h) |
e2c20fae | 6 | |
6706f116 AO |
7 | # This works around the fact that libtool configuration may change LD |
8 | # for this particular configuration, but some shells, instead of | |
9 | # keeping the changes in LD private, export them just because LD is | |
2c839a4e | 10 | # exported. Only used at the end of this file. |
ff66d28f | 11 | ### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD |
6706f116 | 12 | |
ff66d28f | 13 | # Find the rest of the source tree framework. |
076e5443 | 14 | AM_ENABLE_MULTILIB(, ..) |
aebb8c22 | 15 | |
58b08ac3 | 16 | # Gets build, host, target, *_vendor, *_cpu, *_os, etc. |
2c839a4e PE |
17 | # |
18 | # You will slowly go insane if you do not grok the following fact: when | |
19 | # building v3 as part of the compiler, the top-level /target/ becomes the | |
ff66d28f | 20 | # library's /host/. configure then causes --target to default to --host, |
2c839a4e PE |
21 | # exactly like any other package using autoconf. Therefore, 'target' and |
22 | # 'host' will always be the same. This makes sense both for native and | |
23 | # cross compilers, just think about it for a little while. :-) | |
24 | # | |
25 | # Also, if v3 is being configured as part of a cross compiler, the top-level | |
26 | # configure script will pass the "real" host as $with_cross_host. | |
27 | # | |
ff66d28f PE |
28 | # Do not delete or change the following two lines. For why, see |
29 | # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html | |
b2dad0e3 | 30 | AC_CANONICAL_SYSTEM |
ff66d28f PE |
31 | target_alias=${target_alias-$host_alias} |
32 | ||
33 | # Handy for debugging: | |
34 | #AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5 | |
35 | ||
0df3f383 PE |
36 | if test "$build" != "$host"; then |
37 | # We are being configured with some form of cross compiler. | |
38 | GLIBCXX_IS_NATIVE=false | |
0646b059 GK |
39 | case "$host","$target" in |
40 | # Darwin crosses can use the host system's libraries and headers, | |
41 | # because of the fat library support. Of course, it must be the | |
42 | # same version of Darwin on both sides. Allow the user to | |
43 | # just say --target=foo-darwin without a version number to mean | |
44 | # "the version on this system". | |
45 | *-*-darwin*,*-*-darwin*) | |
46 | hostos=`echo $host | sed 's/.*-darwin/darwin/'` | |
47 | targetos=`echo $target | sed 's/.*-darwin/darwin/'` | |
0ed5259c | 48 | if test $hostos = $targetos || test $targetos = darwin ; then |
0646b059 GK |
49 | GLIBCXX_IS_NATIVE=true |
50 | fi | |
51 | ;; | |
52 | ||
53 | *) | |
54 | GCC_NO_EXECUTABLES | |
55 | ;; | |
56 | esac | |
0df3f383 PE |
57 | else |
58 | GLIBCXX_IS_NATIVE=true | |
59 | fi | |
60 | ||
bcb1f438 AA |
61 | # In the case that we're building without headers, we won't have <stdio.h> |
62 | # available. In these cases, we have to instruct autotools to never include | |
63 | # <stdio.h> as a part of default headers. | |
64 | m4_version_prereq([2.70], [], [ | |
65 | if test "x$with_headers" = "xno"; then | |
66 | ac_includes_default=`echo "$ac_includes_default" | sed '/^#include <stdio.h>$/d'` | |
67 | fi | |
68 | ]) | |
69 | ||
ff66d28f PE |
70 | # Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the |
71 | # following is magically included in AUTOMAKE_OPTIONS in each Makefile.am. | |
72 | # 1.x: minimum required version | |
73 | # no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch | |
74 | # of other PACKAGE_* variables will, however, and there's nothing | |
fbe057bb | 75 | # we can do about that; they come from AC_INIT). |
ff66d28f PE |
76 | # foreign: we don't follow the normal rules for GNU packages (no COPYING |
77 | # file in the top srcdir, etc, etc), so stop complaining. | |
78 | # no-dependencies: turns off auto dependency generation (just for now) | |
13917ae3 | 79 | # no-dist: we don't want 'dist' and related rules. |
2d52e9e3 PE |
80 | # -Wall: turns on all automake warnings... |
81 | # -Wno-portability: ...except this one, since GNU make is now required. | |
13917ae3 | 82 | AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dependencies no-dist -Wall -Wno-portability -Wno-override]) |
3a24bf5d KC |
83 | AH_TEMPLATE(PACKAGE, [Name of package]) |
84 | AH_TEMPLATE(VERSION, [Version number of package]) | |
ff66d28f | 85 | |
ae66da3b RW |
86 | # -fno-builtin must be present here so that a non-conflicting form of |
87 | # std::exit can be guessed by AC_PROG_CXX, and used in later tests. | |
88 | ||
ae66da3b RW |
89 | save_CXXFLAGS="$CXXFLAGS" |
90 | CXXFLAGS="$CXXFLAGS -fno-builtin" | |
91 | AC_PROG_CC | |
92 | AC_PROG_CXX | |
93 | CXXFLAGS="$save_CXXFLAGS" | |
ae66da3b | 94 | |
2fc11587 JW |
95 | AC_SYS_LARGEFILE |
96 | ||
ae66da3b | 97 | # Runs configure.host, and assorted other critical bits. Sets |
ff66d28f PE |
98 | # up critical shell variables. |
99 | GLIBCXX_CONFIGURE | |
100 | ||
ac6d1200 | 101 | # Libtool setup. |
68c2e9e9 JW |
102 | if test "x${with_newlib}" != "xyes" && |
103 | test "x${with_avrlibc}" != "xyes" && | |
104 | test "x$with_headers" != "xno"; then | |
be95b355 BS |
105 | AC_LIBTOOL_DLOPEN |
106 | fi | |
5780a46b | 107 | AM_PROG_LIBTOOL |
7de6ba7a | 108 | ACX_LT_HOST_FLAGS |
34791641 PE |
109 | AC_SUBST(enable_shared) |
110 | AC_SUBST(enable_static) | |
6a6d3817 | 111 | AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes]) |
04e78786 | 112 | |
2077db1b CT |
113 | if test "$enable_vtable_verify" = yes; then |
114 | predep_objects_CXX="${predep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_start.o" | |
115 | postdep_objects_CXX="${postdep_objects_CXX} ${glibcxx_builddir}/../libgcc/vtv_end.o" | |
116 | fi | |
117 | ||
118 | ||
ac6d1200 BK |
119 | # libtool variables for C++ shared and position-independent compiles. |
120 | # | |
121 | # Use glibcxx_lt_pic_flag to designate the automake variable | |
122 | # used to encapsulate the default libtool approach to creating objects | |
123 | # with position-independent code. Default: -prefer-pic. | |
124 | # | |
125 | # Use glibcxx_compiler_shared_flag to designate a compile-time flags for | |
126 | # creating shared objects. Default: -D_GLIBCXX_SHARED. | |
127 | # | |
128 | # Use glibcxx_compiler_pic_flag to designate a compile-time flags for | |
129 | # creating position-independent objects. This varies with the target | |
130 | # hardware and operating system, but is often: -DPIC -fPIC. | |
131 | if test "$enable_shared" = yes; then | |
132 | glibcxx_lt_pic_flag="-prefer-pic" | |
133 | glibcxx_compiler_pic_flag="$lt_prog_compiler_pic_CXX" | |
134 | glibcxx_compiler_shared_flag="-D_GLIBCXX_SHARED" | |
135 | ||
136 | else | |
137 | glibcxx_lt_pic_flag= | |
138 | glibcxx_compiler_pic_flag= | |
139 | glibcxx_compiler_shared_flag= | |
140 | fi | |
141 | AC_SUBST(glibcxx_lt_pic_flag) | |
142 | AC_SUBST(glibcxx_compiler_pic_flag) | |
143 | AC_SUBST(glibcxx_compiler_shared_flag) | |
144 | ||
145 | # Override the libtool's pic_flag and pic_mode. | |
146 | # Do this step after AM_PROG_LIBTOOL, but before AC_OUTPUT. | |
147 | # NB: this impacts --with-pic and --without-pic. | |
148 | lt_prog_compiler_pic_CXX="$glibcxx_compiler_pic_flag $glibcxx_compiler_shared_flag" | |
149 | pic_mode='default' | |
150 | ||
a6918ffd RW |
151 | # Eliminate -lstdc++ addition to postdeps for cross compiles. |
152 | postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` | |
153 | ||
92eabea2 | 154 | # Possibly disable most of the library. |
347669a0 | 155 | ## TODO: Consider skipping unncessary tests altogether in this case, rather |
92eabea2 PE |
156 | ## than just ignoring the results. Faster /and/ more correct, win win. |
157 | GLIBCXX_ENABLE_HOSTED | |
158 | ||
5a86d36f SH |
159 | # Enable descriptive messages to standard output on termination. |
160 | GLIBCXX_ENABLE_VERBOSE | |
161 | ||
0646d8a3 | 162 | # Enable compiler support that doesn't require linking. |
92eabea2 | 163 | GLIBCXX_ENABLE_PCH($is_hosted) |
e55d0e35 | 164 | GLIBCXX_ENABLE_THREADS |
f958e3ca | 165 | GLIBCXX_ENABLE_ATOMIC_BUILTINS |
da29d2a3 | 166 | GLIBCXX_ENABLE_LOCK_POLICY |
4cdc8761 | 167 | GLIBCXX_ENABLE_DECIMAL_FLOAT |
ad0a3be4 | 168 | GLIBCXX_ENABLE_FLOAT128 |
bb59f396 MG |
169 | if test "$enable_float128" = yes; then |
170 | port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/abi/pre/float128.ver" | |
171 | fi | |
e55d0e35 | 172 | |
b8c41c8e | 173 | # Checks for compiler support that doesn't require linking. |
e55d0e35 | 174 | GLIBCXX_CHECK_COMPILER_FEATURES |
b2dad0e3 | 175 | |
1894e4c5 | 176 | # Enable all the variable C++ runtime options that don't require linking. |
3d7c150e BK |
177 | GLIBCXX_ENABLE_CSTDIO |
178 | GLIBCXX_ENABLE_CLOCALE | |
8b0d6051 | 179 | GLIBCXX_ENABLE_ALLOCATOR |
ff66d28f | 180 | GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host |
3d7c150e | 181 | GLIBCXX_ENABLE_LONG_LONG([yes]) |
347669a0 | 182 | GLIBCXX_ENABLE_WCHAR_T([yes]) |
8a9b2875 | 183 | GLIBCXX_ENABLE_C99([yes]) |
ff66d28f | 184 | GLIBCXX_ENABLE_CONCEPT_CHECKS([no]) |
fe3e9780 | 185 | GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0 -D_GLIBCXX_ASSERTIONS"]) |
3d7c150e | 186 | GLIBCXX_ENABLE_DEBUG([no]) |
6995087d | 187 | GLIBCXX_ENABLE_PARALLEL([yes]) |
ff66d28f | 188 | GLIBCXX_ENABLE_CXX_FLAGS |
1165dc50 | 189 | GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no]) |
ed4f96af | 190 | GLIBCXX_ENABLE_EXTERN_TEMPLATE([yes]) |
2a5d011c | 191 | GLIBCXX_ENABLE_PYTHON |
c3be340e | 192 | GLIBCXX_ENABLE_WERROR([no]) |
2077db1b | 193 | GLIBCXX_ENABLE_VTABLE_VERIFY([no]) |
b2dad0e3 | 194 | |
b8c41c8e | 195 | # Checks for operating systems support that doesn't require linking. |
1b6ce36f | 196 | GLIBCXX_CHECK_STDIO_PROTO |
ef3a7506 | 197 | GLIBCXX_CHECK_MATH11_PROTO |
20b5f0b3 | 198 | GLIBCXX_CHECK_UCHAR_H |
974e336b | 199 | |
74745ec5 PC |
200 | # For LFS support. |
201 | GLIBCXX_CHECK_LFS | |
202 | ||
203 | # For showmanyc_helper(). | |
204 | AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) | |
205 | GLIBCXX_CHECK_POLL | |
206 | GLIBCXX_CHECK_S_ISREG_OR_S_IFREG | |
207 | ||
208 | # For xsputn_2(). | |
209 | AC_CHECK_HEADERS(sys/uio.h) | |
210 | GLIBCXX_CHECK_WRITEV | |
211 | ||
5e5f34bf SE |
212 | # Check for fenv.h and complex.h before GLIBCXX_CHECK_C99_TR1 |
213 | # so that the check is done with the C compiler (not C++). | |
214 | # Checking with C++ can break a canadian cross build if either | |
215 | # file does not exist in C but does in C++. | |
216 | AC_CHECK_HEADERS(fenv.h complex.h) | |
217 | ||
0f24e8de PC |
218 | # For C99 support to TR1. |
219 | GLIBCXX_CHECK_C99_TR1 | |
220 | ||
ddc9c40d PC |
221 | # For the EOF, SEEK_CUR, and SEEK_END integer constants. |
222 | GLIBCXX_COMPUTE_STDIO_INTEGER_CONSTANTS | |
974e336b | 223 | |
610870b2 PC |
224 | # For gettimeofday support. |
225 | GLIBCXX_CHECK_GETTIMEOFDAY | |
226 | ||
959d14e1 | 227 | # For clock_gettime, nanosleep and sched_yield support. |
88b1a025 | 228 | GLIBCXX_ENABLE_LIBSTDCXX_TIME |
610870b2 | 229 | |
7370b9df BRF |
230 | # Check for tmpnam which is obsolescent in POSIX.1-2008 |
231 | GLIBCXX_CHECK_TMPNAM | |
232 | ||
ad4d1d21 MC |
233 | # For pthread_cond_clockwait |
234 | GLIBCXX_CHECK_PTHREAD_COND_CLOCKWAIT | |
235 | ||
3b2fb543 MC |
236 | # For pthread_mutex_clocklock |
237 | GLIBCXX_CHECK_PTHREAD_MUTEX_CLOCKLOCK | |
238 | ||
ab40695a MC |
239 | # For pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock |
240 | GLIBCXX_CHECK_PTHREAD_RWLOCK_CLOCKLOCK | |
241 | ||
99bf8d16 PC |
242 | AC_LC_MESSAGES |
243 | ||
43653c33 JW |
244 | # For hardware_concurrency |
245 | AC_CHECK_HEADERS(sys/sysinfo.h) | |
246 | GLIBCXX_CHECK_GET_NPROCS | |
247 | AC_CHECK_HEADERS(unistd.h) | |
248 | GLIBCXX_CHECK_SC_NPROCESSORS_ONLN | |
5ee360d0 JW |
249 | GLIBCXX_CHECK_SC_NPROC_ONLN |
250 | GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP | |
251 | GLIBCXX_CHECK_SYSCTL_HW_NCPU | |
d74e340d | 252 | GLIBCXX_CHECK_SDT_H |
43653c33 | 253 | |
74745ec5 | 254 | # Check for available headers. |
a1360f57 SR |
255 | AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \ |
256 | locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \ | |
74745ec5 | 257 | strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \ |
d74e340d | 258 | sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \ |
dac867c9 UB |
259 | wchar.h wctype.h linux/types.h]) |
260 | ||
261 | AC_CHECK_HEADERS([linux/random.h], [], [], | |
262 | [[#ifdef HAVE_LINUX_TYPES_H | |
263 | # include <linux/types.h> | |
264 | #endif | |
265 | ]]) | |
74745ec5 | 266 | |
932fbc86 JW |
267 | AC_CHECK_HEADERS([xlocale.h]) |
268 | ||
6995087d | 269 | # Only do link tests if native. Else, hardcode. |
000f8b9a | 270 | if $GLIBCXX_IS_NATIVE; then |
b2dad0e3 | 271 | |
0df3f383 PE |
272 | # We can do more elaborate tests that assume a working linker. |
273 | CANADIAN=no | |
274 | ||
0df3f383 PE |
275 | GLIBCXX_CHECK_LINKER_FEATURES |
276 | GLIBCXX_CHECK_MATH_SUPPORT | |
0df3f383 PE |
277 | GLIBCXX_CHECK_STDLIB_SUPPORT |
278 | ||
5ae2c32a JW |
279 | # For /dev/random and /dev/urandom for std::random_device. |
280 | GLIBCXX_CHECK_DEV_RANDOM | |
d8bc9819 | 281 | |
cddfb1c7 BK |
282 | # For TLS support. |
283 | GCC_CHECK_TLS | |
284 | ||
2a792efe | 285 | AC_CHECK_FUNCS(__cxa_thread_atexit_impl __cxa_thread_atexit) |
af63ba4b | 286 | AC_CHECK_FUNCS(aligned_alloc posix_memalign memalign _aligned_malloc) |
b0292359 | 287 | AC_CHECK_FUNCS(_wfopen) |
3dbd4d94 | 288 | AC_CHECK_FUNCS(secure_getenv) |
bed152e3 | 289 | |
a61ae535 JW |
290 | # C11 functions for C++17 library |
291 | AC_CHECK_FUNCS(timespec_get) | |
292 | ||
187fdaea JW |
293 | # For Networking TS. |
294 | AC_CHECK_FUNCS(sockatmark) | |
295 | ||
932fbc86 JW |
296 | # Non-standard functions used by C++17 std::from_chars |
297 | AC_CHECK_FUNCS(uselocale) | |
298 | ||
5f34ed87 BK |
299 | # For iconv support. |
300 | AM_ICONV | |
301 | ||
000f8b9a | 302 | else |
eebc608e | 303 | |
2c839a4e PE |
304 | # This lets us hard-code the functionality we know we'll have in the cross |
305 | # target environment. "Let" is a sugar-coated word placed on an especially | |
306 | # dull and tedious hack, actually. | |
307 | # | |
3d7c150e | 308 | # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros |
2c839a4e PE |
309 | # that involve linking, can't be used: |
310 | # "cannot open sim-crt0.o" | |
311 | # "cannot open crt0.o" | |
312 | # etc. All this is because there currently exists no unified, consistent | |
313 | # way for top level CC information to be passed down to target directories: | |
314 | # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc. | |
315 | # When all of that is done, all of this hokey, excessive AC_DEFINE junk for | |
316 | # crosses can be removed. | |
317 | ||
318 | # If Canadian cross, then don't pick up tools from the build directory. | |
0df3f383 | 319 | # Used only in GLIBCXX_EXPORT_INCLUDES. |
ff66d28f | 320 | if test -n "$with_cross_host" && |
f5cf58dd | 321 | test x"$build_alias" != x"$with_cross_host" && |
ff66d28f PE |
322 | test x"$build" != x"$target"; |
323 | then | |
b2dad0e3 | 324 | CANADIAN=yes |
b2dad0e3 BK |
325 | else |
326 | CANADIAN=no | |
b2dad0e3 BK |
327 | fi |
328 | ||
75940b88 | 329 | # Construct crosses by hand, eliminating bits that need ld... |
3d7c150e | 330 | # GLIBCXX_CHECK_MATH_SUPPORT |
75940b88 | 331 | |
ff66d28f PE |
332 | # First, test for "known" system libraries. We may be using newlib even |
333 | # on a hosted environment. | |
000f8b9a | 334 | if test "x${with_newlib}" = "xyes"; then |
ff66d28f PE |
335 | os_include_dir="os/newlib" |
336 | AC_DEFINE(HAVE_HYPOT) | |
337 | ||
338 | # GLIBCXX_CHECK_STDLIB_SUPPORT | |
b25e6b79 | 339 | AC_DEFINE(HAVE_STRTOF) |
ff66d28f PE |
340 | |
341 | AC_DEFINE(HAVE_ACOSF) | |
342 | AC_DEFINE(HAVE_ASINF) | |
343 | AC_DEFINE(HAVE_ATAN2F) | |
344 | AC_DEFINE(HAVE_ATANF) | |
345 | AC_DEFINE(HAVE_CEILF) | |
ff66d28f PE |
346 | AC_DEFINE(HAVE_COSF) |
347 | AC_DEFINE(HAVE_COSHF) | |
348 | AC_DEFINE(HAVE_EXPF) | |
349 | AC_DEFINE(HAVE_FABSF) | |
350 | AC_DEFINE(HAVE_FLOORF) | |
351 | AC_DEFINE(HAVE_FMODF) | |
352 | AC_DEFINE(HAVE_FREXPF) | |
c6c42819 | 353 | AC_DEFINE(HAVE_HYPOTF) |
ff66d28f PE |
354 | AC_DEFINE(HAVE_LDEXPF) |
355 | AC_DEFINE(HAVE_LOG10F) | |
356 | AC_DEFINE(HAVE_LOGF) | |
357 | AC_DEFINE(HAVE_MODFF) | |
358 | AC_DEFINE(HAVE_POWF) | |
359 | AC_DEFINE(HAVE_SINF) | |
360 | AC_DEFINE(HAVE_SINHF) | |
361 | AC_DEFINE(HAVE_SQRTF) | |
362 | AC_DEFINE(HAVE_TANF) | |
363 | AC_DEFINE(HAVE_TANHF) | |
517da0ce | 364 | |
c6c42819 JB |
365 | dnl # Support for the long version of some math libraries depends on |
366 | dnl # architecture and newlib version. So test for their availability | |
367 | dnl # rather than hardcoding that information. | |
368 | GLIBCXX_CHECK_MATH_DECLS([ | |
369 | acosl asinl atan2l atanl ceill coshl cosl expl fabsl floorl fmodl | |
370 | frexpl hypotl ldexpl log10l logl modfl powl sinhl sinl sqrtl | |
371 | tanhl tanl]) | |
372 | ||
5f34ed87 | 373 | AC_DEFINE(HAVE_ICONV) |
7be8d663 | 374 | AC_DEFINE(HAVE_MEMALIGN) |
e0466d32 SH |
375 | |
376 | case "${target}" in | |
377 | *-rtems*) | |
378 | case "${target}" in | |
379 | bfin* | lm32* | mips* | moxie* | or1k* | v850*) | |
380 | ;; | |
381 | *) | |
382 | AC_DEFINE(HAVE_TLS) | |
383 | ;; | |
384 | esac | |
385 | AC_DEFINE(HAVE_ALIGNED_ALLOC) | |
386 | AC_DEFINE(HAVE_AT_QUICK_EXIT) | |
387 | AC_DEFINE(HAVE_LINK) | |
e0466d32 SH |
388 | AC_DEFINE(HAVE_QUICK_EXIT) |
389 | AC_DEFINE(HAVE_READLINK) | |
390 | AC_DEFINE(HAVE_SETENV) | |
391 | AC_DEFINE(HAVE_SLEEP) | |
392 | AC_DEFINE(HAVE_SOCKATMARK) | |
393 | AC_DEFINE(HAVE_STRERROR_L) | |
394 | AC_DEFINE(HAVE_SYMLINK) | |
395 | AC_DEFINE(HAVE_TRUNCATE) | |
396 | AC_DEFINE(HAVE_USLEEP) | |
397 | ;; | |
398 | esac | |
000f8b9a | 399 | elif test "x$with_headers" != "xno"; then |
c41f82b2 | 400 | GLIBCXX_CROSSCONFIG |
000f8b9a | 401 | fi |
75940b88 SE |
402 | |
403 | # At some point, we should differentiate between architectures | |
404 | # like x86, which have long double versions, and alpha/powerpc/etc., | |
405 | # which don't. For the time being, punt. | |
000f8b9a | 406 | if test x"long_double_math_on_this_cpu" = x"yes"; then |
75940b88 SE |
407 | AC_DEFINE(HAVE_ACOSL) |
408 | AC_DEFINE(HAVE_ASINL) | |
409 | AC_DEFINE(HAVE_ATAN2L) | |
410 | AC_DEFINE(HAVE_ATANL) | |
411 | AC_DEFINE(HAVE_CEILL) | |
75940b88 SE |
412 | AC_DEFINE(HAVE_COSL) |
413 | AC_DEFINE(HAVE_COSHL) | |
414 | AC_DEFINE(HAVE_EXPL) | |
415 | AC_DEFINE(HAVE_FABSL) | |
75940b88 SE |
416 | AC_DEFINE(HAVE_FLOORL) |
417 | AC_DEFINE(HAVE_FMODL) | |
418 | AC_DEFINE(HAVE_FREXPL) | |
75940b88 SE |
419 | AC_DEFINE(HAVE_LDEXPL) |
420 | AC_DEFINE(HAVE_LOG10L) | |
421 | AC_DEFINE(HAVE_LOGL) | |
422 | AC_DEFINE(HAVE_MODFL) | |
423 | AC_DEFINE(HAVE_POWL) | |
424 | AC_DEFINE(HAVE_SINCOSL) | |
425 | AC_DEFINE(HAVE_SINL) | |
426 | AC_DEFINE(HAVE_SINHL) | |
427 | AC_DEFINE(HAVE_SQRTL) | |
428 | AC_DEFINE(HAVE_TANL) | |
429 | AC_DEFINE(HAVE_TANHL) | |
000f8b9a JW |
430 | fi |
431 | fi | |
b2dad0e3 | 432 | |
bc3f0248 SE |
433 | # Check for _Unwind_GetIPInfo. |
434 | GCC_CHECK_UNWIND_GETIPINFO | |
435 | ||
0f3e711e JJ |
436 | GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) |
437 | ||
3d7c150e | 438 | GLIBCXX_ENABLE_SYMVERS([yes]) |
2799d972 BK |
439 | AC_SUBST(libtool_VERSION) |
440 | ||
dbe17524 | 441 | GLIBCXX_ENABLE_LIBSTDCXX_VISIBILITY([yes]) |
fe413112 | 442 | |
34a2b755 JW |
443 | GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI([yes]) |
444 | GLIBCXX_DEFAULT_ABI | |
375f837b | 445 | |
6defecc2 | 446 | ac_ldbl_compat=no |
7c1e7eed JW |
447 | ac_ldbl_alt128_compat=no |
448 | ac_ldbl_ieee128_default=no | |
6d49b790 | 449 | LONG_DOUBLE_COMPAT_FLAGS="-mlong-double-64" |
7c1e7eed JW |
450 | LONG_DOUBLE_128_FLAGS= |
451 | LONG_DOUBLE_ALT128_COMPAT_FLAGS= | |
6defecc2 | 452 | case "$target" in |
f7cc5390 | 453 | powerpc*-*-linux* | \ |
6defecc2 JJ |
454 | sparc*-*-linux* | \ |
455 | s390*-*-linux* | \ | |
456 | alpha*-*-linux*) | |
457 | AC_TRY_COMPILE(, [ | |
458 | #if !defined __LONG_DOUBLE_128__ || (defined(__sparc__) && defined(__arch64__)) | |
459 | #error no need for long double compatibility | |
460 | #endif | |
461 | ], [ac_ldbl_compat=yes], [ac_ldbl_compat=no]) | |
000f8b9a | 462 | if test "$ac_ldbl_compat" = yes; then |
6defecc2 JJ |
463 | AC_DEFINE([_GLIBCXX_LONG_DOUBLE_COMPAT],1, |
464 | [Define if compatibility should be provided for -mlong-double-64.]) | |
465 | port_specific_symbol_files="\$(top_srcdir)/config/os/gnu-linux/ldbl-extra.ver" | |
6d49b790 AM |
466 | case "$target" in |
467 | powerpc*-*-linux*) | |
7c1e7eed JW |
468 | LONG_DOUBLE_COMPAT_FLAGS="$LONG_DOUBLE_COMPAT_FLAGS -mno-gnu-attribute" |
469 | # Check for IEEE128 support in libm: | |
470 | AC_CHECK_LIB(m, __frexpieee128, | |
471 | [ac_ldbl_ieee128_in_libc=yes], | |
472 | [ac_ldbl_ieee128_in_libc=no]) | |
473 | if test $ac_ldbl_ieee128_in_libc = yes; then | |
474 | # Determine which long double format is the compiler's default: | |
475 | AC_TRY_COMPILE(, [ | |
476 | #ifndef __LONG_DOUBLE_IEEE128__ | |
477 | #error compiler defaults to ibm128 | |
478 | #endif | |
479 | ], [ac_ldbl_ieee128_default=yes], [ac_ldbl_ieee128_default=no]) | |
480 | # Library objects should use default long double format. | |
481 | if test "$ac_ldbl_ieee128_default" = yes; then | |
482 | LONG_DOUBLE_128_FLAGS="-mno-gnu-attribute" | |
483 | # Except for the ones that explicitly use these flags: | |
484 | LONG_DOUBLE_ALT128_COMPAT_FLAGS="-mabi=ibmlongdouble -mno-gnu-attribute -Wno-psabi" | |
485 | else | |
486 | LONG_DOUBLE_128_FLAGS="-mno-gnu-attribute" | |
487 | LONG_DOUBLE_ALT128_COMPAT_FLAGS="-mabi=ieeelongdouble -mno-gnu-attribute -Wno-psabi" | |
488 | fi | |
489 | AC_DEFINE([_GLIBCXX_LONG_DOUBLE_ALT128_COMPAT],1, | |
490 | [Define if compatibility should be provided for alternative 128-bit long double formats.]) | |
491 | port_specific_symbol_files="$port_specific_symbol_files \$(top_srcdir)/config/os/gnu-linux/ldbl-ieee128-extra.ver" | |
492 | ac_ldbl_alt128_compat=yes | |
493 | else | |
494 | ac_ldbl_alt128_compat=no | |
495 | fi | |
496 | ;; | |
6d49b790 | 497 | esac |
000f8b9a | 498 | fi |
6defecc2 | 499 | esac |
6d49b790 | 500 | AC_SUBST(LONG_DOUBLE_COMPAT_FLAGS) |
7c1e7eed JW |
501 | AC_SUBST(LONG_DOUBLE_128_FLAGS) |
502 | AC_SUBST(LONG_DOUBLE_ALT128_COMPAT_FLAGS) | |
6defecc2 | 503 | GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_COMPAT, test $ac_ldbl_compat = yes) |
7c1e7eed | 504 | GLIBCXX_CONDITIONAL(GLIBCXX_LDBL_ALT128_COMPAT, test $ac_ldbl_alt128_compat = yes) |
6defecc2 | 505 | |
9520425b | 506 | # Check if assembler supports disabling hardware capability support. |
1ec62aa9 | 507 | GCC_CHECK_ASSEMBLER_HWCAP |
9520425b | 508 | |
3ca6351d UD |
509 | # Check if assembler supports rdrand opcode. |
510 | GLIBCXX_CHECK_X86_RDRAND | |
b0c0d878 JW |
511 | # Check if assembler supports rdseed opcode. |
512 | GLIBCXX_CHECK_X86_RDSEED | |
3ca6351d | 513 | |
3439657b JW |
514 | # Check for other random number APIs |
515 | GLIBCXX_CHECK_GETENTROPY | |
516 | GLIBCXX_CHECK_ARC4RANDOM | |
517 | ||
ff66d28f | 518 | # This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE. |
3d7c150e | 519 | GLIBCXX_CONFIGURE_TESTSUITE |
c4c064e7 | 520 | |
bae868fb RO |
521 | # For gthread support. Depends on GLIBCXX_ENABLE_SYMVERS. |
522 | GLIBCXX_CHECK_GTHREADS | |
523 | ||
0ca7ba9a | 524 | # For Filesystem TS. |
bf53e6a9 | 525 | AC_CHECK_HEADERS([fcntl.h dirent.h sys/statvfs.h utime.h]) |
0ca7ba9a JW |
526 | GLIBCXX_ENABLE_FILESYSTEM_TS |
527 | GLIBCXX_CHECK_FILESYSTEM_DEPS | |
528 | ||
3acb929c JW |
529 | GLIBCXX_ENABLE_BACKTRACE |
530 | ||
82a0f2fd JW |
531 | # For Networking TS. |
532 | AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h netdb.h arpa/inet.h netinet/in.h netinet/tcp.h]) | |
1cacdef0 JW |
533 | AC_CHECK_DECL(F_GETFL,,,[#include <fcntl.h>]) |
534 | AC_CHECK_DECL(F_SETFL,,,[#include <fcntl.h>]) | |
535 | if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then | |
536 | AC_CHECK_DECL(O_NONBLOCK,,,[#include <fcntl.h>]) | |
cd67d138 | 537 | fi |
82a0f2fd | 538 | |
a04d5fc9 TR |
539 | # For Transactional Memory TS |
540 | GLIBCXX_CHECK_SIZE_T_MANGLING | |
541 | ||
ed3cb497 PN |
542 | # Check which release added std::exception_ptr for the target |
543 | GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER | |
544 | ||
637e3668 JW |
545 | # For libsupc++/eh_alloc.cc defaults. |
546 | GLIBCXX_EMERGENCY_EH_ALLOC | |
547 | ||
9fc61d45 JW |
548 | # For src/c++20/tzdb.cc defaults. |
549 | GLIBCXX_ZONEINFO_DIR | |
550 | ||
94a311ab JW |
551 | # For src/c++11/shared_ptr.cc alignment. |
552 | GLIBCXX_CHECK_ALIGNAS_CACHELINE | |
553 | ||
fe2651af JW |
554 | # For using init_priority in ios_init.cc |
555 | GLIBCXX_CHECK_INIT_PRIORITY | |
556 | ||
c4baeaec JW |
557 | # For __basic_file::native_handle() |
558 | GLIBCXX_CHECK_FILEBUF_NATIVE_HANDLES | |
559 | ||
b25e6b79 BK |
560 | # Define documentation rules conditionally. |
561 | ||
562 | # See if makeinfo has been installed and is modern enough | |
563 | # that we can use it. | |
564 | ACX_CHECK_PROG_VER([MAKEINFO], [makeinfo], [--version], | |
565 | [GNU texinfo.* \([0-9][0-9.]*\)], | |
566 | [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) | |
567 | AM_CONDITIONAL(BUILD_INFO, test $gcc_cv_prog_makeinfo_modern = "yes") | |
568 | ||
569 | # Check for doxygen | |
570 | AC_CHECK_PROG([DOXYGEN], doxygen, yes, no) | |
571 | AC_CHECK_PROG([DOT], dot, yes, no) | |
572 | ||
573 | # Check for docbook | |
a4395a84 | 574 | AC_CHECK_PROG([XMLCATALOG], xmlcatalog, yes, no) |
b25e6b79 BK |
575 | AC_CHECK_PROG([XSLTPROC], xsltproc, yes, no) |
576 | AC_CHECK_PROG([XMLLINT], xmllint, yes, no) | |
b329dd10 | 577 | GLIBCXX_CONFIGURE_DOCBOOK |
b25e6b79 BK |
578 | |
579 | # Check for xml/html dependencies. | |
580 | AM_CONDITIONAL(BUILD_XML, | |
581 | test $ac_cv_prog_DOXYGEN = "yes" && | |
582 | test $ac_cv_prog_DOT = "yes" && | |
583 | test $ac_cv_prog_XSLTPROC = "yes" && | |
584 | test $ac_cv_prog_XMLLINT = "yes" && | |
585 | test $glibcxx_stylesheets = "yes") | |
586 | ||
587 | AM_CONDITIONAL(BUILD_HTML, | |
588 | test $ac_cv_prog_DOXYGEN = "yes" && | |
589 | test $ac_cv_prog_DOT = "yes" && | |
590 | test $ac_cv_prog_XSLTPROC = "yes" && | |
591 | test $ac_cv_prog_XMLLINT = "yes" && | |
592 | test $glibcxx_stylesheets = "yes") | |
593 | ||
594 | # Check for man dependencies. | |
595 | AM_CONDITIONAL(BUILD_MAN, | |
596 | test $ac_cv_prog_DOXYGEN = "yes" && | |
597 | test $ac_cv_prog_DOT = "yes") | |
598 | ||
43fe49ec | 599 | # Check for pdf dependencies. |
b25e6b79 BK |
600 | AC_CHECK_PROG([DBLATEX], dblatex, yes, no) |
601 | AC_CHECK_PROG([PDFLATEX], pdflatex, yes, no) | |
602 | AM_CONDITIONAL(BUILD_PDF, | |
758d7478 JW |
603 | test $ac_cv_prog_DOXYGEN = "yes" && |
604 | test $ac_cv_prog_DOT = "yes" && | |
605 | test $ac_cv_prog_XSLTPROC = "yes" && | |
606 | test $ac_cv_prog_XMLLINT = "yes" && | |
b25e6b79 BK |
607 | test $ac_cv_prog_DBLATEX = "yes" && |
608 | test $ac_cv_prog_PDFLATEX = "yes") | |
609 | ||
51f174c0 JW |
610 | case "$build" in |
611 | *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;; | |
612 | * ) glibcxx_include_dir_notparallel=no ;; | |
613 | esac | |
614 | AM_CONDITIONAL(INCLUDE_DIR_NOTPARALLEL, | |
615 | test $glibcxx_include_dir_notparallel = "yes") | |
b25e6b79 | 616 | |
4a9d5109 | 617 | # Propagate the target-specific source directories through the build chain. |
2c5d0ae8 BK |
618 | ATOMICITY_SRCDIR=config/${atomicity_dir} |
619 | ATOMIC_WORD_SRCDIR=config/${atomic_word_dir} | |
c2ba9709 | 620 | ATOMIC_FLAGS=${atomic_flags} |
4b90c838 | 621 | CPU_DEFINES_SRCDIR=config/${cpu_defines_dir} |
cc5112c9 | 622 | OS_INC_SRCDIR=config/${os_include_dir} |
e4bf5dfc | 623 | ERROR_CONSTANTS_SRCDIR=config/${error_constants_dir} |
1568430f | 624 | ABI_TWEAKS_SRCDIR=config/${abi_tweaks_dir} |
9bf714c2 | 625 | CPU_OPT_EXT_RANDOM=config/${cpu_opt_ext_random} |
48c7b524 | 626 | CPU_OPT_BITS_RANDOM=config/${cpu_opt_bits_random} |
2c5d0ae8 BK |
627 | AC_SUBST(ATOMICITY_SRCDIR) |
628 | AC_SUBST(ATOMIC_WORD_SRCDIR) | |
c2ba9709 | 629 | AC_SUBST(ATOMIC_FLAGS) |
4b90c838 | 630 | AC_SUBST(CPU_DEFINES_SRCDIR) |
1568430f | 631 | AC_SUBST(ABI_TWEAKS_SRCDIR) |
cc5112c9 | 632 | AC_SUBST(OS_INC_SRCDIR) |
e4bf5dfc | 633 | AC_SUBST(ERROR_CONSTANTS_SRCDIR) |
9bf714c2 | 634 | AC_SUBST(CPU_OPT_EXT_RANDOM) |
48c7b524 | 635 | AC_SUBST(CPU_OPT_BITS_RANDOM) |
cc5112c9 | 636 | |
47ddb895 DE |
637 | # Conditionalize the makefile for this target machine. |
638 | tmake_file_= | |
639 | for f in ${tmake_file} | |
640 | do | |
641 | if test -f ${srcdir}/config/$f | |
642 | then | |
643 | tmake_file_="${tmake_file_} \$(srcdir)/config/$f" | |
644 | fi | |
645 | done | |
646 | tmake_file="${tmake_file_}" | |
647 | AC_SUBST(tmake_file) | |
9268b7cb | 648 | |
36101de9 IT |
649 | # Add CET specific flags if Intel CET is enabled. |
650 | GCC_CET_FLAGS(CET_FLAGS) | |
651 | EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $CET_FLAGS" | |
652 | EXTRA_CFLAGS="$EXTRA_CFLAGS $CET_FLAGS" | |
653 | AC_SUBST(EXTRA_CFLAGS) | |
654 | AC_SUBST(EXTRA_CXX_FLAGS) | |
655 | ||
ff66d28f PE |
656 | # Determine cross-compile flags and AM_CONDITIONALs. |
657 | #AC_SUBST(GLIBCXX_IS_NATIVE) | |
0df3f383 | 658 | #AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes) |
92eabea2 | 659 | GLIBCXX_EVALUATE_CONDITIONALS |
b25e6b79 | 660 | |
5e53dba6 | 661 | AC_CACHE_SAVE |
b2dad0e3 | 662 | |
ff66d28f | 663 | if test ${multilib} = yes; then |
b2dad0e3 BK |
664 | multilib_arg="--enable-multilib" |
665 | else | |
666 | multilib_arg= | |
667 | fi | |
668 | ||
0df3f383 | 669 | # Export all the install information. |
3d7c150e | 670 | GLIBCXX_EXPORT_INSTALL_INFO |
1fd2f510 | 671 | |
6aa43d99 | 672 | # Export all the include and flag information to Makefiles. |
3d7c150e BK |
673 | GLIBCXX_EXPORT_INCLUDES |
674 | GLIBCXX_EXPORT_FLAGS | |
e466dc8a | 675 | |
3c36aa6b JJ |
676 | # Determine what GCC version number to use in filesystem paths. |
677 | GCC_BASE_VER | |
678 | ||
ff66d28f PE |
679 | dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros, |
680 | dnl which can all be called multiple times as needed, plus one (different) | |
65fc9769 | 681 | dnl AC_OUTPUT macro. This one lists the files to be created: |
6330e1d9 | 682 | AC_CONFIG_FILES(Makefile) |
ff66d28f | 683 | AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags]) |
e1208a57 | 684 | AC_CONFIG_FILES([scripts/extract_symvers],[chmod +x scripts/extract_symvers]) |
8d24c975 | 685 | AC_CONFIG_FILES([doc/xsl/customization.xsl]) |
3acb929c | 686 | AC_CONFIG_FILES([src/libbacktrace/backtrace-supported.h]) |
ff66d28f | 687 | |
6330e1d9 RW |
688 | # Multilibs need MULTISUBDIR defined correctly in certain makefiles so |
689 | # that multilib installs will end up installed in the correct place. | |
690 | # The testsuite needs it for multilib-aware ABI baseline files. | |
691 | # To work around this not being passed down from config-ml.in -> | |
692 | # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually | |
693 | # append it here. Only modify Makefiles that have just been created. | |
694 | # | |
695 | # Also, get rid of this simulated-VPATH thing that automake does. | |
696 | AC_CONFIG_FILES(AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ]), | |
697 | [cat > vpsed$$ << \_EOF | |
0df3f383 PE |
698 | s!`test -f '$<' || echo '$(srcdir)/'`!! |
699 | _EOF | |
6330e1d9 | 700 | sed -f vpsed$$ $ac_file > tmp$$ |
6330e1d9 RW |
701 | mv tmp$$ $ac_file |
702 | rm vpsed$$ | |
d4e0a1c0 L |
703 | echo 'MULTISUBDIR =' >> $ac_file |
704 | ml_norecursion=yes | |
705 | . ${multi_basedir}/config-ml.in | |
706 | AS_UNSET([ml_norecursion]) | |
ff66d28f PE |
707 | ]) |
708 | ||
6330e1d9 RW |
709 | AC_CONFIG_COMMANDS([generate-headers], |
710 | [(cd include && ${MAKE-make} pch_build= )]) | |
711 | ||
ff66d28f PE |
712 | dnl And this actually makes things happen: |
713 | AC_OUTPUT |