configure.in: Fix cross compiling math routines.
[gcc.git] / libstdc++-v3 / configure.in
index 8a2b5364d1fd4cbe59742cc0e577a0ad3d915f1e..ebf969ff830704c5e007fe96df886332bcd677d8 100644 (file)
@@ -5,12 +5,13 @@ AC_PREREQ(2.13)
 AC_INIT(src/ios.cc)
 
 PACKAGE=libstdc++
-MAJOR_VERSION=3
-MINOR_VERSION=1
-MICRO_VERSION=0
-VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION
 AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
+# For typical GNU versioning info, format is MAJOR.MINOR.MICRO
+release_VERSION=3.1.0
+AC_SUBST(release_VERSION)
+# For libtool versioning info, format is CURRENT:REVISION:AGE
+libtool_VERSION=4:0:0
+AC_SUBST(libtool_VERSION)
 
 # Gets build, host, target, *_vendor, *_cpu, *_os, etc.
 # AC 2.50 sets target_alias iff the user specified --target, but we use it
@@ -19,7 +20,7 @@ AC_CANONICAL_SYSTEM
 target_alias=${target_alias-$target}
 AC_SUBST(target_alias)
 
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AM_INIT_AUTOMAKE($PACKAGE, $release_VERSION)
 AM_CONFIG_HEADER(config.h)
 
 # Runs configure.host and configure.target, as well as finds CC, CXX
@@ -51,11 +52,20 @@ GLIBCPP_ENABLE_SJLJ_EXCEPTIONS
 
 if test -n "$with_cross_host" || test x"$build" != x"$host"; then
 
+  # 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.
+
   # We are being configured with some form of cross compiler.
-  # mknumeric_limits may not work correctly, either because the
-  # compiler may not run on this machine, may not be able to link
-  # executables, or may produce executables we can't run on this
-  # machine. Thus, just use the pre-generated include/bits/limits_generic.h
   GLIBCPP_IS_CROSS_COMPILING=1
 
   # If Canadian cross, then don't pick up tools from the build
@@ -71,8 +81,8 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
        # Construct linux crosses by hand, eliminating bits that need ld...
         # 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 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])
 
        # GLIBCPP_CHECK_COMPILER_FEATURES
        SECTION_FLAGS='-ffunction-sections -fdata-sections'
@@ -96,6 +106,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
        AC_DEFINE(HAVE_FLOORF)
        AC_DEFINE(HAVE_FMODF)
        AC_DEFINE(HAVE_FREXPF)
+       AC_DEFINE(HAVE_HYPOTF)
        AC_DEFINE(HAVE_ISINF)
        AC_DEFINE(HAVE_ISINFF)
        AC_DEFINE(HAVE_ISNAN)
@@ -131,6 +142,7 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
          AC_DEFINE(HAVE_FLOORL)
          AC_DEFINE(HAVE_FMODL)
          AC_DEFINE(HAVE_FREXPL)
+         AC_DEFINE(HAVE_HYPOTL)
          AC_DEFINE(HAVE_ISINFL)
          AC_DEFINE(HAVE_ISNANL)
          AC_DEFINE(HAVE_LDEXPL)
@@ -155,17 +167,40 @@ if test -n "$with_cross_host" || test x"$build" != x"$host"; then
        AC_DEFINE(HAVE_MMAP)
        ;;
     *)
-       # We assume newlib.  This lets us hard-code the functions we know
-       # we'll have.
+       # We assume newlib. 
+       # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
+       # GLIBCPP_CHECK_MATH_SUPPORT
        AC_DEFINE(HAVE_FINITE)
+       AC_DEFINE(HAVE_HYPOT)
        AC_DEFINE(HAVE_ISNAN)
-       AC_DEFINE(HAVE_ISNANF)
        AC_DEFINE(HAVE_ISINF)
+
+       AC_DEFINE(HAVE_ACOSF)
+       AC_DEFINE(HAVE_ASINF)
+       AC_DEFINE(HAVE_ATAN2F)
+       AC_DEFINE(HAVE_ATANF)
+       AC_DEFINE(HAVE_CEILF)
+       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_HYPOTF)
+       AC_DEFINE(HAVE_ISNANF)
        AC_DEFINE(HAVE_ISINFF)
+       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)
 
        os_include_dir="config/os/newlib"
-
-       # need to check for faster f versions of math functions, ie sinf?
        ;;
   esac
 else
@@ -204,8 +239,10 @@ fi
 # Propagate the target-specific source directories through the build chain.
 OS_INC_SRCDIR=$os_include_dir/bits
 ATOMICITY_INC_SRCDIR=$ATOMICITYH/bits
+LIMITS_INC_SRCDIR=$LIMITSH/bits
 AC_SUBST(OS_INC_SRCDIR)
 AC_SUBST(ATOMICITY_INC_SRCDIR)
+AC_SUBST(LIMITS_INC_SRCDIR)
 
 # Set up cross-compile flags
 AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
@@ -246,7 +283,7 @@ AC_SUBST(LIBSUPCXX_PICFLAGS)
 AC_OUTPUT(Makefile \
     include/Makefile src/Makefile \
     libmath/Makefile libio/Makefile libsupc++/Makefile \
-    po/Makefile intl/Makefile testsuite/Makefile mkcheck testsuite_flags,
+    po/Makefile testsuite/Makefile mkcheck testsuite_flags,
 [if test -n "$CONFIG_FILES"; then
   ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
   grep '^MULTISUBDIR =' Makefile >> src/Makefile