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 SECTION_FLAGS='-ffunction-sections -fdata-sections'
166 AC_SUBST(SECTION_FLAGS)
167 GLIBCPP_CHECK_LINKER_FEATURES
168 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
169 GLIBCPP_CHECK_WCHAR_T_SUPPORT
170 os_include_dir="config/os/qnx/qnx6.1"
173 AC_DEFINE(HAVE_COSHF)
174 AC_DEFINE(HAVE_COSHL)
177 AC_DEFINE(HAVE_LOG10F)
178 AC_DEFINE(HAVE_LOG10L)
181 AC_DEFINE(HAVE_SINHF)
182 AC_DEFINE(HAVE_SINHL)
185 os_include_dir="config/os/newlib"
186 AC_DEFINE(HAVE_HYPOT)
190 case "$target_alias" in
194 AC_DEFINE(HAVE_ACOSF)
195 AC_DEFINE(HAVE_ASINF)
196 AC_DEFINE(HAVE_ATAN2F)
197 AC_DEFINE(HAVE_ATANF)
198 AC_DEFINE(HAVE_CEILF)
199 AC_DEFINE(HAVE_COPYSIGN)
200 AC_DEFINE(HAVE_COPYSIGNF)
202 AC_DEFINE(HAVE_COSHF)
204 AC_DEFINE(HAVE_FABSF)
205 AC_DEFINE(HAVE_FLOORF)
206 AC_DEFINE(HAVE_FMODF)
207 AC_DEFINE(HAVE_FREXPF)
208 AC_DEFINE(HAVE_LDEXPF)
209 AC_DEFINE(HAVE_LOG10F)
211 AC_DEFINE(HAVE_MODFF)
214 AC_DEFINE(HAVE_SINHF)
215 AC_DEFINE(HAVE_SQRTF)
217 AC_DEFINE(HAVE_TANHF)
220 # GLIBCPP_CHECK_STDLIB_SUPPORT
221 AC_DEFINE(HAVE_STRTOF)
222 AC_DEFINE(HAVE_STRTOLD)
226 AC_DEFINE(HAVE_ACOSF)
227 AC_DEFINE(HAVE_ASINF)
228 AC_DEFINE(HAVE_ATAN2F)
229 AC_DEFINE(HAVE_ATANF)
230 AC_DEFINE(HAVE_CEILF)
231 AC_DEFINE(HAVE_COPYSIGN)
232 AC_DEFINE(HAVE_COPYSIGNF)
234 AC_DEFINE(HAVE_COSHF)
236 AC_DEFINE(HAVE_FABSF)
237 AC_DEFINE(HAVE_FINITE)
238 AC_DEFINE(HAVE_FINITEF)
239 AC_DEFINE(HAVE_FLOORF)
240 AC_DEFINE(HAVE_FMODF)
241 AC_DEFINE(HAVE_FREXPF)
242 AC_DEFINE(HAVE_ISINF)
243 AC_DEFINE(HAVE_ISINFF)
244 AC_DEFINE(HAVE_ISNAN)
245 AC_DEFINE(HAVE_ISNANF)
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)
259 # At some point, we should differentiate between architectures
260 # like x86, which have long double versions, and alpha/powerpc/etc.,
261 # which don't. For the time being, punt.
262 if test x"long_double_math_on_this_cpu" = x"yes"; then
263 AC_DEFINE(HAVE_ACOSL)
264 AC_DEFINE(HAVE_ASINL)
265 AC_DEFINE(HAVE_ATAN2L)
266 AC_DEFINE(HAVE_ATANL)
267 AC_DEFINE(HAVE_CEILL)
268 AC_DEFINE(HAVE_COPYSIGNL)
270 AC_DEFINE(HAVE_COSHL)
272 AC_DEFINE(HAVE_FABSL)
273 AC_DEFINE(HAVE_FINITEL)
274 AC_DEFINE(HAVE_FLOORL)
275 AC_DEFINE(HAVE_FMODL)
276 AC_DEFINE(HAVE_FREXPL)
277 AC_DEFINE(HAVE_ISINFL)
278 AC_DEFINE(HAVE_ISNANL)
279 AC_DEFINE(HAVE_LDEXPL)
280 AC_DEFINE(HAVE_LOG10L)
282 AC_DEFINE(HAVE_MODFL)
284 AC_DEFINE(HAVE_SINCOSL)
286 AC_DEFINE(HAVE_SINHL)
287 AC_DEFINE(HAVE_SQRTL)
289 AC_DEFINE(HAVE_TANHL)
293 # We are being configured natively. We can do more elaborate tests
294 # that include AC_TRY_COMPILE now, as the linker is assumed to be
296 GLIBCPP_IS_CROSS_COMPILING=0
299 # Check for available headers.
300 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
301 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h sys/types.h])
303 GLIBCPP_CHECK_COMPILER_FEATURES
304 GLIBCPP_CHECK_LINKER_FEATURES
305 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
306 GLIBCPP_CHECK_MATH_SUPPORT
307 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
308 GLIBCPP_CHECK_WCHAR_T_SUPPORT
309 GLIBCPP_CHECK_STDLIB_SUPPORT
314 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
315 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
320 # Establish limits on memory usage during 'make check'
321 GLIBCPP_CONFIGURE_TESTSUITE
324 # This depends on the possibly-skipped linker test above.
325 GLIBCPP_ENABLE_SYMVERS([yes])
327 # Propagate the target-specific source directories through the build chain.
328 OS_INC_SRCDIR=$os_include_dir/bits
329 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
330 CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
331 AC_SUBST(OS_INC_SRCDIR)
332 AC_SUBST(ATOMICITY_INC_SRCDIR)
333 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
335 # Set up cross-compile flags
336 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
337 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
341 if test "${multilib}" = "yes"; then
342 multilib_arg="--enable-multilib"
347 # Needed so that g++ can find the correct include subdir automatically.
350 # Export all the install information
351 GLIBCPP_EXPORT_INSTALL_INFO
353 # Export all the include and flag information to makefiles.
354 GLIBCPP_EXPORT_INCLUDES
357 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
358 grep "enable shared" > /dev/null; then
359 LIBSUPCXX_PICFLAGS=-prefer-pic
363 AC_SUBST(LIBSUPCXX_PICFLAGS)
365 # Generate the various Makefiles, include files, and scripts.
366 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
367 # and libsupc++/Makefile.am so that multilib installs will end up
368 # installed in the correct place. To work around this not being passed
369 # down from config-ml.in -> top_srcdir/Makefile.am ->
370 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
372 include/Makefile src/Makefile \
373 libmath/Makefile libio/Makefile libsupc++/Makefile \
374 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
375 [if test -n "$CONFIG_FILES"; then
376 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
377 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
378 grep '^MULTISUBDIR =' Makefile >> src/Makefile
379 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
382 chmod +x testsuite_flags
387 with_multisubdir=${with_multisubdir}
388 ac_configure_args="${multilib_arg} ${ac_configure_args}"
389 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
390 glibcpp_basedir=${glibcpp_basedir}
394 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
395 dnl AC_CONFIG_FILES(Makefile \
396 dnl include/Makefile src/Makefile \
397 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
398 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
399 dnl AC_CONFIG_COMMANDS([default],
400 dnl [if test -n "$CONFIG_FILES"; then
401 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
402 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
403 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
406 dnl chmod +x testsuite_flags
411 dnl with_multisubdir=${with_multisubdir}
412 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
413 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
414 dnl glibcpp_basedir=${glibcpp_basedir}
421 # Sanity checking & User-visible messages.
422 # Checks down here, otherwise they get scrolled off before
423 # the user will notice.
425 # Trying to get more people to read documentation. Possibly remove
426 # check and warn all the time. There is no "informational" AC_MSG_
427 # macro, so these are going to be printed even when --quiet/--silent
429 if test ! -f stamp-sanity-warned; then
430 touch stamp-sanity-warned
432 echo "Please make certain that you read the installation information here:"
433 echo " faster => ${srcdir}/docs/html/install.html"
434 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
436 echo "and the configuration information here:"
437 echo " faster => ${srcdir}/docs/html/configopts.html"
438 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
440 echo "before proceeding with ${_cv_gnu_make_command}."