]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.ac
Support automake 1.8.2
[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
ff66d28f 4AC_PREREQ(2.57)
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
8099b2ae 16libtool_VERSION=6:0:0
4e10943d 17AC_SUBST(libtool_VERSION)
b2dad0e3 18
ff66d28f 19# Find the rest of the source tree framework.
3d7c150e 20GLIBCXX_TOPREL_CONFIGURE
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.
ec2075e9 61AM_INIT_AUTOMAKE([1.7.6 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
67#AC_MSG_NOTICE([====== Starting libtool configuration])
b2dad0e3 68AC_LIBTOOL_DLOPEN
5780a46b 69AM_PROG_LIBTOOL
34791641
PE
70AC_SUBST(enable_shared)
71AC_SUBST(enable_static)
ff66d28f 72#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
04e78786 73
92eabea2
PE
74# Possibly disable most of the library.
75## XXX Consider skipping unncessary tests altogether in this case, rather
76## than just ignoring the results. Faster /and/ more correct, win win.
77GLIBCXX_ENABLE_HOSTED
78
44f0760e 79# Check for support bits and g++ features that don't require linking.
3d7c150e 80GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
92eabea2 81GLIBCXX_ENABLE_PCH($is_hosted)
b2dad0e3 82
44f0760e
BK
83# Enable all the variable C++ runtime options.
84# NB: C_MBCHAR must come early.
3d7c150e
BK
85GLIBCXX_ENABLE_CSTDIO
86GLIBCXX_ENABLE_CLOCALE
ff66d28f 87GLIBCXX_ENABLE_CHEADERS($c_model) dnl c_model from configure.host
3d7c150e
BK
88GLIBCXX_ENABLE_C_MBCHAR([yes])
89GLIBCXX_ENABLE_C99([yes])
90GLIBCXX_ENABLE_LONG_LONG([yes])
91GLIBCXX_ENABLE_THREADS
ff66d28f
PE
92GLIBCXX_ENABLE_CONCEPT_CHECKS([no])
93GLIBCXX_ENABLE_DEBUG_FLAGS(["-g3 -O0"])
3d7c150e 94GLIBCXX_ENABLE_DEBUG([no])
ff66d28f 95GLIBCXX_ENABLE_CXX_FLAGS
b2dad0e3 96
974e336b 97# No surprises, no surprises...
2c5d0ae8 98if test $atomicity_dir = cpu/generic ; then
9e57d5ca 99 AC_MSG_WARN([No native atomic operations are provided for this platform.])
974e336b
PE
100 if test $target_thread_file = single; then
101 AC_MSG_WARN([They cannot be faked when thread support is disabled.])
102 AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.])
103 else
104 AC_MSG_WARN([They will be faked using a mutex.])
105 AC_MSG_WARN([Performance of certain classes will degrade as a result.])
106 fi
107fi
108
109
0df3f383 110if $GLIBCXX_IS_NATIVE; then
b2dad0e3 111
0df3f383
PE
112 # We can do more elaborate tests that assume a working linker.
113 CANADIAN=no
114
115 # Check for available headers.
116 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
117 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h \
118 sys/types.h])
119
120 GLIBCXX_CHECK_COMPILER_FEATURES
121 GLIBCXX_CHECK_LINKER_FEATURES
122 GLIBCXX_CHECK_MATH_SUPPORT
123 GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
124 GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
125 GLIBCXX_CHECK_WCHAR_T_SUPPORT
126 GLIBCXX_CHECK_STDLIB_SUPPORT
127
128 # For showmanyc_helper().
129 AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
130 GLIBCXX_CHECK_POLL
131 GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
132
133 # For xsputn_2().
134 AC_CHECK_HEADERS(sys/uio.h)
135 GLIBCXX_CHECK_WRITEV
136
3d05b345
PC
137 # For the __streamoff_base_type typedef.
138 GLIBCXX_CHECK_INT64_T
139
140 # For LFS support.
141 GLIBCXX_CHECK_LFS
142
0df3f383
PE
143 AC_LC_MESSAGES
144
145 AC_TRY_COMPILE(
146 [#include <setjmp.h>],
147 [sigjmp_buf env;
148 while (! sigsetjmp (env, 1))
149 siglongjmp (env, 1);
150 ],
151 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.])])
152
153 AC_FUNC_MMAP
154
155else
eebc608e 156
2c839a4e
PE
157 # This lets us hard-code the functionality we know we'll have in the cross
158 # target environment. "Let" is a sugar-coated word placed on an especially
159 # dull and tedious hack, actually.
160 #
3d7c150e 161 # Here's why GLIBCXX_CHECK_MATH_SUPPORT, and other autoconf macros
2c839a4e
PE
162 # that involve linking, can't be used:
163 # "cannot open sim-crt0.o"
164 # "cannot open crt0.o"
165 # etc. All this is because there currently exists no unified, consistent
166 # way for top level CC information to be passed down to target directories:
167 # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc.
168 # When all of that is done, all of this hokey, excessive AC_DEFINE junk for
169 # crosses can be removed.
170
171 # If Canadian cross, then don't pick up tools from the build directory.
0df3f383 172 # Used only in GLIBCXX_EXPORT_INCLUDES.
ff66d28f 173 if test -n "$with_cross_host" &&
f5cf58dd 174 test x"$build_alias" != x"$with_cross_host" &&
ff66d28f
PE
175 test x"$build" != x"$target";
176 then
b2dad0e3 177 CANADIAN=yes
b2dad0e3
BK
178 else
179 CANADIAN=no
b2dad0e3
BK
180 fi
181
75940b88 182 # Construct crosses by hand, eliminating bits that need ld...
3d7c150e
BK
183 # GLIBCXX_CHECK_COMPILER_FEATURES
184 # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
185 # GLIBCXX_CHECK_MATH_SUPPORT
75940b88 186
ff66d28f
PE
187 # First, test for "known" system libraries. We may be using newlib even
188 # on a hosted environment.
189 if test "x${with_newlib}" = "xyes"; then
190 os_include_dir="os/newlib"
191 AC_DEFINE(HAVE_HYPOT)
192
193 # GLIBCXX_CHECK_STDLIB_SUPPORT
194 AC_DEFINE(HAVE_STRTOF)
195 AC_DEFINE(HAVE_STRTOLD)
196 # AC_FUNC_MMAP
197 AC_DEFINE(HAVE_MMAP)
198
199 AC_DEFINE(HAVE_ACOSF)
200 AC_DEFINE(HAVE_ASINF)
201 AC_DEFINE(HAVE_ATAN2F)
202 AC_DEFINE(HAVE_ATANF)
203 AC_DEFINE(HAVE_CEILF)
204 AC_DEFINE(HAVE_COPYSIGN)
205 AC_DEFINE(HAVE_COPYSIGNF)
206 AC_DEFINE(HAVE_COSF)
207 AC_DEFINE(HAVE_COSHF)
208 AC_DEFINE(HAVE_EXPF)
209 AC_DEFINE(HAVE_FABSF)
210 AC_DEFINE(HAVE_FLOORF)
211 AC_DEFINE(HAVE_FMODF)
212 AC_DEFINE(HAVE_FREXPF)
213 AC_DEFINE(HAVE_LDEXPF)
214 AC_DEFINE(HAVE_LOG10F)
215 AC_DEFINE(HAVE_LOGF)
216 AC_DEFINE(HAVE_MODFF)
217 AC_DEFINE(HAVE_POWF)
218 AC_DEFINE(HAVE_SINF)
219 AC_DEFINE(HAVE_SINHF)
220 AC_DEFINE(HAVE_SQRTF)
221 AC_DEFINE(HAVE_TANF)
222 AC_DEFINE(HAVE_TANHF)
517da0ce
MM
223
224 AC_DEFINE(HAVE_S_ISREG)
225 AC_DEFINE(HAVE_S_IFREG)
ff66d28f
PE
226 else
227 m4_include([crossconfig.m4])
228 fi
75940b88
SE
229
230 # At some point, we should differentiate between architectures
231 # like x86, which have long double versions, and alpha/powerpc/etc.,
232 # which don't. For the time being, punt.
233 if test x"long_double_math_on_this_cpu" = x"yes"; then
234 AC_DEFINE(HAVE_ACOSL)
235 AC_DEFINE(HAVE_ASINL)
236 AC_DEFINE(HAVE_ATAN2L)
237 AC_DEFINE(HAVE_ATANL)
238 AC_DEFINE(HAVE_CEILL)
239 AC_DEFINE(HAVE_COPYSIGNL)
240 AC_DEFINE(HAVE_COSL)
241 AC_DEFINE(HAVE_COSHL)
242 AC_DEFINE(HAVE_EXPL)
243 AC_DEFINE(HAVE_FABSL)
75940b88
SE
244 AC_DEFINE(HAVE_FLOORL)
245 AC_DEFINE(HAVE_FMODL)
246 AC_DEFINE(HAVE_FREXPL)
75940b88
SE
247 AC_DEFINE(HAVE_LDEXPL)
248 AC_DEFINE(HAVE_LOG10L)
249 AC_DEFINE(HAVE_LOGL)
250 AC_DEFINE(HAVE_MODFL)
251 AC_DEFINE(HAVE_POWL)
252 AC_DEFINE(HAVE_SINCOSL)
253 AC_DEFINE(HAVE_SINL)
254 AC_DEFINE(HAVE_SINHL)
255 AC_DEFINE(HAVE_SQRTL)
256 AC_DEFINE(HAVE_TANL)
257 AC_DEFINE(HAVE_TANHL)
258 fi
2c839a4e 259
b2dad0e3
BK
260fi
261
ff66d28f 262# This depends on GLIBCXX CHECK_LINKER_FEATURES, but without it assumes no.
3d7c150e 263GLIBCXX_ENABLE_SYMVERS([yes])
fe413112 264
ff66d28f 265# This depends on GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE.
3d7c150e 266GLIBCXX_CONFIGURE_TESTSUITE
c4c064e7 267
4a9d5109 268# Propagate the target-specific source directories through the build chain.
ff66d28f 269# (Nothing currently uses cpu_include_dir directly; only atomicity_include_dir
974e336b 270# uses it, and it only gets used in this file.)
2c5d0ae8
BK
271ATOMICITY_SRCDIR=config/${atomicity_dir}
272ATOMIC_WORD_SRCDIR=config/${atomic_word_dir}
cc5112c9 273OS_INC_SRCDIR=config/${os_include_dir}
2c5d0ae8
BK
274AC_SUBST(ATOMICITY_SRCDIR)
275AC_SUBST(ATOMIC_WORD_SRCDIR)
cc5112c9
BK
276AC_SUBST(OS_INC_SRCDIR)
277
ff66d28f
PE
278# Determine cross-compile flags and AM_CONDITIONALs.
279#AC_SUBST(GLIBCXX_IS_NATIVE)
0df3f383 280#AM_CONDITIONAL(CANADIAN, test $CANADIAN = yes)
ff66d28f 281# from GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT:
0df3f383 282#AM_CONDITIONAL(GLIBCXX_BUILD_LIBMATH, test $need_libmath = yes)
92eabea2 283GLIBCXX_EVALUATE_CONDITIONALS
c4d3f801 284
5e53dba6 285AC_CACHE_SAVE
b2dad0e3 286
ff66d28f 287if test ${multilib} = yes; then
b2dad0e3
BK
288 multilib_arg="--enable-multilib"
289else
290 multilib_arg=
291fi
292
0df3f383 293# Export all the install information.
3d7c150e 294GLIBCXX_EXPORT_INSTALL_INFO
1fd2f510 295
6aa43d99 296# Export all the include and flag information to Makefiles.
3d7c150e
BK
297GLIBCXX_EXPORT_INCLUDES
298GLIBCXX_EXPORT_FLAGS
e466dc8a 299
f8e4b51d 300if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
ff66d28f
PE
301 grep "enable shared" > /dev/null;
302then
f8e4b51d
AO
303 LIBSUPCXX_PICFLAGS=-prefer-pic
304else
305 LIBSUPCXX_PICFLAGS=
306fi
307AC_SUBST(LIBSUPCXX_PICFLAGS)
308
ff66d28f
PE
309dnl In autoconf 2.5x, AC_OUTPUT is replaced by four AC_CONFIG_* macros,
310dnl which can all be called multiple times as needed, plus one (different)
65fc9769 311dnl AC_OUTPUT macro. This one lists the files to be created:
82ba99d5 312AC_CONFIG_FILES( \
ff66d28f 313 Makefile \
82ba99d5
PE
314 AC_FOREACH([DIR], glibcxx_SUBDIRS, [DIR/Makefile ])
315 )
ff66d28f
PE
316AC_CONFIG_FILES([scripts/check_survey],[chmod +x scripts/check_survey])
317AC_CONFIG_FILES([scripts/testsuite_flags],[chmod +x scripts/testsuite_flags])
318
319dnl These commands are run at the end of config.status:
320AC_CONFIG_COMMANDS([default],
321[if test -n "$CONFIG_FILES"; then
322 # Multilibs need MULTISUBDIR defined correctly in certain makefiles so
323 # that multilib installs will end up installed in the correct place.
324 # The testsuite needs it for multilib-aware ABI baseline files.
325 # To work around this not being passed down from config-ml.in ->
326 # srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
327 # append it here. Only modify Makefiles that have just been created.
0df3f383
PE
328 #
329 # Also, get rid of this simulated-VPATH thing that automake does.
330 cat > vpsed << \_EOF
331s!`test -f '$<' || echo '$(srcdir)/'`!!
332_EOF
82ba99d5 333 for i in $SUBDIRS; do
ff66d28f
PE
334 case $CONFIG_FILES in
335 *${i}/Makefile*)
336 #echo "Adding MULTISUBDIR to $i/Makefile"
0df3f383
PE
337 sed -f vpsed $i/Makefile > tmp
338 grep '^MULTISUBDIR =' Makefile >> tmp
339 mv tmp $i/Makefile
ff66d28f
PE
340 ;;
341 esac
342 done
0df3f383 343 rm vpsed
38a9323a 344 fi
ff66d28f
PE
345 (cd include && ${MAKE-make})
346],
347[
82ba99d5
PE
348# Variables needed in config.status (file generation) which aren't already
349# passed by autoconf.
350SUBDIRS="$SUBDIRS"
ff66d28f
PE
351])
352
353dnl And this actually makes things happen:
354AC_OUTPUT