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
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.
23 # AC 2.5x sets target_alias iff the user specified --target, but we use it
24 # everywhere, so we set it here just to be sure. In AC 2.13
25 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
27 target_alias=${target_alias-$target}
28 AC_SUBST(target_alias)
30 AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
31 AM_CONFIG_HEADER(config.h)
33 # Runs configure.host and configure.target, as well as finds CC, CXX
34 # and assorted other critical bits. Have to run this before the
35 # GLIBCPP_ENABLE_* macros below.
40 AC_SUBST(enable_shared)
41 AC_SUBST(enable_static)
43 # Check for c++ or library specific bits that don't require linking.
44 #GLIBCPP_CHECK_COMPILER_VERSION
45 GLIBCPP_CHECK_GNU_MAKE
47 # Enable all the variable C++ stuff. C_MBCHAR must come early.
48 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
50 GLIBCPP_ENABLE_CLOCALE
51 GLIBCPP_ENABLE_C_MBCHAR([yes])
52 GLIBCPP_ENABLE_C99([yes])
53 GLIBCPP_ENABLE_LONG_LONG([yes])
54 GLIBCPP_ENABLE_CHEADERS([c_std])
55 GLIBCPP_ENABLE_THREADS
56 GLIBCPP_ENABLE_CXX_FLAGS([none])
57 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
58 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
59 GLIBCPP_ENABLE_CONCEPT_CHECKS
61 # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c
62 AC_CHECK_HEADERS(string.h stdlib.h)
64 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
66 # This lets us hard-code the functionality we know
67 # we'll have in the cross target environment. "Let" is a
68 # sugar-coated word placed on an especially dull and tedious hack, actually.
69 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
70 # that involve linking can't be used:
71 # "cannot open sim-crt0.o"
72 # "cannot open crt0.o"
73 # etc. All this is because there currently exists no unified,
74 # consistent way for top level CC information to be passed down
75 # to target directories: newlib includes, newlib linking info,
76 # libgloss versus newlib crt0.o, etc. When all of this is done, all
77 # of this hokey, excessive AC_DEFINE junk for crosses can be removed.
79 # We are being configured with some form of cross compiler.
80 GLIBCPP_IS_CROSS_COMPILING=1
82 # If Canadian cross, then don't pick up tools from the build
84 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
90 # Construct crosses by hand, eliminating bits that need ld...
91 # GLIBCPP_CHECK_COMPILER_FEATURES
92 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
93 # GLIBCPP_CHECK_MATH_SUPPORT
95 case "$target_alias" in
97 # Check for available headers.
98 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
99 machine/endian.h machine/param.h sys/machine.h sys/types.h \
100 fp.h locale.h float.h inttypes.h])
101 SECTION_FLAGS='-ffunction-sections -fdata-sections'
102 AC_SUBST(SECTION_FLAGS)
103 GLIBCPP_CHECK_LINKER_FEATURES
104 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
105 GLIBCPP_CHECK_WCHAR_T_SUPPORT
106 os_include_dir="config/os/gnu-linux"
107 AC_DEFINE(HAVE_COPYSIGN)
108 AC_DEFINE(HAVE_COPYSIGNF)
109 AC_DEFINE(HAVE_FINITEF)
110 AC_DEFINE(HAVE_FREXPF)
111 AC_DEFINE(HAVE_HYPOTF)
112 AC_DEFINE(HAVE_SINCOS)
113 AC_DEFINE(HAVE_SINCOSF)
114 if test x"long_double_math_on_this_cpu" = x"yes"; then
115 AC_DEFINE(HAVE_HYPOTL)
119 # Check for available headers.
120 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
121 machine/endian.h machine/param.h sys/machine.h sys/types.h \
122 fp.h locale.h float.h inttypes.h])
123 SECTION_FLAGS='-ffunction-sections -fdata-sections'
124 AC_SUBST(SECTION_FLAGS)
125 GLIBCPP_CHECK_LINKER_FEATURES
126 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
127 GLIBCPP_CHECK_WCHAR_T_SUPPORT
128 os_include_dir="config/os/hpux"
129 AC_DEFINE(HAVE_COPYSIGN)
130 AC_DEFINE(HAVE_COPYSIGNF)
131 AC_DEFINE(HAVE_FINITEF)
132 AC_DEFINE(HAVE_FREXPF)
133 AC_DEFINE(HAVE_HYPOT)
134 AC_DEFINE(HAVE_SINCOS)
135 AC_DEFINE(HAVE_SINCOSF)
138 # Check for available headers.
139 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
140 machine/endian.h machine/param.h sys/machine.h sys/types.h \
141 fp.h locale.h float.h inttypes.h])
142 SECTION_FLAGS='-ffunction-sections -fdata-sections'
143 AC_SUBST(SECTION_FLAGS)
144 GLIBCPP_CHECK_LINKER_FEATURES
145 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
146 GLIBCPP_CHECK_WCHAR_T_SUPPORT
147 os_include_dir="config/os/bsd/netbsd"
148 AC_DEFINE(HAVE_COPYSIGN)
149 AC_DEFINE(HAVE_COPYSIGNF)
150 AC_DEFINE(HAVE_FINITEF)
151 AC_DEFINE(HAVE_FREXPF)
152 AC_DEFINE(HAVE_HYPOTF)
155 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
156 GLIBCPP_CHECK_LINKER_FEATURES
157 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
158 GLIBCPP_CHECK_WCHAR_T_SUPPORT
159 os_include_dir="config/os/mingw32"
162 os_include_dir="config/os/windiss"
165 os_include_dir="config/os/newlib"
166 AC_DEFINE(HAVE_HYPOT)
170 case "$target_alias" in
174 AC_DEFINE(HAVE_ACOSF)
175 AC_DEFINE(HAVE_ASINF)
176 AC_DEFINE(HAVE_ATAN2F)
177 AC_DEFINE(HAVE_ATANF)
178 AC_DEFINE(HAVE_CEILF)
179 AC_DEFINE(HAVE_COPYSIGN)
180 AC_DEFINE(HAVE_COPYSIGNF)
182 AC_DEFINE(HAVE_COSHF)
184 AC_DEFINE(HAVE_FABSF)
185 AC_DEFINE(HAVE_FLOORF)
186 AC_DEFINE(HAVE_FMODF)
187 AC_DEFINE(HAVE_FREXPF)
188 AC_DEFINE(HAVE_LDEXPF)
189 AC_DEFINE(HAVE_LOG10F)
191 AC_DEFINE(HAVE_MODFF)
194 AC_DEFINE(HAVE_SINHF)
195 AC_DEFINE(HAVE_SQRTF)
197 AC_DEFINE(HAVE_TANHF)
200 # GLIBCPP_CHECK_STDLIB_SUPPORT
201 AC_DEFINE(HAVE_STRTOF)
202 AC_DEFINE(HAVE_STRTOLD)
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_FINITE)
218 AC_DEFINE(HAVE_FINITEF)
219 AC_DEFINE(HAVE_FLOORF)
220 AC_DEFINE(HAVE_FMODF)
221 AC_DEFINE(HAVE_FREXPF)
222 AC_DEFINE(HAVE_ISINF)
223 AC_DEFINE(HAVE_ISINFF)
224 AC_DEFINE(HAVE_ISNAN)
225 AC_DEFINE(HAVE_ISNANF)
226 AC_DEFINE(HAVE_LDEXPF)
227 AC_DEFINE(HAVE_LOG10F)
229 AC_DEFINE(HAVE_MODFF)
232 AC_DEFINE(HAVE_SINHF)
233 AC_DEFINE(HAVE_SQRTF)
235 AC_DEFINE(HAVE_TANHF)
239 # At some point, we should differentiate between architectures
240 # like x86, which have long double versions, and alpha/powerpc/etc.,
241 # which don't. For the time being, punt.
242 if test x"long_double_math_on_this_cpu" = x"yes"; then
243 AC_DEFINE(HAVE_ACOSL)
244 AC_DEFINE(HAVE_ASINL)
245 AC_DEFINE(HAVE_ATAN2L)
246 AC_DEFINE(HAVE_ATANL)
247 AC_DEFINE(HAVE_CEILL)
248 AC_DEFINE(HAVE_COPYSIGNL)
250 AC_DEFINE(HAVE_COSHL)
252 AC_DEFINE(HAVE_FABSL)
253 AC_DEFINE(HAVE_FINITEL)
254 AC_DEFINE(HAVE_FLOORL)
255 AC_DEFINE(HAVE_FMODL)
256 AC_DEFINE(HAVE_FREXPL)
257 AC_DEFINE(HAVE_ISINFL)
258 AC_DEFINE(HAVE_ISNANL)
259 AC_DEFINE(HAVE_LDEXPL)
260 AC_DEFINE(HAVE_LOG10L)
262 AC_DEFINE(HAVE_MODFL)
264 AC_DEFINE(HAVE_SINCOSL)
266 AC_DEFINE(HAVE_SINHL)
267 AC_DEFINE(HAVE_SQRTL)
269 AC_DEFINE(HAVE_TANHL)
273 # We are being configured natively. We can do more elaborate tests
274 # that include AC_TRY_COMPILE now, as the linker is assumed to be
276 GLIBCPP_IS_CROSS_COMPILING=0
279 # Check for available headers.
280 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
281 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
283 GLIBCPP_CHECK_COMPILER_FEATURES
284 GLIBCPP_CHECK_LINKER_FEATURES
285 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
286 GLIBCPP_CHECK_MATH_SUPPORT
287 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
288 GLIBCPP_CHECK_WCHAR_T_SUPPORT
289 GLIBCPP_CHECK_STDLIB_SUPPORT
294 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
295 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
300 # Establish limits on memory usage during 'make check'
301 GLIBCPP_CONFIGURE_TESTSUITE
304 # This depends on the possibly-skipped linker test above.
305 GLIBCPP_ENABLE_SYMVERS([yes])
307 # Propagate the target-specific source directories through the build chain.
308 OS_INC_SRCDIR=$os_include_dir/bits
309 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
310 CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
311 AC_SUBST(OS_INC_SRCDIR)
312 AC_SUBST(ATOMICITY_INC_SRCDIR)
313 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
315 # Set up cross-compile flags
316 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
317 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
321 if test "${multilib}" = "yes"; then
322 multilib_arg="--enable-multilib"
327 # Needed so that g++ can find the correct include subdir automatically.
330 # Export all the install information
331 GLIBCPP_EXPORT_INSTALL_INFO
333 # Export all the include and flag information to makefiles.
334 GLIBCPP_EXPORT_INCLUDES
337 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
338 grep "enable shared" > /dev/null; then
339 LIBSUPCXX_PICFLAGS=-prefer-pic
343 AC_SUBST(LIBSUPCXX_PICFLAGS)
345 # Generate the various Makefiles, include files, and scripts.
346 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
347 # and libsupc++/Makefile.am so that multilib installs will end up
348 # installed in the correct place. To work around this not being passed
349 # down from config-ml.in -> top_srcdir/Makefile.am ->
350 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
352 include/Makefile src/Makefile \
353 libmath/Makefile libio/Makefile libsupc++/Makefile \
354 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
355 [if test -n "$CONFIG_FILES"; then
356 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
357 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
358 grep '^MULTISUBDIR =' Makefile >> src/Makefile
359 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
362 chmod +x testsuite_flags
367 with_multisubdir=${with_multisubdir}
368 ac_configure_args="${multilib_arg} ${ac_configure_args}"
369 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
370 glibcpp_basedir=${glibcpp_basedir}
374 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
375 dnl AC_CONFIG_FILES(Makefile \
376 dnl include/Makefile src/Makefile \
377 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
378 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
379 dnl AC_CONFIG_COMMANDS([default],
380 dnl [if test -n "$CONFIG_FILES"; then
381 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
382 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
383 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
386 dnl chmod +x testsuite_flags
391 dnl with_multisubdir=${with_multisubdir}
392 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
393 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
394 dnl glibcpp_basedir=${glibcpp_basedir}
401 # Sanity checking & User-visible messages.
402 # Checks down here, otherwise they get scrolled off before
403 # the user will notice.
405 # Trying to get more people to read documentation. Possibly remove
406 # check and warn all the time. There is no "informational" AC_MSG_
407 # macro, so these are going to be printed even when --quiet/--silent
409 if test ! -f stamp-sanity-warned; then
410 touch stamp-sanity-warned
412 echo "Please make certain that you read the installation information here:"
413 echo " faster => ${srcdir}/docs/html/install.html"
414 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
416 echo "and the configuration information here:"
417 echo " faster => ${srcdir}/docs/html/configopts.html"
418 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
420 echo "before proceeding with ${_cv_gnu_make_command}."