OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / acinclude.m4
index b694668..6c60934 100644 (file)
@@ -27,38 +27,6 @@ AC_DEFUN([GLIBCXX_CHECK_HOST], [
   AC_MSG_NOTICE([OS config directory is $os_include_dir])
 ])
 
-
-dnl
-dnl Initialize basic configure bits.
-dnl
-dnl Substs:
-dnl  multi_basedir
-dnl
-AC_DEFUN([GLIBCXX_TOPREL_CONFIGURE], [
-  # Sets up multi_basedir, which is srcdir/.. plus the usual
-  # "multi_source_toprel_bottom_adjust" lunacy as needed.
-  AM_ENABLE_MULTILIB(, ..)
-
-  # The generated code is exactly the same, except that automake's looks in
-  # ".. $srcdir/.." and autoconf's looks in multi_basedir.  Apparently other
-  # things are triggered on the presence of the two ...AUX_DIR[S], but I don't
-  # know what they are or what the other differences might be (and they keep
-  # changing anyhow).
-  #
-  # Looking in multi_basedir seems smarter, so actually execute that branch.
-  if false; then
-    # this is for automake
-    AC_CONFIG_AUX_DIR(..)
-  else
-    # this is for autoconf
-    AC_CONFIG_AUX_DIRS(${multi_basedir})
-  fi
-
-  dnl XXX Turn this on.
-  dnl AC_LANG_CPLUSPLUS
-])
-
-
 dnl
 dnl Initialize the rest of the library configury.  At this point we have
 dnl variables like $host.
@@ -336,6 +304,8 @@ dnl
 dnl Defines:
 dnl  HAVE_MBSTATE_T if mbstate_t is not in wchar.h
 dnl  _GLIBCXX_USE_WCHAR_T if all the bits are found.
