source: trunk/third/gcc/libstdc++-v3/configure.in @ 18474

Revision 18474, 12.7 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18473, which included commits to RCS files with non-trunk default branches.
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:1: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  AC_LC_MESSAGES
283
284  AC_TRY_COMPILE([
285  #include <setjmp.h>
286  ], [sigjmp_buf env; while (! sigsetjmp (env, 1)) siglongjmp (env, 1);],
287  [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define if sigsetjmp is available.  ])
288  ])
289
290  AC_FUNC_MMAP
291
292  # Establish limits on memory usage during 'make check'
293  GLIBCPP_CONFIGURE_TESTSUITE
294fi
295
296# This depends on the possibly-skipped linker test above.
297GLIBCPP_ENABLE_SYMVERS([yes])
298
299# Propagate the target-specific source directories through the build chain.
300OS_INC_SRCDIR=$os_include_dir/bits
301ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
302CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits
303AC_SUBST(OS_INC_SRCDIR)
304AC_SUBST(ATOMICITY_INC_SRCDIR)
305AC_SUBST(CPU_LIMITS_INC_SRCDIR)
306
307# Set up cross-compile flags
308AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
309AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
310 
311AC_CACHE_SAVE
312
313if test "${multilib}" = "yes"; then
314  multilib_arg="--enable-multilib"
315else
316  multilib_arg=
317fi
318
319# Export all the install information
320GLIBCPP_EXPORT_INSTALL_INFO
321
322# Export all the include and flag information to makefiles.
323GLIBCPP_EXPORT_INCLUDES
324GLIBCPP_EXPORT_FLAGS
325
326if ${CONFIG_SHELL-/bin/sh} ./libtool --tag CXX --features |
327   grep "enable shared" > /dev/null; then
328  LIBSUPCXX_PICFLAGS=-prefer-pic
329else
330  LIBSUPCXX_PICFLAGS=
331fi
332AC_SUBST(LIBSUPCXX_PICFLAGS)
333
334# Generate the various Makefiles, include files, and scripts.
335# NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am
336# and libsupc++/Makefile.am so that multilib installs will end up
337# installed in the correct place. To work around this not being passed
338# down from config-ml.in -> top_srcdir/Makefile.am ->
339# top_srcdir/{src,libsupc++}/Makefile.am, manually append it here.
340AC_OUTPUT(Makefile \
341    include/Makefile src/Makefile \
342    libmath/Makefile libio/Makefile libsupc++/Makefile \
343    po/Makefile testsuite/Makefile mkcheck testsuite_flags,
344[if test -n "$CONFIG_FILES"; then
345  LD="${ORIGINAL_LD_FOR_MULTILIBS}"
346  ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
347  grep '^MULTISUBDIR =' Makefile >> src/Makefile
348  grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
349fi
350chmod +x mkcheck
351chmod +x testsuite_flags
352],
353srcdir=${srcdir}
354host=${host}
355target=${target}
356with_multisubdir=${with_multisubdir}
357ac_configure_args="${multilib_arg} ${ac_configure_args}"
358CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
359glibcpp_basedir=${glibcpp_basedir}
360CC="${CC}"
361CXX="${CXX}"
362)
363dnl  In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros:
364dnl  AC_CONFIG_FILES(Makefile \
365dnl      include/Makefile src/Makefile \
366dnl      libmath/Makefile libio/Makefile libsupc++/Makefile \
367dnl      po/Makefile testsuite/Makefile mkcheck testsuite_flags)
368dnl  AC_CONFIG_COMMANDS([default],
369dnl  [if test -n "$CONFIG_FILES"; then
370dnl    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
371dnl    grep '^MULTISUBDIR =' Makefile >> src/Makefile
372dnl    grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile
373dnl  fi
374dnl  chmod +x mkcheck
375dnl  chmod +x testsuite_flags
376dnl  ],
377dnl  srcdir=${srcdir}
378dnl  host=${host}
379dnl  target=${target}
380dnl  with_multisubdir=${with_multisubdir}
381dnl  ac_configure_args="${multilib_arg} ${ac_configure_args}"
382dnl  CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
383dnl  glibcpp_basedir=${glibcpp_basedir}
384dnl  CC="${CC}"
385dnl  CXX="${CXX}"
386dnl  )
387dnl  AC_OUTPUT
388
389
390# Sanity checking & User-visible messages.
391# Checks down here, otherwise they get scrolled off before
392# the user will notice.
393
394# Trying to get more people to read documentation.  Possibly remove
395# check and warn all the time. There is no "informational" AC_MSG_
396# macro, so these are going to be printed even when --quiet/--silent
397# is given.
398if test ! -f stamp-sanity-warned; then
399  touch stamp-sanity-warned
400  echo ""
401  echo "Please make certain that you read the installation information here:"
402  echo "  faster => ${srcdir}/docs/html/install.html"
403  echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/install.html>"
404  echo ""
405  echo "and the configuration information here:"
406  echo "  faster => ${srcdir}/docs/html/configopts.html"
407  echo "  slower => <URL:http://gcc.gnu.org/onlinedocs/libstdc++/configopts.html>"
408  echo ""
409  echo "before proceeding with ${_cv_gnu_make_command}."
410  echo ""
411fi
Note: See TracBrowser for help on using the repository browser.