OSDN Git Service

2003-06-26 Paolo Carlini <pcarlini@unitus.it>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / acinclude.m4
index ed9eda0..c34d93d 100644 (file)
@@ -202,6 +202,16 @@ AC_DEFUN(GLIBCPP_CONFIGURE, [
     *) glibcpp_flagbasedir='[$](top_builddir)/'[$]{glibcpp_basedir} ;;
   esac
 
+  # Set up safe default values for all subsequent AM_CONDITIONAL tests.
+  need_libmath=no
+  enable_wchar_t=no
+  #enable_debug=no
+  #glibcpp_pch_comp=no
+  #enable_cheaders=c
+  #c_compatibility=no
+  #enable_abi_check=no
+  #enable_symvers=no
+
   # Find platform-specific directories containing configuration info.  In
   # addition to possibly modifying the same flags, it also sets up symlinks.
   GLIBCPP_CHECK_HOST
@@ -849,7 +859,9 @@ dnl Define USE_COMPLEX_LONG_DOUBLE etc if "copysignl" is found.
 dnl
 dnl GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT
 AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
-  dnl Check for complex versions of math functions of platform.
+  dnl Check for complex versions of math functions of platform.  This will
+  dnl always pass if libm is available, and fail if it isn't.  If it is
+  dnl available, we assume we'll need it later, so add it to LIBS.
   AC_CHECK_LIB(m, main)
   AC_REPLACE_MATHFUNCS(nan copysignf)
 
@@ -869,7 +881,6 @@ AC_DEFUN(GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT, [
     need_libmath=yes
   fi
   AC_SUBST(LIBMATHOBJS)
-  AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH,  test "$need_libmath" = yes)
 ])
 
 
@@ -896,7 +907,6 @@ dnl
 dnl GLIBCPP_CHECK_WCHAR_T_SUPPORT
 AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
   dnl Wide characters disabled by default.
-  enable_wchar_t=no
 
   dnl Test wchar.h for mbstate_t, which is needed for char_traits and
   dnl others even if wchar_t support is not on.
@@ -995,7 +1005,6 @@ AC_DEFUN(GLIBCPP_CHECK_WCHAR_T_SUPPORT, [
   fi
   AC_MSG_CHECKING([for enabled wchar_t specializations])
   AC_MSG_RESULT($enable_wchar_t)       
-  AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)   
 ])
 
 
@@ -1320,10 +1329,9 @@ AC_DEFUN(GLIBCPP_ENABLE_CLOCALE, [
 
 
 dnl
-dnl Check for which I/O library to use:  libio, or something specific.
+dnl Check for which I/O library to use:  stdio, or something specific.
 dnl
 dnl GLIBCPP_ENABLE_CSTDIO
-dnl --enable-cstdio=libio sets config/io/c_io_libio.h and friends
 dnl
 dnl default is stdio
 dnl
@@ -1342,72 +1350,12 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
 
   dnl Check if a valid I/O package
   case x${enable_cstdio_flag} in
-    xlibio)
-      CSTDIO_H=config/io/c_io_libio.h
-      BASIC_FILE_H=config/io/basic_file_libio.h
-      BASIC_FILE_CC=config/io/basic_file_libio.cc
-      AC_MSG_RESULT(libio)
-
-      # see if we are on a system with libio native (ie, linux)
-      AC_CHECK_HEADER(libio.h,  has_libio=yes, has_libio=no)
-
-      # Need to check and see what version of glibc is being used. If
-      # it's not glibc-2.2 or higher, then we'll need to go ahead and
-      # compile most of libio for linux systems.
-      if test x$has_libio = x"yes"; then
-        case "$target" in
-          *-*-linux*)
-              AC_MSG_CHECKING([for glibc version >= 2.2])
-              AC_EGREP_CPP([ok], [
-            #include <features.h>
-              #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
-                    ok
-              #endif
-              ], glibc_satisfactory=yes, glibc_satisfactory=no)
-              AC_MSG_RESULT($glibc_satisfactory)
-            ;;
-        esac
-
-        # XXX at the moment, admit defeat and force the recompilation
-        # XXX of glibc even on glibc-2.2 systems, because libio is not synched.
-        glibc_satisfactory=no
-
-        if test x$glibc_satisfactory = x"yes"; then
-           need_libio=no
-           need_wlibio=no
-        else
-           need_libio=yes
-           # bkoz XXX need to add checks to enable this
-           # pme XXX here's a first pass at such a check
-           if test x$enable_c_mbchar != xno; then
-              need_wlibio=yes
-           else
-              need_wlibio=no
-           fi
-        fi
-
-      else
-         # Using libio, but <libio.h> doesn't exist on the target system. . .
-         need_libio=yes
-         # bkoz XXX need to add checks to enable this
-         # pme XXX here's a first pass at such a check
-         if test x$enable_c_mbchar != xno; then
-             need_wlibio=yes
-         else
-             need_wlibio=no
-         fi
-      fi
-      ;;
     xstdio | x | xno | xnone | xyes)
       # default
       CSTDIO_H=config/io/c_io_stdio.h
       BASIC_FILE_H=config/io/basic_file_stdio.h
       BASIC_FILE_CC=config/io/basic_file_stdio.cc
       AC_MSG_RESULT(stdio)
