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 typical GNU versioning info, format is MAJOR.MINOR.MICRO
17 AC_SUBST(release_VERSION)
18 # For libtool versioning info, format is CURRENT:REVISION:AGE
20 AC_SUBST(libtool_VERSION)
22 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
24 # You will slowly go insane if you do not grok the following fact: when
25 # building v3 as part of the compiler, the top-level /target/ becomes the
26 # library's /host/. `configure' then causes --target to default to --host,
27 # exactly like any other package using autoconf. Therefore, 'target' and
28 # 'host' will always be the same. This makes sense both for native and
29 # cross compilers, just think about it for a little while. :-)
31 # Also, if v3 is being configured as part of a cross compiler, the top-level
32 # configure script will pass the "real" host as $with_cross_host.
34 # AC 2.5x sets target_alias iff the user specified --target, but we use it
35 # everywhere, so we set it here just to be sure. In AC 2.13
36 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
38 target_alias=${target_alias-$target}
39 AC_SUBST(target_alias)
41 AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
42 AM_CONFIG_HEADER(config.h)
44 # Runs configure.target, finds CC, CXX and assorted other critical bits.
45 # Must run this before the GLIBCPP_ENABLE_* macros below.
50 AC_SUBST(enable_shared)
51 AC_SUBST(enable_static)
53 # Check for c++ or library specific bits that don't require linking.
54 #GLIBCPP_CHECK_COMPILER_VERSION
55 GLIBCPP_CHECK_GNU_MAKE
57 # Enable all the variable C++ stuff. C_MBCHAR must come early.
58 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
60 GLIBCPP_ENABLE_CLOCALE
61 GLIBCPP_ENABLE_C_MBCHAR([yes])
62 GLIBCPP_ENABLE_C99([yes])
63 GLIBCPP_ENABLE_LONG_LONG([yes])
64 GLIBCPP_ENABLE_CHEADERS([$c_model])
65 GLIBCPP_ENABLE_THREADS
66 GLIBCPP_ENABLE_CXX_FLAGS([none])
67 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
68 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
69 GLIBCPP_ENABLE_CONCEPT_CHECKS
71 # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
72 AC_CHECK_HEADERS(string.h stdlib.h)
74 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
76 # We are being configured with some form of cross compiler.
77 GLIBCPP_IS_CROSS_COMPILING=1
79 # This lets us hard-code the functionality we know we'll have in the cross
80 # target environment. "Let" is a sugar-coated word placed on an especially
81 # dull and tedious hack, actually.
83 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
84 # that involve linking, can't be used:
85 # "cannot open sim-crt0.o"
86 # "cannot open crt0.o"
87 # etc. All this is because there currently exists no unified, consistent
88 # way for top level CC information to be passed down to target directories:
89 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
90 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
91 # crosses can be removed.
93 # If Canadian cross, then don't pick up tools from the build directory.
94 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
95 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
101 # Construct crosses by hand, eliminating bits that need ld...
102 # GLIBCPP_CHECK_COMPILER_FEATURES
103 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
104 # GLIBCPP_CHECK_MATH_SUPPORT
106 case "$target_alias" in
108 os_include_dir="os/gnu-linux"
109 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
110 machine/endian.h machine/param.h sys/machine.h sys/types.h \
111 fp.h locale.h float.h inttypes.h])
112 SECTION_FLAGS='-ffunction-sections -fdata-sections'
113 AC_SUBST(SECTION_FLAGS)
114 GLIBCPP_CHECK_LINKER_FEATURES
115 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
116 GLIBCPP_CHECK_WCHAR_T_SUPPORT
117 AC_DEFINE(HAVE_COPYSIGN)
118 AC_DEFINE(HAVE_COPYSIGNF)
119 AC_DEFINE(HAVE_FINITE)
120 AC_DEFINE(HAVE_FINITEF)
121 AC_DEFINE(HAVE_FREXPF)
122 AC_DEFINE(HAVE_HYPOTF)
123 AC_DEFINE(HAVE_ISINF)
124 AC_DEFINE(HAVE_ISINFF)
125 AC_DEFINE(HAVE_ISNAN)
126 AC_DEFINE(HAVE_ISNANF)
127 AC_DEFINE(HAVE_SINCOS)
128 AC_DEFINE(HAVE_SINCOSF)
129 if test x"long_double_math_on_this_cpu" = x"yes"; then
130 AC_DEFINE(HAVE_FINITEL)
131 AC_DEFINE(HAVE_HYPOTL)
132 AC_DEFINE(HAVE_ISINFL)
133 AC_DEFINE(HAVE_ISNANL)
137 # Check for available headers.
138 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
139 machine/endian.h machine/param.h sys/machine.h sys/types.h \
140 fp.h locale.h float.h inttypes.h])
141 SECTION_FLAGS='-ffunction-sections -fdata-sections'
142 AC_SUBST(SECTION_FLAGS)
143 GLIBCPP_CHECK_LINKER_FEATURES
144 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
145 GLIBCPP_CHECK_WCHAR_T_SUPPORT
146 os_include_dir="os/hpux"
147 AC_DEFINE(HAVE_COPYSIGN)
148 AC_DEFINE(HAVE_COPYSIGNF)
149 AC_DEFINE(HAVE_FREXPF)
150 AC_DEFINE(HAVE_HYPOT)
151 case "$target_alias" in
153 AC_DEFINE(HAVE_FINITE)
154 AC_DEFINE(HAVE_FINITEF)
155 AC_DEFINE(HAVE_ISINF)
156 AC_DEFINE(HAVE_ISINFF)
157 AC_DEFINE(HAVE_ISNAN)
158 AC_DEFINE(HAVE_ISNANF)
164 # Check for available headers.
165 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
166 machine/endian.h machine/param.h sys/machine.h sys/types.h \
167 fp.h locale.h float.h inttypes.h])
168 SECTION_FLAGS='-ffunction-sections -fdata-sections'
169 AC_SUBST(SECTION_FLAGS)
170 GLIBCPP_CHECK_LINKER_FEATURES
171 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
172 GLIBCPP_CHECK_WCHAR_T_SUPPORT
173 os_include_dir="os/bsd/netbsd"
174 AC_DEFINE(HAVE_COPYSIGN)
175 AC_DEFINE(HAVE_COPYSIGNF)
176 AC_DEFINE(HAVE_FINITEF)
177 AC_DEFINE(HAVE_FINITE)
178 AC_DEFINE(HAVE_FREXPF)
179 AC_DEFINE(HAVE_HYPOTF)
180 AC_DEFINE(HAVE_ISINF)
181 AC_DEFINE(HAVE_ISINFF)
182 AC_DEFINE(HAVE_ISNAN)
183 AC_DEFINE(HAVE_ISNANF)
184 if test x"long_double_math_on_this_cpu" = x"yes"; then
185 AC_DEFINE(HAVE_FINITEL)
186 AC_DEFINE(HAVE_ISINFL)
187 AC_DEFINE(HAVE_ISNANL)
191 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
192 GLIBCPP_CHECK_LINKER_FEATURES
193 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
194 GLIBCPP_CHECK_WCHAR_T_SUPPORT
195 os_include_dir="os/mingw32"
198 os_include_dir="os/windiss"
203 SECTION_FLAGS='-ffunction-sections -fdata-sections'
204 AC_SUBST(SECTION_FLAGS)
205 GLIBCPP_CHECK_LINKER_FEATURES
206 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
207 GLIBCPP_CHECK_WCHAR_T_SUPPORT
208 os_include_dir="os/qnx/qnx6.1"
211 AC_DEFINE(HAVE_COSHF)
212 AC_DEFINE(HAVE_COSHL)
215 AC_DEFINE(HAVE_LOG10F)
216 AC_DEFINE(HAVE_LOG10L)
219 AC_DEFINE(HAVE_SINHF)
220 AC_DEFINE(HAVE_SINHL)
223 os_include_dir="os/newlib"
224 AC_DEFINE(HAVE_HYPOT)
228 case "$target_alias" in
232 AC_DEFINE(HAVE_ACOSF)
233 AC_DEFINE(HAVE_ASINF)
234 AC_DEFINE(HAVE_ATAN2F)
235 AC_DEFINE(HAVE_ATANF)
236 AC_DEFINE(HAVE_CEILF)
237 AC_DEFINE(HAVE_COPYSIGN)
238 AC_DEFINE(HAVE_COPYSIGNF)
240 AC_DEFINE(HAVE_COSHF)
242 AC_DEFINE(HAVE_FABSF)
243 AC_DEFINE(HAVE_FLOORF)
244 AC_DEFINE(HAVE_FMODF)
245 AC_DEFINE(HAVE_FREXPF)
246 AC_DEFINE(HAVE_LDEXPF)
247 AC_DEFINE(HAVE_LOG10F)
249 AC_DEFINE(HAVE_MODFF)
252 AC_DEFINE(HAVE_SINHF)
253 AC_DEFINE(HAVE_SQRTF)
255 AC_DEFINE(HAVE_TANHF)
258 # GLIBCPP_CHECK_STDLIB_SUPPORT
259 AC_DEFINE(HAVE_STRTOF)
260 AC_DEFINE(HAVE_STRTOLD)
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)
291 # At some point, we should differentiate between architectures
292 # like x86, which have long double versions, and alpha/powerpc/etc.,
293 # which don't. For the time being, punt.
294 if test x"long_double_math_on_this_cpu" = x"yes"; then
295 AC_DEFINE(HAVE_ACOSL)
296 AC_DEFINE(HAVE_ASINL)
297 AC_DEFINE(HAVE_ATAN2L)
298 AC_DEFINE(HAVE_ATANL)
299 AC_DEFINE(HAVE_CEILL)
300 AC_DEFINE(HAVE_COPYSIGNL)
302 AC_DEFINE(HAVE_COSHL)
304 AC_DEFINE(HAVE_FABSL)
305 AC_DEFINE(HAVE_FLOORL)
306 AC_DEFINE(HAVE_FMODL)
307 AC_DEFINE(HAVE_FREXPL)
308 AC_DEFINE(HAVE_LDEXPL)
309 AC_DEFINE(HAVE_LOG10L)
311 AC_DEFINE(HAVE_MODFL)
313 AC_DEFINE(HAVE_SINCOSL)
315 AC_DEFINE(HAVE_SINHL)
316 AC_DEFINE(HAVE_SQRTL)
318 AC_DEFINE(HAVE_TANHL)
323 # We are being configured natively. We can do more elaborate tests
324 # that include AC_TRY_COMPILE now, as the linker is assumed to be
326 GLIBCPP_IS_CROSS_COMPILING=0
329 # Check for available headers.
330 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
331 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
333 GLIBCPP_CHECK_COMPILER_FEATURES
334 GLIBCPP_CHECK_LINKER_FEATURES
335 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
336 GLIBCPP_CHECK_MATH_SUPPORT
337 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
338 GLIBCPP_CHECK_WCHAR_T_SUPPORT
339 GLIBCPP_CHECK_STDLIB_SUPPORT
344 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
345 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
350 # Establish limits on memory usage during 'make check'
351 GLIBCPP_CONFIGURE_TESTSUITE
354 # This depends on the possibly-skipped linker test above.
355 GLIBCPP_ENABLE_SYMVERS([yes])
357 # Propagate the target-specific source directories through the build chain.
358 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH and
359 # CPULIMITSH [might] use it, and they only get used here.)
360 OS_INC_SRCDIR=config/${os_include_dir}
361 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
362 CPU_LIMITS_INC_SRCDIR=config/${CPULIMITSH}
363 AC_SUBST(OS_INC_SRCDIR)
364 AC_SUBST(ATOMICITY_INC_SRCDIR)
365 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
367 # Set up cross-compile flags
368 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
369 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
373 if test "${multilib}" = "yes"; then
374 multilib_arg="--enable-multilib"
379 # Needed so that g++ can find the correct include subdir automatically.
382 # Export all the install information
383 GLIBCPP_EXPORT_INSTALL_INFO
385 # Export all the include and flag information to makefiles.
386 GLIBCPP_EXPORT_INCLUDES
389 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
390 grep "enable shared" > /dev/null; then
391 LIBSUPCXX_PICFLAGS=-prefer-pic
395 AC_SUBST(LIBSUPCXX_PICFLAGS)
397 # Generate the various Makefiles, include files, and scripts.
398 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
399 # and libsupc++/Makefile.am so that multilib installs will end up
400 # installed in the correct place. To work around this not being passed
401 # down from config-ml.in -> top_srcdir/Makefile.am ->
402 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
404 include/Makefile src/Makefile \
405 libmath/Makefile libio/Makefile libsupc++/Makefile \
406 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
407 [if test -n "$CONFIG_FILES"; then
408 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
409 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
410 grep '^MULTISUBDIR =' Makefile >> src/Makefile
411 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
414 chmod +x testsuite_flags
419 with_multisubdir=${with_multisubdir}
420 ac_configure_args="${multilib_arg} ${ac_configure_args}"
421 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
422 glibcpp_basedir=${glibcpp_basedir}
426 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
427 dnl AC_CONFIG_FILES(Makefile \
428 dnl include/Makefile src/Makefile \
429 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
430 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
431 dnl AC_CONFIG_COMMANDS([default],
432 dnl [if test -n "$CONFIG_FILES"; then
433 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
434 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
435 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
438 dnl chmod +x testsuite_flags
443 dnl with_multisubdir=${with_multisubdir}
444 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
445 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
446 dnl glibcpp_basedir=${glibcpp_basedir}
453 # Sanity checking & User-visible messages.
454 # Checks down here, otherwise they get scrolled off before
455 # the user will notice.
457 # Trying to get more people to read documentation. Possibly remove
458 # check and warn all the time. There is no "informational" AC_MSG_
459 # macro, so these are going to be printed even when --quiet/--silent
461 if test ! -f stamp-sanity-warned; then
462 touch stamp-sanity-warned
464 echo "Please make certain that you read the installation information here:"
465 echo " faster => ${srcdir}/docs/html/install.html"
466 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
468 echo "and the configuration information here:"
469 echo " faster => ${srcdir}/docs/html/configopts.html"
470 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
472 echo "before proceeding with ${_cv_gnu_make_command}."