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.5x sets target_alias iff the user specified --target, but we use it
18 # everywhere, so we set it here just to be sure. In AC 2.13
19 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
21 target_alias=${target_alias-$target}
22 AC_SUBST(target_alias)
24 AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
25 AM_CONFIG_HEADER(config.h)
27 # Runs configure.host and configure.target, as well as finds CC, CXX
28 # and assorted other critical bits. Have to run this before the
29 # GLIBCPP_ENABLE_* macros below.
34 AC_SUBST(enable_shared)
35 AC_SUBST(enable_static)
37 # Check for c++ or library specific bits that don't require linking.
38 #GLIBCPP_CHECK_COMPILER_VERSION
39 GLIBCPP_CHECK_GNU_MAKE
41 # Enable all the variable C++ stuff. C_MBCHAR must come early.
42 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
44 GLIBCPP_ENABLE_CLOCALE
45 GLIBCPP_ENABLE_C_MBCHAR([yes])
46 GLIBCPP_ENABLE_C99([yes])
47 GLIBCPP_ENABLE_LONG_LONG([yes])
48 GLIBCPP_ENABLE_CHEADERS([c_std])
49 GLIBCPP_ENABLE_THREADS
50 GLIBCPP_ENABLE_CXX_FLAGS([none])
51 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
52 GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
53 GLIBCPP_ENABLE_CONCEPT_CHECKS
56 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
58 # This lets us hard-code the functionality we know
59 # we'll have in the cross target environment. "Let" is a
60 # sugar-coated word placed on an especially dull and tedious hack, actually.
61 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
62 # that involve linking can't be used:
63 # "cannot open sim-crt0.o"
64 # "cannot open crt0.o"
65 # etc. All this is because there currently exists no unified,
66 # consistent way for top level CC information to be passed down
67 # to target directories: newlib includes, newlib linking info,
68 # libgloss versus newlib crt0.o, etc. When all of this is done, all
69 # of this hokey, excessive AC_DEFINE junk for crosses can be removed.
71 # We are being configured with some form of cross compiler.
72 GLIBCPP_IS_CROSS_COMPILING=1
74 # If Canadian cross, then don't pick up tools from the build
76 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
82 # Construct crosses by hand, eliminating bits that need ld...
83 # GLIBCPP_CHECK_COMPILER_FEATURES
84 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
85 # GLIBCPP_CHECK_MATH_SUPPORT
87 case "$target_alias" in
89 # Check for available headers.
90 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
91 machine/endian.h machine/param.h sys/machine.h sys/types.h \
92 fp.h locale.h float.h inttypes.h])
93 SECTION_FLAGS='-ffunction-sections -fdata-sections'
94 AC_SUBST(SECTION_FLAGS)
95 GLIBCPP_CHECK_LINKER_FEATURES
96 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
97 GLIBCPP_CHECK_WCHAR_T_SUPPORT
98 os_include_dir="config/os/gnu-linux"
99 AC_DEFINE(HAVE_COPYSIGN)
100 AC_DEFINE(HAVE_COPYSIGNF)
101 AC_DEFINE(HAVE_FINITEF)
102 AC_DEFINE(HAVE_FREXPF)
103 AC_DEFINE(HAVE_HYPOTF)
104 AC_DEFINE(HAVE_SINCOS)
105 AC_DEFINE(HAVE_SINCOSF)
106 if test x"long_double_math_on_this_cpu" = x"yes"; then
107 AC_DEFINE(HAVE_HYPOTL)
111 # Check for available headers.
112 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
113 machine/endian.h machine/param.h sys/machine.h sys/types.h \
114 fp.h locale.h float.h inttypes.h])
115 SECTION_FLAGS='-ffunction-sections -fdata-sections'
116 AC_SUBST(SECTION_FLAGS)
117 GLIBCPP_CHECK_LINKER_FEATURES
118 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
119 GLIBCPP_CHECK_WCHAR_T_SUPPORT
120 os_include_dir="config/os/hpux"
121 AC_DEFINE(HAVE_COPYSIGN)
122 AC_DEFINE(HAVE_COPYSIGNF)
123 AC_DEFINE(HAVE_FINITEF)
124 AC_DEFINE(HAVE_FREXPF)
125 AC_DEFINE(HAVE_HYPOT)
126 AC_DEFINE(HAVE_SINCOS)
127 AC_DEFINE(HAVE_SINCOSF)
130 # Check for available headers.
131 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
132 machine/endian.h machine/param.h sys/machine.h sys/types.h \
133 fp.h locale.h float.h inttypes.h])
134 SECTION_FLAGS='-ffunction-sections -fdata-sections'
135 AC_SUBST(SECTION_FLAGS)
136 GLIBCPP_CHECK_LINKER_FEATURES
137 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
138 GLIBCPP_CHECK_WCHAR_T_SUPPORT
139 os_include_dir="config/os/bsd/netbsd"
140 AC_DEFINE(HAVE_COPYSIGN)
141 AC_DEFINE(HAVE_COPYSIGNF)
142 AC_DEFINE(HAVE_FINITEF)
143 AC_DEFINE(HAVE_FREXPF)
144 AC_DEFINE(HAVE_HYPOTF)
147 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
148 GLIBCPP_CHECK_LINKER_FEATURES
149 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
150 GLIBCPP_CHECK_WCHAR_T_SUPPORT
151 os_include_dir="config/os/mingw32"
154 os_include_dir="config/os/newlib"
155 AC_DEFINE(HAVE_HYPOT)
159 case "$target_alias" in
163 # GLIBCPP_CHECK_STDLIB_SUPPORT
164 AC_DEFINE(HAVE_STRTOF)
165 AC_DEFINE(HAVE_STRTOLD)
169 AC_DEFINE(HAVE_ACOSF)
170 AC_DEFINE(HAVE_ASINF)
171 AC_DEFINE(HAVE_ATAN2F)
172 AC_DEFINE(HAVE_ATANF)
173 AC_DEFINE(HAVE_CEILF)
174 AC_DEFINE(HAVE_COPYSIGN)
175 AC_DEFINE(HAVE_COPYSIGNF)
177 AC_DEFINE(HAVE_COSHF)
179 AC_DEFINE(HAVE_FABSF)
180 AC_DEFINE(HAVE_FINITE)
181 AC_DEFINE(HAVE_FINITEF)
182 AC_DEFINE(HAVE_FLOORF)
183 AC_DEFINE(HAVE_FMODF)
184 AC_DEFINE(HAVE_FREXPF)
185 AC_DEFINE(HAVE_ISINF)
186 AC_DEFINE(HAVE_ISINFF)
187 AC_DEFINE(HAVE_ISNAN)
188 AC_DEFINE(HAVE_ISNANF)
189 AC_DEFINE(HAVE_LDEXPF)
190 AC_DEFINE(HAVE_LOG10F)
192 AC_DEFINE(HAVE_MODFF)
195 AC_DEFINE(HAVE_SINHF)
196 AC_DEFINE(HAVE_SQRTF)
198 AC_DEFINE(HAVE_TANHF)
202 # At some point, we should differentiate between architectures
203 # like x86, which have long double versions, and alpha/powerpc/etc.,
204 # which don't. For the time being, punt.
205 if test x"long_double_math_on_this_cpu" = x"yes"; then
206 AC_DEFINE(HAVE_ACOSL)
207 AC_DEFINE(HAVE_ASINL)
208 AC_DEFINE(HAVE_ATAN2L)
209 AC_DEFINE(HAVE_ATANL)
210 AC_DEFINE(HAVE_CEILL)
211 AC_DEFINE(HAVE_COPYSIGNL)
213 AC_DEFINE(HAVE_COSHL)
215 AC_DEFINE(HAVE_FABSL)
216 AC_DEFINE(HAVE_FINITEL)
217 AC_DEFINE(HAVE_FLOORL)
218 AC_DEFINE(HAVE_FMODL)
219 AC_DEFINE(HAVE_FREXPL)
220 AC_DEFINE(HAVE_ISINFL)
221 AC_DEFINE(HAVE_ISNANL)
222 AC_DEFINE(HAVE_LDEXPL)
223 AC_DEFINE(HAVE_LOG10L)
225 AC_DEFINE(HAVE_MODFL)
227 AC_DEFINE(HAVE_SINCOSL)
229 AC_DEFINE(HAVE_SINHL)
230 AC_DEFINE(HAVE_SQRTL)
232 AC_DEFINE(HAVE_TANHL)
236 # We are being configured natively. We can do more elaborate tests
237 # that include AC_TRY_COMPILE now, as the linker is assumed to be
239 GLIBCPP_IS_CROSS_COMPILING=0
242 # Check for available headers.
243 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
244 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
246 GLIBCPP_CHECK_COMPILER_FEATURES
247 GLIBCPP_CHECK_LINKER_FEATURES
248 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
249 GLIBCPP_CHECK_MATH_SUPPORT
250 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
251 GLIBCPP_CHECK_WCHAR_T_SUPPORT
252 GLIBCPP_CHECK_STDLIB_SUPPORT
257 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
258 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
263 # Establish limits on memory usage during 'make check'
264 GLIBCPP_CONFIGURE_TESTSUITE
267 # This depends on the possibly-skipped linker test above.
268 GLIBCPP_ENABLE_SYMVERS([yes])
270 # Propagate the target-specific source directories through the build chain.
271 OS_INC_SRCDIR=$os_include_dir/bits
272 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
273 CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
274 AC_SUBST(OS_INC_SRCDIR)
275 AC_SUBST(ATOMICITY_INC_SRCDIR)
276 AC_SUBST(CPU_LIMITS_INC_SRCDIR)
278 # Set up cross-compile flags
279 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
280 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
284 if test "${multilib}" = "yes"; then
285 multilib_arg="--enable-multilib"
290 # Needed so that g++ can find the correct include subdir automatically.
293 # Export all the install information
294 GLIBCPP_EXPORT_INSTALL_INFO
296 # Export all the include and flag information to makefiles.
297 GLIBCPP_EXPORT_INCLUDES
300 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
301 grep "enable shared" > /dev/null; then
302 LIBSUPCXX_PICFLAGS=-prefer-pic
306 AC_SUBST(LIBSUPCXX_PICFLAGS)
308 # Generate the various Makefiles, include files, and scripts.
309 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
310 # and libsupc++/Makefile.am so that multilib installs will end up
311 # installed in the correct place. To work around this not being passed
312 # down from config-ml.in -> top_srcdir/Makefile.am ->
313 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
315 include/Makefile src/Makefile \
316 libmath/Makefile libio/Makefile libsupc++/Makefile \
317 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
318 [if test -n "$CONFIG_FILES"; then
319 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
320 grep '^MULTISUBDIR =' Makefile >> src/Makefile
321 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
324 chmod +x testsuite_flags
329 with_multisubdir=${with_multisubdir}
330 ac_configure_args="${multilib_arg} ${ac_configure_args}"
331 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
332 glibcpp_basedir=${glibcpp_basedir}
336 dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
337 dnl AC_CONFIG_FILES(Makefile \
338 dnl include/Makefile src/Makefile \
339 dnl libmath/Makefile libio/Makefile libsupc++/Makefile \
340 dnl po/Makefile testsuite/Makefile mkcheck testsuite_flags)
341 dnl AC_CONFIG_COMMANDS([default],
342 dnl [if test -n "$CONFIG_FILES"; then
343 dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
344 dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
345 dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
348 dnl chmod +x testsuite_flags
353 dnl with_multisubdir=${with_multisubdir}
354 dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
355 dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
356 dnl glibcpp_basedir=${glibcpp_basedir}
363 # Sanity checking & User-visible messages.
364 # Checks down here, otherwise they get scrolled off before
365 # the user will notice.
367 # Trying to get more people to read documentation. Possibly remove
368 # check and warn all the time. There is no "informational" AC_MSG_
369 # macro, so these are going to be printed even when --quiet/--silent
371 if test ! -f stamp-sanity-warned; then
372 touch stamp-sanity-warned
374 echo "Please make certain that you read the installation information here:"
375 echo " faster => ${srcdir}/docs/html/install.html"
376 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
378 echo "and the configuration information here:"
379 echo " faster => ${srcdir}/docs/html/configopts.html"
380 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
382 echo "before proceeding with ${_cv_gnu_make_command}."