]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/configure.in
acinclude.m4 (GLIBCPP_CHECK_LINKER_FEATURES): Also check version.
[thirdparty/gcc.git] / libstdc++-v3 / configure.in
CommitLineData
b2dad0e3 1# Process this file with autoconf to produce a configure script, like so:
d94611f1 2# aclocal, autoconf, autoheader, automake
b2dad0e3
BK
3
4AC_PREREQ(2.13)
1228c7b6 5AC_INIT(src/ios.cc)
e2c20fae 6
33590f13 7PACKAGE=libstdc++
33590f13 8AC_SUBST(PACKAGE)
4e10943d
BK
9# For typical GNU versioning info, format is MAJOR.MINOR.MICRO
10release_VERSION=3.1.0
11AC_SUBST(release_VERSION)
12# For libtool versioning info, format is CURRENT:REVISION:AGE
13libtool_VERSION=4:0:0
14AC_SUBST(libtool_VERSION)
b2dad0e3 15
58b08ac3 16# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
52b55e7d
PE
17# AC 2.50 sets target_alias iff the user specified --target, but we use it
18# everywhere, so we set it here just to be sure.
b2dad0e3 19AC_CANONICAL_SYSTEM
52b55e7d
PE
20target_alias=${target_alias-$target}
21AC_SUBST(target_alias)
b2dad0e3 22
4e10943d 23AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
33590f13 24AM_CONFIG_HEADER(config.h)
4a9d5109 25
33590f13
BK
26# Runs configure.host and configure.target, as well as finds CC, CXX
27# and assorted other critical bits. Have to run this before the
28# GLIBCPP_ENABLE_* macros below.
b2dad0e3 29GLIBCPP_CONFIGURE(.)
f4c79fef 30
b2dad0e3 31AC_LIBTOOL_DLOPEN
5780a46b 32AM_PROG_LIBTOOL
34791641
PE
33AC_SUBST(enable_shared)
34AC_SUBST(enable_static)
04e78786 35
b2dad0e3 36# Check for c++ or library specific bits that don't require linking.
33590f13
BK
37#GLIBCPP_CHECK_COMPILER_VERSION
38GLIBCPP_CHECK_GNU_MAKE
b2dad0e3 39
33590f13 40# Enable all the variable C++ stuff. C_MBCHAR must come early.
7f586614 41GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
b2dad0e3 42GLIBCPP_ENABLE_CSTDIO
0214010c 43GLIBCPP_ENABLE_CLOCALE
e26cb7ab 44GLIBCPP_ENABLE_C_MBCHAR([yes])
7cda84dc
BK
45GLIBCPP_ENABLE_C99([yes])
46GLIBCPP_ENABLE_LONG_LONG([yes])
e3123ab3 47GLIBCPP_ENABLE_CHEADERS([c_std])
b2dad0e3 48GLIBCPP_ENABLE_THREADS
32a4595e 49GLIBCPP_ENABLE_CXX_FLAGS([none])
52a11cbf 50GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
4d16bdbb 51GLIBCPP_ENABLE_CONCEPT_CHECKS
b2dad0e3 52
33590f13 53
39f5fa33 54if test -n "$with_cross_host" || test x"$build" != x"$host"; then
b2dad0e3 55
f280fdf4
BK
56 # This lets us hard-code the functionality we know
57 # we'll have in the cross target environment. "Let" is a
58 # sugar-coated word placed on an especially dull and tedious hack, actually.
59 # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros
60 # that involve linking can't be used:
61 # "cannot open sim-crt0.o"
62 # "cannot open crt0.o"
63 # etc. All this is because there currently exists no unified,
64 # consistent way for top level CC information to be passed down
65 # to target directories: newlib includes, newlib linking info,
66 # libgloss versus newlib crt0.o, etc. When all of this is done, all
67 # of this hokey, excessive AC_DEFINE junk for crosses can be removed.
68
39f5fa33 69 # We are being configured with some form of cross compiler.
4a9d5109 70 GLIBCPP_IS_CROSS_COMPILING=1
eebc608e 71
b2dad0e3
BK
72 # If Canadian cross, then don't pick up tools from the build
73 # directory.
39f5fa33 74 if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then
b2dad0e3 75 CANADIAN=yes
b2dad0e3
BK
76 else
77 CANADIAN=no
b2dad0e3
BK
78 fi
79
75940b88
SE
80 # Construct crosses by hand, eliminating bits that need ld...
81 # GLIBCPP_CHECK_COMPILER_FEATURES
82 # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
83 # GLIBCPP_CHECK_MATH_SUPPORT
84
b2dad0e3 85 case "$target_alias" in
1d8939ef 86 *-linux*)
75940b88
SE
87 # Check for available headers.
88 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
c8f9b302
ME
89 machine/endian.h machine/param.h sys/machine.h sys/types.h \
90 fp.h locale.h float.h inttypes.h])
75940b88
SE
91 SECTION_FLAGS='-ffunction-sections -fdata-sections'
92 AC_SUBST(SECTION_FLAGS)
93 GLIBCPP_CHECK_LINKER_FEATURES
94 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
95 GLIBCPP_CHECK_WCHAR_T_SUPPORT
96 os_include_dir="config/os/gnu-linux"
97 AC_DEFINE(HAVE_COPYSIGN)
98 AC_DEFINE(HAVE_COPYSIGNF)
99 AC_DEFINE(HAVE_FINITEF)
100 AC_DEFINE(HAVE_FREXPF)
101 AC_DEFINE(HAVE_HYPOTF)
102 AC_DEFINE(HAVE_SINCOS)
103 AC_DEFINE(HAVE_SINCOSF)
104 if test x"long_double_math_on_this_cpu" = x"yes"; then
105 AC_DEFINE(HAVE_HYPOTL)
106 fi
107 ;;
108 *-hpux*)
109 # Check for available headers.
110 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
111 machine/endian.h machine/param.h sys/machine.h sys/types.h \
112 fp.h locale.h float.h inttypes.h])
113 SECTION_FLAGS='-ffunction-sections -fdata-sections'
114 AC_SUBST(SECTION_FLAGS)
115 GLIBCPP_CHECK_LINKER_FEATURES
116 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
117 GLIBCPP_CHECK_WCHAR_T_SUPPORT
118 os_include_dir="config/os/hpux"
119 AC_DEFINE(HAVE_COPYSIGN)
120 AC_DEFINE(HAVE_COPYSIGNF)
121 AC_DEFINE(HAVE_FINITEF)
122 AC_DEFINE(HAVE_FREXPF)
123 AC_DEFINE(HAVE_HYPOT)
124 AC_DEFINE(HAVE_SINCOS)
125 AC_DEFINE(HAVE_SINCOSF)
126 ;;
40ded872
JT
127 *-netbsd*)
128 # Check for available headers.
129 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
130 machine/endian.h machine/param.h sys/machine.h sys/types.h \
131 fp.h locale.h float.h inttypes.h])
132 SECTION_FLAGS='-ffunction-sections -fdata-sections'
133 AC_SUBST(SECTION_FLAGS)
134 GLIBCPP_CHECK_LINKER_FEATURES
135 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
136 GLIBCPP_CHECK_WCHAR_T_SUPPORT
137 os_include_dir="config/os/bsd/netbsd"
138 AC_DEFINE(HAVE_COPYSIGN)
139 AC_DEFINE(HAVE_COPYSIGNF)
140 AC_DEFINE(HAVE_FINITEF)
141 AC_DEFINE(HAVE_FREXPF)
142 AC_DEFINE(HAVE_HYPOTF)
143 ;;
b2dad0e3 144 *)
75940b88
SE
145 os_include_dir="config/os/newlib"
146 AC_DEFINE(HAVE_HYPOT)
147 ;;
b2dad0e3 148 esac
75940b88
SE
149
150 # GLIBCPP_CHECK_STDLIB_SUPPORT
151 AC_DEFINE(HAVE_STRTOF)
152 AC_DEFINE(HAVE_STRTOLD)
153 # AC_FUNC_MMAP
154 AC_DEFINE(HAVE_MMAP)
155
156 AC_DEFINE(HAVE_ACOSF)
157 AC_DEFINE(HAVE_ASINF)
158 AC_DEFINE(HAVE_ATAN2F)
159 AC_DEFINE(HAVE_ATANF)
160 AC_DEFINE(HAVE_CEILF)
161 AC_DEFINE(HAVE_COPYSIGN)
162 AC_DEFINE(HAVE_COPYSIGNF)
163 AC_DEFINE(HAVE_COSF)
164 AC_DEFINE(HAVE_COSHF)
165 AC_DEFINE(HAVE_EXPF)
166 AC_DEFINE(HAVE_FABSF)
167 AC_DEFINE(HAVE_FINITE)
168 AC_DEFINE(HAVE_FINITEF)
169 AC_DEFINE(HAVE_FLOORF)
170 AC_DEFINE(HAVE_FMODF)
171 AC_DEFINE(HAVE_FREXPF)
172 AC_DEFINE(HAVE_ISINF)
173 AC_DEFINE(HAVE_ISINFF)
174 AC_DEFINE(HAVE_ISNAN)
175 AC_DEFINE(HAVE_ISNANF)
176 AC_DEFINE(HAVE_LDEXPF)
177 AC_DEFINE(HAVE_LOG10F)
178 AC_DEFINE(HAVE_LOGF)
179 AC_DEFINE(HAVE_MODFF)
180 AC_DEFINE(HAVE_POWF)
181 AC_DEFINE(HAVE_SINF)
182 AC_DEFINE(HAVE_SINHF)
183 AC_DEFINE(HAVE_SQRTF)
184 AC_DEFINE(HAVE_TANF)
185 AC_DEFINE(HAVE_TANHF)
186
187 # At some point, we should differentiate between architectures
188 # like x86, which have long double versions, and alpha/powerpc/etc.,
189 # which don't. For the time being, punt.
190 if test x"long_double_math_on_this_cpu" = x"yes"; then
191 AC_DEFINE(HAVE_ACOSL)
192 AC_DEFINE(HAVE_ASINL)
193 AC_DEFINE(HAVE_ATAN2L)
194 AC_DEFINE(HAVE_ATANL)
195 AC_DEFINE(HAVE_CEILL)
196 AC_DEFINE(HAVE_COPYSIGNL)
197 AC_DEFINE(HAVE_COSL)
198 AC_DEFINE(HAVE_COSHL)
199 AC_DEFINE(HAVE_EXPL)
200 AC_DEFINE(HAVE_FABSL)
201 AC_DEFINE(HAVE_FINITEL)
202 AC_DEFINE(HAVE_FLOORL)
203 AC_DEFINE(HAVE_FMODL)
204 AC_DEFINE(HAVE_FREXPL)
205 AC_DEFINE(HAVE_ISINFL)
206 AC_DEFINE(HAVE_ISNANL)
207 AC_DEFINE(HAVE_LDEXPL)
208 AC_DEFINE(HAVE_LOG10L)
209 AC_DEFINE(HAVE_LOGL)
210 AC_DEFINE(HAVE_MODFL)
211 AC_DEFINE(HAVE_POWL)
212 AC_DEFINE(HAVE_SINCOSL)
213 AC_DEFINE(HAVE_SINL)
214 AC_DEFINE(HAVE_SINHL)
215 AC_DEFINE(HAVE_SQRTL)
216 AC_DEFINE(HAVE_TANL)
217 AC_DEFINE(HAVE_TANHL)
218 fi
b2dad0e3
BK
219else
220
221 # We are being configured natively. We can do more elaborate tests
222 # that include AC_TRY_COMPILE now, as the linker is assumed to be
223 # working.
4a9d5109 224 GLIBCPP_IS_CROSS_COMPILING=0
b2dad0e3 225 CANADIAN=no
b2dad0e3
BK
226
227 # Check for available headers.
228 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h machine/endian.h \
34791641 229 machine/param.h sys/machine.h fp.h locale.h float.h inttypes.h gconv.h])
b2dad0e3 230
c470c17d
BK
231 GLIBCPP_CHECK_COMPILER_FEATURES
232 GLIBCPP_CHECK_LINKER_FEATURES
b2dad0e3
BK
233 GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
234 GLIBCPP_CHECK_MATH_SUPPORT
2f103494 235 GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
b2dad0e3 236 GLIBCPP_CHECK_WCHAR_T_SUPPORT
e7140677 237 GLIBCPP_CHECK_STDLIB_SUPPORT
58b08ac3 238 AC_LC_MESSAGES
b2dad0e3 239
48dbafe4 240 AC_TRY_COMPILE([
f295ecef
BK
241 #include <setjmp.h>
242 ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
243 [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available. ])
244 ])
48dbafe4 245
b2dad0e3 246 AC_FUNC_MMAP
33590f13 247
58b08ac3
BK
248 # Establish limits on memory usage during 'make check'
249 GLIBCPP_CONFIGURE_TESTSUITE
b2dad0e3
BK
250fi
251
c98b201b
PE
252# This depends on the possibly-skipped linker test above.
253GLIBCPP_ENABLE_SYMVERS([no])
fe413112 254
4a9d5109
SW
255# Propagate the target-specific source directories through the build chain.
256OS_INC_SRCDIR=$os_include_dir/bits
257ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
f295ecef 258CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
4a9d5109
SW
259AC_SUBST(OS_INC_SRCDIR)
260AC_SUBST(ATOMICITY_INC_SRCDIR)
f295ecef 261AC_SUBST(CPU_LIMITS_INC_SRCDIR)
eebc608e 262
4a9d5109
SW
263# Set up cross-compile flags
264AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
6e138b89 265AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
c4d3f801 266
5e53dba6 267AC_CACHE_SAVE
b2dad0e3 268
b2dad0e3
BK
269if test "${multilib}" = "yes"; then
270 multilib_arg="--enable-multilib"
271else
272 multilib_arg=
273fi
274
1fd2f510
BK
275# Needed so that g++ can find the correct include subdir automatically.
276INTERFACE=v3
277
43ba4a58
BK
278# Export all the install information
279GLIBCPP_EXPORT_INSTALL_INFO
1fd2f510 280
e466dc8a
BK
281# Export all the include and flag information to makefiles.
282GLIBCPP_EXPORT_INCLUDES
283GLIBCPP_EXPORT_FLAGS
284
f8e4b51d
AO
285if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
286 grep "enable shared" > /dev/null; then
287 LIBSUPCXX_PICFLAGS=-prefer-pic
288else
289 LIBSUPCXX_PICFLAGS=
290fi
291AC_SUBST(LIBSUPCXX_PICFLAGS)
292
4a9d5109 293# Generate the various Makefiles, include files, and scripts.
b2dad0e3 294# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
c8f33f22
CD
295# and libsupc++/Makefile.am so that multilib installs will end up
296# installed in the correct place. To work around this not being passed
297# down from config-ml.in -> top_srcdir/Makefile.am ->
298# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
4a9d5109
SW
299AC_OUTPUT(Makefile \
300 include/Makefile src/Makefile \
301 libmath/Makefile libio/Makefile libsupc++/Makefile \
4e10943d 302 po/Makefile testsuite/Makefile mkcheck testsuite_flags,
b2dad0e3
BK
303[if test -n "$CONFIG_FILES"; then
304 ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
305 grep '^MULTISUBDIR =' Makefile >> src/Makefile
c8f33f22 306 grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
be5aeb60
MM
307fi
308chmod +x mkcheck
c6192d88 309chmod +x testsuite_flags
be5aeb60 310],
b2dad0e3
BK
311srcdir=${srcdir}
312host=${host}
313target=${target}
314with_multisubdir=${with_multisubdir}
315ac_configure_args="${multilib_arg} ${ac_configure_args}"
316CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
317glibcpp_basedir=${glibcpp_basedir}
318CC="${CC}"
319CXX="${CXX}"
320)
321
322
29bd52c8
PE
323# Sanity checking & User-visible messages.
324# Checks down here, otherwise they get scrolled off before
325# the user will notice.
29bd52c8 326
5780a46b
BK
327# Trying to get more people to read documentation. Possibly remove
328# check and warn all the time. There is no "informational" AC_MSG_
329# macro, so these are going to be printed even when --quiet/--silent
330# is given.
99b51359
BK
331if test ! -f stamp-sanity-warned; then
332 touch stamp-sanity-warned
5780a46b
BK
333 echo ""
334 echo "Please make certain that you read the installation information here:"
29bd52c8 335 echo " faster => ${srcdir}/docs/install.html"
a9ab8db1 336 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
5780a46b
BK
337 echo ""
338 echo "and the configuration information here:"
29bd52c8 339 echo " faster => ${srcdir}/docs/configopts.html"
a9ab8db1 340 echo " slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
5780a46b 341 echo ""
421173e6 342 echo "before proceeding with ${_cv_gnu_make_command}."
5780a46b 343 echo ""
29bd52c8 344fi