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 # Will set LN_S to either 'ln -s' or 'ln'. With autoconf 2.50+, can also
40 # be 'cp -p' if linking isn't available.
41 ac_cv_prog_LN_S='cp -p'
44 # We use these options to decide which functions to include.
45 AC_ARG_WITH(target-subdir,
46 [ --with-target-subdir=SUBDIR
47 configuring in a subdirectory])
48 AC_ARG_WITH(cross-host,
49 [ --with-cross-host=HOST configuring with a cross compiler])
51 # Runs configure.host and configure.target. Have to run this before
52 # the GLIBCPP_ENABLE_* macros below.
57 AC_SUBST(enable_shared)
58 AC_SUBST(enable_static)
59 GLIBCPP_CHECK_GNU_MAKE
61 AM_CONFIG_HEADER(config.h)
63 # Check for c++ or library specific bits that don't require linking.
64 GLIBCPP_CHECK_COMPILER_VERSION
66 # Enable all the crazy c++ stuff. C_MBCHAR must come early.
67 GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
69 GLIBCPP_ENABLE_CLOCALE
70 GLIBCPP_ENABLE_C_MBCHAR([yes])
71 GLIBCPP_ENABLE_C99([yes])
72 GLIBCPP_ENABLE_LONG_LONG([yes])
73 GLIBCPP_ENABLE_CHEADERS([c_std])
74 GLIBCPP_ENABLE_THREADS
75 GLIBCPP_ENABLE_CXX_FLAGS([none])
76 GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
78 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
80 # We are being configured with some form of cross compiler.
81 # mknumeric_limits may not work correctly, either because the
82 # compiler may not run on this machine, may not be able to link
83 # executables, or may produce executables we can't run on this
85 GLIBCPP_IS_CROSS_COMPILING=1
87 # If Canadian cross, then don't pick up tools from the build
89 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
95 case "$target_alias" in
97 # Construct linux crosses by hand, eliminating bits that need ld...
98 # Check for available headers.
99 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
100 machine/endian.h machine/param.h sys/machine.h fp.h locale.h \
103 # GLIBCPP_CHECK_COMPILER_FEATURES
104 SECTION_FLAGS='-ffunction-sections -fdata-sections'
105 AC_SUBST(SECTION_FLAGS)
106 GLIBCPP_CHECK_LINKER_FEATURES
107 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
108 # GLIBCPP_CHECK_MATH_SUPPORT
109 AC_DEFINE(HAVE_ACOSF)
110 AC_DEFINE(HAVE_ASINF)
111 AC_DEFINE(HAVE_ATAN2F)
112 AC_DEFINE(HAVE_ATANF)
113 AC_DEFINE(HAVE_CEILF)
114 AC_DEFINE(HAVE_COPYSIGN)
115 AC_DEFINE(HAVE_COPYSIGNF)
117 AC_DEFINE(HAVE_COSHF)
119 AC_DEFINE(HAVE_FABSF)
120 AC_DEFINE(HAVE_FINITE)
121 AC_DEFINE(HAVE_FINITEF)
122 AC_DEFINE(HAVE_FLOORF)
123 AC_DEFINE(HAVE_FMODF)
124 AC_DEFINE(HAVE_FREXPF)
125 AC_DEFINE(HAVE_ISINF)
126 AC_DEFINE(HAVE_ISINFF)
127 AC_DEFINE(HAVE_ISNAN)
128 AC_DEFINE(HAVE_ISNANF)
129 AC_DEFINE(HAVE_LDEXPF)
130 AC_DEFINE(HAVE_LOG10F)
132 AC_DEFINE(HAVE_MODFF)
134 AC_DEFINE(HAVE_SINCOS)
135 AC_DEFINE(HAVE_SINCOSF)
137 AC_DEFINE(HAVE_SINHF)
138 AC_DEFINE(HAVE_SQRTF)
140 AC_DEFINE(HAVE_TANHF)
142 # At some point, we should differentiate between architectures
143 # like x86, which have long double versions, and alpha/powerpc/etc.,
144 # which don't. For the time being, punt.
145 if test x"long_double_math_on_this_cpu" = x"yes"; then
146 AC_DEFINE(HAVE_ACOSL)
147 AC_DEFINE(HAVE_ASINL)
148 AC_DEFINE(HAVE_ATAN2L)
149 AC_DEFINE(HAVE_ATANL)
150 AC_DEFINE(HAVE_CEILL)
151 AC_DEFINE(HAVE_COPYSIGNL)
153 AC_DEFINE(HAVE_COSHL)
155 AC_DEFINE(HAVE_FABSL)
156 AC_DEFINE(HAVE_FINITEL)
157 AC_DEFINE(HAVE_FLOORL)
158 AC_DEFINE(HAVE_FMODL)
159 AC_DEFINE(HAVE_FREXPL)
160 AC_DEFINE(HAVE_ISINFL)
161 AC_DEFINE(HAVE_ISNANL)
162 AC_DEFINE(HAVE_LDEXPL)
163 AC_DEFINE(HAVE_LOG10L)
165 AC_DEFINE(HAVE_MODFL)
167 AC_DEFINE(HAVE_SINCOSL)
169 AC_DEFINE(HAVE_SINHL)
170 AC_DEFINE(HAVE_SQRTL)
172 AC_DEFINE(HAVE_TANHL)
174 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
175 GLIBCPP_CHECK_WCHAR_T_SUPPORT
176 os_include_dir="config/os/gnu-linux"
177 # GLIBCPP_CHECK_STDLIB_SUPPORT
178 AC_DEFINE(HAVE_STRTOF)
179 AC_DEFINE(HAVE_STRTOLD)
184 # We assume newlib. This lets us hard-code the functions we know
186 AC_DEFINE(HAVE_FINITE)
187 AC_DEFINE(HAVE_ISNAN)
188 AC_DEFINE(HAVE_ISNANF)
189 AC_DEFINE(HAVE_ISINF)
190 AC_DEFINE(HAVE_ISINFF)
192 os_include_dir="config/os/newlib"
194 # need to check for faster f versions of math functions, ie sinf?
199 # We are being configured natively. We can do more elaborate tests
200 # that include AC_TRY_COMPILE now, as the linker is assumed to be
202 GLIBCPP_IS_CROSS_COMPILING=0
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 # Propagate the target-specific source directories through the build chain.
226 OS_INC_SRCDIR=$os_include_dir/bits
227 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
228 AC_SUBST(OS_INC_SRCDIR)
229 AC_SUBST(ATOMICITY_INC_SRCDIR)
231 # Set up cross-compile flags
232 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
233 AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
238 if test "${multilib}" = "yes"; then
239 multilib_arg="--enable-multilib"
244 # Needed so that g++ can find the correct include subdir automatically.
247 # Export all the install information
248 GLIBCPP_EXPORT_INSTALL_INFO
250 # Export all the include and flag information to makefiles.
251 GLIBCPP_EXPORT_INCLUDES
254 if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
255 grep "enable shared" > /dev/null; then
256 LIBSUPCXX_PICFLAGS=-prefer-pic
260 AC_SUBST(LIBSUPCXX_PICFLAGS)
262 # Generate the various Makefiles, include files, and scripts.
263 # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
264 # and libsupc++/Makefile.am so that multilib installs will end up
265 # installed in the correct place. To work around this not being passed
266 # down from config-ml.in -> top_srcdir/Makefile.am ->
267 # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
269 include/Makefile src/Makefile \
270 libmath/Makefile libio/Makefile libsupc++/Makefile \
271 testsuite/Makefile mkcheck testsuite_flags,
272 [if test -n "$CONFIG_FILES"; then
273 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
274 grep '^MULTISUBDIR =' Makefile >> src/Makefile
275 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
278 chmod +x testsuite_flags
283 with_multisubdir=${with_multisubdir}
284 ac_configure_args="${multilib_arg} ${ac_configure_args}"
285 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
286 glibcpp_basedir=${glibcpp_basedir}
292 # Sanity checking & User-visible messages.
293 # Checks down here, otherwise they get scrolled off before
294 # the user will notice.
296 # Trying to get more people to read documentation. Possibly remove
297 # check and warn all the time. There is no "informational" AC_MSG_
298 # macro, so these are going to be printed even when --quiet/--silent
300 if test ! -f stamp-sanity-warned; then
301 touch stamp-sanity-warned
303 echo "Please make certain that you read the installation information here:"
304 echo " faster => ${srcdir}/docs/install.html"
305 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
307 echo "and the configuration information here:"
308 echo " faster => ${srcdir}/docs/configopts.html"
309 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
311 echo "before proceeding with ${_cv_gnu_make_command}."