1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal, autoconf, autoheader, automake
7 # When building with srcdir == objdir, links to the source files will
8 # be created in directories within the target_subdir. We have to
9 # adjust toplevel_srcdir accordingly, so that configure finds
10 # install-sh and other auxiliary files that live in the top-level
12 if test "${srcdir}" = "."; then
13 if test -z "${with_target_subdir}"; then
16 if test "${with_target_subdir}" != "."; then
17 toprel="${with_multisrctop}../.."
19 toprel="${with_multisrctop}.."
25 AC_CONFIG_AUX_DIR(${srcdir}/$toprel)
26 toplevel_srcdir=\${top_srcdir}/$toprel
27 AC_SUBST(toplevel_srcdir)
29 dnl This is here just to satisfy automake.
30 ifelse(not,equal,[AC_CONFIG_AUX_DIR(..)])
32 # Gets and sets build, host, target, *_vendor, *_cpu, *_os, etc.
33 # AC 2.50 sets target_alias iff the user specified --target, but we use it
34 # everywhere, so we set it here just to be sure.
36 target_alias=${target_alias-$target}
37 AC_SUBST(target_alias)
39 # We use these options to decide which functions to include.
40 AC_ARG_WITH(target-subdir,
41 [ --with-target-subdir=SUBDIR
42 configuring in a subdirectory])
43 AC_ARG_WITH(cross-host,
44 [ --with-cross-host=HOST configuring with a cross compiler])
46 # Runs configure.host and configure.target. Have to run this before
47 # the GLIBCPP_ENABLE_* macros below.
52 AC_SUBST(enable_shared)
53 AC_SUBST(enable_static)
54 GLIBCPP_CHECK_GNU_MAKE
58 AM_CONFIG_HEADER(config.h)
60 # Check for c++ or library specific bits that don't require linking.
61 GLIBCPP_CHECK_COMPILER_VERSION
63 # Enable all the crazy c++ stuff. C_MBCHAR must come early.
64 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
66 GLIBCPP_ENABLE_CLOCALE
67 GLIBCPP_ENABLE_C_MBCHAR([yes])
68 GLIBCPP_ENABLE_C99([yes])
69 GLIBCPP_ENABLE_LONG_LONG([yes])
70 GLIBCPP_ENABLE_CHEADERS([c_std])
71 GLIBCPP_ENABLE_THREADS
72 GLIBCPP_ENABLE_CXX_FLAGS([none])
73 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
75 if test -n "$with_cross_host"; then
77 # We are being configured with a cross compiler. AC_REPLACE_FUNCS
78 # may not work correctly, because the compiler may not be able to
83 # If Canadian cross, then don't pick up tools from the build
85 if test x"$build" != x"$with_cross_host" && x"$build" != x"$target"; then
93 case "$target_alias" in
95 # Construct linux crosses by hand, eliminating bits that need ld...
96 # Check for available headers.
97 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
98 machine/endian.h machine/param.h sys/machine.h fp.h locale.h \
101 # GLIBCPP_CHECK_COMPILER_FEATURES
102 SECTION_FLAGS='-ffunction-sections -fdata-sections'
103 AC_SUBST(SECTION_FLAGS)
104 GLIBCPP_CHECK_LINKER_FEATURES
105 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
106 # GLIBCPP_CHECK_MATH_SUPPORT
107 AC_DEFINE(HAVE_ACOSF)
108 AC_DEFINE(HAVE_ASINF)
109 AC_DEFINE(HAVE_ATAN2F)
110 AC_DEFINE(HAVE_ATANF)
111 AC_DEFINE(HAVE_CEILF)
112 AC_DEFINE(HAVE_COPYSIGN)
113 AC_DEFINE(HAVE_COPYSIGNF)
115 AC_DEFINE(HAVE_COSHF)
117 AC_DEFINE(HAVE_FABSF)
118 AC_DEFINE(HAVE_FINITE)
119 AC_DEFINE(HAVE_FINITEF)
120 AC_DEFINE(HAVE_FLOORF)
121 AC_DEFINE(HAVE_FMODF)
122 AC_DEFINE(HAVE_FREXPF)
123 AC_DEFINE(HAVE_ISINF)
124 AC_DEFINE(HAVE_ISINFF)
125 AC_DEFINE(HAVE_ISNAN)
126 AC_DEFINE(HAVE_ISNANF)
127 AC_DEFINE(HAVE_LDEXPF)
128 AC_DEFINE(HAVE_LOG10F)
130 AC_DEFINE(HAVE_MODFF)
132 AC_DEFINE(HAVE_SINCOS)
133 AC_DEFINE(HAVE_SINCOSF)
135 AC_DEFINE(HAVE_SINHF)
136 AC_DEFINE(HAVE_SQRTF)
138 AC_DEFINE(HAVE_TANHF)
140 # At some point, we should differentiate between architectures
141 # like x86, which have long double versions, and alpha/powerpc/etc.,
142 # which don't. For the time being, punt.
143 if test x"long_double_math_on_this_cpu" = x"yes"; then
144 AC_DEFINE(HAVE_ACOSL)
145 AC_DEFINE(HAVE_ASINL)
146 AC_DEFINE(HAVE_ATAN2L)
147 AC_DEFINE(HAVE_ATANL)
148 AC_DEFINE(HAVE_CEILL)
149 AC_DEFINE(HAVE_COPYSIGNL)
151 AC_DEFINE(HAVE_COSHL)
153 AC_DEFINE(HAVE_FABSL)
154 AC_DEFINE(HAVE_FINITEL)
155 AC_DEFINE(HAVE_FLOORL)
156 AC_DEFINE(HAVE_FMODL)
157 AC_DEFINE(HAVE_FREXPL)
158 AC_DEFINE(HAVE_ISINFL)
159 AC_DEFINE(HAVE_ISNANL)
160 AC_DEFINE(HAVE_LDEXPL)
161 AC_DEFINE(HAVE_LOG10L)
163 AC_DEFINE(HAVE_MODFL)
165 AC_DEFINE(HAVE_SINCOSL)
167 AC_DEFINE(HAVE_SINHL)
168 AC_DEFINE(HAVE_SQRTL)
170 AC_DEFINE(HAVE_TANHL)
172 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
173 GLIBCPP_CHECK_WCHAR_T_SUPPORT
174 os_include_dir="config/os/gnu-linux"
175 # GLIBCPP_CHECK_STDLIB_SUPPORT
176 AC_DEFINE(HAVE_STRTOF)
177 AC_DEFINE(HAVE_STRTOLD)
182 # We assume newlib. This lets us hard-code the functions we know
184 AC_DEFINE(HAVE_FINITE)
185 AC_DEFINE(HAVE_ISNAN)
186 AC_DEFINE(HAVE_ISNANF)
187 AC_DEFINE(HAVE_ISINF)
188 AC_DEFINE(HAVE_ISINFF)
190 os_include_dir="config/os/newlib"
192 # need to check for faster f versions of math functions, ie sinf?
197 # We are being configured natively. We can do more elaborate tests
198 # that include AC_TRY_COMPILE now, as the linker is assumed to be
205 # Check for available headers.
206 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
207 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
209 GLIBCPP_CHECK_COMPILER_FEATURES
210 GLIBCPP_CHECK_LINKER_FEATURES
211 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
212 GLIBCPP_CHECK_MATH_SUPPORT
213 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
214 GLIBCPP_CHECK_WCHAR_T_SUPPORT
215 GLIBCPP_CHECK_STDLIB_SUPPORT
219 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
220 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])])
225 # Now that ctype is determined for all possible targets, we can do this...
226 AC_LINK_FILES($os_include_dir/bits/ctype_base.h, \
227 include/bits/ctype_base.h)
228 AC_LINK_FILES($os_include_dir/bits/ctype_inline.h, \
229 include/bits/ctype_inline.h)
230 AC_LINK_FILES($os_include_dir/bits/ctype_noninline.h, \
231 include/bits/ctype_noninline.h)
232 AC_LINK_FILES($ATOMICITYH/bits/atomicity.h, include/bits/atomicity.h)
234 AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
235 AM_CONDITIONAL(NATIVE, test "$NATIVE" = yes || test "$NULL_TARGET" = yes)
236 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
241 if test "${multilib}" = "yes"; then
242 multilib_arg="--enable-multilib"
248 # Generate the various Makefiles, include files, and scripts.
250 # Needed so that g++ can find the correct include subdir automatically.
253 # Export all the install information
254 GLIBCPP_EXPORT_INSTALL_INFO
256 # Export all the include and flag information to makefiles.
257 GLIBCPP_EXPORT_INCLUDES
260 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
261 grep "enable shared" > /dev/null; then
262 LIBSUPCXX_PICFLAGS=-prefer-pic
266 AC_SUBST(LIBSUPCXX_PICFLAGS)
268 # This should be done by mkincludedir, but hack around it now.
270 echo "checking for $blddir/include"
272 if test ! -d "$blddir/include"; then
273 mkdir "$blddir/include"
276 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
277 # and libsupc++/Makefile.am so that multilib installs will end up
278 # installed in the correct place. To work around this not being passed
279 # down from config-ml.in -> top_srcdir/Makefile.am ->
280 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
281 AC_OUTPUT(Makefile src/Makefile libmath/Makefile libio/Makefile libsupc++/Makefile testsuite/Makefile mkcheck testsuite_flags,
282 [if test -n "$CONFIG_FILES"; then
283 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
284 grep '^MULTISUBDIR =' Makefile >> src/Makefile
285 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
288 chmod +x testsuite_flags
293 with_multisubdir=${with_multisubdir}
294 ac_configure_args="${multilib_arg} ${ac_configure_args}"
295 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
296 glibcpp_basedir=${glibcpp_basedir}
302 # Generate bits/c++config.h
303 # NB: This must be the first generated file as others include it. . .
304 $srcdir/mkc++config $blddir $srcdir
306 # Generate bits/std_limits.h and src/limitsMEMBERS.cc
307 if test ! -f stamp-limits; then
308 $srcdir/mknumeric_limits $blddir $srcdir $xcompiling
309 if test ! -f include/bits/std_limits.h; then
310 echo "mknumeric_limits failed to execute properly: exiting"
318 # Sanity checking & User-visible messages.
319 # Checks down here, otherwise they get scrolled off before
320 # the user will notice.
322 # Trying to get more people to read documentation. Possibly remove
323 # check and warn all the time. There is no "informational" AC_MSG_
324 # macro, so these are going to be printed even when --quiet/--silent
326 if test ! -f stamp-sanity-warned; then
327 touch stamp-sanity-warned
329 echo "Please make certain that you read the installation information here:"
330 echo " faster => ${srcdir}/docs/install.html"
331 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
333 echo "and the configuration information here:"
334 echo " faster => ${srcdir}/docs/configopts.html"
335 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
337 echo "before proceeding with ${_cv_gnu_make_command}."