]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.ac
invoke.texi (Optimize Options): Mention -ftree-lrs, not -ftree-live_range_split.
[thirdparty/gcc.git] / libstdc++-v3 / configure.ac
CommitLineData
b2dad0e3 1# Process this file with autoconf to produce a configure script, like so:
d2caef2e 2# aclocal && autoconf && autoheader && automake
b2dad0e3 3
8ab705be 4AC_PREREQ(2.59)
fbe057bb 5AC_INIT(package-unused, version-unused,, libstdc++)
ff66d28f
PE
6AC_CONFIG_SRCDIR(src/ios.cc)
7AC_CONFIG_HEADER(config.h)
e2c20fae 8
6706f116
AO
9# This works around the fact that libtool configuration may change LD
10# for this particular configuration, but some shells, instead of
11# keeping the changes in LD private, export them just because LD is
2c839a4e 12# exported. Only used at the end of this file.
ff66d28f 13### am handles this now? ORIGINAL_LD_FOR_MULTILIBS=$LD
6706f116 14
4e10943d 15# For libtool versioning info, format is CURRENT:REVISION:AGE
8736cbe6 16libtool_VERSION=6:4:0
4e10943d 17AC_SUBST(libtool_VERSION)
b2dad0e3 18
ff66d28f 19# Find the rest of the source tree framework.
076e5443 20AM_ENABLE_MULTILIB(, ..)
aebb8c22 21
58b08ac3 22# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
2c839a4e
PE
23#
24# You will slowly go insane if you do not grok the following fact: when
25# building v3 as part of the compiler, the top-level /target/ becomes the
ff66d28f 26# library's /host/. configure then causes --target to default to --host,
2c839a4e
PE
27# exactly like any other package using autoconf. Therefore, 'target' and
28# 'host' will always be the same. This makes sense both for native and
29# cross compilers, just think about it for a little while. :-)
30#
31# Also, if v3 is being configured as part of a cross compiler, the top-level
32# configure script will pass the "real" host as $with_cross_host.
33#
ff66d28f
PE
34# Do not delete or change the following two lines. For why, see
35# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
b2dad0e3 36AC_CANONICAL_SYSTEM
ff66d28f
PE
37target_alias=${target_alias-$host_alias}
38
39# Handy for debugging:
40#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
41
0df3f383
PE
42if test "$build" != "$host"; then
43 # We are being configured with some form of cross compiler.
44 GLIBCXX_IS_NATIVE=false
72730fdb 45 GCC_NO_EXECUTABLES
0df3f383
PE
46else
47 GLIBCXX_IS_NATIVE=true
48fi
49
ff66d28f
PE
50# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
51# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
52# 1.x: minimum required version
53# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
54# of other PACKAGE_* variables will, however, and there's nothing
fbe057bb 55# we can do about that; they come from AC_INIT).
ff66d28f
PE
56# foreign: we don't follow the normal rules for GNU packages (no COPYING
57# file in the top srcdir, etc, etc), so stop complaining.
58# no-dependencies: turns off auto dependency generation (just for now)
2d52e9e3
PE
59# -Wall: turns on all automake warnings...
60# -Wno-portability: ...except this one, since GNU make is now required.
a60945f8 61AM_INIT_AUTOMAKE([1.9.1 no-define foreign no-dependencies -Wall -Wno-portability -Wno-override])
ff66d28f 62
ff66d28f
PE
63# Runs configure.host, finds CC, CXX, and assorted other critical bits. Sets
64# up critical shell variables.
65GLIBCXX_CONFIGURE
66
b2dad0e3 67AC_LIBTOOL_DLOPEN
5780a46b 68AM_PROG_LIBTOOL
34791641
PE
69AC_SUBST(enable_shared)
70AC_SUBST(enable_static)
04e78786 71
92eabea2 72# Possibly disable most of the library.
347669a0 73## TODO: Consider skipping unncessary tests altogether in this case, rather
92eabea2
PE
74## than just ignoring the results. Faster /and/ more correct, win win.
75GLIBCXX_ENABLE_HOSTED
76
347669a0 77# Check for compiler support that doesn't require linking.
3d7c150e 78GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
92eabea2 79GLIBCXX_ENABLE_PCH($is_hosted)
b2dad0e3 80
44f0760e 81# Enable all the variable C++ runtime options.
3d7c150e
BK
82GLIBCXX_ENABLE_CSTDIO
83GLIBCXX_ENABLE_CLOCALE
8b0d6051 84GLIBCXX_ENABLE_ALLOCATOR
ff66d28f 85GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host
3d7c150e
BK
86GLIBCXX_ENABLE_C99([yes])
87GLIBCXX_ENABLE_LONG_LONG([yes])
347669a0 88GLIBCXX_ENABLE_WCHAR_T([yes])
ff66d28f
PE
89GLIBCXX_ENABLE_CONCEPT_CHECKS([no])
90GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0"])
3d7c150e 91GLIBCXX_ENABLE_DEBUG([no])
ff66d28f 92GLIBCXX_ENABLE_CXX_FLAGS
1165dc50 93GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
b2dad0e3 94
974e336b 95# No surprises, no surprises...
347669a0 96GLIBCXX_ENABLE_THREADS
2c5d0ae8 97if test $atomicity_dir = cpu/generic ; then
9e57d5ca 98 AC_MSG_WARN([No native atomic operations are provided for this platform.])
974e336b
PE
99 if test $target_thread_file = single; then
100 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
101 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
102 else
103 AC_MSG_WARN([They will be faked using a mutex.])
104 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
105 fi
106fi
107
108
0df3f383 109if $GLIBCXX_IS_NATIVE; then
b2dad0e3 110
0df3f383
PE
111 # We can do more elaborate tests that assume a working linker.
112 CANADIAN=no
113
114 # Check for available headers.
115 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
116 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
8f1032c1 117 sys/types.h sys/ipc.h sys/sem.h])
0df3f383
PE
118
119 GLIBCXX_CHECK_COMPILER_FEATURES
120 GLIBCXX_CHECK_LINKER_FEATURES
121 GLIBCXX_CHECK_MATH_SUPPORT
122 GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
123 GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
347669a0 124 GLIBCXX_CHECK_ICONV_SUPPORT
0df3f383
PE
125 GLIBCXX_CHECK_STDLIB_SUPPORT
126
127 # For showmanyc_helper().
128 AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
129 GLIBCXX_CHECK_POLL
130 GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
131
132 # For xsputn_2().
133 AC_CHECK_HEADERS(sys/uio.h)
134 GLIBCXX_CHECK_WRITEV
135
3d05b345
PC
136 # For the __streamoff_base_type typedef.
137 GLIBCXX_CHECK_INT64_T
138
139 # For LFS support.
140 GLIBCXX_CHECK_LFS
141
0df3f383
PE
142 AC_LC_MESSAGES
143
144 AC_TRY_COMPILE(
145 [#include <setjmp.h>],
146 [sigjmp_buf env;
147 while (! sigsetjmp (env, 1))
148 siglongjmp (env, 1);
149 ],
150 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
151
152 AC_FUNC_MMAP
153
154else
eebc608e 155
2c839a4e
PE
156 # This lets us hard-code the functionality we know we'll have in the cross
157 # target environment. "Let" is a sugar-coated word placed on an especially
158 # dull and tedious hack, actually.
159 #
3d7c150e 160 # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
2c839a4e
PE
161 # that involve linking, can't be used:
162 # "cannot open sim-crt0.o"
163 # "cannot open crt0.o"
164 # etc. All this is because there currently exists no unified, consistent
165 # way for top level CC information to be passed down to target directories:
166 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
167 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
168 # crosses can be removed.
169
170 # If Canadian cross, then don't pick up tools from the build directory.
0df3f383 171 # Used only in GLIBCXX_EXPORT_INCLUDES.
ff66d28f 172 if test -n "$with_cross_host" &&
f5cf58dd 173 test x"$build_alias" != x"$with_cross_host" &&
ff66d28f
PE
174 test x"$build" != x"$target";
175 then
b2dad0e3 176 CANADIAN=yes
b2dad0e3
BK
177 else
178 CANADIAN=no
b2dad0e3
BK
179 fi
180
75940b88 181 # Construct crosses by hand, eliminating bits that need ld...
3d7c150e
BK
182 # GLIBCXX_CHECK_COMPILER_FEATURES
183 # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
184 # GLIBCXX_CHECK_MATH_SUPPORT
75940b88 185
ff66d28f
PE
186 # First, test for "known" system libraries. We may be using newlib even
187 # on a hosted environment.
188 if test "x${with_newlib}" = "xyes"; then
189 os_include_dir="os/newlib"
190 AC_DEFINE(HAVE_HYPOT)
191
192 # GLIBCXX_CHECK_STDLIB_SUPPORT
193 AC_DEFINE(HAVE_STRTOF)
ff66d28f
PE
194 # AC_FUNC_MMAP
195 AC_DEFINE(HAVE_MMAP)
196
197 AC_DEFINE(HAVE_ACOSF)
198 AC_DEFINE(HAVE_ASINF)
199 AC_DEFINE(HAVE_ATAN2F)
200 AC_DEFINE(HAVE_ATANF)
201 AC_DEFINE(HAVE_CEILF)
202 AC_DEFINE(HAVE_COPYSIGN)
203 AC_DEFINE(HAVE_COPYSIGNF)
204 AC_DEFINE(HAVE_COSF)
205 AC_DEFINE(HAVE_COSHF)
206 AC_DEFINE(HAVE_EXPF)
207 AC_DEFINE(HAVE_FABSF)
208 AC_DEFINE(HAVE_FLOORF)
209 AC_DEFINE(HAVE_FMODF)
210 AC_DEFINE(HAVE_FREXPF)
211 AC_DEFINE(HAVE_LDEXPF)
212 AC_DEFINE(HAVE_LOG10F)
213 AC_DEFINE(HAVE_LOGF)
214 AC_DEFINE(HAVE_MODFF)
215 AC_DEFINE(HAVE_POWF)
216 AC_DEFINE(HAVE_SINF)
217 AC_DEFINE(HAVE_SINHF)
218 AC_DEFINE(HAVE_SQRTF)
219 AC_DEFINE(HAVE_TANF)
220 AC_DEFINE(HAVE_TANHF)
517da0ce
MM
221
222 AC_DEFINE(HAVE_S_ISREG)
223 AC_DEFINE(HAVE_S_IFREG)
ff66d28f
PE
224 else
225 m4_include([crossconfig.m4])
226 fi
75940b88
SE
227
228 # At some point, we should differentiate between architectures
229 # like x86, which have long double versions, and alpha/powerpc/etc.,
230 # which don't. For the time being, punt.
231 if test x"long_double_math_on_this_cpu" = x"yes"; then
232 AC_DEFINE(HAVE_ACOSL)
233 AC_DEFINE(HAVE_ASINL)
234 AC_DEFINE(HAVE_ATAN2L)
235 AC_DEFINE(HAVE_ATANL)
236 AC_DEFINE(HAVE_CEILL)
237 AC_DEFINE(HAVE_COPYSIGNL)
238 AC_DEFINE(HAVE_COSL)
239 AC_DEFINE(HAVE_COSHL)
240 AC_DEFINE(HAVE_EXPL)
241 AC_DEFINE(HAVE_FABSL)
75940b88
SE
242 AC_DEFINE(HAVE_FLOORL)
243 AC_DEFINE(HAVE_FMODL)
244 AC_DEFINE(HAVE_FREXPL)
75940b88
SE
245 AC_DEFINE(HAVE_LDEXPL)
246 AC_DEFINE(HAVE_LOG10L)
247 AC_DEFINE(HAVE_LOGL)
248 AC_DEFINE(HAVE_MODFL)
249 AC_DEFINE(HAVE_POWL)
250 AC_DEFINE(HAVE_SINCOSL)
251 AC_DEFINE(HAVE_SINL)
252 AC_DEFINE(HAVE_SINHL)
253 AC_DEFINE(HAVE_SQRTL)
254 AC_DEFINE(HAVE_TANL)
255 AC_DEFINE(HAVE_TANHL)
256 fi
2c839a4e 257
b2dad0e3
BK
258fi
259
ff66d28f 260# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
3d7c150e 261GLIBCXX_ENABLE_SYMVERS([yes])
fe413112 262
ff66d28f 263# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
3d7c150e 264GLIBCXX_CONFIGURE_TESTSUITE
c4c064e7 265
4a9d5109 266# Propagate the target-specific source directories through the build chain.
2c5d0ae8
BK
267ATOMICITY_SRCDIR=config/${atomicity_dir}
268ATOMIC_WORD_SRCDIR=config/${atomic_word_dir}
cc5112c9 269OS_INC_SRCDIR=config/${os_include_dir}
1568430f 270ABI_TWEAKS_SRCDIR=config/${abi_tweaks_dir}
2c5d0ae8
BK
271AC_SUBST(ATOMICITY_SRCDIR)
272AC_SUBST(ATOMIC_WORD_SRCDIR)
1568430f 273AC_SUBST(ABI_TWEAKS_SRCDIR)
cc5112c9
BK
274AC_SUBST(OS_INC_SRCDIR)
275
ff66d28f
PE
276# Determine cross-compile flags and AM_CONDITIONALs.
277#AC_SUBST(GLIBCXX_IS_NATIVE)
0df3f383 278#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
ff66d28f 279# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
0df3f383 280#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
92eabea2 281GLIBCXX_EVALUATE_CONDITIONALS
c4d3f801 282
5e53dba6 283AC_CACHE_SAVE
b2dad0e3 284
ff66d28f 285if test ${multilib} = yes; then
b2dad0e3
BK
286 multilib_arg="--enable-multilib"
287else
288 multilib_arg=
289fi
290
0df3f383 291# Export all the install information.
3d7c150e 292GLIBCXX_EXPORT_INSTALL_INFO
1fd2f510 293
6aa43d99 294# Export all the include and flag information to Makefiles.
3d7c150e
BK
295GLIBCXX_EXPORT_INCLUDES
296GLIBCXX_EXPORT_FLAGS
e466dc8a 297
f8e4b51d 298if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
ff66d28f
PE
299 grep "enable shared" > /dev/null;
300then
f8e4b51d
AO
301 LIBSUPCXX_PICFLAGS=-prefer-pic
302else
303 LIBSUPCXX_PICFLAGS=
304fi
305AC_SUBST(LIBSUPCXX_PICFLAGS)
306
ff66d28f
PE
307dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros,
308dnl which can all be called multiple times as needed, plus one (different)
65fc9769 309dnl AC_OUTPUT macro. This one lists the files to be created:
82ba99d5 310AC_CONFIG_FILES( \
ff66d28f 311 Makefile \
82ba99d5
PE
312 AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ])
313 )
ff66d28f
PE
314AC_CONFIG_FILES([scripts/check_survey],[chmod +x scripts/check_survey])
315AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
316
317dnl These commands are run at the end of config.status:
318AC_CONFIG_COMMANDS([default],
319[if test -n "$CONFIG_FILES"; then
320 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
321 # that multilib installs will end up installed in the correct place.
322 # The testsuite needs it for multilib-aware ABI baseline files.
323 # To work around this not being passed down from config-ml.in ->
324 # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
325 # append it here. Only modify Makefiles that have just been created.
0df3f383
PE
326 #
327 # Also, get rid of this simulated-VPATH thing that automake does.
328 cat > vpsed << \_EOF
329s!`test -f '$<' || echo '$(srcdir)/'`!!
330_EOF
82ba99d5 331 for i in $SUBDIRS; do
ff66d28f
PE
332 case $CONFIG_FILES in
333 *${i}/Makefile*)
334 #echo "Adding MULTISUBDIR to $i/Makefile"
0df3f383
PE
335 sed -f vpsed $i/Makefile > tmp
336 grep '^MULTISUBDIR =' Makefile >> tmp
337 mv tmp $i/Makefile
ff66d28f
PE
338 ;;
339 esac
340 done
0df3f383 341 rm vpsed
38a9323a 342 fi
ff66d28f
PE
343 (cd include && ${MAKE-make})
344],
345[
82ba99d5
PE
346# Variables needed in config.status (file generation) which aren't already
347# passed by autoconf.
348SUBDIRS="$SUBDIRS"
ff66d28f
PE
349])
350
351dnl And this actually makes things happen:
352AC_OUTPUT