-
-      # We're not using stdio.
-      need_libio=no
-      need_wlibio=no
       ;;
     *)
       echo "$enable_cstdio is an unknown io package" 1>&2
@@ -1417,22 +1365,6 @@ AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
   AC_SUBST(CSTDIO_H)
   AC_SUBST(BASIC_FILE_H)
   AC_SUBST(BASIC_FILE_CC)
-
-  # 2000-08-04 bkoz hack
-  CCODECVT_C=config/io/c_io_libio_codecvt.c
-  AC_SUBST(CCODECVT_C)
-  # 2000-08-04 bkoz hack
-
-  AM_CONDITIONAL(GLIBCPP_BUILD_LIBIO,
-                 test "$need_libio" = yes || test "$need_wlibio" = yes)
-  AM_CONDITIONAL(GLIBCPP_NEED_LIBIO, test "$need_libio" = yes)
-  AM_CONDITIONAL(GLIBCPP_NEED_WLIBIO, test "$need_wlibio" = yes)
-  if test "$need_libio" = yes || test "$need_wlibio" = yes; then
-    libio_la=../libio/libio.la
-  else
-    libio_la=
-  fi
-  AC_SUBST(libio_la)
 ])
 
 
@@ -1464,6 +1396,12 @@ AC_DEFUN(GLIBCPP_CHECK_PCH, [
 
   CXXFLAGS="$ac_save_CXXFLAGS"
   AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "$glibcpp_pch_comp" = yes)
+  if test "$glibcpp_pch_comp" = yes; then
+       glibcpp_PCHFLAGS="-include bits/stdc++.h"
+  else
+       glibcpp_PCHFLAGS=""
+  fi
+  AC_SUBST(glibcpp_PCHFLAGS)
 ])
 
 dnl
@@ -1842,7 +1780,6 @@ dnl
 dnl TOPLEVEL_INCLUDES
 dnl LIBMATH_INCLUDES
 dnl LIBSUPCXX_INCLUDES
-dnl LIBIO_INCLUDES
 dnl
 dnl GLIBCPP_EXPORT_INCLUDES
 AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
@@ -1858,11 +1795,6 @@ AC_DEFUN(GLIBCPP_EXPORT_INCLUDES, [
 
   LIBSUPCXX_INCLUDES='-I$(top_srcdir)/libsupc++'
 
-  if test x"$need_libio" = xyes; then
-    LIBIO_INCLUDES='-I$(top_builddir)/libio -I$(top_srcdir)/libio'
-    AC_SUBST(LIBIO_INCLUDES)
-  fi
-
   # Now, export this to all the little Makefiles....
   AC_SUBST(GLIBCPP_INCLUDES)
   AC_SUBST(TOPLEVEL_INCLUDES)
@@ -2117,24 +2049,33 @@ dnl the testsuite_hooks.h header.
 dnl
 dnl GLIBCPP_CONFIGURE_TESTSUITE  [no args]
 AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
-  GLIBCPP_CHECK_SETRLIMIT
 
-  # Look for setenv, so that extended locale tests can be performed.
-  GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+  if test  x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
+    # Do checks for memory limit functions.
+    GLIBCPP_CHECK_SETRLIMIT
+
+    # Look for setenv, so that extended locale tests can be performed.
+    GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
+  fi
 
   # Export file names for ABI checking.
-  baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
-  AC_SUBST(baseline_file)
+  baseline_dir="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)"
+  AC_SUBST(baseline_dir)
 
-  case "$target" in
-    *-*-cygwin* ) enable_abi_check=no ;;
-    * ) enable_abi_check=yes ;;
-  esac
+  # Determine if checking the ABI is desirable.
+  if test x$enable_symvers = xno; then
+    enable_abi_check=no
+  else
+    case "$host" in
+      *-*-cygwin*) 
+       enable_abi_check=no ;;
+      *) 
+        enable_abi_check=yes ;;
+    esac
+  fi
 
-  # Don't do ABI checking unless native.
-  AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
-                 test x"$build" = x"$host" && test -z "$with_cross_host" \
-                && test "$enable_abi_check" = yes )
+  AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)   
+  AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
 ])