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.
57 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
59 GLIBCPP_ENABLE_CLOCALE
60 GLIBCPP_ENABLE_C_MBCHAR([yes])
61 GLIBCPP_ENABLE_C99([yes])
62 GLIBCPP_ENABLE_LONG_LONG([yes])
63 GLIBCPP_ENABLE_CHEADERS([$c_model])
64 GLIBCPP_ENABLE_THREADS
65 GLIBCPP_ENABLE_CXX_FLAGS([none])
66 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
67 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
68 GLIBCPP_ENABLE_CONCEPT_CHECKS
70 # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
71 AC_CHECK_HEADERS(string.h stdlib.h)
73 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
75 # We are being configured with some form of cross compiler.
76 GLIBCPP_IS_CROSS_COMPILING=1
78 # This lets us hard-code the functionality we know we'll have in the cross
79 # target environment. "Let" is a sugar-coated word placed on an especially
80 # dull and tedious hack, actually.
82 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
83 # that involve linking, can't be used:
84 # "cannot open sim-crt0.o"
85 # "cannot open crt0.o"
86 # etc. All this is because there currently exists no unified, consistent
87 # way for top level CC information to be passed down to target directories:
88 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
89 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
90 # crosses can be removed.
92 # If Canadian cross, then don't pick up tools from the build directory.
93 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
94 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
100 # Construct crosses by hand, eliminating bits that need ld...
101 # GLIBCPP_CHECK_COMPILER_FEATURES
102 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
103 # GLIBCPP_CHECK_MATH_SUPPORT
107 os_include_dir="os/gnu-linux"
108 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
109 machine/endian.h machine/param.h sys/machine.h sys/types.h \
110 fp.h locale.h float.h inttypes.h])
111 SECTION_FLAGS='-ffunction-sections -fdata-sections'
112 AC_SUBST(SECTION_FLAGS)
113 GLIBCPP_CHECK_LINKER_FEATURES
114 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
115 GLIBCPP_CHECK_WCHAR_T_SUPPORT
116 AC_DEFINE(HAVE_COPYSIGN)
117 AC_DEFINE(HAVE_COPYSIGNF)
118 AC_DEFINE(HAVE_FINITE)
119 AC_DEFINE(HAVE_FINITEF)
120 AC_DEFINE(HAVE_FREXPF)
121 AC_DEFINE(HAVE_HYPOTF)
122 AC_DEFINE(HAVE_ISINF)
123 AC_DEFINE(HAVE_ISINFF)
124 AC_DEFINE(HAVE_ISNAN)
125 AC_DEFINE(HAVE_ISNANF)
126 AC_DEFINE(HAVE_SINCOS)
127 AC_DEFINE(HAVE_SINCOSF)
128 if test x"long_double_math_on_this_cpu" = x"yes"; then
129 AC_DEFINE(HAVE_FINITEL)
130 AC_DEFINE(HAVE_HYPOTL)
131 AC_DEFINE(HAVE_ISINFL)
132 AC_DEFINE(HAVE_ISNANL)
136 # Check for available headers.
137 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
138 machine/endian.h machine/param.h sys/machine.h sys/types.h \
139 fp.h locale.h float.h inttypes.h])
140 SECTION_FLAGS='-ffunction-sections -fdata-sections'
141 AC_SUBST(SECTION_FLAGS)
142 GLIBCPP_CHECK_LINKER_FEATURES
143 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
144 GLIBCPP_CHECK_WCHAR_T_SUPPORT
145 os_include_dir="os/hpux"
146 AC_DEFINE(HAVE_COPYSIGN)
147 AC_DEFINE(HAVE_COPYSIGNF)
148 AC_DEFINE(HAVE_FREXPF)
149 AC_DEFINE(HAVE_HYPOT)
152 AC_DEFINE(HAVE_FINITE)
153 AC_DEFINE(HAVE_FINITEF)
154 AC_DEFINE(HAVE_ISINF)
155 AC_DEFINE(HAVE_ISINFF)
156 AC_DEFINE(HAVE_ISNAN)
157 AC_DEFINE(HAVE_ISNANF)
163 # Check for available headers.
164 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
165 machine/endian.h machine/param.h sys/machine.h sys/types.h \
166 fp.h locale.h float.h inttypes.h])
167 SECTION_FLAGS='-ffunction-sections -fdata-sections'
168 AC_SUBST(SECTION_FLAGS)
169 GLIBCPP_CHECK_LINKER_FEATURES
170 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
171 GLIBCPP_CHECK_WCHAR_T_SUPPORT
172 os_include_dir="os/bsd/netbsd"
173 AC_DEFINE(HAVE_COPYSIGN)
174 AC_DEFINE(HAVE_COPYSIGNF)
175 AC_DEFINE(HAVE_FINITEF)
176 AC_DEFINE(HAVE_FINITE)
177 AC_DEFINE(HAVE_FREXPF)
178 AC_DEFINE(HAVE_HYPOTF)
179 AC_DEFINE(HAVE_ISINF)
180 AC_DEFINE(HAVE_ISINFF)
181 AC_DEFINE(HAVE_ISNAN)
182 AC_DEFINE(HAVE_ISNANF)
183 if test x"long_double_math_on_this_cpu" = x"yes"; then
184 AC_DEFINE(HAVE_FINITEL)
185 AC_DEFINE(HAVE_ISINFL)
186 AC_DEFINE(HAVE_ISNANL)
190 # Check for available headers.
191 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
192 machine/endian.h machine/param.h sys/machine.h sys/types.h \
193 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
194 sys/time.h unistd.h])
195 SECTION_FLAGS='-ffunction-sections -fdata-sections'
196 AC_SUBST(SECTION_FLAGS)
197 GLIBCPP_CHECK_LINKER_FEATURES
198 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
199 GLIBCPP_CHECK_WCHAR_T_SUPPORT
200 os_include_dir="os/bsd/freebsd"
201 AC_DEFINE(HAVE_LC_MESSAGES)
202 AC_DEFINE(HAVE_DRAND48)
203 AC_DEFINE(HAVE_GETPAGESIZE)
204 AC_DEFINE(HAVE_SETENV)
205 AC_DEFINE(HAVE_SIGSETJMP)
206 AC_DEFINE(HAVE_COPYSIGN)
207 AC_DEFINE(HAVE_COPYSIGNF)
208 AC_DEFINE(HAVE_FINITEF)
209 AC_DEFINE(HAVE_FINITE)
210 AC_DEFINE(HAVE_FREXPF)
211 AC_DEFINE(HAVE_HYPOT)
212 AC_DEFINE(HAVE_HYPOTF)
213 AC_DEFINE(HAVE_ISINF)
214 AC_DEFINE(HAVE_ISNAN)
215 AC_DEFINE(HAVE_ISNANF)
216 if test x"long_double_math_on_this_cpu" = x"yes"; then
217 AC_DEFINE(HAVE_FINITEL)
218 AC_DEFINE(HAVE_ISINFL)
219 AC_DEFINE(HAVE_ISNANL)
223 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
224 GLIBCPP_CHECK_LINKER_FEATURES
225 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
226 GLIBCPP_CHECK_WCHAR_T_SUPPORT
227 os_include_dir="os/mingw32"
230 os_include_dir="os/windiss"
235 SECTION_FLAGS='-ffunction-sections -fdata-sections'
236 AC_SUBST(SECTION_FLAGS)
237 GLIBCPP_CHECK_LINKER_FEATURES
238 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
239 GLIBCPP_CHECK_WCHAR_T_SUPPORT
240 os_include_dir="os/qnx/qnx6.1"
243 AC_DEFINE(HAVE_COSHF)
244 AC_DEFINE(HAVE_COSHL)
247 AC_DEFINE(HAVE_LOG10F)
248 AC_DEFINE(HAVE_LOG10L)
251 AC_DEFINE(HAVE_SINHF)
252 AC_DEFINE(HAVE_SINHL)
255 os_include_dir="os/newlib"
256 AC_DEFINE(HAVE_HYPOT)
264 AC_DEFINE(HAVE_ACOSF)
265 AC_DEFINE(HAVE_ASINF)
266 AC_DEFINE(HAVE_ATAN2F)
267 AC_DEFINE(HAVE_ATANF)
268 AC_DEFINE(HAVE_CEILF)
269 AC_DEFINE(HAVE_COPYSIGN)
270 AC_DEFINE(HAVE_COPYSIGNF)
272 AC_DEFINE(HAVE_COSHF)
274 AC_DEFINE(HAVE_FABSF)
275 AC_DEFINE(HAVE_FLOORF)
276 AC_DEFINE(HAVE_FMODF)
277 AC_DEFINE(HAVE_FREXPF)
278 AC_DEFINE(HAVE_LDEXPF)
279 AC_DEFINE(HAVE_LOG10F)
281 AC_DEFINE(HAVE_MODFF)
284 AC_DEFINE(HAVE_SINHF)
285 AC_DEFINE(HAVE_SQRTF)
287 AC_DEFINE(HAVE_TANHF)
290 # Must replicate generic section since we don't have strtof or strtold.
292 AC_DEFINE(HAVE_ACOSF)
293 AC_DEFINE(HAVE_ASINF)
294 AC_DEFINE(HAVE_ATAN2F)
295 AC_DEFINE(HAVE_ATANF)
296 AC_DEFINE(HAVE_CEILF)
297 AC_DEFINE(HAVE_COPYSIGN)
298 AC_DEFINE(HAVE_COPYSIGNF)
300 AC_DEFINE(HAVE_COSHF)
302 AC_DEFINE(HAVE_FABSF)
303 AC_DEFINE(HAVE_FLOORF)
304 AC_DEFINE(HAVE_FMODF)
305 AC_DEFINE(HAVE_FREXPF)
306 AC_DEFINE(HAVE_LDEXPF)
307 AC_DEFINE(HAVE_LOG10F)
309 AC_DEFINE(HAVE_MODFF)
312 AC_DEFINE(HAVE_SINHF)
313 AC_DEFINE(HAVE_SQRTF)
315 AC_DEFINE(HAVE_TANHF)
318 # GLIBCPP_CHECK_STDLIB_SUPPORT
319 AC_DEFINE(HAVE_STRTOF)
320 AC_DEFINE(HAVE_STRTOLD)
324 AC_DEFINE(HAVE_ACOSF)
325 AC_DEFINE(HAVE_ASINF)
326 AC_DEFINE(HAVE_ATAN2F)
327 AC_DEFINE(HAVE_ATANF)
328 AC_DEFINE(HAVE_CEILF)
329 AC_DEFINE(HAVE_COPYSIGN)
330 AC_DEFINE(HAVE_COPYSIGNF)
332 AC_DEFINE(HAVE_COSHF)
334 AC_DEFINE(HAVE_FABSF)
335 AC_DEFINE(HAVE_FLOORF)
336 AC_DEFINE(HAVE_FMODF)
337 AC_DEFINE(HAVE_FREXPF)
338 AC_DEFINE(HAVE_LDEXPF)
339 AC_DEFINE(HAVE_LOG10F)
341 AC_DEFINE(HAVE_MODFF)
344 AC_DEFINE(HAVE_SINHF)
345 AC_DEFINE(HAVE_SQRTF)
347 AC_DEFINE(HAVE_TANHF)
351 # At some point, we should differentiate between architectures
352 # like x86, which have long double versions, and alpha/powerpc/etc.,
353 # which don't. For the time being, punt.
354 if test x"long_double_math_on_this_cpu" = x"yes"; then
355 AC_DEFINE(HAVE_ACOSL)
356 AC_DEFINE(HAVE_ASINL)
357 AC_DEFINE(HAVE_ATAN2L)
358 AC_DEFINE(HAVE_ATANL)
359 AC_DEFINE(HAVE_CEILL)
360 AC_DEFINE(HAVE_COPYSIGNL)
362 AC_DEFINE(HAVE_COSHL)
364 AC_DEFINE(HAVE_FABSL)
365 AC_DEFINE(HAVE_FLOORL)
366 AC_DEFINE(HAVE_FMODL)
367 AC_DEFINE(HAVE_FREXPL)
368 AC_DEFINE(HAVE_LDEXPL)
369 AC_DEFINE(HAVE_LOG10L)
371 AC_DEFINE(HAVE_MODFL)
373 AC_DEFINE(HAVE_SINCOSL)
375 AC_DEFINE(HAVE_SINHL)
376 AC_DEFINE(HAVE_SQRTL)
378 AC_DEFINE(HAVE_TANHL)
383 # We are being configured natively. We can do more elaborate tests
384 # that include AC_TRY_COMPILE now, as the linker is assumed to be
386 GLIBCPP_IS_CROSS_COMPILING=0
389 # Check for available headers.
390 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
391 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
393 GLIBCPP_CHECK_COMPILER_FEATURES
394 GLIBCPP_CHECK_LINKER_FEATURES
395 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
396 GLIBCPP_CHECK_MATH_SUPPORT
397 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
398 GLIBCPP_CHECK_WCHAR_T_SUPPORT
399 GLIBCPP_CHECK_STDLIB_SUPPORT
404 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
405 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
410 # Establish limits on memory usage during 'make check'
411 GLIBCPP_CONFIGURE_TESTSUITE
414 # This depends on the possibly-skipped linker test above.
415 GLIBCPP_ENABLE_SYMVERS([yes])
417 # Propagate the target-specific source directories through the build chain.
418 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
419 # uses it, and they only get used here.)
420 OS_INC_SRCDIR=config/${os_include_dir}
421 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
422 AC_SUBST(OS_INC_SRCDIR)
423 AC_SUBST(ATOMICITY_INC_SRCDIR)
425 # Set up cross-compile flags
426 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
427 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
431 if test "${multilib}" = "yes"; then
432 multilib_arg="--enable-multilib"
437 # Export all the install information
438 GLIBCPP_EXPORT_INSTALL_INFO
440 # Export all the include and flag information to makefiles.
441 GLIBCPP_EXPORT_INCLUDES
444 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
445 grep "enable shared" > /dev/null; then
446 LIBSUPCXX_PICFLAGS=-prefer-pic
450 AC_SUBST(LIBSUPCXX_PICFLAGS)
452 # Generate the various Makefiles, include files, and scripts.
453 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
454 # and libsupc++/Makefile.am so that multilib installs will end up
455 # installed in the correct place. To work around this not being passed
456 # down from config-ml.in -> top_srcdir/Makefile.am ->
457 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
459 include/Makefile src/Makefile \
460 libmath/Makefile libio/Makefile libsupc++/Makefile \
461 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
462 [if test -n "$CONFIG_FILES"; then
463 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
464 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
465 grep '^MULTISUBDIR =' Makefile >> src/Makefile
466 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
469 chmod +x testsuite_flags
474 with_multisubdir=${with_multisubdir}
475 ac_configure_args="${multilib_arg} ${ac_configure_args}"
476 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
477 glibcpp_basedir=${glibcpp_basedir}
481 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
482 dnl AC_CONFIG_FILES(Makefile \
483 dnl include/Makefile src/Makefile \
484 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
485 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
486 dnl AC_CONFIG_COMMANDS([default],
487 dnl [if test -n "$CONFIG_FILES"; then
488 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
489 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
490 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
493 dnl chmod +x testsuite_flags
498 dnl with_multisubdir=${with_multisubdir}
499 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
500 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
501 dnl glibcpp_basedir=${glibcpp_basedir}
508 # Sanity checking & User-visible messages.
509 # Checks down here, otherwise they get scrolled off before
510 # the user will notice.
512 # Trying to get more people to read documentation. Possibly remove
513 # check and warn all the time. There is no "informational" AC_MSG_
514 # macro, so these are going to be printed even when --quiet/--silent
516 if test ! -f stamp-sanity-warned; then
517 touch stamp-sanity-warned
519 echo "Please make certain that you read the installation information here:"
520 echo " faster => ${srcdir}/docs/html/install.html"
521 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
523 echo "and the configuration information here:"
524 echo " faster => ${srcdir}/docs/html/configopts.html"
525 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
527 echo "before proceeding with ${_cv_gnu_make_command}."