]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.in
call.c: Fix comment typos.
[thirdparty/gcc.git] / libstdc++-v3 / configure.in
CommitLineData
b2dad0e3 1# Process this file with autoconf to produce a configure script, like so:
d2caef2e 2# aclocal && autoconf && autoheader && automake
b2dad0e3
BK
3
4AC_PREREQ(2.13)
1228c7b6 5AC_INIT(src/ios.cc)
e2c20fae 6
6706f116
AO
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
2c839a4e 10# exported. Only used at the end of this file.
6706f116
AO
11ORIGINAL_LD_FOR_MULTILIBS=$LD
12
33590f13 13PACKAGE=libstdc++
33590f13 14AC_SUBST(PACKAGE)
4e10943d 15# For libtool versioning info, format is CURRENT:REVISION:AGE
8099b2ae 16libtool_VERSION=6:0:0
4e10943d 17AC_SUBST(libtool_VERSION)
b2dad0e3 18
aebb8c22
DD
19GLIBCPP_TOPREL_CONFIGURE
20
58b08ac3 21# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
2c839a4e
PE
22#
23# You will slowly go insane if you do not grok the following fact: when
24# building v3 as part of the compiler, the top-level /target/ becomes the
25# library's /host/. `configure' then causes --target to default to --host,
26# exactly like any other package using autoconf. Therefore, 'target' and
27# 'host' will always be the same. This makes sense both for native and
28# cross compilers, just think about it for a little while. :-)
29#
30# Also, if v3 is being configured as part of a cross compiler, the top-level
31# configure script will pass the "real" host as $with_cross_host.
32#
b731048b 33# In AC 2.13 AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM.
b2dad0e3
BK
34AC_CANONICAL_SYSTEM
35
b731048b 36# Runs configure.host, finds CC, CXX and assorted other critical bits.
2c839a4e 37# Must run this before the GLIBCPP_ENABLE_* macros below.
b2dad0e3 38GLIBCPP_CONFIGURE(.)
f4c79fef 39
2f235b6d
PE
40AM_INIT_AUTOMAKE($PACKAGE, $gcc_version)
41AM_CONFIG_HEADER(config.h)
42
b2dad0e3 43AC_LIBTOOL_DLOPEN
5780a46b 44AM_PROG_LIBTOOL
34791641
PE
45AC_SUBST(enable_shared)
46AC_SUBST(enable_static)
04e78786 47
44f0760e 48# Check for support bits and g++ features that don't require linking.
33590f13 49GLIBCPP_CHECK_GNU_MAKE
249ed716 50#GLIBCPP_CHECK_COMPILER_VERSION
44f0760e
BK
51GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
52GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS
53GLIBCPP_ENABLE_PCH([yes])
b2dad0e3 54
44f0760e
BK
55# Enable all the variable C++ runtime options.
56# NB: C_MBCHAR must come early.
b2dad0e3 57GLIBCPP_ENABLE_CSTDIO
0214010c 58GLIBCPP_ENABLE_CLOCALE
6aa43d99 59GLIBCPP_ENABLE_CHEADERS([$c_model])
e26cb7ab 60GLIBCPP_ENABLE_C_MBCHAR([yes])
7cda84dc
BK
61GLIBCPP_ENABLE_C99([yes])
62GLIBCPP_ENABLE_LONG_LONG([yes])
b2dad0e3 63GLIBCPP_ENABLE_THREADS
4d16bdbb 64GLIBCPP_ENABLE_CONCEPT_CHECKS
645419c8 65GLIBCPP_ENABLE_CXX_FLAGS
6aa43d99
BK
66GLIBCPP_ENABLE_DEBUG([no])
67GLIBCPP_ENABLE_DEBUG_FLAGS([none])
b2dad0e3 68
974e336b
PE
69# No surprises, no surprises...
70if test $ATOMICITYH = cpu/generic ; then
9e57d5ca 71 AC_MSG_WARN([No native atomic operations are provided for this platform.])
974e336b
PE
72 if test $target_thread_file = single; then
73 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
74 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
75 else
76 AC_MSG_WARN([They will be faked using a mutex.])
77 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
78 fi
79fi
80
81
b731048b 82if test x"$build" != x"$host"; then
b2dad0e3 83
39f5fa33 84 # We are being configured with some form of cross compiler.
16da539b 85 GLIBCPP_IS_CROSS_COMPILING=true
eebc608e 86
2c839a4e
PE
87 # This lets us hard-code the functionality we know we'll have in the cross
88 # target environment. "Let" is a sugar-coated word placed on an especially
89 # dull and tedious hack, actually.
90 #
91 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
92 # that involve linking, can't be used:
93 # "cannot open sim-crt0.o"
94 # "cannot open crt0.o"
95 # etc. All this is because there currently exists no unified, consistent
96 # way for top level CC information to be passed down to target directories:
97 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
98 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
99 # crosses can be removed.
100
101 # If Canadian cross, then don't pick up tools from the build directory.
102 # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?).
b731048b
BK
103 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host" \
104 && test x"$build" != x"$target"; then
b2dad0e3 105 CANADIAN=yes
b2dad0e3
BK
106 else
107 CANADIAN=no
b2dad0e3
BK
108 fi
109
75940b88
SE
110 # Construct crosses by hand, eliminating bits that need ld...
111 # GLIBCPP_CHECK_COMPILER_FEATURES
112 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
113 # GLIBCPP_CHECK_MATH_SUPPORT
114
b731048b 115 case "${host}" in
e8751f35
BK
116 *-freebsd*)
117 os_include_dir="os/bsd/freebsd"
75940b88 118 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
2c839a4e 119 machine/endian.h machine/param.h sys/machine.h sys/types.h \
e8751f35
BK
120 fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \
121 sys/time.h unistd.h])
75940b88 122 SECTION_FLAGS='-ffunction-sections -fdata-sections'
e8751f35 123 AC_SUBST(SECTION_FLAGS)
75940b88
SE
124 GLIBCPP_CHECK_LINKER_FEATURES
125 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
126 GLIBCPP_CHECK_WCHAR_T_SUPPORT
e8751f35
BK
127 AC_DEFINE(HAVE_LC_MESSAGES)
128 AC_DEFINE(HAVE_DRAND48)
129 AC_DEFINE(HAVE_GETPAGESIZE)
130 AC_DEFINE(HAVE_SETENV)
131 AC_DEFINE(HAVE_SIGSETJMP)
75940b88
SE
132 AC_DEFINE(HAVE_COPYSIGN)
133 AC_DEFINE(HAVE_COPYSIGNF)
134 AC_DEFINE(HAVE_FINITEF)
e8751f35 135 AC_DEFINE(HAVE_FINITE)
75940b88 136 AC_DEFINE(HAVE_FREXPF)
e8751f35 137 AC_DEFINE(HAVE_HYPOT)
75940b88 138 AC_DEFINE(HAVE_HYPOTF)
a616effa 139 AC_DEFINE(HAVE_ISINF)
a616effa
SE
140 AC_DEFINE(HAVE_ISNAN)
141 AC_DEFINE(HAVE_ISNANF)
e8751f35
BK
142
143 AC_DEFINE(HAVE_MMAP)
144 AC_DEFINE(HAVE_ACOSF)
145 AC_DEFINE(HAVE_ASINF)
146 AC_DEFINE(HAVE_ATAN2F)
147 AC_DEFINE(HAVE_ATANF)
148 AC_DEFINE(HAVE_CEILF)
149 AC_DEFINE(HAVE_COPYSIGN)
150 AC_DEFINE(HAVE_COPYSIGNF)
151 AC_DEFINE(HAVE_COSF)
152 AC_DEFINE(HAVE_COSHF)
153 AC_DEFINE(HAVE_EXPF)
154 AC_DEFINE(HAVE_FABSF)
155 AC_DEFINE(HAVE_FLOORF)
156 AC_DEFINE(HAVE_FMODF)
157 AC_DEFINE(HAVE_FREXPF)
158 AC_DEFINE(HAVE_LDEXPF)
159 AC_DEFINE(HAVE_LOG10F)
160 AC_DEFINE(HAVE_LOGF)
161 AC_DEFINE(HAVE_MODFF)
162 AC_DEFINE(HAVE_POWF)
163 AC_DEFINE(HAVE_SINF)
164 AC_DEFINE(HAVE_SINHF)
165 AC_DEFINE(HAVE_SQRTF)
166 AC_DEFINE(HAVE_TANF)
167 AC_DEFINE(HAVE_TANHF)
75940b88 168 if test x"long_double_math_on_this_cpu" = x"yes"; then
a616effa 169 AC_DEFINE(HAVE_FINITEL)
a616effa
SE
170 AC_DEFINE(HAVE_ISINFL)
171 AC_DEFINE(HAVE_ISNANL)
75940b88
SE
172 fi
173 ;;
174 *-hpux*)
e8751f35 175 os_include_dir="os/hpux"
75940b88 176 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
2c839a4e
PE
177 machine/endian.h machine/param.h sys/machine.h sys/types.h \
178 fp.h locale.h float.h inttypes.h])
75940b88
SE
179 SECTION_FLAGS='-ffunction-sections -fdata-sections'
180 AC_SUBST(SECTION_FLAGS)
181 GLIBCPP_CHECK_LINKER_FEATURES
182 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
183 GLIBCPP_CHECK_WCHAR_T_SUPPORT
75940b88
SE
184 AC_DEFINE(HAVE_COPYSIGN)
185 AC_DEFINE(HAVE_COPYSIGNF)
75940b88
SE
186 AC_DEFINE(HAVE_FREXPF)
187 AC_DEFINE(HAVE_HYPOT)
a0f27776 188 case "$target" in
a616effa
SE
189 *-hpux10*)
190 AC_DEFINE(HAVE_FINITE)
191 AC_DEFINE(HAVE_FINITEF)
192 AC_DEFINE(HAVE_ISINF)
193 AC_DEFINE(HAVE_ISINFF)
194 AC_DEFINE(HAVE_ISNAN)
195 AC_DEFINE(HAVE_ISNANF)
196 ;;
197 esac
75940b88 198 ;;
e8751f35
BK
199 *-linux*)
200 os_include_dir="os/gnu-linux"
40ded872 201 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
2c839a4e
PE
202 machine/endian.h machine/param.h sys/machine.h sys/types.h \
203 fp.h locale.h float.h inttypes.h])
40ded872 204 SECTION_FLAGS='-ffunction-sections -fdata-sections'
e8751f35 205 AC_SUBST(SECTION_FLAGS)
40ded872
JT
206 GLIBCPP_CHECK_LINKER_FEATURES
207 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
208 GLIBCPP_CHECK_WCHAR_T_SUPPORT
40ded872
JT
209 AC_DEFINE(HAVE_COPYSIGN)
210 AC_DEFINE(HAVE_COPYSIGNF)
a616effa 211 AC_DEFINE(HAVE_FINITE)
e8751f35 212 AC_DEFINE(HAVE_FINITEF)
40ded872
JT
213 AC_DEFINE(HAVE_FREXPF)
214 AC_DEFINE(HAVE_HYPOTF)
a616effa
SE
215 AC_DEFINE(HAVE_ISINF)
216 AC_DEFINE(HAVE_ISINFF)
217 AC_DEFINE(HAVE_ISNAN)
218 AC_DEFINE(HAVE_ISNANF)
e8751f35
BK
219 AC_DEFINE(HAVE_SINCOS)
220 AC_DEFINE(HAVE_SINCOSF)
a616effa
SE
221 if test x"long_double_math_on_this_cpu" = x"yes"; then
222 AC_DEFINE(HAVE_FINITEL)
e8751f35 223 AC_DEFINE(HAVE_HYPOTL)
a616effa
SE
224 AC_DEFINE(HAVE_ISINFL)
225 AC_DEFINE(HAVE_ISNANL)
226 fi
40ded872 227 ;;
e8751f35
BK
228 *-mingw32*)
229 os_include_dir="os/mingw32"
230 AC_CHECK_HEADERS([sys/types.h locale.h float.h])
231 GLIBCPP_CHECK_LINKER_FEATURES
232 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
233 GLIBCPP_CHECK_WCHAR_T_SUPPORT
234 ;;
235 *-netbsd*)
236 os_include_dir="os/bsd/netbsd"
58be1883
MV
237 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
238 machine/endian.h machine/param.h sys/machine.h sys/types.h \
e8751f35 239 fp.h locale.h float.h inttypes.h])
58be1883
MV
240 SECTION_FLAGS='-ffunction-sections -fdata-sections'
241 AC_SUBST(SECTION_FLAGS)
242 GLIBCPP_CHECK_LINKER_FEATURES
243 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
244 GLIBCPP_CHECK_WCHAR_T_SUPPORT
58be1883
MV
245 AC_DEFINE(HAVE_COPYSIGN)
246 AC_DEFINE(HAVE_COPYSIGNF)
247 AC_DEFINE(HAVE_FINITEF)
248 AC_DEFINE(HAVE_FINITE)
249 AC_DEFINE(HAVE_FREXPF)
58be1883
MV
250 AC_DEFINE(HAVE_HYPOTF)
251 AC_DEFINE(HAVE_ISINF)
e8751f35 252 AC_DEFINE(HAVE_ISINFF)
58be1883
MV
253 AC_DEFINE(HAVE_ISNAN)
254 AC_DEFINE(HAVE_ISNANF)
255 if test x"long_double_math_on_this_cpu" = x"yes"; then
256 AC_DEFINE(HAVE_FINITEL)
257 AC_DEFINE(HAVE_ISINFL)
258 AC_DEFINE(HAVE_ISNANL)
259 fi
260 ;;
e8751f35
BK
261 *-qnx6.1* | *-qnx6.2*)
262 os_include_dir="os/qnx/qnx6.1"
f62bef48
C
263 SECTION_FLAGS='-ffunction-sections -fdata-sections'
264 AC_SUBST(SECTION_FLAGS)
265 GLIBCPP_CHECK_LINKER_FEATURES
266 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
267 GLIBCPP_CHECK_WCHAR_T_SUPPORT
f62bef48
C
268 AC_DEFINE(HAVE_COSF)
269 AC_DEFINE(HAVE_COSL)
270 AC_DEFINE(HAVE_COSHF)
271 AC_DEFINE(HAVE_COSHL)
272 AC_DEFINE(HAVE_LOGF)
273 AC_DEFINE(HAVE_LOGL)
274 AC_DEFINE(HAVE_LOG10F)
275 AC_DEFINE(HAVE_LOG10L)
276 AC_DEFINE(HAVE_SINF)
277 AC_DEFINE(HAVE_SINL)
278 AC_DEFINE(HAVE_SINHF)
279 AC_DEFINE(HAVE_SINHL)
280 ;;
e8751f35
BK
281 *-solaris*)
282 case "$target" in
283 *-solaris2.5)
284 os_include_dir="os/solaris/solaris2.5"
285 ;;
286 *-solaris2.6)
287 os_include_dir="os/solaris/solaris2.6"
288 ;;
289 *-solaris2.7 | *-solaris2.8 | *-solaris2.9)
290 os_include_dir="os/solaris/solaris2.7"
291 ;;
292 esac
293 AC_DEFINE(HAVE_STRTOF)
294 AC_DEFINE(HAVE_STRTOLD)
295 AC_DEFINE(HAVE_MMAP)
58be1883 296 AC_DEFINE(HAVE_COPYSIGN)
e8751f35
BK
297 AC_DEFINE(HAVE_ISNAN)
298 AC_DEFINE(HAVE_ISNANF)
58be1883 299 AC_DEFINE(HAVE_MODFF)
e8751f35 300 AC_DEFINE(HAVE_HYPOT)
58be1883 301 ;;
e8751f35
BK
302 *-windiss*)
303 os_include_dir="os/windiss"
58be1883
MV
304 AC_DEFINE(HAVE_ACOSF)
305 AC_DEFINE(HAVE_ASINF)
306 AC_DEFINE(HAVE_ATAN2F)
307 AC_DEFINE(HAVE_ATANF)
522e3d22
MM
308 AC_DEFINE(HAVE_CEILF)
309 AC_DEFINE(HAVE_COPYSIGN)
310 AC_DEFINE(HAVE_COPYSIGNF)
311 AC_DEFINE(HAVE_COSF)
312 AC_DEFINE(HAVE_COSHF)
313 AC_DEFINE(HAVE_EXPF)
314 AC_DEFINE(HAVE_FABSF)
315 AC_DEFINE(HAVE_FLOORF)
316 AC_DEFINE(HAVE_FMODF)
317 AC_DEFINE(HAVE_FREXPF)
318 AC_DEFINE(HAVE_LDEXPF)
319 AC_DEFINE(HAVE_LOG10F)
320 AC_DEFINE(HAVE_LOGF)
321 AC_DEFINE(HAVE_MODFF)
322 AC_DEFINE(HAVE_POWF)
323 AC_DEFINE(HAVE_SINF)
324 AC_DEFINE(HAVE_SINHF)
325 AC_DEFINE(HAVE_SQRTF)
326 AC_DEFINE(HAVE_TANF)
327 AC_DEFINE(HAVE_TANHF)
328 ;;
660bdf36 329 *)
b731048b
BK
330 if test "x${with_newlib}" = "xyes"; then
331 os_include_dir="os/newlib"
332 AC_DEFINE(HAVE_HYPOT)
e8751f35 333
b731048b
BK
334 # GLIBCPP_CHECK_STDLIB_SUPPORT
335 AC_DEFINE(HAVE_STRTOF)
336 AC_DEFINE(HAVE_STRTOLD)
337 # AC_FUNC_MMAP
338 AC_DEFINE(HAVE_MMAP)
660bdf36 339
b731048b
BK
340 AC_DEFINE(HAVE_ACOSF)
341 AC_DEFINE(HAVE_ASINF)
342 AC_DEFINE(HAVE_ATAN2F)
343 AC_DEFINE(HAVE_ATANF)
344 AC_DEFINE(HAVE_CEILF)
345 AC_DEFINE(HAVE_COPYSIGN)
346 AC_DEFINE(HAVE_COPYSIGNF)
347 AC_DEFINE(HAVE_COSF)
348 AC_DEFINE(HAVE_COSHF)
349 AC_DEFINE(HAVE_EXPF)
350 AC_DEFINE(HAVE_FABSF)
351 AC_DEFINE(HAVE_FLOORF)
352 AC_DEFINE(HAVE_FMODF)
353 AC_DEFINE(HAVE_FREXPF)
354 AC_DEFINE(HAVE_LDEXPF)
355 AC_DEFINE(HAVE_LOG10F)
356 AC_DEFINE(HAVE_LOGF)
357 AC_DEFINE(HAVE_MODFF)
358 AC_DEFINE(HAVE_POWF)
359 AC_DEFINE(HAVE_SINF)
360 AC_DEFINE(HAVE_SINHF)
361 AC_DEFINE(HAVE_SQRTF)
362 AC_DEFINE(HAVE_TANF)
363 AC_DEFINE(HAVE_TANHF)
364 else
365 AC_MSG_ERROR([No support for this host/target combination.])
366 fi
367 ;;
660bdf36 368 esac
75940b88
SE
369
370 # At some point, we should differentiate between architectures
371 # like x86, which have long double versions, and alpha/powerpc/etc.,
372 # which don't. For the time being, punt.
373 if test x"long_double_math_on_this_cpu" = x"yes"; then
374 AC_DEFINE(HAVE_ACOSL)
375 AC_DEFINE(HAVE_ASINL)
376 AC_DEFINE(HAVE_ATAN2L)
377 AC_DEFINE(HAVE_ATANL)
378 AC_DEFINE(HAVE_CEILL)
379 AC_DEFINE(HAVE_COPYSIGNL)
380 AC_DEFINE(HAVE_COSL)
381 AC_DEFINE(HAVE_COSHL)
382 AC_DEFINE(HAVE_EXPL)
383 AC_DEFINE(HAVE_FABSL)
75940b88
SE
384 AC_DEFINE(HAVE_FLOORL)
385 AC_DEFINE(HAVE_FMODL)
386 AC_DEFINE(HAVE_FREXPL)
75940b88
SE
387 AC_DEFINE(HAVE_LDEXPL)
388 AC_DEFINE(HAVE_LOG10L)
389 AC_DEFINE(HAVE_LOGL)
390 AC_DEFINE(HAVE_MODFL)
391 AC_DEFINE(HAVE_POWL)
392 AC_DEFINE(HAVE_SINCOSL)
393 AC_DEFINE(HAVE_SINL)
394 AC_DEFINE(HAVE_SINHL)
395 AC_DEFINE(HAVE_SQRTL)
396 AC_DEFINE(HAVE_TANL)
397 AC_DEFINE(HAVE_TANHL)
398 fi
2c839a4e 399
b2dad0e3
BK
400else
401
402 # We are being configured natively. We can do more elaborate tests
403 # that include AC_TRY_COMPILE now, as the linker is assumed to be
404 # working.
16da539b 405 GLIBCPP_IS_CROSS_COMPILING=false
b2dad0e3 406 CANADIAN=no
b2dad0e3
BK
407
408 # Check for available headers.
409 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
9e57d5ca 410 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
c67528fe 411 sys/types.h])
b2dad0e3 412
c470c17d
BK
413 GLIBCPP_CHECK_COMPILER_FEATURES
414 GLIBCPP_CHECK_LINKER_FEATURES
b2dad0e3 415 GLIBCPP_CHECK_MATH_SUPPORT
9e57d5ca 416 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
2f103494 417 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
b2dad0e3 418 GLIBCPP_CHECK_WCHAR_T_SUPPORT
e7140677 419 GLIBCPP_CHECK_STDLIB_SUPPORT
bbacb998
PC
420
421 # For showmanyc_helper().
422 AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
423 GLIBCPP_CHECK_POLL
424 GLIBCPP_CHECK_S_ISREG_OR_S_IFREG
425
58b08ac3 426 AC_LC_MESSAGES
b2dad0e3 427
48dbafe4 428 AC_TRY_COMPILE([
f295ecef
BK
429 #include <setjmp.h>
430 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
431 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
432 ])
48dbafe4 433
b2dad0e3
BK
434 AC_FUNC_MMAP
435fi
436
c4c064e7 437# This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no.
ab3bc736 438GLIBCPP_ENABLE_SYMVERS([yes])
fe413112 439
c4c064e7
BK
440# This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING.
441GLIBCPP_CONFIGURE_TESTSUITE
442
4a9d5109 443# Propagate the target-specific source directories through the build chain.
ca017eef 444# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH
974e336b 445# uses it, and it only gets used in this file.)
d32e25df 446ATOMICITY_INC_SRCDIR=config/${ATOMICITYH}
cc5112c9
BK
447OS_INC_SRCDIR=config/${os_include_dir}
448FPOS_INC_SRCDIR=config/${fpos_include_dir}
4a9d5109 449AC_SUBST(ATOMICITY_INC_SRCDIR)
cc5112c9
BK
450AC_SUBST(FPOS_INC_SRCDIR)
451AC_SUBST(OS_INC_SRCDIR)
452
eebc608e 453
c4c064e7 454# Determine cross-compile flags and all AM_CONDITIONALs.
16da539b 455AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
6e138b89 456AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
16da539b
PE
457dnl from GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT:
458AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH, test "$need_libmath" = yes)
c4d3f801 459
5e53dba6 460AC_CACHE_SAVE
b2dad0e3 461
b2dad0e3
BK
462if test "${multilib}" = "yes"; then
463 multilib_arg="--enable-multilib"
464else
465 multilib_arg=
466fi
467
43ba4a58
BK
468# Export all the install information
469GLIBCPP_EXPORT_INSTALL_INFO
1fd2f510 470
6aa43d99 471# Export all the include and flag information to Makefiles.
e466dc8a
BK
472GLIBCPP_EXPORT_INCLUDES
473GLIBCPP_EXPORT_FLAGS
474
f8e4b51d
AO
475if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
476 grep "enable shared" > /dev/null; then
477 LIBSUPCXX_PICFLAGS=-prefer-pic
478else
479 LIBSUPCXX_PICFLAGS=
480fi
481AC_SUBST(LIBSUPCXX_PICFLAGS)
482
4a9d5109 483# Generate the various Makefiles, include files, and scripts.
97460e9a
AJ
484# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am,
485# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs
486# will end up installed in the correct place. To work around this not being
487# passed # down from config-ml.in -> top_srcdir/Makefile.am ->
c8f33f22 488# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
4a9d5109 489AC_OUTPUT(Makefile \
38a9323a 490include/Makefile src/Makefile \
58ac1d7f 491libmath/Makefile libsupc++/Makefile \
2f934953 492po/Makefile testsuite/Makefile scripts/check_survey scripts/testsuite_flags,
38a9323a
BK
493[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
494 if test -n "$CONFIG_FILES"; then
495 if test -n "${with_build_subdir}" || test -n "${with_target_subdir}"; then
496 LD="${ORIGINAL_LD_FOR_MULTILIBS}"
8d3f82aa
AS
497 # Ony modify Makefiles that are just being created.
498 case " $CONFIG_FILES" in
499 *" Makefile"*)
500 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
501 ;;
502 esac
503 case $CONFIG_FILES in
504 *src/Makefile*)
505 grep '^MULTISUBDIR =' Makefile >> src/Makefile
506 ;;
507 esac
508 case $CONFIG_FILES in
509 *libsupc++/Makefile*)
510 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
511 ;;
512 esac
97460e9a
AJ
513 case $CONFIG_FILES in
514 *testsuite/Makefile*)
515 grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
516 ;;
517 esac
7ec3af37 518 fi
38a9323a 519 fi
2f934953 520 chmod +x scripts/check_survey
0676e930 521 chmod +x scripts/testsuite_flags],
b2dad0e3
BK
522srcdir=${srcdir}
523host=${host}
524target=${target}
b1f70d9d
UW
525with_target_subdir=${with_target_subdir}
526with_build_subdir=${with_build_subdir}
b2dad0e3
BK
527with_multisubdir=${with_multisubdir}
528ac_configure_args="${multilib_arg} ${ac_configure_args}"
529CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
530glibcpp_basedir=${glibcpp_basedir}
531CC="${CC}"
532CXX="${CXX}"
3343fdd2 533ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}"
b2dad0e3 534)
d2caef2e
PE
535dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
536dnl AC_CONFIG_FILES(Makefile \
537dnl include/Makefile src/Makefile \
58ac1d7f 538dnl libmath/Makefile libsupc++/Makefile \
2f934953
BK
539dnl po/Makefile testsuite/Makefile \
540dnl scripts/check_survey scripts/testsuite_flags)
d2caef2e
PE
541dnl AC_CONFIG_COMMANDS([default],
542dnl [if test -n "$CONFIG_FILES"; then
8d3f82aa
AS
543dnl # Ony modify Makefiles that are just being created.
544dnl case " $CONFIG_FILES" in
545dnl *" Makefile"*)
546dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
547dnl ;;
548dnl esac
549dnl case $CONFIG_FILES in
550dnl *src/Makefile*)
551dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile
552dnl ;;
553dnl esac
554dnl case $CONFIG_FILES in
555dnl *libsupc++/Makefile*)
556dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
557dnl ;;
558dnl esac
97460e9a
AJ
559dnl case $CONFIG_FILES in
560dnl *testsuite/Makefile*)
561dnl grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile
562dnl ;;
563dnl esac
d2caef2e 564dnl fi
2f934953 565dnl chmod +x scripts/check_survey
0676e930 566dnl chmod +x scripts/testsuite_flags
d2caef2e
PE
567dnl ],
568dnl srcdir=${srcdir}
569dnl host=${host}
570dnl target=${target}
571dnl with_multisubdir=${with_multisubdir}
572dnl ac_configure_args="${multilib_arg} ${ac_configure_args}"
573dnl CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
574dnl glibcpp_basedir=${glibcpp_basedir}
575dnl CC="${CC}"
576dnl CXX="${CXX}"
577dnl )
578dnl AC_OUTPUT
b2dad0e3
BK
579
580
29bd52c8
PE
581# Sanity checking & User-visible messages.
582# Checks down here, otherwise they get scrolled off before
583# the user will notice.
29bd52c8 584
5780a46b
BK
585# Trying to get more people to read documentation. Possibly remove
586# check and warn all the time. There is no "informational" AC_MSG_
587# macro, so these are going to be printed even when --quiet/--silent
588# is given.
99b51359
BK
589if test ! -f stamp-sanity-warned; then
590 touch stamp-sanity-warned
5780a46b
BK
591 echo ""
592 echo "Please make certain that you read the installation information here:"
d6ab05a0 593 echo " faster => ${srcdir}/docs/html/install.html"
a9ab8db1 594 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
5780a46b
BK
595 echo ""
596 echo "and the configuration information here:"
d6ab05a0 597 echo " faster => ${srcdir}/docs/html/configopts.html"
a9ab8db1 598 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
5780a46b 599 echo ""
421173e6 600 echo "before proceeding with ${_cv_gnu_make_command}."
5780a46b 601 echo ""
29bd52c8 602fi