OSDN Git Service

2004-10-10 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / acinclude.m4
index f4c449f..ff775e5 100644 (file)
@@ -8,12 +8,12 @@ dnl conditional will depend on the final state of the variable.  For a simple
 dnl example of why this is needed, see GLIBCXX_ENABLE_HOSTED.
 dnl
 m4_define([_m4_divert(glibcxx_diversion)], 8000)dnl
-AC_DEFUN(GLIBCXX_CONDITIONAL, [dnl
+AC_DEFUN([GLIBCXX_CONDITIONAL], [dnl
   m4_divert_text([glibcxx_diversion],dnl
    AM_CONDITIONAL([$1],[$2])
   )dnl
 ])dnl
-AC_DEFUN(GLIBCXX_EVALUATE_CONDITIONALS, [m4_undivert([glibcxx_diversion])])dnl
+AC_DEFUN([GLIBCXX_EVALUATE_CONDITIONALS], [m4_undivert([glibcxx_diversion])])dnl
 
 
 dnl
@@ -21,44 +21,12 @@ dnl Check to see what architecture and operating system we are compiling
 dnl for.  Also, if architecture- or OS-specific flags are required for
 dnl compilation, pick them up here.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_HOST, [
+AC_DEFUN([GLIBCXX_CHECK_HOST], [
   . $glibcxx_srcdir/configure.host
-  AC_MSG_NOTICE(CPU config directory is $cpu_include_dir)
-  AC_MSG_NOTICE(OS config directory is $os_include_dir)
+  AC_MSG_NOTICE([CPU config directory is $cpu_include_dir])
+  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.
@@ -78,7 +46,7 @@ dnl  - the variables in GLIBCXX_CHECK_HOST / configure.host
 dnl  - default settings for all AM_CONFITIONAL test variables
 dnl  - lots of tools, like CC and CXX
 dnl
-AC_DEFUN(GLIBCXX_CONFIGURE, [
+AC_DEFUN([GLIBCXX_CONFIGURE], [
   # Keep these sync'd with the list in Makefile.am.  The first provides an
   # expandable list at autoconf time; the second provides an expandable list
   # (i.e., shell variable) at configure time.
@@ -193,7 +161,7 @@ dnl   Leave it out by default and use maint-mode to use it.
 dnl  SECTION_FLAGS='-ffunction-sections -fdata-sections' if
 dnl   compiler supports it and the user has not requested debug mode.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_COMPILER_FEATURES, [
+AC_DEFUN([GLIBCXX_CHECK_COMPILER_FEATURES], [
   # All these tests are for C++; save the language and the compiler flags.
   # The CXXFLAGS thing is suspicious, but based on similar bits previously
   # found in GLIBCXX_CONFIGURE.
@@ -246,7 +214,7 @@ dnl
 dnl The last will be a single integer, e.g., version 1.23.45.0.67.89 will
 dnl set glibcxx_gnu_ld_version to 12345.  Zeros cause problems.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_LINKER_FEATURES, [
+AC_DEFUN([GLIBCXX_CHECK_LINKER_FEATURES], [
   # If we're not using GNU ld, then there's no point in even trying these
   # tests.  Check for that first.  We should have already tested for gld
   # by now (in libtool), but require it now just to be safe...
@@ -336,8 +304,10 @@ 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, [
+AC_DEFUN([GLIBCXX_CHECK_WCHAR_T_SUPPORT], [
   # Test wchar.h for mbstate_t, which is needed for char_traits and
   # others even if wchar_t support is not on.
   AC_MSG_CHECKING([for mbstate_t])
@@ -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,10 +422,10 @@ 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_DEFUN([GLIBCXX_CHECK_SETRLIMIT_ancilliary], [
   AC_TRY_COMPILE(
     [#include <unistd.h>
      #include <sys/time.h>
@@ -462,11 +433,11 @@ 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.])
 ])
 
-AC_DEFUN(GLIBCXX_CHECK_SETRLIMIT, [
+AC_DEFUN([GLIBCXX_CHECK_SETRLIMIT], [
   setrlimit_have_headers=yes
   AC_CHECK_HEADERS(unistd.h sys/time.h sys/resource.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)
 ])
 
 
@@ -508,7 +480,7 @@ dnl
 dnl Check whether S_ISREG (Posix) or S_IFREG is available in <sys/stat.h>.
 dnl Define HAVE_S_ISREG / HAVE_S_IFREG appropriately.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
+AC_DEFUN([GLIBCXX_CHECK_S_ISREG_OR_S_IFREG], [
   AC_CACHE_VAL(glibcxx_cv_S_ISREG, [
     AC_TRY_LINK(
       [#include <sys/stat.h>],
@@ -538,7 +510,7 @@ AC_DEFUN(GLIBCXX_CHECK_S_ISREG_OR_S_IFREG, [
 dnl
 dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_POLL, [
+AC_DEFUN([GLIBCXX_CHECK_POLL], [
   AC_CACHE_VAL(glibcxx_cv_POLL, [
     AC_TRY_LINK(
       [#include <poll.h>],
@@ -557,7 +529,7 @@ AC_DEFUN(GLIBCXX_CHECK_POLL, [
 dnl
 dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
+AC_DEFUN([GLIBCXX_CHECK_WRITEV], [
   AC_CACHE_VAL(glibcxx_cv_WRITEV, [
     AC_TRY_LINK(
       [#include <sys/uio.h>],
@@ -575,7 +547,7 @@ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
 dnl
 dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_INT64_T, [
+AC_DEFUN([GLIBCXX_CHECK_INT64_T], [
   AC_CACHE_VAL(glibcxx_cv_INT64_T, [
     AC_TRY_COMPILE(
       [#include <stdint.h>],
@@ -592,28 +564,68 @@ AC_DEFUN(GLIBCXX_CHECK_INT64_T, [
 dnl
 dnl Check whether LFS support is available.
 dnl
-AC_DEFUN(GLIBCXX_CHECK_LFS, [
+AC_DEFUN([GLIBCXX_CHECK_LFS], [
   AC_LANG_SAVE
-  AC_LANG_CPLUSPLUS    
+  AC_LANG_CPLUSPLUS
+  ac_save_CXXFLAGS="$CXXFLAGS"
+  CXXFLAGS="$CXXFLAGS -fno-exceptions" 
   AC_CACHE_VAL(glibcxx_cv_LFS, [
     AC_TRY_LINK(
       [#include <unistd.h>
        #include <stdio.h>
+       #include <sys/stat.h>
       ],
       [FILE* fp;
        fopen64("t", "w");
        fseeko64(fp, 0, SEEK_CUR);
        ftello64(fp);
-       lseek64(1, 0, SEEK_CUR);],      
+       lseek64(1, 0, SEEK_CUR);
+       struct stat64 buf;
+       fstat64(1, &buf);],
       [glibcxx_cv_LFS=yes],
       [glibcxx_cv_LFS=no])
   ])
   if test $glibcxx_cv_LFS = yes; then
     AC_DEFINE(_GLIBCXX_USE_LFS)
   fi
-  AC_LANG_RESTORE      
+  CXXFLAGS="$ac_save_CXXFLAGS"
+  AC_LANG_RESTORE
+])
+
+
+dnl
+dnl Check for whether a fully dynamic basic_string implementation should
+dnl be turned on, that does not put empty objects in per-process static
+dnl memory (mostly useful together with shared memory allocators, see PR
+dnl libstdc++/16612 for details).
+dnl
+dnl --enable-fully-dynamic-string defines _GLIBCXX_FULLY_DYNAMIC_STRING
+dnl --disable-fully-dynamic-string leaves _GLIBCXX_FULLY_DYNAMIC_STRING undefined
+dnl  +  Usage:  GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING[(DEFAULT)]
+dnl       Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING], [
+  GLIBCXX_ENABLE(fully-dynamic-string,$1,,[do not put empty strings in per-process static memory])
+  if test $enable_fully_dynamic_string = yes; then
+    AC_DEFINE(_GLIBCXX_FULLY_DYNAMIC_STRING)
+  fi
 ])
 
+dnl
+dnl Check for --enable-__cxa_atexit
+dnl
+dnl --enable-__cxa_atexit defines _GLIBCXX_USE___CXA_ATEXIT
+dnl --disable-__cxa_atexit doesn't define _GLIBCXX_USE___CXA_ATEXIT
+dnl  +  Usage:  GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING[(DEFAULT)]
+dnl       Where DEFAULT is either `yes' or `no'.
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_CXA_ATEXIT], [
+  GLIBCXX_ENABLE(__cxa_atexit,$1,,
+                 [Define if __cxa_atexit is to be used instead of atexit.])
+  if test $enable___cxa_atexit = yes; then
+    AC_DEFINE(_GLIBCXX_USE___CXA_ATEXIT)
+  fi
+])
 
 dnl
 dnl Does any necessary configuration of the testsuite directory.  Generates
@@ -623,12 +635,14 @@ dnl GLIBCXX_ENABLE_SYMVERS and GLIBCXX_IS_NATIVE must be done before this.
 dnl
 dnl Sets:
 dnl  enable_abi_check / GLIBCXX_TEST_ABI
+dnl  GLIBCXX_TEST_WCHAR_T
+dnl  GLIBCXX_TEST_THREAD
 dnl Substs:
 dnl  baseline_dir
 dnl
-AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
+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.
@@ -655,6 +669,7 @@ AC_DEFUN(GLIBCXX_CONFIGURE_TESTSUITE, [
   AC_SUBST(baseline_dir)
 
   GLIBCXX_CONDITIONAL(GLIBCXX_TEST_WCHAR_T, test $enable_wchar_t = yes)
+  GLIBCXX_CONDITIONAL(GLIBCXX_TEST_THREAD, test $enable_thread = yes)
   GLIBCXX_CONDITIONAL(GLIBCXX_TEST_ABI, test $enable_abi_check = yes)
 ])
 
@@ -666,7 +681,7 @@ dnl Substs:
 dnl  GLIBCXX_INCLUDES
 dnl  TOPLEVEL_INCLUDES
 dnl
-AC_DEFUN(GLIBCXX_EXPORT_INCLUDES, [
+AC_DEFUN([GLIBCXX_EXPORT_INCLUDES], [
   # Used for every C++ compile we perform.
   GLIBCXX_INCLUDES="\
 -I$glibcxx_builddir/include/$host_alias \
@@ -697,14 +712,14 @@ dnl Substs:
 dnl  OPTIMIZE_CXXFLAGS
 dnl  WARN_FLAGS
 dnl
-AC_DEFUN(GLIBCXX_EXPORT_FLAGS, [
+AC_DEFUN([GLIBCXX_EXPORT_FLAGS], [
   # Optimization flags that are probably a good idea for thrill-seekers. Just
   # uncomment the lines below and make, everything else is ready to go...
   # OPTIMIZE_CXXFLAGS = -O3 -fstrict-aliasing -fvtable-gc
   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)
 ])
 
@@ -721,7 +736,7 @@ dnl
 dnl Assumes cross_compiling bits already done, and with_cross_host in
 dnl particular.
 dnl
-AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
+AC_DEFUN([GLIBCXX_EXPORT_INSTALL_INFO], [
   glibcxx_toolexecdir=no
   glibcxx_toolexeclibdir=no
   glibcxx_prefixdir=$prefix
@@ -759,11 +774,12 @@ AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
   if test $version_specific_libs = yes; then
     # Need the gcc compiler version to know where to install libraries
     # and header files if --enable-version-specific-runtime-libs option
-    # is selected.
+    # is selected.  FIXME: these variables are misnamed, there are
+    # no executables installed in _toolexecdir or _toolexeclibdir.
     if test x"$gxx_include_dir" = x"no"; then
-      gxx_include_dir='${libdir}/gcc-lib/${host_alias}/'$gcc_version/include/c++
+      gxx_include_dir='${libdir}/gcc/${host_alias}/'$gcc_version/include/c++
     fi
-    glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+    glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
     glibcxx_toolexeclibdir='${toolexecdir}/'$gcc_version'$(MULTISUBDIR)'
   fi
 
@@ -775,7 +791,7 @@ AC_DEFUN(GLIBCXX_EXPORT_INSTALL_INFO, [
       glibcxx_toolexecdir='${exec_prefix}/${host_alias}'
       glibcxx_toolexeclibdir='${toolexecdir}/lib'
     else
-      glibcxx_toolexecdir='${libdir}/gcc-lib/${host_alias}'
+      glibcxx_toolexecdir='${libdir}/gcc/${host_alias}'
       glibcxx_toolexeclibdir='${libdir}'
     fi
     multi_os_directory=`$CXX -print-multi-os-directory`
@@ -840,7 +856,7 @@ dnl  +  Usage:  GLIBCXX_ENABLE_C99[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
 dnl  +  If 'C99' stuff is not available, ignores DEFAULT and sets `no'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_C99, [
+AC_DEFUN([GLIBCXX_ENABLE_C99], [
   GLIBCXX_ENABLE(c99,$1,,[turns on ISO/IEC 9899:1999 support])
 
   AC_LANG_SAVE
@@ -967,7 +983,7 @@ dnl --disable-cheaders [does not do anything, really].
 dnl  +  Usage:  GLIBCXX_ENABLE_CHEADERS[(DEFAULT)]
 dnl       Where DEFAULT is either `c' or `c_std'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_CHEADERS, [
+AC_DEFUN([GLIBCXX_ENABLE_CHEADERS], [
   GLIBCXX_ENABLE(cheaders,$1,[=KIND],
     [construct "C" headers for g++], [permit c|c_std])
   AC_MSG_NOTICE("C" header strategy set to $enable_cheaders)
@@ -987,7 +1003,7 @@ dnl a subdirectory of config/locale.
 dnl
 dnl Default is generic.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
+AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
   AC_MSG_CHECKING([for C locale to use])
   GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
     [use MODEL for target locale package],
@@ -1006,8 +1022,8 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
   # Probe for locale support if no specific model is specified.
   # Default to "generic".
   if test $enable_clocale_flag = auto; then
-    case x${target_os} in
-      xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
+    case ${target_os} in
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
         AC_EGREP_CPP([_GLIBCXX_ok], [
         #include <features.h>
         #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
@@ -1016,7 +1032,7 @@ AC_DEFUN(GLIBCXX_ENABLE_CLOCALE, [
         ], enable_clocale_flag=gnu, enable_clocale_flag=generic)
 
         # Test for bugs early in glibc-2.2.x series
-          if test x$enable_clocale_flag = xgnu; then
+          if test $enable_clocale_flag = gnu; then
           AC_TRY_RUN([
           #define _GNU_SOURCE 1
           #include <locale.h>
@@ -1167,6 +1183,75 @@ 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". Auto implies the default choice
+  # for a particular platform.
+  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
+      linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+        enable_libstdcxx_allocator_flag=mt
+        ;;
+      *)
+        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.
@@ -1174,7 +1259,7 @@ dnl --disable-concept-checks leaves them off.
 dnl  +  Usage:  GLIBCXX_ENABLE_CONCEPT_CHECKS[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_CONCEPT_CHECKS, [
+AC_DEFUN([GLIBCXX_ENABLE_CONCEPT_CHECKS], [
   GLIBCXX_ENABLE(concept-checks,$1,,[use Boost-derived template checks])
   if test $enable_concept_checks = yes; then
     AC_DEFINE(_GLIBCXX_CONCEPT_CHECKS)
@@ -1187,7 +1272,7 @@ dnl Check for which I/O library to use:  stdio, or something specific.
 dnl
 dnl Default is stdio.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_CSTDIO, [
+AC_DEFUN([GLIBCXX_ENABLE_CSTDIO], [
   AC_MSG_CHECKING([for underlying I/O to use])
   GLIBCXX_ENABLE(cstdio,stdio,[=PACKAGE],
     [use target-specific I/O package], [permit stdio])
@@ -1223,7 +1308,7 @@ dnl  +  Usage:  GLIBCXX_ENABLE_CXX_FLAGS(default flags)
 dnl       If "default flags" is an empty string, the effect is the same
 dnl       as --disable or --enable=no.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_CXX_FLAGS, [dnl
+AC_DEFUN([GLIBCXX_ENABLE_CXX_FLAGS], [dnl
   AC_MSG_CHECKING([for extra compiler flags for building])
   GLIBCXX_ENABLE(cxx-flags,$1,[=FLAGS],
     [pass compiler FLAGS when building library],
@@ -1261,7 +1346,7 @@ dnl --disable-c-mbchar doesn't.
 dnl  +  Usage:  GLIBCXX_ENABLE_C_MBCHAR[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_C_MBCHAR, [
+AC_DEFUN([GLIBCXX_ENABLE_C_MBCHAR], [
   GLIBCXX_ENABLE(c-mbchar,$1,,[enable multibyte (wide) characters])
   # Option parsed, now other scripts can test enable_c_mbchar for yes/no.
 ])
@@ -1283,7 +1368,7 @@ dnl
 dnl  +  Usage:  GLIBCXX_ENABLE_DEBUG[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG, [
+AC_DEFUN([GLIBCXX_ENABLE_DEBUG], [
   AC_MSG_CHECKING([for additional debug build])
   GLIBCXX_ENABLE(libstdcxx-debug,$1,,[build extra debug library])
   AC_MSG_RESULT($enable_libstdcxx_debug)
@@ -1303,7 +1388,7 @@ dnl  +  Usage:  GLIBCXX_ENABLE_DEBUG_FLAGS(default flags)
 dnl       If "default flags" is an empty string, the effect is the same
 dnl       as --disable or --enable=no.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_DEBUG_FLAGS, [
+AC_DEFUN([GLIBCXX_ENABLE_DEBUG_FLAGS], [
   GLIBCXX_ENABLE(libstdcxx-debug-flags,[$1],[=FLAGS],
     [pass compiler FLAGS when building debug library],
     [case "x$enable_libstdcxx_debug_flags" in
@@ -1334,11 +1419,18 @@ dnl
 dnl Defines:
 dnl  _GLIBCXX_HOSTED   (always defined, either to 1 or 0)
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
+AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
   AC_ARG_ENABLE([hosted-libstdcxx],
     AC_HELP_STRING([--disable-hosted-libstdcxx],
                    [only build freestanding C++ runtime support]),,
-    [enable_hosted_libstdcxx=yes])
+    [case "$host" in
+       arm*-*-symbianelf*) 
+           enable_hosted_libstdcxx=no
+           ;;
+        *) 
+           enable_hosted_libstdcxx=yes
+           ;;
+     esac])
   if test "$enable_hosted_libstdcxx" = no; then
     AC_MSG_NOTICE([Only freestanding libraries will be built])
     is_hosted=no
@@ -1364,28 +1456,12 @@ dnl --enable-long-long defines _GLIBCXX_USE_LONG_LONG
 dnl --disable-long-long leaves _GLIBCXX_USE_LONG_LONG undefined
 dnl  +  Usage:  GLIBCXX_ENABLE_LONG_LONG[(DEFAULT)]
 dnl       Where DEFAULT is either `yes' or `no'.
-dnl  +  If 'long long' stuff is not available, ignores DEFAULT and sets `no'.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_LONG_LONG, [
+AC_DEFUN([GLIBCXX_ENABLE_LONG_LONG], [
   GLIBCXX_ENABLE(long-long,$1,,[enables I/O support for 'long long'])
-
-  AC_LANG_SAVE
-  AC_LANG_CPLUSPLUS
-
-  AC_MSG_CHECKING([for enabled long long I/O support])
-  # iostreams require strtoll, strtoull to compile
-  AC_TRY_COMPILE([#include <stdlib.h>],
-                 [char* tmp; strtoll("gnu", &tmp, 10);],,[enable_long_long=no])
-  AC_TRY_COMPILE([#include <stdlib.h>],
-                 [char* tmp; strtoull("gnu", &tmp, 10);],,[enable_long_long=no])
-
-  # Option parsed, now set things appropriately
   if test $enable_long_long = yes; then
     AC_DEFINE(_GLIBCXX_USE_LONG_LONG)
   fi
-  AC_MSG_RESULT($enable_long_long)
-
-  AC_LANG_RESTORE
 ])
 
 
@@ -1403,7 +1479,7 @@ dnl
 dnl Substs:
 dnl  glibcxx_PCHFLAGS
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_PCH, [
+AC_DEFUN([GLIBCXX_ENABLE_PCH], [
   AC_MSG_CHECKING([for enabled PCH])
   GLIBCXX_ENABLE(libstdcxx-pch,$1,,[build pre-compiled libstdc++ headers])
   AC_MSG_RESULT([$enable_libstdcxx_pch])
@@ -1455,7 +1531,7 @@ dnl
 dnl Defines:
 dnl  _GLIBCXX_SJLJ_EXCEPTIONS if the compiler is configured for it
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_SJLJ_EXCEPTIONS, [
+AC_DEFUN([GLIBCXX_ENABLE_SJLJ_EXCEPTIONS], [
   AC_MSG_CHECKING([for exception model to use])
   AC_LANG_SAVE
   AC_LANG_CPLUSPLUS
@@ -1525,7 +1601,7 @@ dnl       Where DEFAULT is either 'yes' or 'no'.  Passing `yes' tries to
 dnl       choose a default style based on linker characteristics.  Passing
 dnl       'no' disables versioning.
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_SYMVERS, [
+AC_DEFUN([GLIBCXX_ENABLE_SYMVERS], [
 
 GLIBCXX_ENABLE(symvers,$1,[=STYLE],
   [enables symbol versioning of the shared library],
@@ -1548,6 +1624,23 @@ if test $enable_symvers != no; then
   CFLAGS=' -lgcc_s'
   AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes, glibcxx_shared_libgcc=no)
   CFLAGS="$ac_save_CFLAGS"
+  if test $glibcxx_shared_libgcc = no; then
+    cat > conftest.c <<EOF
+int main (void) { return 0; }
+EOF
+changequote(,)dnl
+    glibcxx_libgcc_s_suffix=`${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \
+                            -shared -shared-libgcc -o conftest.so \
+                            conftest.c -v 2>&1 >/dev/null \
+                            | sed -n 's/^.* -lgcc_s\([^ ]*\) .*$/\1/p'`
+changequote([,])dnl
+    rm -f conftest.c conftest.so
+    if test x${glibcxx_libgcc_s_suffix+set} = xset; then
+      CFLAGS=" -lgcc_s$glibcxx_libgcc_s_suffix"
+      AC_TRY_LINK(, [return 0;], glibcxx_shared_libgcc=yes)
+      CFLAGS="$ac_save_CFLAGS"
+    fi
+  fi
   AC_MSG_RESULT($glibcxx_shared_libgcc)
 fi
 
@@ -1627,19 +1720,26 @@ dnl  glibcxx_thread_h
 dnl
 dnl Defines:
 dnl  HAVE_GTHR_DEFAULT
-dnl  _GLIBCXX_SUPPORTS_WEAK
 dnl
-AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
+AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
   AC_MSG_CHECKING([for thread model used by GCC])
   target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
   AC_MSG_RESULT([$target_thread_file])
 
   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
+
+  dnl Check for __GTHREADS define.
+  gthread_file=${toplevel_srcdir}/gcc/${glibcxx_thread_h}
+  if grep __GTHREADS $gthread_file >/dev/null 2>&1 ; then
+    enable_thread=yes
+  else
+   enable_thread=no
+  fi
+
   AC_SUBST(glibcxx_thread_h)
 ])
 
@@ -1653,7 +1753,7 @@ AC_DEFUN(GLIBCXX_ENABLE_THREADS, [
 # Please note that the actual code is *not* freely available.
 
 # serial 1
-AC_DEFUN(AC_LC_MESSAGES, [
+AC_DEFUN([AC_LC_MESSAGES], [
   AC_CHECK_HEADER(locale.h, [
     AC_CACHE_CHECK([for LC_MESSAGES], ac_cv_val_LC_MESSAGES,
       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],