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 # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
72 AC_CHECK_HEADERS(string.h stdlib.h)
74 # No surprises, no surprises...
75 if test $ATOMICITYH = cpu/generic ; then
76 AC_MSG_WARN([No native atomic operations are provided yet for this platform.])
77 if test $target_thread_file = single; then
78 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
79 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
81 AC_MSG_WARN([They will be faked using a mutex.])
82 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
87 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
89 # We are being configured with some form of cross compiler.
90 GLIBCPP_IS_CROSS_COMPILING=1
92 # This lets us hard-code the functionality we know we'll have in the cross
93 # target environment. "Let" is a sugar-coated word placed on an especially
94 # dull and tedious hack, actually.
96 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
97 # that involve linking, can't be used:
98 # "cannot open sim-crt0.o"
99 # "cannot open crt0.o"
100 # etc. All this is because there currently exists no unified, consistent
101 # way for top level CC information to be passed down to target directories:
102 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
103 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
104 # crosses can be removed.
106 # If Canadian cross, then don't pick up tools from the build directory.
107 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
108 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
114 # Construct crosses by hand, eliminating bits that need ld...
115 # GLIBCPP_CHECK_COMPILER_FEATURES
116 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
117 # GLIBCPP_CHECK_MATH_SUPPORT
121 os_include_dir="os/gnu-linux"
122 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
123 machine/endian.h machine/param.h sys/machine.h sys/types.h \
124 fp.h locale.h float.h inttypes.h])
125 SECTION_FLAGS='-ffunction-sections -fdata-sections'
126 AC_SUBST(SECTION_FLAGS)
127 GLIBCPP_CHECK_LINKER_FEATURES
128 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
129 GLIBCPP_CHECK_WCHAR_T_SUPPORT
130 AC_DEFINE(HAVE_COPYSIGN)
131 AC_DEFINE(HAVE_COPYSIGNF)
132 AC_DEFINE(HAVE_FINITE)
133 AC_DEFINE(HAVE_FINITEF)
134 AC_DEFINE(HAVE_FREXPF)
135 AC_DEFINE(HAVE_HYPOTF)
136 AC_DEFINE(HAVE_ISINF)
137 AC_DEFINE(HAVE_ISINFF)
138 AC_DEFINE(HAVE_ISNAN)
139 AC_DEFINE(HAVE_ISNANF)
140 AC_DEFINE(HAVE_SINCOS)
141 AC_DEFINE(HAVE_SINCOSF)
142 if test x"long_double_math_on_this_cpu" = x"yes"; then
143 AC_DEFINE(HAVE_FINITEL)
144 AC_DEFINE(HAVE_HYPOTL)
145 AC_DEFINE(HAVE_ISINFL)
146 AC_DEFINE(HAVE_ISNANL)
150 # Check for available headers.
151 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
152 machine/endian.h machine/param.h sys/machine.h sys/types.h \
153 fp.h locale.h float.h inttypes.h])
154 SECTION_FLAGS='-ffunction-sections -fdata-sections'
155 AC_SUBST(SECTION_FLAGS)
156 GLIBCPP_CHECK_LINKER_FEATURES
157 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
158 GLIBCPP_CHECK_WCHAR_T_SUPPORT
159 os_include_dir="os/hpux"
160 AC_DEFINE(HAVE_COPYSIGN)
161 AC_DEFINE(HAVE_COPYSIGNF)
162 AC_DEFINE(HAVE_FREXPF)
163 AC_DEFINE(HAVE_HYPOT)
166 AC_DEFINE(HAVE_FINITE)
167 AC_DEFINE(HAVE_FINITEF)
168 AC_DEFINE(HAVE_ISINF)
169 AC_DEFINE(HAVE_ISINFF)
170 AC_DEFINE(HAVE_ISNAN)
171 AC_DEFINE(HAVE_ISNANF)
177 # Check for available headers.
178 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
179 machine/endian.h machine/param.h sys/machine.h sys/types.h \
180 fp.h locale.h float.h inttypes.h])
181 SECTION_FLAGS='-ffunction-sections -fdata-sections'
182 AC_SUBST(SECTION_FLAGS)
183 GLIBCPP_CHECK_LINKER_FEATURES
184 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
185 GLIBCPP_CHECK_WCHAR_T_SUPPORT
186 os_include_dir="os/bsd/netbsd"
187 AC_DEFINE(HAVE_COPYSIGN)
188 AC_DEFINE(HAVE_COPYSIGNF)
189 AC_DEFINE(HAVE_FINITEF)
190 AC_DEFINE(HAVE_FINITE)
191 AC_DEFINE(HAVE_FREXPF)
192 AC_DEFINE(HAVE_HYPOTF)
193 AC_DEFINE(HAVE_ISINF)
194 AC_DEFINE(HAVE_ISINFF)
195 AC_DEFINE(HAVE_ISNAN)
196 AC_DEFINE(HAVE_ISNANF)
197 if test x"long_double_math_on_this_cpu" = x"yes"; then
198 AC_DEFINE(HAVE_FINITEL)
199 AC_DEFINE(HAVE_ISINFL)
200 AC_DEFINE(HAVE_ISNANL)
204 # Check for available headers.
205 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
206 machine/endian.h machine/param.h sys/machine.h sys/types.h \
207 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
208 sys/time.h unistd.h])
209 SECTION_FLAGS='-ffunction-sections -fdata-sections'
210 AC_SUBST(SECTION_FLAGS)
211 GLIBCPP_CHECK_LINKER_FEATURES
212 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
213 GLIBCPP_CHECK_WCHAR_T_SUPPORT
214 os_include_dir="os/bsd/freebsd"
215 AC_DEFINE(HAVE_LC_MESSAGES)
216 AC_DEFINE(HAVE_DRAND48)
217 AC_DEFINE(HAVE_GETPAGESIZE)
218 AC_DEFINE(HAVE_SETENV)
219 AC_DEFINE(HAVE_SIGSETJMP)
220 AC_DEFINE(HAVE_COPYSIGN)
221 AC_DEFINE(HAVE_COPYSIGNF)
222 AC_DEFINE(HAVE_FINITEF)
223 AC_DEFINE(HAVE_FINITE)
224 AC_DEFINE(HAVE_FREXPF)
225 AC_DEFINE(HAVE_HYPOT)
226 AC_DEFINE(HAVE_HYPOTF)
227 AC_DEFINE(HAVE_ISINF)
228 AC_DEFINE(HAVE_ISNAN)
229 AC_DEFINE(HAVE_ISNANF)
230 if test x"long_double_math_on_this_cpu" = x"yes"; then
231 AC_DEFINE(HAVE_FINITEL)
232 AC_DEFINE(HAVE_ISINFL)
233 AC_DEFINE(HAVE_ISNANL)
237 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
238 GLIBCPP_CHECK_LINKER_FEATURES
239 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
240 GLIBCPP_CHECK_WCHAR_T_SUPPORT
241 os_include_dir="os/mingw32"
244 os_include_dir="os/windiss"
249 SECTION_FLAGS='-ffunction-sections -fdata-sections'
250 AC_SUBST(SECTION_FLAGS)
251 GLIBCPP_CHECK_LINKER_FEATURES
252 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
253 GLIBCPP_CHECK_WCHAR_T_SUPPORT
254 os_include_dir="os/qnx/qnx6.1"
257 AC_DEFINE(HAVE_COSHF)
258 AC_DEFINE(HAVE_COSHL)
261 AC_DEFINE(HAVE_LOG10F)
262 AC_DEFINE(HAVE_LOG10L)
265 AC_DEFINE(HAVE_SINHF)
266 AC_DEFINE(HAVE_SINHL)
269 os_include_dir="os/newlib"
270 AC_DEFINE(HAVE_HYPOT)
278 AC_DEFINE(HAVE_ACOSF)
279 AC_DEFINE(HAVE_ASINF)
280 AC_DEFINE(HAVE_ATAN2F)
281 AC_DEFINE(HAVE_ATANF)
282 AC_DEFINE(HAVE_CEILF)
283 AC_DEFINE(HAVE_COPYSIGN)
284 AC_DEFINE(HAVE_COPYSIGNF)
286 AC_DEFINE(HAVE_COSHF)
288 AC_DEFINE(HAVE_FABSF)
289 AC_DEFINE(HAVE_FLOORF)
290 AC_DEFINE(HAVE_FMODF)
291 AC_DEFINE(HAVE_FREXPF)
292 AC_DEFINE(HAVE_LDEXPF)
293 AC_DEFINE(HAVE_LOG10F)
295 AC_DEFINE(HAVE_MODFF)
298 AC_DEFINE(HAVE_SINHF)
299 AC_DEFINE(HAVE_SQRTF)
301 AC_DEFINE(HAVE_TANHF)
304 # Must replicate generic section since we don't have strtof or strtold.
306 AC_DEFINE(HAVE_ACOSF)
307 AC_DEFINE(HAVE_ASINF)
308 AC_DEFINE(HAVE_ATAN2F)
309 AC_DEFINE(HAVE_ATANF)
310 AC_DEFINE(HAVE_CEILF)
311 AC_DEFINE(HAVE_COPYSIGN)
312 AC_DEFINE(HAVE_COPYSIGNF)
314 AC_DEFINE(HAVE_COSHF)
316 AC_DEFINE(HAVE_FABSF)
317 AC_DEFINE(HAVE_FLOORF)
318 AC_DEFINE(HAVE_FMODF)
319 AC_DEFINE(HAVE_FREXPF)
320 AC_DEFINE(HAVE_LDEXPF)
321 AC_DEFINE(HAVE_LOG10F)
323 AC_DEFINE(HAVE_MODFF)
326 AC_DEFINE(HAVE_SINHF)
327 AC_DEFINE(HAVE_SQRTF)
329 AC_DEFINE(HAVE_TANHF)
332 # GLIBCPP_CHECK_STDLIB_SUPPORT
333 AC_DEFINE(HAVE_STRTOF)
334 AC_DEFINE(HAVE_STRTOLD)
338 AC_DEFINE(HAVE_ACOSF)
339 AC_DEFINE(HAVE_ASINF)
340 AC_DEFINE(HAVE_ATAN2F)
341 AC_DEFINE(HAVE_ATANF)
342 AC_DEFINE(HAVE_CEILF)
343 AC_DEFINE(HAVE_COPYSIGN)
344 AC_DEFINE(HAVE_COPYSIGNF)
346 AC_DEFINE(HAVE_COSHF)
348 AC_DEFINE(HAVE_FABSF)
349 AC_DEFINE(HAVE_FLOORF)
350 AC_DEFINE(HAVE_FMODF)
351 AC_DEFINE(HAVE_FREXPF)
352 AC_DEFINE(HAVE_LDEXPF)
353 AC_DEFINE(HAVE_LOG10F)
355 AC_DEFINE(HAVE_MODFF)
358 AC_DEFINE(HAVE_SINHF)
359 AC_DEFINE(HAVE_SQRTF)
361 AC_DEFINE(HAVE_TANHF)
365 # At some point, we should differentiate between architectures
366 # like x86, which have long double versions, and alpha/powerpc/etc.,
367 # which don't. For the time being, punt.
368 if test x"long_double_math_on_this_cpu" = x"yes"; then
369 AC_DEFINE(HAVE_ACOSL)
370 AC_DEFINE(HAVE_ASINL)
371 AC_DEFINE(HAVE_ATAN2L)
372 AC_DEFINE(HAVE_ATANL)
373 AC_DEFINE(HAVE_CEILL)
374 AC_DEFINE(HAVE_COPYSIGNL)
376 AC_DEFINE(HAVE_COSHL)
378 AC_DEFINE(HAVE_FABSL)
379 AC_DEFINE(HAVE_FLOORL)
380 AC_DEFINE(HAVE_FMODL)
381 AC_DEFINE(HAVE_FREXPL)
382 AC_DEFINE(HAVE_LDEXPL)
383 AC_DEFINE(HAVE_LOG10L)
385 AC_DEFINE(HAVE_MODFL)
387 AC_DEFINE(HAVE_SINCOSL)
389 AC_DEFINE(HAVE_SINHL)
390 AC_DEFINE(HAVE_SQRTL)
392 AC_DEFINE(HAVE_TANHL)
397 # We are being configured natively. We can do more elaborate tests
398 # that include AC_TRY_COMPILE now, as the linker is assumed to be
400 GLIBCPP_IS_CROSS_COMPILING=0
403 # Check for available headers.
404 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
405 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
407 GLIBCPP_CHECK_COMPILER_FEATURES
408 GLIBCPP_CHECK_LINKER_FEATURES
409 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
410 GLIBCPP_CHECK_MATH_SUPPORT
411 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
412 GLIBCPP_CHECK_WCHAR_T_SUPPORT
413 GLIBCPP_CHECK_STDLIB_SUPPORT
414 GLIBCPP_CHECK_UNISTD_SUPPORT
419 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
420 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
425 # Establish limits on memory usage during 'make check'
426 GLIBCPP_CONFIGURE_TESTSUITE
429 # This depends on the possibly-skipped linker test above.
430 GLIBCPP_ENABLE_SYMVERS([yes])
432 # Propagate the target-specific source directories through the build chain.
433 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
434 # uses it, and it only gets used in this file.)
435 OS_INC_SRCDIR=config/${os_include_dir}
436 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
437 AC_SUBST(OS_INC_SRCDIR)
438 AC_SUBST(ATOMICITY_INC_SRCDIR)
440 # Set up cross-compile flags
441 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
442 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
446 if test "${multilib}" = "yes"; then
447 multilib_arg="--enable-multilib"
452 # Export all the install information
453 GLIBCPP_EXPORT_INSTALL_INFO
455 # Export all the include and flag information to Makefiles.
456 GLIBCPP_EXPORT_INCLUDES
459 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
460 grep "enable shared" > /dev/null; then
461 LIBSUPCXX_PICFLAGS=-prefer-pic
465 AC_SUBST(LIBSUPCXX_PICFLAGS)
467 # Generate the various Makefiles, include files, and scripts.
468 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
469 # and libsupc++/Makefile.am so that multilib installs will end up
470 # installed in the correct place. To work around this not being passed
471 # down from config-ml.in -> top_srcdir/Makefile.am ->
472 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
474 include/Makefile src/Makefile \
475 libmath/Makefile libio/Makefile libsupc++/Makefile \
476 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
477 [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
478 if test -n "$CONFIG_FILES"; then
479 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
480 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
481 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
482 grep '^MULTISUBDIR =' Makefile >> src/Makefile
483 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
487 chmod +x testsuite_flags],
491 with_target_subdir=${with_target_subdir}
492 with_build_subdir=${with_build_subdir}
493 with_multisubdir=${with_multisubdir}
494 ac_configure_args="${multilib_arg} ${ac_configure_args}"
495 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
496 glibcpp_basedir=${glibcpp_basedir}
500 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
501 dnl AC_CONFIG_FILES(Makefile \
502 dnl include/Makefile src/Makefile \
503 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
504 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
505 dnl AC_CONFIG_COMMANDS([default],
506 dnl [if test -n "$CONFIG_FILES"; then
507 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
508 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
509 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
512 dnl chmod +x testsuite_flags
517 dnl with_multisubdir=${with_multisubdir}
518 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
519 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
520 dnl glibcpp_basedir=${glibcpp_basedir}
527 # Sanity checking & User-visible messages.
528 # Checks down here, otherwise they get scrolled off before
529 # the user will notice.
531 # Trying to get more people to read documentation. Possibly remove
532 # check and warn all the time. There is no "informational" AC_MSG_
533 # macro, so these are going to be printed even when --quiet/--silent
535 if test ! -f stamp-sanity-warned; then
536 touch stamp-sanity-warned
538 echo "Please make certain that you read the installation information here:"
539 echo " faster => ${srcdir}/docs/html/install.html"
540 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
542 echo "and the configuration information here:"
543 echo " faster => ${srcdir}/docs/html/configopts.html"
544 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
546 echo "before proceeding with ${_cv_gnu_make_command}."