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_COMPILER_VERSION
54 GLIBCPP_CHECK_GNU_MAKE
56 # Enable all the variable C++ stuff. 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_SJLJ_EXCEPTIONS
65 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
66 GLIBCPP_ENABLE_CONCEPT_CHECKS
67 GLIBCPP_ENABLE_CXX_FLAGS
68 GLIBCPP_ENABLE_DEBUG([no])
69 GLIBCPP_ENABLE_DEBUG_FLAGS([none])
71 # No surprises, no surprises...
72 if test $ATOMICITYH = cpu/generic ; then
73 AC_MSG_WARN([No native atomic operations are provided for this platform.])
74 if test $target_thread_file = single; then
75 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
76 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
78 AC_MSG_WARN([They will be faked using a mutex.])
79 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
84 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
86 # We are being configured with some form of cross compiler.
87 GLIBCPP_IS_CROSS_COMPILING=1
89 # This lets us hard-code the functionality we know we'll have in the cross
90 # target environment. "Let" is a sugar-coated word placed on an especially
91 # dull and tedious hack, actually.
93 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
94 # that involve linking, can't be used:
95 # "cannot open sim-crt0.o"
96 # "cannot open crt0.o"
97 # etc. All this is because there currently exists no unified, consistent
98 # way for top level CC information to be passed down to target directories:
99 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
100 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
101 # crosses can be removed.
103 # If Canadian cross, then don't pick up tools from the build directory.
104 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
105 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
111 # Construct crosses by hand, eliminating bits that need ld...
112 # GLIBCPP_CHECK_COMPILER_FEATURES
113 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
114 # GLIBCPP_CHECK_MATH_SUPPORT
118 os_include_dir="os/gnu-linux"
119 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
120 machine/endian.h machine/param.h sys/machine.h sys/types.h \
121 fp.h locale.h float.h inttypes.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_COPYSIGN)
128 AC_DEFINE(HAVE_COPYSIGNF)
129 AC_DEFINE(HAVE_FINITE)
130 AC_DEFINE(HAVE_FINITEF)
131 AC_DEFINE(HAVE_FREXPF)
132 AC_DEFINE(HAVE_HYPOTF)
133 AC_DEFINE(HAVE_ISINF)
134 AC_DEFINE(HAVE_ISINFF)
135 AC_DEFINE(HAVE_ISNAN)
136 AC_DEFINE(HAVE_ISNANF)
137 AC_DEFINE(HAVE_SINCOS)
138 AC_DEFINE(HAVE_SINCOSF)
139 if test x"long_double_math_on_this_cpu" = x"yes"; then
140 AC_DEFINE(HAVE_FINITEL)
141 AC_DEFINE(HAVE_HYPOTL)
142 AC_DEFINE(HAVE_ISINFL)
143 AC_DEFINE(HAVE_ISNANL)
147 # Check for available headers.
148 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
149 machine/endian.h machine/param.h sys/machine.h sys/types.h \
150 fp.h locale.h float.h inttypes.h])
151 SECTION_FLAGS='-ffunction-sections -fdata-sections'
152 AC_SUBST(SECTION_FLAGS)
153 GLIBCPP_CHECK_LINKER_FEATURES
154 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
155 GLIBCPP_CHECK_WCHAR_T_SUPPORT
156 os_include_dir="os/hpux"
157 AC_DEFINE(HAVE_COPYSIGN)
158 AC_DEFINE(HAVE_COPYSIGNF)
159 AC_DEFINE(HAVE_FREXPF)
160 AC_DEFINE(HAVE_HYPOT)
163 AC_DEFINE(HAVE_FINITE)
164 AC_DEFINE(HAVE_FINITEF)
165 AC_DEFINE(HAVE_ISINF)
166 AC_DEFINE(HAVE_ISINFF)
167 AC_DEFINE(HAVE_ISNAN)
168 AC_DEFINE(HAVE_ISNANF)
174 # Check for available headers.
175 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
176 machine/endian.h machine/param.h sys/machine.h sys/types.h \
177 fp.h locale.h float.h inttypes.h])
178 SECTION_FLAGS='-ffunction-sections -fdata-sections'
179 AC_SUBST(SECTION_FLAGS)
180 GLIBCPP_CHECK_LINKER_FEATURES
181 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
182 GLIBCPP_CHECK_WCHAR_T_SUPPORT
183 os_include_dir="os/bsd/netbsd"
184 AC_DEFINE(HAVE_COPYSIGN)
185 AC_DEFINE(HAVE_COPYSIGNF)
186 AC_DEFINE(HAVE_FINITEF)
187 AC_DEFINE(HAVE_FINITE)
188 AC_DEFINE(HAVE_FREXPF)
189 AC_DEFINE(HAVE_HYPOTF)
190 AC_DEFINE(HAVE_ISINF)
191 AC_DEFINE(HAVE_ISINFF)
192 AC_DEFINE(HAVE_ISNAN)
193 AC_DEFINE(HAVE_ISNANF)
194 if test x"long_double_math_on_this_cpu" = x"yes"; then
195 AC_DEFINE(HAVE_FINITEL)
196 AC_DEFINE(HAVE_ISINFL)
197 AC_DEFINE(HAVE_ISNANL)
201 # Check for available headers.
202 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
203 machine/endian.h machine/param.h sys/machine.h sys/types.h \
204 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
205 sys/time.h unistd.h])
206 SECTION_FLAGS='-ffunction-sections -fdata-sections'
207 AC_SUBST(SECTION_FLAGS)
208 GLIBCPP_CHECK_LINKER_FEATURES
209 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
210 GLIBCPP_CHECK_WCHAR_T_SUPPORT
211 os_include_dir="os/bsd/freebsd"
212 AC_DEFINE(HAVE_LC_MESSAGES)
213 AC_DEFINE(HAVE_DRAND48)
214 AC_DEFINE(HAVE_GETPAGESIZE)
215 AC_DEFINE(HAVE_SETENV)
216 AC_DEFINE(HAVE_SIGSETJMP)
217 AC_DEFINE(HAVE_COPYSIGN)
218 AC_DEFINE(HAVE_COPYSIGNF)
219 AC_DEFINE(HAVE_FINITEF)
220 AC_DEFINE(HAVE_FINITE)
221 AC_DEFINE(HAVE_FREXPF)
222 AC_DEFINE(HAVE_HYPOT)
223 AC_DEFINE(HAVE_HYPOTF)
224 AC_DEFINE(HAVE_ISINF)
225 AC_DEFINE(HAVE_ISNAN)
226 AC_DEFINE(HAVE_ISNANF)
227 if test x"long_double_math_on_this_cpu" = x"yes"; then
228 AC_DEFINE(HAVE_FINITEL)
229 AC_DEFINE(HAVE_ISINFL)
230 AC_DEFINE(HAVE_ISNANL)
234 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
235 GLIBCPP_CHECK_LINKER_FEATURES
236 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
237 GLIBCPP_CHECK_WCHAR_T_SUPPORT
238 os_include_dir="os/mingw32"
241 os_include_dir="os/windiss"
246 SECTION_FLAGS='-ffunction-sections -fdata-sections'
247 AC_SUBST(SECTION_FLAGS)
248 GLIBCPP_CHECK_LINKER_FEATURES
249 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
250 GLIBCPP_CHECK_WCHAR_T_SUPPORT
251 os_include_dir="os/qnx/qnx6.1"
254 AC_DEFINE(HAVE_COSHF)
255 AC_DEFINE(HAVE_COSHL)
258 AC_DEFINE(HAVE_LOG10F)
259 AC_DEFINE(HAVE_LOG10L)
262 AC_DEFINE(HAVE_SINHF)
263 AC_DEFINE(HAVE_SINHL)
266 os_include_dir="os/newlib"
267 AC_DEFINE(HAVE_HYPOT)
275 AC_DEFINE(HAVE_ACOSF)
276 AC_DEFINE(HAVE_ASINF)
277 AC_DEFINE(HAVE_ATAN2F)
278 AC_DEFINE(HAVE_ATANF)
279 AC_DEFINE(HAVE_CEILF)
280 AC_DEFINE(HAVE_COPYSIGN)
281 AC_DEFINE(HAVE_COPYSIGNF)
283 AC_DEFINE(HAVE_COSHF)
285 AC_DEFINE(HAVE_FABSF)
286 AC_DEFINE(HAVE_FLOORF)
287 AC_DEFINE(HAVE_FMODF)
288 AC_DEFINE(HAVE_FREXPF)
289 AC_DEFINE(HAVE_LDEXPF)
290 AC_DEFINE(HAVE_LOG10F)
292 AC_DEFINE(HAVE_MODFF)
295 AC_DEFINE(HAVE_SINHF)
296 AC_DEFINE(HAVE_SQRTF)
298 AC_DEFINE(HAVE_TANHF)
301 # Must replicate generic section since we don't have strtof or strtold.
303 AC_DEFINE(HAVE_ACOSF)
304 AC_DEFINE(HAVE_ASINF)
305 AC_DEFINE(HAVE_ATAN2F)
306 AC_DEFINE(HAVE_ATANF)
307 AC_DEFINE(HAVE_CEILF)
308 AC_DEFINE(HAVE_COPYSIGN)
309 AC_DEFINE(HAVE_COPYSIGNF)
311 AC_DEFINE(HAVE_COSHF)
313 AC_DEFINE(HAVE_FABSF)
314 AC_DEFINE(HAVE_FLOORF)
315 AC_DEFINE(HAVE_FMODF)
316 AC_DEFINE(HAVE_FREXPF)
317 AC_DEFINE(HAVE_LDEXPF)
318 AC_DEFINE(HAVE_LOG10F)
320 AC_DEFINE(HAVE_MODFF)
323 AC_DEFINE(HAVE_SINHF)
324 AC_DEFINE(HAVE_SQRTF)
326 AC_DEFINE(HAVE_TANHF)
329 # GLIBCPP_CHECK_STDLIB_SUPPORT
330 AC_DEFINE(HAVE_STRTOF)
331 AC_DEFINE(HAVE_STRTOLD)
335 AC_DEFINE(HAVE_ACOSF)
336 AC_DEFINE(HAVE_ASINF)
337 AC_DEFINE(HAVE_ATAN2F)
338 AC_DEFINE(HAVE_ATANF)
339 AC_DEFINE(HAVE_CEILF)
340 AC_DEFINE(HAVE_COPYSIGN)
341 AC_DEFINE(HAVE_COPYSIGNF)
343 AC_DEFINE(HAVE_COSHF)
345 AC_DEFINE(HAVE_FABSF)
346 AC_DEFINE(HAVE_FLOORF)
347 AC_DEFINE(HAVE_FMODF)
348 AC_DEFINE(HAVE_FREXPF)
349 AC_DEFINE(HAVE_LDEXPF)
350 AC_DEFINE(HAVE_LOG10F)
352 AC_DEFINE(HAVE_MODFF)
355 AC_DEFINE(HAVE_SINHF)
356 AC_DEFINE(HAVE_SQRTF)
358 AC_DEFINE(HAVE_TANHF)
362 # At some point, we should differentiate between architectures
363 # like x86, which have long double versions, and alpha/powerpc/etc.,
364 # which don't. For the time being, punt.
365 if test x"long_double_math_on_this_cpu" = x"yes"; then
366 AC_DEFINE(HAVE_ACOSL)
367 AC_DEFINE(HAVE_ASINL)
368 AC_DEFINE(HAVE_ATAN2L)
369 AC_DEFINE(HAVE_ATANL)
370 AC_DEFINE(HAVE_CEILL)
371 AC_DEFINE(HAVE_COPYSIGNL)
373 AC_DEFINE(HAVE_COSHL)
375 AC_DEFINE(HAVE_FABSL)
376 AC_DEFINE(HAVE_FLOORL)
377 AC_DEFINE(HAVE_FMODL)
378 AC_DEFINE(HAVE_FREXPL)
379 AC_DEFINE(HAVE_LDEXPL)
380 AC_DEFINE(HAVE_LOG10L)
382 AC_DEFINE(HAVE_MODFL)
384 AC_DEFINE(HAVE_SINCOSL)
386 AC_DEFINE(HAVE_SINHL)
387 AC_DEFINE(HAVE_SQRTL)
389 AC_DEFINE(HAVE_TANHL)
394 # We are being configured natively. We can do more elaborate tests
395 # that include AC_TRY_COMPILE now, as the linker is assumed to be
397 GLIBCPP_IS_CROSS_COMPILING=0
400 # Check for available headers.
401 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
402 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
405 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}."