+dnl Substs:
+dnl  LIBICONV to a -l string containing the iconv library, if needed.
 dnl
 AC_DEFUN([GLIBCXX_CHECK_WCHAR_T_SUPPORT], [
   # Test wchar.h for mbstate_t, which is needed for char_traits and
@@ -412,9 +382,10 @@ AC_DEFUN([GLIBCXX_CHECK_WCHAR_T_SUPPORT], [
     AC_CHECK_HEADER(langinfo.h, ac_has_langinfo_h=yes, ac_has_langinfo_h=no)
 
     # Check for existence of libiconv.a providing XPG2 wchar_t support.
-    AC_CHECK_LIB(iconv, iconv, libiconv="-liconv")
+    AC_CHECK_LIB(iconv, iconv, LIBICONV="-liconv")
     ac_save_LIBS="$LIBS"
-    LIBS="$LIBS $libiconv"
+    LIBS="$LIBS $LIBICONV"
+    AC_SUBST(LIBICONV)
 
     AC_CHECK_FUNCS([iconv_open iconv_close iconv nl_langinfo],
     [ac_XPG2funcs=yes], [ac_XPG2funcs=no])
@@ -451,8 +422,8 @@ dnl Check for headers for, and arguments to, the setrlimit() function.
 dnl Used only in testsuite_hooks.h.  Called from GLIBCXX_CONFIGURE_TESTSUITE.
 dnl
 dnl Defines:
-dnl  _GLIBCXX_MEM_LIMITS if we can set artificial limits on memory
-dnl  various HAVE_MEMLIMIT_* for individual limit names
+dnl  _GLIBCXX_RES_LIMITS if we can set artificial resource limits 
+dnl  various HAVE_LIMIT_* for individual limit names
 dnl
 AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [
   AC_TRY_COMPILE(
@@ -462,7 +433,7 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [
     ],
     [ int f = RLIMIT_$1 ; ],
     [glibcxx_mresult=1], [glibcxx_mresult=0])
-  AC_DEFINE_UNQUOTED(HAVE_MEMLIMIT_$1, $glibcxx_mresult,
+  AC_DEFINE_UNQUOTED(HAVE_LIMIT_$1, $glibcxx_mresult,
                      [Only used in build directory testsuite_hooks.h.])
 ])
 
@@ -479,6 +450,7 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [
     GLIBCXX_CHECK_SETRLIMIT_ancilliary(RSS)
     GLIBCXX_CHECK_SETRLIMIT_ancilliary(VMEM)
     GLIBCXX_CHECK_SETRLIMIT_ancilliary(AS)
+    GLIBCXX_CHECK_SETRLIMIT_ancilliary(FSIZE)
 
     # Check for rlimit, setrlimit.
     AC_CACHE_VAL(ac_setrlimit, [
@@ -493,14 +465,14 @@ AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [
     ])
   fi
 
-  AC_MSG_CHECKING([for testsuite memory limit support])
+  AC_MSG_CHECKING([for testsuite resource limits support])
   if test $setrlimit_have_headers = yes && test $ac_setrlimit = yes; then
-    ac_mem_limits=yes
-    AC_DEFINE(_GLIBCXX_MEM_LIMITS)
+    ac_res_limits=yes
+    AC_DEFINE(_GLIBCXX_RES_LIMITS)
   else
-    ac_mem_limits=no
+    ac_res_limits=no
   fi
-  AC_MSG_RESULT($ac_mem_limits)
+  AC_MSG_RESULT($ac_res_limits)
 ])
 
 
@@ -631,7 +603,7 @@ dnl  baseline_dir
 dnl
 AC_DEFUN([GLIBCXX_CONFIGURE_TESTSUITE], [
   if $GLIBCXX_IS_NATIVE && test $is_hosted = yes; then
-    # Do checks for memory limit functions.
+    # Do checks for resource limit functions.
     GLIBCXX_CHECK_SETRLIMIT
 
     # Look for setenv, so that extended locale tests can be performed.
@@ -707,7 +679,7 @@ AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [
   OPTIMIZE_CXXFLAGS=
   AC_SUBST(OPTIMIZE_CXXFLAGS)
 
-  WARN_FLAGS='-Wall -W -Wwrite-strings -Wcast-qual'
+  WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
   AC_SUBST(WARN_FLAGS)
 ])
 
@@ -1171,6 +1143,68 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
 
 
 dnl
+dnl Check for which std::allocator base class to use.  The choice is
+dnl mapped from a subdirectory of include/ext.
+dnl
+dnl Default is new.
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_ALLOCATOR], [
+  AC_MSG_CHECKING([for std::allocator base class to use])
+  GLIBCXX_ENABLE(libstdcxx-allocator,auto,[=KIND],
+    [use KIND for target std::allocator base],
+    [permit new|malloc|mt|bitmap|pool|yes|no|auto])
+  # If they didn't use this option switch, or if they specified --enable
+  # with no specific model, we'll have to look for one.  If they
+  # specified --disable (???), do likewise.
+  if test $enable_libstdcxx_allocator = no || test $enable_libstdcxx_allocator = yes; then
+     enable_libstdcxx_allocator=auto
+  fi
+
+  # Either a known package, or "auto"
+  enable_libstdcxx_allocator_flag=$enable_libstdcxx_allocator
+
+  # Probe for host-specific support if no specific model is specified.
+  # Default to "new".
+  if test $enable_libstdcxx_allocator_flag = auto; then
+    case ${target_os} in
+      *)
+        enable_libstdcxx_allocator_flag=new
+        ;;
+    esac
+  fi
+  AC_MSG_RESULT($enable_libstdcxx_allocator_flag)
+  
+
+  # Set configure bits for specified locale package
+  case ${enable_libstdcxx_allocator_flag} in
+    bitmap)
+      ALLOCATOR_H=config/allocator/bitmap_allocator_base.h
+      ALLOCATOR_NAME=__gnu_cxx::bitmap_allocator
+      ;;
+    malloc)
+      ALLOCATOR_H=config/allocator/malloc_allocator_base.h
+      ALLOCATOR_NAME=__gnu_cxx::malloc_allocator
+      ;;
+    mt)
+      ALLOCATOR_H=config/allocator/mt_allocator_base.h
+      ALLOCATOR_NAME=__gnu_cxx::__mt_alloc
+      ;;
+    new)
+      ALLOCATOR_H=config/allocator/new_allocator_base.h
+      ALLOCATOR_NAME=__gnu_cxx::new_allocator
+      ;;
+    pool)
+      ALLOCATOR_H=config/allocator/pool_allocator_base.h
+      ALLOCATOR_NAME=__gnu_cxx::__pool_alloc
+      ;;       
+  esac
+
+  AC_SUBST(ALLOCATOR_H)
+  AC_SUBST(ALLOCATOR_NAME)
+])
+
+
+dnl
 dnl Check for whether the Boost-derived checks should be turned on.
 dnl
 dnl --enable-concept-checks turns them on.
@@ -1631,7 +1665,6 @@ dnl  glibcxx_thread_h
 dnl
 dnl Defines:
 dnl  HAVE_GTHR_DEFAULT
-dnl  _GLIBCXX_SUPPORTS_WEAK
 dnl
 AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
   AC_MSG_CHECKING([for thread model used by GCC])
@@ -1640,7 +1673,6 @@ AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
 
   if test $target_thread_file != single; then
     AC_DEFINE(HAVE_GTHR_DEFAULT)
-    AC_DEFINE(_GLIBCXX_SUPPORTS_WEAK, __GXX_WEAK__)
   fi
 
   glibcxx_thread_h=gthr-$target_thread_file.h