1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal && autoconf && autoheader && automake
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
10 # exported. Only used at the end of this file.
11 ORIGINAL_LD_FOR_MULTILIBS=$LD
15 # For libtool versioning info, format is CURRENT:REVISION:AGE
17 AC_SUBST(libtool_VERSION)
19 GLIBCPP_TOPREL_CONFIGURE
21 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
23 # You will slowly go insane if you do not grok the following fact: when
24 # building v3 as part of the compiler, the top-level /target/ becomes the
25 # library's /host/. `configure' then causes --target to default to --host,
26 # exactly like any other package using autoconf. Therefore, 'target' and
27 # 'host' will always be the same. This makes sense both for native and
28 # cross compilers, just think about it for a little while. :-)
30 # Also, if v3 is being configured as part of a cross compiler, the top-level
31 # configure script will pass the "real" host as $with_cross_host.
33 # In AC 2.13 AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
36 # Runs configure.host, finds CC, CXX and assorted other critical bits.
37 # Must run this before the GLIBCPP_ENABLE_* macros below.
40 AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
41 AM_CONFIG_HEADER(config.h)
45 AC_SUBST(enable_shared)
46 AC_SUBST(enable_static)
48 # Check for support bits and g++ features that don't require linking.
49 GLIBCPP_CHECK_GNU_MAKE
50 #GLIBCPP_CHECK_COMPILER_VERSION
51 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
52 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
53 GLIBCPP_ENABLE_PCH([yes])
55 # Enable all the variable C++ runtime options.
56 # NB: C_MBCHAR must come early.
58 GLIBCPP_ENABLE_CLOCALE
59 GLIBCPP_ENABLE_CHEADERS([$c_model])
60 GLIBCPP_ENABLE_C_MBCHAR([yes])
61 GLIBCPP_ENABLE_C99([yes])
62 GLIBCPP_ENABLE_LONG_LONG([yes])
63 GLIBCPP_ENABLE_THREADS
64 GLIBCPP_ENABLE_CONCEPT_CHECKS
65 GLIBCPP_ENABLE_CXX_FLAGS
66 GLIBCPP_ENABLE_DEBUG([no])
67 GLIBCPP_ENABLE_DEBUG_FLAGS([none])
69 # No surprises, no surprises...
70 if test $ATOMICITYH = cpu/generic ; then
71 AC_MSG_WARN([No native atomic operations are provided for this platform.])
72 if test $target_thread_file = single; then
73 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
74 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
76 AC_MSG_WARN([They will be faked using a mutex.])
77 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
82 if test x"$build" != x"$host"; then
84 # We are being configured with some form of cross compiler.
85 GLIBCPP_IS_CROSS_COMPILING=true
87 # This lets us hard-code the functionality we know we'll have in the cross
88 # target environment. "Let" is a sugar-coated word placed on an especially
89 # dull and tedious hack, actually.
91 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
92 # that involve linking, can't be used:
93 # "cannot open sim-crt0.o"
94 # "cannot open crt0.o"
95 # etc. All this is because there currently exists no unified, consistent
96 # way for top level CC information to be passed down to target directories:
97 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
98 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
99 # crosses can be removed.
101 # If Canadian cross, then don't pick up tools from the build directory.
102 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
103 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host" \
104 && test x"$build" != x"$target"; then
110 # Construct crosses by hand, eliminating bits that need ld...
111 # GLIBCPP_CHECK_COMPILER_FEATURES
112 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
113 # GLIBCPP_CHECK_MATH_SUPPORT
117 os_include_dir="os/bsd/freebsd"
118 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
119 machine/endian.h machine/param.h sys/machine.h sys/types.h \
120 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
121 sys/time.h unistd.h])
122 SECTION_FLAGS='-ffunction-sections -fdata-sections'
123 AC_SUBST(SECTION_FLAGS)
124 GLIBCPP_CHECK_LINKER_FEATURES
125 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
126 GLIBCPP_CHECK_WCHAR_T_SUPPORT
127 AC_DEFINE(HAVE_LC_MESSAGES)
128 AC_DEFINE(HAVE_DRAND48)
129 AC_DEFINE(HAVE_GETPAGESIZE)
130 AC_DEFINE(HAVE_SETENV)
131 AC_DEFINE(HAVE_SIGSETJMP)
132 AC_DEFINE(HAVE_COPYSIGN)
133 AC_DEFINE(HAVE_COPYSIGNF)
134 AC_DEFINE(HAVE_FINITEF)
135 AC_DEFINE(HAVE_FINITE)
136 AC_DEFINE(HAVE_FREXPF)
137 AC_DEFINE(HAVE_HYPOT)
138 AC_DEFINE(HAVE_HYPOTF)
139 AC_DEFINE(HAVE_ISINF)
140 AC_DEFINE(HAVE_ISNAN)
141 AC_DEFINE(HAVE_ISNANF)
144 AC_DEFINE(HAVE_ACOSF)
145 AC_DEFINE(HAVE_ASINF)
146 AC_DEFINE(HAVE_ATAN2F)
147 AC_DEFINE(HAVE_ATANF)
148 AC_DEFINE(HAVE_CEILF)
149 AC_DEFINE(HAVE_COPYSIGN)
150 AC_DEFINE(HAVE_COPYSIGNF)
152 AC_DEFINE(HAVE_COSHF)
154 AC_DEFINE(HAVE_FABSF)
155 AC_DEFINE(HAVE_FLOORF)
156 AC_DEFINE(HAVE_FMODF)
157 AC_DEFINE(HAVE_FREXPF)
158 AC_DEFINE(HAVE_LDEXPF)
159 AC_DEFINE(HAVE_LOG10F)
161 AC_DEFINE(HAVE_MODFF)
164 AC_DEFINE(HAVE_SINHF)
165 AC_DEFINE(HAVE_SQRTF)
167 AC_DEFINE(HAVE_TANHF)
168 if test x"long_double_math_on_this_cpu" = x"yes"; then
169 AC_DEFINE(HAVE_FINITEL)
170 AC_DEFINE(HAVE_ISINFL)
171 AC_DEFINE(HAVE_ISNANL)
175 os_include_dir="os/hpux"
176 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
177 machine/endian.h machine/param.h sys/machine.h sys/types.h \
178 fp.h locale.h float.h inttypes.h])
179 SECTION_FLAGS='-ffunction-sections -fdata-sections'
180 AC_SUBST(SECTION_FLAGS)
181 GLIBCPP_CHECK_LINKER_FEATURES
182 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
183 GLIBCPP_CHECK_WCHAR_T_SUPPORT
184 AC_DEFINE(HAVE_COPYSIGN)
185 AC_DEFINE(HAVE_COPYSIGNF)
186 AC_DEFINE(HAVE_FREXPF)
187 AC_DEFINE(HAVE_HYPOT)
190 AC_DEFINE(HAVE_FINITE)
191 AC_DEFINE(HAVE_FINITEF)
192 AC_DEFINE(HAVE_ISINF)
193 AC_DEFINE(HAVE_ISINFF)
194 AC_DEFINE(HAVE_ISNAN)
195 AC_DEFINE(HAVE_ISNANF)
200 os_include_dir="os/gnu-linux"
201 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
202 machine/endian.h machine/param.h sys/machine.h sys/types.h \
203 fp.h locale.h float.h inttypes.h])
204 SECTION_FLAGS='-ffunction-sections -fdata-sections'
205 AC_SUBST(SECTION_FLAGS)
206 GLIBCPP_CHECK_LINKER_FEATURES
207 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
208 GLIBCPP_CHECK_WCHAR_T_SUPPORT
209 AC_DEFINE(HAVE_COPYSIGN)
210 AC_DEFINE(HAVE_COPYSIGNF)
211 AC_DEFINE(HAVE_FINITE)
212 AC_DEFINE(HAVE_FINITEF)
213 AC_DEFINE(HAVE_FREXPF)
214 AC_DEFINE(HAVE_HYPOTF)
215 AC_DEFINE(HAVE_ISINF)
216 AC_DEFINE(HAVE_ISINFF)
217 AC_DEFINE(HAVE_ISNAN)
218 AC_DEFINE(HAVE_ISNANF)
219 AC_DEFINE(HAVE_SINCOS)
220 AC_DEFINE(HAVE_SINCOSF)
221 if test x"long_double_math_on_this_cpu" = x"yes"; then
222 AC_DEFINE(HAVE_FINITEL)
223 AC_DEFINE(HAVE_HYPOTL)
224 AC_DEFINE(HAVE_ISINFL)
225 AC_DEFINE(HAVE_ISNANL)
229 os_include_dir="os/mingw32"
230 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
231 GLIBCPP_CHECK_LINKER_FEATURES
232 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
233 GLIBCPP_CHECK_WCHAR_T_SUPPORT
236 os_include_dir="os/bsd/netbsd"
237 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
238 machine/endian.h machine/param.h sys/machine.h sys/types.h \
239 fp.h locale.h float.h inttypes.h])
240 SECTION_FLAGS='-ffunction-sections -fdata-sections'
241 AC_SUBST(SECTION_FLAGS)
242 GLIBCPP_CHECK_LINKER_FEATURES
243 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
244 GLIBCPP_CHECK_WCHAR_T_SUPPORT
245 AC_DEFINE(HAVE_COPYSIGN)
246 AC_DEFINE(HAVE_COPYSIGNF)
247 AC_DEFINE(HAVE_FINITEF)
248 AC_DEFINE(HAVE_FINITE)
249 AC_DEFINE(HAVE_FREXPF)
250 AC_DEFINE(HAVE_HYPOTF)
251 AC_DEFINE(HAVE_ISINF)
252 AC_DEFINE(HAVE_ISINFF)
253 AC_DEFINE(HAVE_ISNAN)
254 AC_DEFINE(HAVE_ISNANF)
255 if test x"long_double_math_on_this_cpu" = x"yes"; then
256 AC_DEFINE(HAVE_FINITEL)
257 AC_DEFINE(HAVE_ISINFL)
258 AC_DEFINE(HAVE_ISNANL)
261 *-qnx6.1* | *-qnx6.2*)
262 os_include_dir="os/qnx/qnx6.1"
263 SECTION_FLAGS='-ffunction-sections -fdata-sections'
264 AC_SUBST(SECTION_FLAGS)
265 GLIBCPP_CHECK_LINKER_FEATURES
266 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
267 GLIBCPP_CHECK_WCHAR_T_SUPPORT
270 AC_DEFINE(HAVE_COSHF)
271 AC_DEFINE(HAVE_COSHL)
274 AC_DEFINE(HAVE_LOG10F)
275 AC_DEFINE(HAVE_LOG10L)
278 AC_DEFINE(HAVE_SINHF)
279 AC_DEFINE(HAVE_SINHL)
284 os_include_dir="os/solaris/solaris2.5"
287 os_include_dir="os/solaris/solaris2.6"
289 *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
290 os_include_dir="os/solaris/solaris2.7"
293 AC_DEFINE(HAVE_STRTOF)
294 AC_DEFINE(HAVE_STRTOLD)
296 AC_DEFINE(HAVE_COPYSIGN)
297 AC_DEFINE(HAVE_ISNAN)
298 AC_DEFINE(HAVE_ISNANF)
299 AC_DEFINE(HAVE_MODFF)
300 AC_DEFINE(HAVE_HYPOT)
303 os_include_dir="os/windiss"
304 AC_DEFINE(HAVE_ACOSF)
305 AC_DEFINE(HAVE_ASINF)
306 AC_DEFINE(HAVE_ATAN2F)
307 AC_DEFINE(HAVE_ATANF)
308 AC_DEFINE(HAVE_CEILF)
309 AC_DEFINE(HAVE_COPYSIGN)
310 AC_DEFINE(HAVE_COPYSIGNF)
312 AC_DEFINE(HAVE_COSHF)
314 AC_DEFINE(HAVE_FABSF)
315 AC_DEFINE(HAVE_FLOORF)
316 AC_DEFINE(HAVE_FMODF)
317 AC_DEFINE(HAVE_FREXPF)
318 AC_DEFINE(HAVE_LDEXPF)
319 AC_DEFINE(HAVE_LOG10F)
321 AC_DEFINE(HAVE_MODFF)
324 AC_DEFINE(HAVE_SINHF)
325 AC_DEFINE(HAVE_SQRTF)
327 AC_DEFINE(HAVE_TANHF)
330 if test "x${with_newlib}" = "xyes"; then
331 os_include_dir="os/newlib"
332 AC_DEFINE(HAVE_HYPOT)
334 # GLIBCPP_CHECK_STDLIB_SUPPORT
335 AC_DEFINE(HAVE_STRTOF)
336 AC_DEFINE(HAVE_STRTOLD)
340 AC_DEFINE(HAVE_ACOSF)
341 AC_DEFINE(HAVE_ASINF)
342 AC_DEFINE(HAVE_ATAN2F)
343 AC_DEFINE(HAVE_ATANF)
344 AC_DEFINE(HAVE_CEILF)
345 AC_DEFINE(HAVE_COPYSIGN)
346 AC_DEFINE(HAVE_COPYSIGNF)
348 AC_DEFINE(HAVE_COSHF)
350 AC_DEFINE(HAVE_FABSF)
351 AC_DEFINE(HAVE_FLOORF)
352 AC_DEFINE(HAVE_FMODF)
353 AC_DEFINE(HAVE_FREXPF)
354 AC_DEFINE(HAVE_LDEXPF)
355 AC_DEFINE(HAVE_LOG10F)
357 AC_DEFINE(HAVE_MODFF)
360 AC_DEFINE(HAVE_SINHF)
361 AC_DEFINE(HAVE_SQRTF)
363 AC_DEFINE(HAVE_TANHF)
365 AC_MSG_ERROR([No support for this host/target combination.])
370 # At some point, we should differentiate between architectures
371 # like x86, which have long double versions, and alpha/powerpc/etc.,
372 # which don't. For the time being, punt.
373 if test x"long_double_math_on_this_cpu" = x"yes"; then
374 AC_DEFINE(HAVE_ACOSL)
375 AC_DEFINE(HAVE_ASINL)
376 AC_DEFINE(HAVE_ATAN2L)
377 AC_DEFINE(HAVE_ATANL)
378 AC_DEFINE(HAVE_CEILL)
379 AC_DEFINE(HAVE_COPYSIGNL)
381 AC_DEFINE(HAVE_COSHL)
383 AC_DEFINE(HAVE_FABSL)
384 AC_DEFINE(HAVE_FLOORL)
385 AC_DEFINE(HAVE_FMODL)
386 AC_DEFINE(HAVE_FREXPL)
387 AC_DEFINE(HAVE_LDEXPL)
388 AC_DEFINE(HAVE_LOG10L)
390 AC_DEFINE(HAVE_MODFL)
392 AC_DEFINE(HAVE_SINCOSL)
394 AC_DEFINE(HAVE_SINHL)
395 AC_DEFINE(HAVE_SQRTL)
397 AC_DEFINE(HAVE_TANHL)
402 # We are being configured natively. We can do more elaborate tests
403 # that include AC_TRY_COMPILE now, as the linker is assumed to be
405 GLIBCPP_IS_CROSS_COMPILING=false
408 # Check for available headers.
409 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
410 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
413 GLIBCPP_CHECK_COMPILER_FEATURES
414 GLIBCPP_CHECK_LINKER_FEATURES
415 GLIBCPP_CHECK_MATH_SUPPORT
416 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
417 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
418 GLIBCPP_CHECK_WCHAR_T_SUPPORT
419 GLIBCPP_CHECK_STDLIB_SUPPORT
421 # For showmanyc_helper().
422 AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
424 GLIBCPP_CHECK_S_ISREG_OR_S_IFREG
430 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
431 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
437 # This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no.
438 GLIBCPP_ENABLE_SYMVERS([yes])
440 # This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING.
441 GLIBCPP_CONFIGURE_TESTSUITE
443 # Propagate the target-specific source directories through the build chain.
444 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
445 # uses it, and it only gets used in this file.)
446 OS_INC_SRCDIR=config/${os_include_dir}
447 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
448 AC_SUBST(OS_INC_SRCDIR)
449 AC_SUBST(ATOMICITY_INC_SRCDIR)
451 # Determine cross-compile flags and all AM_CONDITIONALs.
452 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
453 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
454 dnl from GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT:
455 AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
459 if test "${multilib}" = "yes"; then
460 multilib_arg="--enable-multilib"
465 # Export all the install information
466 GLIBCPP_EXPORT_INSTALL_INFO
468 # Export all the include and flag information to Makefiles.
469 GLIBCPP_EXPORT_INCLUDES
472 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
473 grep "enable shared" > /dev/null; then
474 LIBSUPCXX_PICFLAGS=-prefer-pic
478 AC_SUBST(LIBSUPCXX_PICFLAGS)
480 # Generate the various Makefiles, include files, and scripts.
481 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am,
482 # libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
483 # will end up installed in the correct place. To work around this not being
484 # passed # down from config-ml.in -> top_srcdir/Makefile.am ->
485 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
487 include/Makefile src/Makefile \
488 libmath/Makefile libsupc++/Makefile \
489 po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags,
490 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
491 if test -n "$CONFIG_FILES"; then
492 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
493 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
494 # Ony modify Makefiles that are just being created.
495 case " $CONFIG_FILES" in
497 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
500 case $CONFIG_FILES in
502 grep '^MULTISUBDIR =' Makefile >> src/Makefile
505 case $CONFIG_FILES in
506 *libsupc++/Makefile*)
507 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
510 case $CONFIG_FILES in
511 *testsuite/Makefile*)
512 grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
517 chmod +x scripts/check_survey
518 chmod +x scripts/testsuite_flags],
522 with_target_subdir=${with_target_subdir}
523 with_build_subdir=${with_build_subdir}
524 with_multisubdir=${with_multisubdir}
525 ac_configure_args="${multilib_arg} ${ac_configure_args}"
526 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
527 glibcpp_basedir=${glibcpp_basedir}
530 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
532 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
533 dnl AC_CONFIG_FILES(Makefile \
534 dnl include/Makefile src/Makefile \
535 dnl libmath/Makefile libsupc++/Makefile \
536 dnl po/Makefile testsuite/Makefile \
537 dnl scripts/check_survey scripts/testsuite_flags)
538 dnl AC_CONFIG_COMMANDS([default],
539 dnl [if test -n "$CONFIG_FILES"; then
540 dnl # Ony modify Makefiles that are just being created.
541 dnl case " $CONFIG_FILES" in
543 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
546 dnl case $CONFIG_FILES in
548 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
551 dnl case $CONFIG_FILES in
552 dnl *libsupc++/Makefile*)
553 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
556 dnl case $CONFIG_FILES in
557 dnl *testsuite/Makefile*)
558 dnl grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
562 dnl chmod +x scripts/check_survey
563 dnl chmod +x scripts/testsuite_flags
568 dnl with_multisubdir=${with_multisubdir}
569 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
570 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
571 dnl glibcpp_basedir=${glibcpp_basedir}
578 # Sanity checking & User-visible messages.
579 # Checks down here, otherwise they get scrolled off before
580 # the user will notice.
582 # Trying to get more people to read documentation. Possibly remove
583 # check and warn all the time. There is no "informational" AC_MSG_
584 # macro, so these are going to be printed even when --quiet/--silent
586 if test ! -f stamp-sanity-warned; then
587 touch stamp-sanity-warned
589 echo "Please make certain that you read the installation information here:"
590 echo " faster => ${srcdir}/docs/html/install.html"
591 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
593 echo "and the configuration information here:"
594 echo " faster => ${srcdir}/docs/html/configopts.html"
595 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
597 echo "before proceeding with ${_cv_gnu_make_command}."