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_std])
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_FINITEF)
120 AC_DEFINE(HAVE_FREXPF)
121 AC_DEFINE(HAVE_HYPOTF)
122 AC_DEFINE(HAVE_SINCOS)
123 AC_DEFINE(HAVE_SINCOSF)
124 if test x"long_double_math_on_this_cpu" = x"yes"; then
125 AC_DEFINE(HAVE_HYPOTL)
129 # Check for available headers.
130 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
131 machine/endian.h machine/param.h sys/machine.h sys/types.h \
132 fp.h locale.h float.h inttypes.h])
133 SECTION_FLAGS='-ffunction-sections -fdata-sections'
134 AC_SUBST(SECTION_FLAGS)
135 GLIBCPP_CHECK_LINKER_FEATURES
136 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
137 GLIBCPP_CHECK_WCHAR_T_SUPPORT
138 os_include_dir="os/hpux"
139 AC_DEFINE(HAVE_COPYSIGN)
140 AC_DEFINE(HAVE_COPYSIGNF)
141 AC_DEFINE(HAVE_FINITEF)
142 AC_DEFINE(HAVE_FREXPF)
143 AC_DEFINE(HAVE_HYPOT)
144 AC_DEFINE(HAVE_SINCOS)
145 AC_DEFINE(HAVE_SINCOSF)
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/bsd/netbsd"
158 AC_DEFINE(HAVE_COPYSIGN)
159 AC_DEFINE(HAVE_COPYSIGNF)
160 AC_DEFINE(HAVE_FINITEF)
161 AC_DEFINE(HAVE_FREXPF)
162 AC_DEFINE(HAVE_HYPOTF)
165 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
166 GLIBCPP_CHECK_LINKER_FEATURES
167 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
168 GLIBCPP_CHECK_WCHAR_T_SUPPORT
169 os_include_dir="os/mingw32"
172 os_include_dir="os/windiss"
177 SECTION_FLAGS='-ffunction-sections -fdata-sections'
178 AC_SUBST(SECTION_FLAGS)
179 GLIBCPP_CHECK_LINKER_FEATURES
180 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
181 GLIBCPP_CHECK_WCHAR_T_SUPPORT
182 os_include_dir="os/qnx/qnx6.1"
185 AC_DEFINE(HAVE_COSHF)
186 AC_DEFINE(HAVE_COSHL)
189 AC_DEFINE(HAVE_LOG10F)
190 AC_DEFINE(HAVE_LOG10L)
193 AC_DEFINE(HAVE_SINHF)
194 AC_DEFINE(HAVE_SINHL)
197 os_include_dir="os/newlib"
198 AC_DEFINE(HAVE_HYPOT)
202 case "$target_alias" in
206 AC_DEFINE(HAVE_ACOSF)
207 AC_DEFINE(HAVE_ASINF)
208 AC_DEFINE(HAVE_ATAN2F)
209 AC_DEFINE(HAVE_ATANF)
210 AC_DEFINE(HAVE_CEILF)
211 AC_DEFINE(HAVE_COPYSIGN)
212 AC_DEFINE(HAVE_COPYSIGNF)
214 AC_DEFINE(HAVE_COSHF)
216 AC_DEFINE(HAVE_FABSF)
217 AC_DEFINE(HAVE_FLOORF)
218 AC_DEFINE(HAVE_FMODF)
219 AC_DEFINE(HAVE_FREXPF)
220 AC_DEFINE(HAVE_LDEXPF)
221 AC_DEFINE(HAVE_LOG10F)
223 AC_DEFINE(HAVE_MODFF)
226 AC_DEFINE(HAVE_SINHF)
227 AC_DEFINE(HAVE_SQRTF)
229 AC_DEFINE(HAVE_TANHF)
232 # GLIBCPP_CHECK_STDLIB_SUPPORT
233 AC_DEFINE(HAVE_STRTOF)
234 AC_DEFINE(HAVE_STRTOLD)
238 AC_DEFINE(HAVE_ACOSF)
239 AC_DEFINE(HAVE_ASINF)
240 AC_DEFINE(HAVE_ATAN2F)
241 AC_DEFINE(HAVE_ATANF)
242 AC_DEFINE(HAVE_CEILF)
243 AC_DEFINE(HAVE_COPYSIGN)
244 AC_DEFINE(HAVE_COPYSIGNF)
246 AC_DEFINE(HAVE_COSHF)
248 AC_DEFINE(HAVE_FABSF)
249 AC_DEFINE(HAVE_FINITE)
250 AC_DEFINE(HAVE_FINITEF)
251 AC_DEFINE(HAVE_FLOORF)
252 AC_DEFINE(HAVE_FMODF)
253 AC_DEFINE(HAVE_FREXPF)
254 AC_DEFINE(HAVE_ISINF)
255 AC_DEFINE(HAVE_ISINFF)
256 AC_DEFINE(HAVE_ISNAN)
257 AC_DEFINE(HAVE_ISNANF)
258 AC_DEFINE(HAVE_LDEXPF)
259 AC_DEFINE(HAVE_LOG10F)
261 AC_DEFINE(HAVE_MODFF)
264 AC_DEFINE(HAVE_SINHF)
265 AC_DEFINE(HAVE_SQRTF)
267 AC_DEFINE(HAVE_TANHF)
271 # At some point, we should differentiate between architectures
272 # like x86, which have long double versions, and alpha/powerpc/etc.,
273 # which don't. For the time being, punt.
274 if test x"long_double_math_on_this_cpu" = x"yes"; then
275 AC_DEFINE(HAVE_ACOSL)
276 AC_DEFINE(HAVE_ASINL)
277 AC_DEFINE(HAVE_ATAN2L)
278 AC_DEFINE(HAVE_ATANL)
279 AC_DEFINE(HAVE_CEILL)
280 AC_DEFINE(HAVE_COPYSIGNL)
282 AC_DEFINE(HAVE_COSHL)
284 AC_DEFINE(HAVE_FABSL)
285 AC_DEFINE(HAVE_FINITEL)
286 AC_DEFINE(HAVE_FLOORL)
287 AC_DEFINE(HAVE_FMODL)
288 AC_DEFINE(HAVE_FREXPL)
289 AC_DEFINE(HAVE_ISINFL)
290 AC_DEFINE(HAVE_ISNANL)
291 AC_DEFINE(HAVE_LDEXPL)
292 AC_DEFINE(HAVE_LOG10L)
294 AC_DEFINE(HAVE_MODFL)
296 AC_DEFINE(HAVE_SINCOSL)
298 AC_DEFINE(HAVE_SINHL)
299 AC_DEFINE(HAVE_SQRTL)
301 AC_DEFINE(HAVE_TANHL)
306 # We are being configured natively. We can do more elaborate tests
307 # that include AC_TRY_COMPILE now, as the linker is assumed to be
309 GLIBCPP_IS_CROSS_COMPILING=0
312 # Check for available headers.
313 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
314 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
316 GLIBCPP_CHECK_COMPILER_FEATURES
317 GLIBCPP_CHECK_LINKER_FEATURES
318 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
319 GLIBCPP_CHECK_MATH_SUPPORT
320 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
321 GLIBCPP_CHECK_WCHAR_T_SUPPORT
322 GLIBCPP_CHECK_STDLIB_SUPPORT
327 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
328 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
333 # Establish limits on memory usage during 'make check'
334 GLIBCPP_CONFIGURE_TESTSUITE
337 # This depends on the possibly-skipped linker test above.
338 GLIBCPP_ENABLE_SYMVERS([yes])
340 # Propagate the target-specific source directories through the build chain.
341 # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH and
342 # CPULIMITSH [might] use it, and they only get used here.)
343 OS_INC_SRCDIR=config/${os_include_dir}/bits
344 ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}/bits
345 CPU_LIMITS_INC_SRCDIR=config/${CPULIMITSH}/bits
346 AC_SUBST(OS_INC_SRCDIR)
347 AC_SUBST(ATOMICITY_INC_SRCDIR)
348 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
350 # Set up cross-compile flags
351 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far.
352 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
356 if test "${multilib}" = "yes"; then
357 multilib_arg="--enable-multilib"
362 # Needed so that g++ can find the correct include subdir automatically.
365 # Export all the install information
366 GLIBCPP_EXPORT_INSTALL_INFO
368 # Export all the include and flag information to makefiles.
369 GLIBCPP_EXPORT_INCLUDES
372 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
373 grep "enable shared" > /dev/null; then
374 LIBSUPCXX_PICFLAGS=-prefer-pic
378 AC_SUBST(LIBSUPCXX_PICFLAGS)
380 # Generate the various Makefiles, include files, and scripts.
381 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
382 # and libsupc++/Makefile.am so that multilib installs will end up
383 # installed in the correct place. To work around this not being passed
384 # down from config-ml.in -> top_srcdir/Makefile.am ->
385 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
387 include/Makefile src/Makefile \
388 libmath/Makefile libio/Makefile libsupc++/Makefile \
389 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
390 [if test -n "$CONFIG_FILES"; then
391 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
392 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
393 grep '^MULTISUBDIR =' Makefile >> src/Makefile
394 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
397 chmod +x testsuite_flags
402 with_multisubdir=${with_multisubdir}
403 ac_configure_args="${multilib_arg} ${ac_configure_args}"
404 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
405 glibcpp_basedir=${glibcpp_basedir}
409 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
410 dnl AC_CONFIG_FILES(Makefile \
411 dnl include/Makefile src/Makefile \
412 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
413 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
414 dnl AC_CONFIG_COMMANDS([default],
415 dnl [if test -n "$CONFIG_FILES"; then
416 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
417 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
418 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
421 dnl chmod +x testsuite_flags
426 dnl with_multisubdir=${with_multisubdir}
427 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
428 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
429 dnl glibcpp_basedir=${glibcpp_basedir}
436 # Sanity checking & User-visible messages.
437 # Checks down here, otherwise they get scrolled off before
438 # the user will notice.
440 # Trying to get more people to read documentation. Possibly remove
441 # check and warn all the time. There is no "informational" AC_MSG_
442 # macro, so these are going to be printed even when --quiet/--silent
444 if test ! -f stamp-sanity-warned; then
445 touch stamp-sanity-warned
447 echo "Please make certain that you read the installation information here:"
448 echo " faster => ${srcdir}/docs/html/install.html"
449 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
451 echo "and the configuration information here:"
452 echo " faster => ${srcdir}/docs/html/configopts.html"
453 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
455 echo "before proceeding with ${_cv_gnu_make_command}."