diff options
Diffstat (limited to 'contrib/libstdc++/configure.in')
-rw-r--r-- | contrib/libstdc++/configure.in | 262 |
1 files changed, 202 insertions, 60 deletions
diff --git a/contrib/libstdc++/configure.in b/contrib/libstdc++/configure.in index c6a5b3a..2124b9b 100644 --- a/contrib/libstdc++/configure.in +++ b/contrib/libstdc++/configure.in @@ -7,18 +7,29 @@ AC_INIT(src/ios.cc) # This works around the fact that libtool configuration may change LD # for this particular configuration, but some shells, instead of # keeping the changes in LD private, export them just because LD is -# exported. +# exported. Only used at the end of this file. ORIGINAL_LD_FOR_MULTILIBS=$LD PACKAGE=libstdc++ AC_SUBST(PACKAGE) # For libtool versioning info, format is CURRENT:REVISION:AGE -libtool_VERSION=5:2:0 +libtool_VERSION=5:5:0 AC_SUBST(libtool_VERSION) GLIBCPP_TOPREL_CONFIGURE # Gets build, host, target, *_vendor, *_cpu, *_os, etc. +# +# You will slowly go insane if you do not grok the following fact: when +# building v3 as part of the compiler, the top-level /target/ becomes the +# library's /host/. `configure' then causes --target to default to --host, +# exactly like any other package using autoconf. Therefore, 'target' and +# 'host' will always be the same. This makes sense both for native and +# cross compilers, just think about it for a little while. :-) +# +# Also, if v3 is being configured as part of a cross compiler, the top-level +# configure script will pass the "real" host as $with_cross_host. +# # AC 2.5x sets target_alias iff the user specified --target, but we use it # everywhere, so we set it here just to be sure. In AC 2.13 # AC_CANONICAL_TARGET was known as AC_CANONICAL_SYSTEM. @@ -26,9 +37,8 @@ AC_CANONICAL_SYSTEM target_alias=${target_alias-$target} AC_SUBST(target_alias) -# Runs configure.host and configure.target, as well as finds CC, CXX -# and assorted other critical bits. Have to run this before the -# GLIBCPP_ENABLE_* macros below. +# Runs configure.target, finds CC, CXX and assorted other critical bits. +# Must run this before the GLIBCPP_ENABLE_* macros below. GLIBCPP_CONFIGURE(.) AM_INIT_AUTOMAKE($PACKAGE, $gcc_version) @@ -44,42 +54,57 @@ AC_SUBST(enable_static) GLIBCPP_CHECK_GNU_MAKE # Enable all the variable C++ stuff. C_MBCHAR must come early. -GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE) GLIBCPP_ENABLE_CSTDIO GLIBCPP_ENABLE_CLOCALE +GLIBCPP_ENABLE_CHEADERS([$c_model]) GLIBCPP_ENABLE_C_MBCHAR([yes]) GLIBCPP_ENABLE_C99([yes]) GLIBCPP_ENABLE_LONG_LONG([yes]) -GLIBCPP_ENABLE_CHEADERS([$c_model]) GLIBCPP_ENABLE_THREADS -GLIBCPP_ENABLE_CXX_FLAGS([none]) GLIBCPP_ENABLE_SJLJ_EXCEPTIONS GLIBCPP_ENABLE_LIBUNWIND_EXCEPTIONS GLIBCPP_ENABLE_CONCEPT_CHECKS +GLIBCPP_ENABLE_CXX_FLAGS +GLIBCPP_ENABLE_DEBUG([no]) +GLIBCPP_ENABLE_DEBUG_FLAGS([none]) # Check for headers necessary for libsupc++ using dyn-string.c/cxa_demangle.c AC_CHECK_HEADERS(string.h stdlib.h) -if test -n "$with_cross_host" || test x"$build" != x"$host"; then +# No surprises, no surprises... +if test $ATOMICITYH = cpu/generic ; then + AC_MSG_WARN([No native atomic operations are provided yet for this platform.]) + if test $target_thread_file = single; then + AC_MSG_WARN([They cannot be faked when thread support is disabled.]) + AC_MSG_WARN([Thread-safety of certain classes is not guaranteed.]) + else + AC_MSG_WARN([They will be faked using a mutex.]) + AC_MSG_WARN([Performance of certain classes will degrade as a result.]) + fi +fi - # This lets us hard-code the functionality we know - # we'll have in the cross target environment. "Let" is a - # sugar-coated word placed on an especially dull and tedious hack, actually. - # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros - # that involve linking can't be used: - # "cannot open sim-crt0.o" - # "cannot open crt0.o" - # etc. All this is because there currently exists no unified, - # consistent way for top level CC information to be passed down - # to target directories: newlib includes, newlib linking info, - # libgloss versus newlib crt0.o, etc. When all of this is done, all - # of this hokey, excessive AC_DEFINE junk for crosses can be removed. + +if test -n "$with_cross_host" || test x"$build" != x"$host"; then # We are being configured with some form of cross compiler. GLIBCPP_IS_CROSS_COMPILING=1 - # If Canadian cross, then don't pick up tools from the build - # directory. + # This lets us hard-code the functionality we know we'll have in the cross + # target environment. "Let" is a sugar-coated word placed on an especially + # dull and tedious hack, actually. + # + # Here's why GLIBCPP_CHECK_MATH_SUPPORT, and other autoconf macros + # that involve linking, can't be used: + # "cannot open sim-crt0.o" + # "cannot open crt0.o" + # etc. All this is because there currently exists no unified, consistent + # way for top level CC information to be passed down to target directories: + # newlib includes, newlib linking info, libgloss versus newlib crt0.o, etc. + # When all of that is done, all of this hokey, excessive AC_DEFINE junk for + # crosses can be removed. + + # If Canadian cross, then don't pick up tools from the build directory. + # Used in GLIBCPP_EXPORT_INCLUDES (and nowhere else?). if test -n "$with_cross_host" && test x"$build" != x"$with_cross_host"; then CANADIAN=yes else @@ -93,69 +118,130 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then case "$target" in *-linux*) - # Check for available headers. + os_include_dir="os/gnu-linux" AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ - machine/endian.h machine/param.h sys/machine.h sys/types.h \ - fp.h locale.h float.h inttypes.h]) + machine/endian.h machine/param.h sys/machine.h sys/types.h \ + fp.h locale.h float.h inttypes.h]) SECTION_FLAGS='-ffunction-sections -fdata-sections' AC_SUBST(SECTION_FLAGS) GLIBCPP_CHECK_LINKER_FEATURES GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT - os_include_dir="config/os/gnu-linux" AC_DEFINE(HAVE_COPYSIGN) AC_DEFINE(HAVE_COPYSIGNF) + AC_DEFINE(HAVE_FINITE) AC_DEFINE(HAVE_FINITEF) AC_DEFINE(HAVE_FREXPF) AC_DEFINE(HAVE_HYPOTF) + AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISINFF) + AC_DEFINE(HAVE_ISNAN) + AC_DEFINE(HAVE_ISNANF) AC_DEFINE(HAVE_SINCOS) AC_DEFINE(HAVE_SINCOSF) if test x"long_double_math_on_this_cpu" = x"yes"; then - AC_DEFINE(HAVE_HYPOTL) + AC_DEFINE(HAVE_FINITEL) + AC_DEFINE(HAVE_HYPOTL) + AC_DEFINE(HAVE_ISINFL) + AC_DEFINE(HAVE_ISNANL) fi ;; *-hpux*) # Check for available headers. AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ - machine/endian.h machine/param.h sys/machine.h sys/types.h \ - fp.h locale.h float.h inttypes.h]) + machine/endian.h machine/param.h sys/machine.h sys/types.h \ + fp.h locale.h float.h inttypes.h]) SECTION_FLAGS='-ffunction-sections -fdata-sections' AC_SUBST(SECTION_FLAGS) GLIBCPP_CHECK_LINKER_FEATURES GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT - os_include_dir="config/os/hpux" + os_include_dir="os/hpux" AC_DEFINE(HAVE_COPYSIGN) AC_DEFINE(HAVE_COPYSIGNF) - AC_DEFINE(HAVE_FINITEF) AC_DEFINE(HAVE_FREXPF) AC_DEFINE(HAVE_HYPOT) - AC_DEFINE(HAVE_SINCOS) - AC_DEFINE(HAVE_SINCOSF) + case "$target" in + *-hpux10*) + AC_DEFINE(HAVE_FINITE) + AC_DEFINE(HAVE_FINITEF) + AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISINFF) + AC_DEFINE(HAVE_ISNAN) + AC_DEFINE(HAVE_ISNANF) + ;; + esac + ;; *-netbsd*) # Check for available headers. AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ - machine/endian.h machine/param.h sys/machine.h sys/types.h \ - fp.h locale.h float.h inttypes.h]) + machine/endian.h machine/param.h sys/machine.h sys/types.h \ + fp.h locale.h float.h inttypes.h]) SECTION_FLAGS='-ffunction-sections -fdata-sections' AC_SUBST(SECTION_FLAGS) GLIBCPP_CHECK_LINKER_FEATURES GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT - os_include_dir="config/os/bsd/netbsd" + os_include_dir="os/bsd/netbsd" AC_DEFINE(HAVE_COPYSIGN) AC_DEFINE(HAVE_COPYSIGNF) AC_DEFINE(HAVE_FINITEF) + AC_DEFINE(HAVE_FINITE) AC_DEFINE(HAVE_FREXPF) AC_DEFINE(HAVE_HYPOTF) + AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISINFF) + AC_DEFINE(HAVE_ISNAN) + AC_DEFINE(HAVE_ISNANF) + if test x"long_double_math_on_this_cpu" = x"yes"; then + AC_DEFINE(HAVE_FINITEL) + AC_DEFINE(HAVE_ISINFL) + AC_DEFINE(HAVE_ISNANL) + fi + ;; + *-freebsd*) + # Check for available headers. + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ + machine/endian.h machine/param.h sys/machine.h sys/types.h \ + fp.h locale.h float.h inttypes.h sys/resource.h sys/stat.h \ + sys/time.h unistd.h]) + SECTION_FLAGS='-ffunction-sections -fdata-sections' + AC_SUBST(SECTION_FLAGS) + GLIBCPP_CHECK_LINKER_FEATURES + GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT + GLIBCPP_CHECK_WCHAR_T_SUPPORT + os_include_dir="os/bsd/freebsd" + AC_DEFINE(HAVE_LC_MESSAGES) + AC_DEFINE(HAVE_DRAND48) + AC_DEFINE(HAVE_GETPAGESIZE) + AC_DEFINE(HAVE_SETENV) + AC_DEFINE(HAVE_SIGSETJMP) + AC_DEFINE(HAVE_COPYSIGN) + AC_DEFINE(HAVE_COPYSIGNF) + AC_DEFINE(HAVE_FINITEF) + AC_DEFINE(HAVE_FINITE) + AC_DEFINE(HAVE_FREXPF) + AC_DEFINE(HAVE_HYPOT) + AC_DEFINE(HAVE_HYPOTF) + AC_DEFINE(HAVE_ISINF) + AC_DEFINE(HAVE_ISNAN) + AC_DEFINE(HAVE_ISNANF) + if test x"long_double_math_on_this_cpu" = x"yes"; then + AC_DEFINE(HAVE_FINITEL) + AC_DEFINE(HAVE_ISINFL) + AC_DEFINE(HAVE_ISNANL) + fi ;; *-mingw32*) AC_CHECK_HEADERS([sys/types.h locale.h float.h]) GLIBCPP_CHECK_LINKER_FEATURES GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT - os_include_dir="config/os/mingw32" + os_include_dir="os/mingw32" + ;; + *-windiss*) + os_include_dir="os/windiss" ;; changequote(,)dnl *-qnx6.[12]*) @@ -165,7 +251,7 @@ changequote([,])dnl GLIBCPP_CHECK_LINKER_FEATURES GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT GLIBCPP_CHECK_WCHAR_T_SUPPORT - os_include_dir="config/os/qnx/qnx6.1" + os_include_dir="os/qnx/qnx6.1" AC_DEFINE(HAVE_COSF) AC_DEFINE(HAVE_COSL) AC_DEFINE(HAVE_COSHF) @@ -180,7 +266,7 @@ changequote([,])dnl AC_DEFINE(HAVE_SINHL) ;; *) - os_include_dir="config/os/newlib" + os_include_dir="os/newlib" AC_DEFINE(HAVE_HYPOT) ;; esac @@ -188,6 +274,60 @@ changequote([,])dnl case "$target" in *-mingw32*) ;; + *-windiss*) + AC_DEFINE(HAVE_ACOSF) + AC_DEFINE(HAVE_ASINF) + AC_DEFINE(HAVE_ATAN2F) + AC_DEFINE(HAVE_ATANF) + AC_DEFINE(HAVE_CEILF) + AC_DEFINE(HAVE_COPYSIGN) + AC_DEFINE(HAVE_COPYSIGNF) + AC_DEFINE(HAVE_COSF) + AC_DEFINE(HAVE_COSHF) + AC_DEFINE(HAVE_EXPF) + AC_DEFINE(HAVE_FABSF) + AC_DEFINE(HAVE_FLOORF) + AC_DEFINE(HAVE_FMODF) + AC_DEFINE(HAVE_FREXPF) + AC_DEFINE(HAVE_LDEXPF) + AC_DEFINE(HAVE_LOG10F) + AC_DEFINE(HAVE_LOGF) + AC_DEFINE(HAVE_MODFF) + AC_DEFINE(HAVE_POWF) + AC_DEFINE(HAVE_SINF) + AC_DEFINE(HAVE_SINHF) + AC_DEFINE(HAVE_SQRTF) + AC_DEFINE(HAVE_TANF) + AC_DEFINE(HAVE_TANHF) + ;; + *-freebsd*) + # Must replicate generic section since we don't have strtof or strtold. + AC_DEFINE(HAVE_MMAP) + AC_DEFINE(HAVE_ACOSF) + AC_DEFINE(HAVE_ASINF) + AC_DEFINE(HAVE_ATAN2F) + AC_DEFINE(HAVE_ATANF) + AC_DEFINE(HAVE_CEILF) + AC_DEFINE(HAVE_COPYSIGN) + AC_DEFINE(HAVE_COPYSIGNF) + AC_DEFINE(HAVE_COSF) + AC_DEFINE(HAVE_COSHF) + AC_DEFINE(HAVE_EXPF) + AC_DEFINE(HAVE_FABSF) + AC_DEFINE(HAVE_FLOORF) + AC_DEFINE(HAVE_FMODF) + AC_DEFINE(HAVE_FREXPF) + AC_DEFINE(HAVE_LDEXPF) + AC_DEFINE(HAVE_LOG10F) + AC_DEFINE(HAVE_LOGF) + AC_DEFINE(HAVE_MODFF) + AC_DEFINE(HAVE_POWF) + AC_DEFINE(HAVE_SINF) + AC_DEFINE(HAVE_SINHF) + AC_DEFINE(HAVE_SQRTF) + AC_DEFINE(HAVE_TANF) + AC_DEFINE(HAVE_TANHF) + ;; *) # GLIBCPP_CHECK_STDLIB_SUPPORT AC_DEFINE(HAVE_STRTOF) @@ -206,15 +346,9 @@ changequote([,])dnl AC_DEFINE(HAVE_COSHF) AC_DEFINE(HAVE_EXPF) AC_DEFINE(HAVE_FABSF) - AC_DEFINE(HAVE_FINITE) - AC_DEFINE(HAVE_FINITEF) AC_DEFINE(HAVE_FLOORF) AC_DEFINE(HAVE_FMODF) AC_DEFINE(HAVE_FREXPF) - AC_DEFINE(HAVE_ISINF) - AC_DEFINE(HAVE_ISINFF) - AC_DEFINE(HAVE_ISNAN) - AC_DEFINE(HAVE_ISNANF) AC_DEFINE(HAVE_LDEXPF) AC_DEFINE(HAVE_LOG10F) AC_DEFINE(HAVE_LOGF) @@ -242,12 +376,9 @@ changequote([,])dnl AC_DEFINE(HAVE_COSHL) AC_DEFINE(HAVE_EXPL) AC_DEFINE(HAVE_FABSL) - AC_DEFINE(HAVE_FINITEL) AC_DEFINE(HAVE_FLOORL) AC_DEFINE(HAVE_FMODL) AC_DEFINE(HAVE_FREXPL) - AC_DEFINE(HAVE_ISINFL) - AC_DEFINE(HAVE_ISNANL) AC_DEFINE(HAVE_LDEXPL) AC_DEFINE(HAVE_LOG10L) AC_DEFINE(HAVE_LOGL) @@ -260,6 +391,7 @@ changequote([,])dnl AC_DEFINE(HAVE_TANL) AC_DEFINE(HAVE_TANHL) fi + else # We are being configured natively. We can do more elaborate tests @@ -280,6 +412,12 @@ else GLIBCPP_CHECK_WCHAR_T_SUPPORT GLIBCPP_CHECK_STDLIB_SUPPORT GLIBCPP_CHECK_UNISTD_SUPPORT + + # For showmanyc_helper(). + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) + GLIBCPP_CHECK_POLL + GLIBCPP_CHECK_S_ISREG_OR_S_IFREG + AC_LC_MESSAGES AC_TRY_COMPILE([ @@ -290,23 +428,24 @@ else AC_FUNC_MMAP - # Establish limits on memory usage during 'make check' - GLIBCPP_CONFIGURE_TESTSUITE fi -# This depends on the possibly-skipped linker test above. +# This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no. GLIBCPP_ENABLE_SYMVERS([yes]) +# This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING. +GLIBCPP_CONFIGURE_TESTSUITE + # Propagate the target-specific source directories through the build chain. -OS_INC_SRCDIR=$os_include_dir/bits -ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits -CPU_LIMITS_INC_SRCDIR=$CPULIMITSH/bits +# (Nothing currently uses cpu_include_dir directly; only ATOMICITYH +# uses it, and it only gets used in this file.) +OS_INC_SRCDIR=config/${os_include_dir} +ATOMICITY_INC_SRCDIR=config/${ATOMICITYH} AC_SUBST(OS_INC_SRCDIR) AC_SUBST(ATOMICITY_INC_SRCDIR) -AC_SUBST(CPU_LIMITS_INC_SRCDIR) # Set up cross-compile flags -AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) +AC_SUBST(GLIBCPP_IS_CROSS_COMPILING) dnl Unused so far. AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes) AC_CACHE_SAVE @@ -334,9 +473,9 @@ AC_SUBST(LIBSUPCXX_PICFLAGS) # Generate the various Makefiles, include files, and scripts. # NB: Multilibs need MULTISUBDIR defined correctly in src/Makefile.am -# and libsupc++/Makefile.am so that multilib installs will end up -# installed in the correct place. To work around this not being passed -# down from config-ml.in -> top_srcdir/Makefile.am -> +# libsupc++/Makefile.am and testsuite/Makefile.am so that multilib installs +# will end up installed in the correct place. To work around this not being +# passed down from config-ml.in -> top_srcdir/Makefile.am -> # top_srcdir/{src,libsupc++}/Makefile.am, manually append it here. AC_OUTPUT(Makefile \ include/Makefile src/Makefile \ @@ -347,6 +486,7 @@ AC_OUTPUT(Makefile \ ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in grep '^MULTISUBDIR =' Makefile >> src/Makefile grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile + grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile fi chmod +x mkcheck chmod +x testsuite_flags @@ -360,6 +500,7 @@ CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} glibcpp_basedir=${glibcpp_basedir} CC="${CC}" CXX="${CXX}" +ORIGINAL_LD_FOR_MULTILIBS="${ORIGINAL_LD_FOR_MULTILIBS}" ) dnl In autoconf 2.5x, AC_OUTPUT is replaced by three AC_ macros: dnl AC_CONFIG_FILES(Makefile \ @@ -371,6 +512,7 @@ dnl [if test -n "$CONFIG_FILES"; then dnl ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in dnl grep '^MULTISUBDIR =' Makefile >> src/Makefile dnl grep '^MULTISUBDIR =' Makefile >> libsupc++/Makefile +dnl grep '^MULTISUBDIR =' Makefile >> testsuite/Makefile dnl fi dnl chmod +x mkcheck dnl chmod +x testsuite_flags |