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 # AC 2.5x sets target_alias iff the user specified --target, but we use it
34 # everywhere, so we set it here just to be sure. In AC 2.13
35 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
37 target_alias=${target_alias-$target}
38 AC_SUBST(target_alias)
40 # Runs configure.target, finds CC, CXX and assorted other critical bits.
41 # Must run this before the GLIBCPP_ENABLE_* macros below.
44 AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
45 AM_CONFIG_HEADER(config.h)
49 AC_SUBST(enable_shared)
50 AC_SUBST(enable_static)
52 # Check for c++ or library specific bits that don't require linking.
53 GLIBCPP_CHECK_GNU_MAKE
54 #GLIBCPP_CHECK_COMPILER_VERSION
57 # Enable all the variable C++ stuff. C_MBCHAR must come early.
59 GLIBCPP_ENABLE_CLOCALE
60 GLIBCPP_ENABLE_CHEADERS([$c_model])
61 GLIBCPP_ENABLE_C_MBCHAR([yes])
62 GLIBCPP_ENABLE_C99([yes])
63 GLIBCPP_ENABLE_LONG_LONG([yes])
64 GLIBCPP_ENABLE_THREADS
65 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
66 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
67 GLIBCPP_ENABLE_CONCEPT_CHECKS
68 GLIBCPP_ENABLE_CXX_FLAGS
69 GLIBCPP_ENABLE_DEBUG([no])
70 GLIBCPP_ENABLE_DEBUG_FLAGS([none])
72 # No surprises, no surprises...
73 if test $ATOMICITYH = cpu/generic ; then
74 AC_MSG_WARN([No native atomic operations are provided for this platform.])
75 if test $target_thread_file = single; then
76 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
77 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
79 AC_MSG_WARN([They will be faked using a mutex.])
80 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
85 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
87 # We are being configured with some form of cross compiler.
88 GLIBCPP_IS_CROSS_COMPILING=1
90 # This lets us hard-code the functionality we know we'll have in the cross
91 # target environment. "Let" is a sugar-coated word placed on an especially
92 # dull and tedious hack, actually.
94 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
95 # that involve linking, can't be used:
96 # "cannot open sim-crt0.o"
97 # "cannot open crt0.o"
98 # etc. All this is because there currently exists no unified, consistent
99 # way for top level CC information to be passed down to target directories:
100 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
101 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
102 # crosses can be removed.
104 # If Canadian cross, then don't pick up tools from the build directory.
105 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
106 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
112 # Construct crosses by hand, eliminating bits that need ld...
113 # GLIBCPP_CHECK_COMPILER_FEATURES
114 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
115 # GLIBCPP_CHECK_MATH_SUPPORT
119 os_include_dir="os/gnu-linux"
120 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
121 machine/endian.h machine/param.h sys/machine.h sys/types.h \
122 fp.h locale.h float.h inttypes.h])
123 SECTION_FLAGS='-ffunction-sections -fdata-sections'
124 AC_SUBST(SECTION_FLAGS)
125 GLIBCPP_CHECK_LINKER_FEATURES
126 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
127 GLIBCPP_CHECK_WCHAR_T_SUPPORT
128 AC_DEFINE(HAVE_COPYSIGN)
129 AC_DEFINE(HAVE_COPYSIGNF)
130 AC_DEFINE(HAVE_FINITE)
131 AC_DEFINE(HAVE_FINITEF)
132 AC_DEFINE(HAVE_FREXPF)
133 AC_DEFINE(HAVE_HYPOTF)
134 AC_DEFINE(HAVE_ISINF)
135 AC_DEFINE(HAVE_ISINFF)
136 AC_DEFINE(HAVE_ISNAN)
137 AC_DEFINE(HAVE_ISNANF)
138 AC_DEFINE(HAVE_SINCOS)
139 AC_DEFINE(HAVE_SINCOSF)
140 if test x"long_double_math_on_this_cpu" = x"yes"; then
141 AC_DEFINE(HAVE_FINITEL)
142 AC_DEFINE(HAVE_HYPOTL)
143 AC_DEFINE(HAVE_ISINFL)
144 AC_DEFINE(HAVE_ISNANL)
148 # Check for available headers.
149 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
150 machine/endian.h machine/param.h sys/machine.h sys/types.h \
151 fp.h locale.h float.h inttypes.h])
152 SECTION_FLAGS='-ffunction-sections -fdata-sections'
153 AC_SUBST(SECTION_FLAGS)
154 GLIBCPP_CHECK_LINKER_FEATURES
155 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
156 GLIBCPP_CHECK_WCHAR_T_SUPPORT
157 os_include_dir="os/hpux"
158 AC_DEFINE(HAVE_COPYSIGN)
159 AC_DEFINE(HAVE_COPYSIGNF)
160 AC_DEFINE(HAVE_FREXPF)
161 AC_DEFINE(HAVE_HYPOT)
164 AC_DEFINE(HAVE_FINITE)
165 AC_DEFINE(HAVE_FINITEF)
166 AC_DEFINE(HAVE_ISINF)
167 AC_DEFINE(HAVE_ISINFF)
168 AC_DEFINE(HAVE_ISNAN)
169 AC_DEFINE(HAVE_ISNANF)
175 # Check for available headers.
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 os_include_dir="os/bsd/netbsd"
185 AC_DEFINE(HAVE_COPYSIGN)
186 AC_DEFINE(HAVE_COPYSIGNF)
187 AC_DEFINE(HAVE_FINITEF)
188 AC_DEFINE(HAVE_FINITE)
189 AC_DEFINE(HAVE_FREXPF)
190 AC_DEFINE(HAVE_HYPOTF)
191 AC_DEFINE(HAVE_ISINF)
192 AC_DEFINE(HAVE_ISINFF)
193 AC_DEFINE(HAVE_ISNAN)
194 AC_DEFINE(HAVE_ISNANF)
195 if test x"long_double_math_on_this_cpu" = x"yes"; then
196 AC_DEFINE(HAVE_FINITEL)
197 AC_DEFINE(HAVE_ISINFL)
198 AC_DEFINE(HAVE_ISNANL)
202 # Check for available headers.
203 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
204 machine/endian.h machine/param.h sys/machine.h sys/types.h \
205 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
206 sys/time.h unistd.h])
207 SECTION_FLAGS='-ffunction-sections -fdata-sections'
208 AC_SUBST(SECTION_FLAGS)
209 GLIBCPP_CHECK_LINKER_FEATURES
210 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
211 GLIBCPP_CHECK_WCHAR_T_SUPPORT
212 os_include_dir="os/bsd/freebsd"
213 AC_DEFINE(HAVE_LC_MESSAGES)
214 AC_DEFINE(HAVE_DRAND48)
215 AC_DEFINE(HAVE_GETPAGESIZE)
216 AC_DEFINE(HAVE_SETENV)
217 AC_DEFINE(HAVE_SIGSETJMP)
218 AC_DEFINE(HAVE_COPYSIGN)
219 AC_DEFINE(HAVE_COPYSIGNF)
220 AC_DEFINE(HAVE_FINITEF)
221 AC_DEFINE(HAVE_FINITE)
222 AC_DEFINE(HAVE_FREXPF)
223 AC_DEFINE(HAVE_HYPOT)
224 AC_DEFINE(HAVE_HYPOTF)
225 AC_DEFINE(HAVE_ISINF)
226 AC_DEFINE(HAVE_ISNAN)
227 AC_DEFINE(HAVE_ISNANF)
228 if test x"long_double_math_on_this_cpu" = x"yes"; then
229 AC_DEFINE(HAVE_FINITEL)
230 AC_DEFINE(HAVE_ISINFL)
231 AC_DEFINE(HAVE_ISNANL)
235 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
236 GLIBCPP_CHECK_LINKER_FEATURES
237 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
238 GLIBCPP_CHECK_WCHAR_T_SUPPORT
239 os_include_dir="os/mingw32"
242 os_include_dir="os/windiss"
247 SECTION_FLAGS='-ffunction-sections -fdata-sections'
248 AC_SUBST(SECTION_FLAGS)
249 GLIBCPP_CHECK_LINKER_FEATURES
250 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
251 GLIBCPP_CHECK_WCHAR_T_SUPPORT
252 os_include_dir="os/qnx/qnx6.1"
255 AC_DEFINE(HAVE_COSHF)
256 AC_DEFINE(HAVE_COSHL)
259 AC_DEFINE(HAVE_LOG10F)
260 AC_DEFINE(HAVE_LOG10L)
263 AC_DEFINE(HAVE_SINHF)
264 AC_DEFINE(HAVE_SINHL)
267 os_include_dir="os/newlib"
268 AC_DEFINE(HAVE_HYPOT)
276 AC_DEFINE(HAVE_ACOSF)
277 AC_DEFINE(HAVE_ASINF)
278 AC_DEFINE(HAVE_ATAN2F)
279 AC_DEFINE(HAVE_ATANF)
280 AC_DEFINE(HAVE_CEILF)
281 AC_DEFINE(HAVE_COPYSIGN)
282 AC_DEFINE(HAVE_COPYSIGNF)
284 AC_DEFINE(HAVE_COSHF)
286 AC_DEFINE(HAVE_FABSF)
287 AC_DEFINE(HAVE_FLOORF)
288 AC_DEFINE(HAVE_FMODF)
289 AC_DEFINE(HAVE_FREXPF)
290 AC_DEFINE(HAVE_LDEXPF)
291 AC_DEFINE(HAVE_LOG10F)
293 AC_DEFINE(HAVE_MODFF)
296 AC_DEFINE(HAVE_SINHF)
297 AC_DEFINE(HAVE_SQRTF)
299 AC_DEFINE(HAVE_TANHF)
302 # Must replicate generic section since we don't have strtof or strtold.
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 # GLIBCPP_CHECK_STDLIB_SUPPORT
331 AC_DEFINE(HAVE_STRTOF)
332 AC_DEFINE(HAVE_STRTOLD)
336 AC_DEFINE(HAVE_ACOSF)
337 AC_DEFINE(HAVE_ASINF)
338 AC_DEFINE(HAVE_ATAN2F)
339 AC_DEFINE(HAVE_ATANF)
340 AC_DEFINE(HAVE_CEILF)
341 AC_DEFINE(HAVE_COPYSIGN)
342 AC_DEFINE(HAVE_COPYSIGNF)
344 AC_DEFINE(HAVE_COSHF)
346 AC_DEFINE(HAVE_FABSF)
347 AC_DEFINE(HAVE_FLOORF)
348 AC_DEFINE(HAVE_FMODF)
349 AC_DEFINE(HAVE_FREXPF)
350 AC_DEFINE(HAVE_LDEXPF)
351 AC_DEFINE(HAVE_LOG10F)
353 AC_DEFINE(HAVE_MODFF)
356 AC_DEFINE(HAVE_SINHF)
357 AC_DEFINE(HAVE_SQRTF)
359 AC_DEFINE(HAVE_TANHF)
363 # At some point, we should differentiate between architectures
364 # like x86, which have long double versions, and alpha/powerpc/etc.,
365 # which don't. For the time being, punt.
366 if test x"long_double_math_on_this_cpu" = x"yes"; then
367 AC_DEFINE(HAVE_ACOSL)
368 AC_DEFINE(HAVE_ASINL)
369 AC_DEFINE(HAVE_ATAN2L)
370 AC_DEFINE(HAVE_ATANL)
371 AC_DEFINE(HAVE_CEILL)
372 AC_DEFINE(HAVE_COPYSIGNL)
374 AC_DEFINE(HAVE_COSHL)
376 AC_DEFINE(HAVE_FABSL)
377 AC_DEFINE(HAVE_FLOORL)
378 AC_DEFINE(HAVE_FMODL)
379 AC_DEFINE(HAVE_FREXPL)
380 AC_DEFINE(HAVE_LDEXPL)
381 AC_DEFINE(HAVE_LOG10L)
383 AC_DEFINE(HAVE_MODFL)
385 AC_DEFINE(HAVE_SINCOSL)
387 AC_DEFINE(HAVE_SINHL)
388 AC_DEFINE(HAVE_SQRTL)
390 AC_DEFINE(HAVE_TANHL)
395 # We are being configured natively. We can do more elaborate tests
396 # that include AC_TRY_COMPILE now, as the linker is assumed to be
398 GLIBCPP_IS_CROSS_COMPILING=0
401 # Check for available headers.
402 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
403 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
406 GLIBCPP_CHECK_COMPILER_FEATURES
407 GLIBCPP_CHECK_LINKER_FEATURES
408 GLIBCPP_CHECK_MATH_SUPPORT
409 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
410 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
411 GLIBCPP_CHECK_WCHAR_T_SUPPORT
412 GLIBCPP_CHECK_STDLIB_SUPPORT
414 # For showmanyc_helper().
415 AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
417 GLIBCPP_CHECK_S_ISREG_OR_S_IFREG
423 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
424 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
429 # Establish limits on memory usage during 'make check'
430 GLIBCPP_CONFIGURE_TESTSUITE
433 # This depends on the possibly-skipped linker test above.
434 GLIBCPP_ENABLE_SYMVERS([yes])
436 # Propagate the target-specific source directories through the build chain.
437 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
438 # uses it, and it only gets used in this file.)
439 OS_INC_SRCDIR=config/${os_include_dir}
440 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
441 AC_SUBST(OS_INC_SRCDIR)
442 AC_SUBST(ATOMICITY_INC_SRCDIR)
444 # Set up cross-compile flags
445 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
446 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
450 if test "${multilib}" = "yes"; then
451 multilib_arg="--enable-multilib"
456 # Export all the install information
457 GLIBCPP_EXPORT_INSTALL_INFO
459 # Export all the include and flag information to Makefiles.
460 GLIBCPP_EXPORT_INCLUDES
463 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
464 grep "enable shared" > /dev/null; then
465 LIBSUPCXX_PICFLAGS=-prefer-pic
469 AC_SUBST(LIBSUPCXX_PICFLAGS)
471 # Generate the various Makefiles, include files, and scripts.
472 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
473 # and libsupc++/Makefile.am so that multilib installs will end up
474 # installed in the correct place. To work around this not being passed
475 # down from config-ml.in -> top_srcdir/Makefile.am ->
476 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
478 include/Makefile src/Makefile \
479 libmath/Makefile libio/Makefile libsupc++/Makefile \
480 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
481 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
482 if test -n "$CONFIG_FILES"; then
483 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
484 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
485 # Ony modify Makefiles that are just being created.
486 case " $CONFIG_FILES" in
488 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
491 case $CONFIG_FILES in
493 grep '^MULTISUBDIR =' Makefile >> src/Makefile
496 case $CONFIG_FILES in
497 *libsupc++/Makefile*)
498 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
504 chmod +x testsuite_flags],
508 with_target_subdir=${with_target_subdir}
509 with_build_subdir=${with_build_subdir}
510 with_multisubdir=${with_multisubdir}
511 ac_configure_args="${multilib_arg} ${ac_configure_args}"
512 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
513 glibcpp_basedir=${glibcpp_basedir}
516 ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
518 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
519 dnl AC_CONFIG_FILES(Makefile \
520 dnl include/Makefile src/Makefile \
521 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
522 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
523 dnl AC_CONFIG_COMMANDS([default],
524 dnl [if test -n "$CONFIG_FILES"; then
525 dnl # Ony modify Makefiles that are just being created.
526 dnl case " $CONFIG_FILES" in
528 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
531 dnl case $CONFIG_FILES in
533 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
536 dnl case $CONFIG_FILES in
537 dnl *libsupc++/Makefile*)
538 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
543 dnl chmod +x testsuite_flags
548 dnl with_multisubdir=${with_multisubdir}
549 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
550 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
551 dnl glibcpp_basedir=${glibcpp_basedir}
558 # Sanity checking & User-visible messages.
559 # Checks down here, otherwise they get scrolled off before
560 # the user will notice.
562 # Trying to get more people to read documentation. Possibly remove
563 # check and warn all the time. There is no "informational" AC_MSG_
564 # macro, so these are going to be printed even when --quiet/--silent
566 if test ! -f stamp-sanity-warned; then
567 touch stamp-sanity-warned
569 echo "Please make certain that you read the installation information here:"
570 echo " faster => ${srcdir}/docs/html/install.html"
571 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
573 echo "and the configuration information here:"
574 echo " faster => ${srcdir}/docs/html/configopts.html"
575 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
577 echo "before proceeding with ${_cv_gnu_make_command}."