1 # Process this file with autoconf to produce a configure script, like so:
2 # aclocal, autoconf, autoheader, automake
9 # For typical GNU versioning info, format is MAJOR.MINOR.MICRO
11 AC_SUBST(release_VERSION)
12 # For libtool versioning info, format is CURRENT:REVISION:AGE
14 AC_SUBST(libtool_VERSION)
16 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
17 # AC 2.50 sets target_alias iff the user specified --target, but we use it
18 # everywhere, so we set it here just to be sure.
20 target_alias=${target_alias-$target}
21 AC_SUBST(target_alias)
23 AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
24 AM_CONFIG_HEADER(config.h)
26 # Runs configure.host and configure.target, as well as finds CC, CXX
27 # and assorted other critical bits. Have to run this before the
28 # GLIBCPP_ENABLE_* macros below.
33 AC_SUBST(enable_shared)
34 AC_SUBST(enable_static)
36 # Check for c++ or library specific bits that don't require linking.
37 #GLIBCPP_CHECK_COMPILER_VERSION
38 GLIBCPP_CHECK_GNU_MAKE
40 # Enable all the variable C++ stuff. C_MBCHAR must come early.
41 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
43 GLIBCPP_ENABLE_CLOCALE
44 GLIBCPP_ENABLE_C_MBCHAR([yes])
45 GLIBCPP_ENABLE_C99([yes])
46 GLIBCPP_ENABLE_LONG_LONG([yes])
47 GLIBCPP_ENABLE_CHEADERS([c_std])
48 GLIBCPP_ENABLE_THREADS
49 GLIBCPP_ENABLE_CXX_FLAGS([none])
50 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
53 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
55 # This lets us hard-code the functionality we know
56 # we'll have in the cross target environment. "Let" is a
57 # sugar-coated word placed on an especially dull and tedious hack, actually.
58 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
59 # that involve linking can't be used:
60 # "cannot open sim-crt0.o"
61 # "cannot open crt0.o"
62 # etc. All this is because there currently exists no unified,
63 # consistent way for top level CC information to be passed down
64 # to target directories: newlib includes, newlib linking info,
65 # libgloss versus newlib crt0.o, etc. When all of this is done, all
66 # of this hokey, excessive AC_DEFINE junk for crosses can be removed.
68 # We are being configured with some form of cross compiler.
69 GLIBCPP_IS_CROSS_COMPILING=1
71 # If Canadian cross, then don't pick up tools from the build
73 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
79 case "$target_alias" in
81 # Construct linux crosses by hand, eliminating bits that need ld...
82 # Check for available headers.
83 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
84 machine/endian.h machine/param.h sys/machine.h sys/types.h \
85 fp.h locale.h float.h inttypes.h])
87 # GLIBCPP_CHECK_COMPILER_FEATURES
88 SECTION_FLAGS='-ffunction-sections -fdata-sections'
89 AC_SUBST(SECTION_FLAGS)
90 GLIBCPP_CHECK_LINKER_FEATURES
91 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
92 # GLIBCPP_CHECK_MATH_SUPPORT
95 AC_DEFINE(HAVE_ATAN2F)
98 AC_DEFINE(HAVE_COPYSIGN)
99 AC_DEFINE(HAVE_COPYSIGNF)
101 AC_DEFINE(HAVE_COSHF)
103 AC_DEFINE(HAVE_FABSF)
104 AC_DEFINE(HAVE_FINITE)
105 AC_DEFINE(HAVE_FINITEF)
106 AC_DEFINE(HAVE_FLOORF)
107 AC_DEFINE(HAVE_FMODF)
108 AC_DEFINE(HAVE_FREXPF)
109 AC_DEFINE(HAVE_HYPOTF)
110 AC_DEFINE(HAVE_ISINF)
111 AC_DEFINE(HAVE_ISINFF)
112 AC_DEFINE(HAVE_ISNAN)
113 AC_DEFINE(HAVE_ISNANF)
114 AC_DEFINE(HAVE_LDEXPF)
115 AC_DEFINE(HAVE_LOG10F)
117 AC_DEFINE(HAVE_MODFF)
119 AC_DEFINE(HAVE_SINCOS)
120 AC_DEFINE(HAVE_SINCOSF)
122 AC_DEFINE(HAVE_SINHF)
123 AC_DEFINE(HAVE_SQRTF)
125 AC_DEFINE(HAVE_TANHF)
127 # At some point, we should differentiate between architectures
128 # like x86, which have long double versions, and alpha/powerpc/etc.,
129 # which don't. For the time being, punt.
130 if test x"long_double_math_on_this_cpu" = x"yes"; then
131 AC_DEFINE(HAVE_ACOSL)
132 AC_DEFINE(HAVE_ASINL)
133 AC_DEFINE(HAVE_ATAN2L)
134 AC_DEFINE(HAVE_ATANL)
135 AC_DEFINE(HAVE_CEILL)
136 AC_DEFINE(HAVE_COPYSIGNL)
138 AC_DEFINE(HAVE_COSHL)
140 AC_DEFINE(HAVE_FABSL)
141 AC_DEFINE(HAVE_FINITEL)
142 AC_DEFINE(HAVE_FLOORL)
143 AC_DEFINE(HAVE_FMODL)
144 AC_DEFINE(HAVE_FREXPL)
145 AC_DEFINE(HAVE_HYPOTL)
146 AC_DEFINE(HAVE_ISINFL)
147 AC_DEFINE(HAVE_ISNANL)
148 AC_DEFINE(HAVE_LDEXPL)
149 AC_DEFINE(HAVE_LOG10L)
151 AC_DEFINE(HAVE_MODFL)
153 AC_DEFINE(HAVE_SINCOSL)
155 AC_DEFINE(HAVE_SINHL)
156 AC_DEFINE(HAVE_SQRTL)
158 AC_DEFINE(HAVE_TANHL)
160 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
161 GLIBCPP_CHECK_WCHAR_T_SUPPORT
162 os_include_dir="config/os/gnu-linux"
163 # GLIBCPP_CHECK_STDLIB_SUPPORT
164 AC_DEFINE(HAVE_STRTOF)
165 AC_DEFINE(HAVE_STRTOLD)
171 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
172 # GLIBCPP_CHECK_MATH_SUPPORT
173 AC_DEFINE(HAVE_FINITE)
174 AC_DEFINE(HAVE_HYPOT)
175 AC_DEFINE(HAVE_ISNAN)
176 AC_DEFINE(HAVE_ISINF)
178 AC_DEFINE(HAVE_ACOSF)
179 AC_DEFINE(HAVE_ASINF)
180 AC_DEFINE(HAVE_ATAN2F)
181 AC_DEFINE(HAVE_ATANF)
182 AC_DEFINE(HAVE_CEILF)
184 AC_DEFINE(HAVE_COSHF)
186 AC_DEFINE(HAVE_FABSF)
187 AC_DEFINE(HAVE_FLOORF)
188 AC_DEFINE(HAVE_FMODF)
189 AC_DEFINE(HAVE_HYPOTF)
190 AC_DEFINE(HAVE_ISNANF)
191 AC_DEFINE(HAVE_ISINFF)
192 AC_DEFINE(HAVE_LDEXPF)
193 AC_DEFINE(HAVE_LOG10F)
195 AC_DEFINE(HAVE_MODFF)
198 AC_DEFINE(HAVE_SINHF)
199 AC_DEFINE(HAVE_SQRTF)
201 AC_DEFINE(HAVE_TANHF)
203 os_include_dir="config/os/newlib"
208 # We are being configured natively. We can do more elaborate tests
209 # that include AC_TRY_COMPILE now, as the linker is assumed to be
211 GLIBCPP_IS_CROSS_COMPILING=0
214 # Check for available headers.
215 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
216 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
218 GLIBCPP_CHECK_COMPILER_FEATURES
219 GLIBCPP_CHECK_LINKER_FEATURES
220 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
221 GLIBCPP_CHECK_MATH_SUPPORT
222 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
223 GLIBCPP_CHECK_WCHAR_T_SUPPORT
224 GLIBCPP_CHECK_STDLIB_SUPPORT
229 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
230 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
235 # Establish limits on memory usage during 'make check'
236 GLIBCPP_CONFIGURE_TESTSUITE
240 # Propagate the target-specific source directories through the build chain.
241 OS_INC_SRCDIR=$os_include_dir/bits
242 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
243 CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
244 AC_SUBST(OS_INC_SRCDIR)
245 AC_SUBST(ATOMICITY_INC_SRCDIR)
246 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
248 # Set up cross-compile flags
249 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
250 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
254 if test "${multilib}" = "yes"; then
255 multilib_arg="--enable-multilib"
260 # Needed so that g++ can find the correct include subdir automatically.
263 # Export all the install information
264 GLIBCPP_EXPORT_INSTALL_INFO
266 # Export all the include and flag information to makefiles.
267 GLIBCPP_EXPORT_INCLUDES
270 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
271 grep "enable shared" > /dev/null; then
272 LIBSUPCXX_PICFLAGS=-prefer-pic
276 AC_SUBST(LIBSUPCXX_PICFLAGS)
278 # Generate the various Makefiles, include files, and scripts.
279 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
280 # and libsupc++/Makefile.am so that multilib installs will end up
281 # installed in the correct place. To work around this not being passed
282 # down from config-ml.in -> top_srcdir/Makefile.am ->
283 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
285 include/Makefile src/Makefile \
286 libmath/Makefile libio/Makefile libsupc++/Makefile \
287 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
288 [if test -n "$CONFIG_FILES"; then
289 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
290 grep '^MULTISUBDIR =' Makefile >> src/Makefile
291 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
294 chmod +x testsuite_flags
299 with_multisubdir=${with_multisubdir}
300 ac_configure_args="${multilib_arg} ${ac_configure_args}"
301 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
302 glibcpp_basedir=${glibcpp_basedir}
308 # Sanity checking & User-visible messages.
309 # Checks down here, otherwise they get scrolled off before
310 # the user will notice.
312 # Trying to get more people to read documentation. Possibly remove
313 # check and warn all the time. There is no "informational" AC_MSG_
314 # macro, so these are going to be printed even when --quiet/--silent
316 if test ! -f stamp-sanity-warned; then
317 touch stamp-sanity-warned
319 echo "Please make certain that you read the installation information here:"
320 echo " faster => ${srcdir}/docs/install.html"
321 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
323 echo "and the configuration information here:"
324 echo " faster => ${srcdir}/docs/configopts.html"
325 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
327 echo "before proceeding with ${_cv_gnu_make_command}."