source: trunk/src/gcc/libstdc++-v3/configure.in@ 696

Last change on this file since 696 was 2, checked in by bird, 23 years ago

Initial revision

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