2008-04-26  Eric Lemings <eric.lemings@roguewave.com>

	STDCXX-396
	* Makefile.am (MAINTAINERCLEANFILES): Removed extraneous
	variable.  Added missing files.
	* TODO: Run `libtoolize' first with most recent versions of
	Autotools.
	* configure.ac: Updated required Autoconf version.  Added section
	notices.  Collected C language checks into types macro.  Added C
	library checks.
	* include/Makefile.am (nobase_include_HEADERS): List headers in
	subdirectories so they get installed properly.  (Yeah, its a
	long list but it doesn't change often and its portable.  See
	"Portable Make Programming" chapter in GNU Autoconf Manual.)
	* etc/config/macros/ac_enable_debug.m4,
	etc/config/macros/ac_enable_threads.m4,
	etc/config/macros/ac_header_nostd.m4: Minor updates.
	* etc/config/macros/rw_sys_atomic_ops.m4: Some x86 architectures
	still reported as `i386'.
	* etc/config/macros/ac_c89_offsetof.m4,
	etc/config/macros/ac_c99_func.m4,
	etc/config/macros/ac_check_typeof.m4,
	etc/config/macros/ac_compute_float.m4,
	etc/config/macros/ac_path_header.m4,
	etc/config/macros/ac_struct_lconv_def.m4,
	etc/config/macros/ac_struct_tm_def.m4,
	etc/config/macros/ac_type_limits.m4,
	etc/config/macros/rw_stdc_*.m4: Added new files.



git-svn-id: https://svn.apache.org/repos/asf/stdcxx/branches/autotools@651878 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/Makefile.am b/Makefile.am
index 5d809de..55a635e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -65,18 +65,22 @@
 # updating/regenerating maintenance files.
 ACLOCAL_AMFLAGS = -I @CONFIG_MACRODIR@
 
-config_auxdir = @CONFIG_AUXDIR@
-
 MAINTAINERCLEANFILES = \
 	COPYING \
 	INSTALL \
 	Makefile.in \
 	aclocal.m4 \
 	configure \
-	$(config_auxdir)/config.guess \
-	$(config_auxdir)/config.sub \
-	$(config_auxdir)/depcomp \
-	$(config_auxdir)/install-sh \
-	$(config_auxdir)/ltmain.sh \
-	$(config_auxdir)/missing
+	libtool \
+	@CONFIG_AUXDIR@/config.guess \
+	@CONFIG_AUXDIR@/config.sub \
+	@CONFIG_AUXDIR@/depcomp \
+	@CONFIG_AUXDIR@/install-sh \
+	@CONFIG_AUXDIR@/ltmain.sh \
+	@CONFIG_AUXDIR@/missing \
+	@CONFIG_MACRODIR@/libtool.m4 \
+	@CONFIG_MACRODIR@/lt~obsolete.m4 \
+	@CONFIG_MACRODIR@/ltsugar.m4 \
+	@CONFIG_MACRODIR@/ltversion.m4 \
+	@CONFIG_MACRODIR@/ltoptions.m4
 
diff --git a/TODO b/TODO
index 6b7da2e..b948575 100644
--- a/TODO
+++ b/TODO
@@ -16,8 +16,8 @@
 To "bootstrap" the resulting distribution, run the following commands
 in the top-level source directory:
 
-	$ aclocal -I etc/config/macros
 	$ libtoolize -c
+	$ aclocal -I etc/config/macros
 	$ autoheader
 	$ automake -ac
 	$ autoconf
diff --git a/configure.ac b/configure.ac
index 8f8790a..07768d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@
 #
 
 # information on the package
-AC_PREREQ([2.59])
+AC_PREREQ([2.62]) # multi-line definitions were added in this version
 AC_COPYRIGHT([Copyright (c) 2005-2007 Apache Software Foundation.
 Copyright (c) 1999-2007 Rogue Wave Software, Inc.])
 AC_REVISION([$Id$])
@@ -36,29 +36,47 @@
 
 AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
 
+# custom configure options
 AM_NLS
 AC_ENABLE_DEBUG
 AC_ENABLE_THREADS
 
-# checks for programs
+AC_MSG_NOTICE([checks for programs])
 AC_PROG_LIBTOOL
+AC_PROG_CC_STDC
 AC_PROG_CXX
 AM_PROG_AS
 
-# checks for system-specific features
+AC_MSG_NOTICE([checks for system-specific features])
 RW_SYS_ATOMIC_OPS
 
-# checks for native C language data types
-AC_CHECK_TYPE([long long], [], [AC_DEFINE([_RWSTD_NO_LONG_LONG], [1],
-[Define if compiler does not support native `long long' type.])])
-AC_CHECK_TYPE([long double], [], [AC_DEFINE([_RWSTD_NO_LONG_DOUBLE], [1],
-[Define if compiler does not support native `long double' type.])])
+AC_MSG_NOTICE([checks for Standard C Language])
+AC_C99_FUNC([], [AC_DEFINE([_RWSTD_NO_FUNC], [1],
+[Define if compiler does not support C99 preprocessing symbol `__func__'.])])
+RW_STDC_TYPES
 
-# checks for common C library type definitions
-AC_CHECK_TYPE([size_t], [], [AC_DEFINE([_RWSTD_NO_SIZE_T], [1],
-[Define if standard headers do not define `size_t' type.])])
+AC_MSG_NOTICE([checks for Standard C Library])
+AC_PATH_HEADER([_RWSTD_ANSI_C_ASSERT_H], [assert.h])
+AC_PATH_HEADER([_RWSTD_ANSI_C_CTYPE_H], [ctype.h])
+AC_PATH_HEADER([_RWSTD_ANSI_C_ERRNO_H], [errno.h])
+AC_PATH_HEADER([_RWSTD_ANSI_C_ISO646_H], [iso646.h])
+AC_PATH_HEADER([_RWSTD_ANSI_C_SETJMP_H], [setjmp.h])
 
-# checks for C++ compiler-specific features
+RW_STDC_FLOAT
+RW_STDC_LOCALE
+RW_STDC_MATH
+RW_STDC_SIGNAL
+RW_STDC_STDARG
+RW_STDC_STDIO
+RW_STDC_STDDEF
+RW_STDC_STDINT
+RW_STDC_STDLIB
+RW_STDC_STRING
+RW_STDC_TIME
+RW_STDC_WCHAR
+RW_STDC_WCTYPE
+
+AC_MSG_NOTICE([checks for C++ compiler features])
 AC_LANG(C++)
 AC_HEADER_NO_STD
 
diff --git a/etc/config/macros/ac_c89_offsetof.m4 b/etc/config/macros/ac_c89_offsetof.m4
new file mode 100644
index 0000000..06b62ef
--- /dev/null
+++ b/etc/config/macros/ac_c89_offsetof.m4
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_C89_OFFSETOF(ACTION-IF-TRUE, ACTION-IF-FALSE)
+# ----------------------------------------------
+# Perform ACTION-IF-TRUE if standard headers define offsetof() macro.
+# Otherwise, performs ACTION-IF-FALSE.
+#
+# TODO: Define offsetof() if not found as follows:
+# offsetof(T, m) (((const char*)&((T*)0)->m) - ((const char*)(T*)0))
+AC_DEFUN([AC_C89_OFFSETOF],
+[
+  AS_VAR_PUSHDEF([ac_Var], [ac_cv_c_offsetof])
+  AC_CACHE_CHECK([for offsetof], [ac_Var],
+    [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+struct S { int i[[2]][[2]]; };],
+[return !(offsetof (struct S, i [[0]][[1]])
+          != offsetof (struct S, i [[1]][[0]]));])],
+                   [AS_VAR_SET([ac_Var], [yes])],
+                   [AS_VAR_SET([ac_Var], [no])])])
+  AS_IF([test AS_VAR_GET([ac_Var]) = yes], [$1], [$2])
+  AS_VAR_POPDEF([ac_Var])
+])# AC_C89_OFFSETOF
+
diff --git a/etc/config/macros/ac_c99_func.m4 b/etc/config/macros/ac_c99_func.m4
new file mode 100644
index 0000000..2de5bb5
--- /dev/null
+++ b/etc/config/macros/ac_c99_func.m4
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_C99_FUNC(ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
+# -------------------------------------------------
+# Performs ACTION-IF-FOUND if the compiler recognizes the C99
+# preprocessor symbol `__func__'.  Otherwise, performs
+# ACTION-IF-NOT-FOUND.
+AC_DEFUN([AC_C99_FUNC],
+[
+  AC_PROG_CC_C99
+  AS_VAR_PUSHDEF([ac_Var], [ac_cv_c__func__])
+  AC_CACHE_CHECK([for __func__], [ac_Var],
+    [AC_COMPILE_IFELSE([const char* s = __func__;],
+                       [AS_VAR_SET([ac_Var], [yes])],
+                       [AS_VAR_SET([ac_Var], [no])])])
+  AS_IF([test AS_VAR_GET([ac_Var]) = yes], [$1], [$2])
+  AS_VAR_POPDEF([ac_Var])dnl
+])# AC_C99_FUNC
+
diff --git a/etc/config/macros/ac_check_typeof.m4 b/etc/config/macros/ac_check_typeof.m4
new file mode 100644
index 0000000..550fe54
--- /dev/null
+++ b/etc/config/macros/ac_check_typeof.m4
@@ -0,0 +1,108 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_LANG_TYPEOF_SAVE(C++)(PROLOGUE, EXPRESSION)
+# ----------------------------------------------
+# Produce a C++ program that saves the runtime evaluation of the type
+# EXPRESSION into `conftest.val'.
+#
+# TODO: Is there a way to generalize this for pointers, cv-qualifiers,
+# and function types?
+#
+m4_define([AC_LANG_TYPEOF_SAVE(C++)],
+[AC_LANG_PROGRAM([$1
+@%:@define TYPESTRING(T) static const char* typestring(T) { return #T; }
+TYPESTRING(char)
+TYPESTRING(unsigned char)
+TYPESTRING(short int)
+TYPESTRING(unsigned short int)
+TYPESTRING(int)
+TYPESTRING(unsigned int)
+TYPESTRING(long int)
+TYPESTRING(unsigned long int)
+@%:@if defined HAVE_LONG_LONG_INT
+  TYPESTRING(long long int)
+@%:@endif
+@%:@if defined HAVE_UNSIGNED_LONG_LONG_INT
+  TYPESTRING(unsigned long long int)
+@%:@endif
+TYPESTRING(float)
+TYPESTRING(double)
+TYPESTRING(long double)
+TYPESTRING(void*)
+TYPESTRING(int*)
+TYPESTRING(const void*)
+TYPESTRING(const int*)
+TYPESTRING(void (*)())
+TYPESTRING(bool)
+
+@%:@include <stdio.h>
+@%:@include <stdlib.h>
+], [
+  FILE* fp = fopen ("conftest.val", "w");
+  if (!fp) return 1;
+  $2 x; fprintf (fp, "%s\n", typestring(x));
+  return ferror (fp) || fclose (fp) != 0;
+])])# AC_LANG_TYPEOF_SAVE(C++)
+
+# AC_LANG_TYPEOF_SAVE(PROLOGUE, EXPRESSION)
+# -----------------------------------------
+# Produce a program that saves the runtime evaluation of the type
+# EXPRESSION into `conftest.val'.
+AC_DEFUN([AC_LANG_TYPEOF_SAVE],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# _AC_CHECK_TYPEOF(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
+# ------------------------------------------------------------
+AC_DEFUN([_AC_CHECK_TYPEOF],
+[
+  AC_LANG_COMPILER_REQUIRE()dnl
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
+  if test "$cross_compiling" = no; then
+    _AC_RUN_IFELSE([AC_LANG_TYPEOF_SAVE([$3], [$2])],
+                   [$1=`cat conftest.val`], [$4])
+  fi
+  rm -f conftest.val[]dnl
+])# _AC_CHECK_TYPEOF
+
+# AC_CHECK_TYPEOF(TYPE, VARIABLE, [INCLUDES=DEFAULT-INCLUDES])
+# ------------------------------------------------------------
+# Define VARIABLE as the intrinsic (i.e. built-in) type which evaluates
+# to a specified type EXPRESSION.  If EXPRESSION can not be evaluated,
+# VARIABLE is undefined.
+AC_DEFUN([AC_CHECK_TYPEOF],
+[
+  AS_VAR_PUSHDEF([ac_Var], [ac_cv_typeof_$1])
+  AC_CACHE_CHECK([type of $1], [ac_Var],
+      [# Only know how to do this in C++ currently.
+       AC_LANG_SAVE
+       AC_LANG_CPLUSPLUS
+       _AC_CHECK_TYPEOF([ac_Var], [$1],
+           [AC_INCLUDES_DEFAULT([$3])],
+           [AC_MSG_FAILURE([cannot determine type of ($1), 77])])
+       AC_LANG_RESTORE
+      ])dnl
+
+  AC_DEFINE_UNQUOTED(AS_TR_CPP([$2]), AS_VAR_GET([ac_Var]),
+                     [Evaluated type for type espression `$1'.])
+  AS_VAR_POPDEF([ac_Var])dnl
+])# AC_CHECK_TYPEOF
+
diff --git a/etc/config/macros/ac_compute_float.m4 b/etc/config/macros/ac_compute_float.m4
new file mode 100644
index 0000000..871d6e6
--- /dev/null
+++ b/etc/config/macros/ac_compute_float.m4
@@ -0,0 +1,97 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_LANG_FLOAT_SAVE(C)(PROLOGUE, EXPRESSION)
+# -------------------------------------------
+# Just like AC_LANG_INT_SAVE except the value is formatted as a
+# floating-point value.
+m4_define([AC_LANG_FLOAT_SAVE(C)],
+[AC_LANG_PROGRAM([$1
+static long double longval () { return $2; }
+@%:@include <stdio.h>
+@%:@include <stdlib.h>],
+[
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  long double i = longval ();
+  if (i != ($2))
+    return 1;
+  fprintf (f, "%Le\n", i);
+  return ferror (f) || fclose (f) != 0;
+])])# AC_LANG_FLOAT_SAVE(C)
+
+# AC_LANG_FLOAT_SAVE(PROLOGUE, EXPRESSION)
+# ----------------------------------------
+# Produce a program that saves the runtime evaluation of the
+# floating-point EXPRESSION into `conftest.val'.
+AC_DEFUN([AC_LANG_FLOAT_SAVE],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# _AC_COMPUTE_FLOAT_COMPILE(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
+# ---------------------------------------------------------------------
+# Store the value of floating-point EXPRESSION in VARIABLE.  This macro
+# computes the value of a floating-point expression by repeatedly
+# compiling a source file (for cross-compiling builds) with the given
+# PROLOGUE and stores the result in VARIABLE.
+m4_define([_AC_COMPUTE_FLOAT_COMPILE],
+[
+dnl TODO: Finish this if needed.  See _AC_COMPUTE_INT_SAVE.
+ac_lo=no
+case $ac_lo in
+?*) $2=$ac_lo;;
+'') $4 ;;
+esac[]dnl
+])# _AC_COMPUTE_FLOAT_COMPILE
+
+
+# _AC_COMPUTE_FLOAT_RUN(EXPRESSION, VARIABLE, PROLOGUE, [IF-FAILS])
+# -----------------------------------------------------------------
+# Store the evaluation of the floating-point EXPRESSION in VARIABLE.
+m4_define([_AC_COMPUTE_FLOAT_RUN],
+[_AC_RUN_IFELSE([AC_LANG_FLOAT_SAVE([$3], [$1])],
+                [if (echo "$2" | grep "FLT") >/dev/null 2>&1; then
+                   $2="`cat conftest.val`F"
+                 elif (echo "$2" | grep "LDBL") >/dev/null 2>&1; then
+                   $2="`cat conftest.val`L"
+                 else
+                   $2=`cat conftest.val`
+                 fi], [$4])])
+
+# AC_COMPUTE_FLOAT(VARIABLE, EXPRESSION, PROLOGUE, [IF-FAILS])
+# ------------------------------------------------------------
+AC_DEFUN([AC_COMPUTE_FLOAT],
+[AC_LANG_COMPILER_REQUIRE()dnl
+if test "$cross_compiling" = yes; then
+  _AC_COMPUTE_FLOAT_COMPILE([$2], [$1], [$3], [$4])
+else
+  _AC_COMPUTE_FLOAT_RUN([$2], [$1], [$3], [$4])
+fi
+rm -f conftest.val[]dnl
+])# AC_COMPUTE_FLOAT
+
+# _AC_CACHE_CHECK_FLOAT(MESSAGE, CACHE-ID, EXPRESSION,
+#                       [PROLOGUE = DEFAULT-INCLUDES], [IF-FAILS])
+# ----------------------------------------------------------------
+AC_DEFUN([_AC_CACHE_CHECK_FLOAT],
+[AC_CACHE_CHECK([$1], [$2],
+   [AC_COMPUTE_FLOAT([$2], [$3], [$4], [$5])])
+])# _AC_CACHE_CHECK_FLOAT
+ 
diff --git a/etc/config/macros/ac_enable_debug.m4 b/etc/config/macros/ac_enable_debug.m4
index c4490fc..3e4bf16 100644
--- a/etc/config/macros/ac_enable_debug.m4
+++ b/etc/config/macros/ac_enable_debug.m4
@@ -15,7 +15,7 @@
 # implied.   See  the License  for  the  specific language  governing
 # permissions and limitations under the License.
 #
-# Copyright 1999-2007 Rogue Wave Software, Inc.
+# Copyright 1999-2008 Rogue Wave Software, Inc.
 #
 
 # AC_ENABLE_DEBUG([DEFAULT])
diff --git a/etc/config/macros/ac_enable_threads.m4 b/etc/config/macros/ac_enable_threads.m4
index edddb46..9f84f90 100644
--- a/etc/config/macros/ac_enable_threads.m4
+++ b/etc/config/macros/ac_enable_threads.m4
@@ -15,7 +15,7 @@
 # implied.   See  the License  for  the  specific language  governing
 # permissions and limitations under the License.
 #
-# Copyright 1999-2007 Rogue Wave Software, Inc.
+# Copyright 1999-2008 Rogue Wave Software, Inc.
 #
 
 # AC_ENABLE_THREADS([DEFAULT])
@@ -32,7 +32,7 @@
 # omitted, it defaults to `native'.
 #
 AC_DEFUN([AC_ENABLE_THREADS], [dnl
-  AC_MSG_CHECKING([whether to build thread targets])
+  AC_MSG_CHECKING([whether to build multithread targets])
 
   define([AC_ENABLE_THREADS_DEFAULT], ifelse($1, no, no, native))dnl
   AC_ARG_ENABLE([THREADS],
diff --git a/etc/config/macros/ac_header_nostd.m4 b/etc/config/macros/ac_header_nostd.m4
index ce7965c..91c3ef5 100644
--- a/etc/config/macros/ac_header_nostd.m4
+++ b/etc/config/macros/ac_header_nostd.m4
@@ -15,7 +15,7 @@
 # implied.   See  the License  for  the  specific language  governing
 # permissions and limitations under the License.
 #
-# Copyright 1999-2007 Rogue Wave Software, Inc.
+# Copyright 1999-2008 Rogue Wave Software, Inc.
 #
 
 # AC_HEADER_NO_STD
diff --git a/etc/config/macros/ac_path_header.m4 b/etc/config/macros/ac_path_header.m4
new file mode 100644
index 0000000..b84d50b
--- /dev/null
+++ b/etc/config/macros/ac_path_header.m4
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_PATH_HEADER(VARIABLE, HEADER-FILE, [INCLUDES],
+#                [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------
+# Define VARIABLE as the absolute pathname of HEADER in double quotes
+# (suitable for an #include directive).  If the pathname can not be
+# determined but the header is otherwise compilable, VARIABLE is defined
+# as HEADER in angle brackets.  Otherwise, VARIABLE is undefined.
+AC_DEFUN([AC_PATH_HEADER], [dnl
+  AS_VAR_PUSHDEF([ac_Header], [ac_cv_path_header_$2])
+
+  AC_CACHE_CHECK([pathname of $2 header], [ac_Header],
+      [AC_COMPILE_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT([$3])
+@%:@include <$2>])],
+                         [AS_VAR_SET([ac_Header],
+[`(eval "$ac_cpp conftest.$ac_ext") 2>&5 \
+| sed -n "s|[[^\"]]* \(\".*/$2\"\).*|\1|p" | head -n 1`])],
+                         [AS_VAR_SET([ac_Header], [no])])])
+
+  AS_IF([test ! AS_VAR_GET([ac_Header]) = no],
+        [AC_DEFINE_UNQUOTED([$1], [AS_VAR_GET([ac_Header])],
+[Define as the pathname of the <$2> header file.])])
+
+  AS_VAR_POPDEF([ac_Header])dnl
+])# AC_PATH_HEADER
+
diff --git a/etc/config/macros/ac_struct_lconv_def.m4 b/etc/config/macros/ac_struct_lconv_def.m4
new file mode 100644
index 0000000..38c5012
--- /dev/null
+++ b/etc/config/macros/ac_struct_lconv_def.m4
@@ -0,0 +1,166 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# _AC_LANG_LCONV_STRUCT
+# ---------------------
+# Expands into program source code that outputs the 'lconv' structure.
+AC_DEFUN([_AC_LANG_LCONV_STRUCT],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+m4_define([_AC_LANG_LCONV_STRUCT(C++)],
+[AC_LANG_PROGRAM([
+
+@%:@include <locale.h>   // for lconv
+@%:@include <stddef.h>   // for offsetof, size_t
+@%:@include <stdio.h>    // for fprintf
+@%:@include <string.h>   // for strlen
+
+#if defined HAVE_OFFSETOF
+#  define OFF(T, m)   offsetof (T, m)
+#else
+   // provide own equivalent when offsetof() macro doesn't work
+   // (e.g., when using the EDG eccp front end with an incompatible
+   // version of gcc)
+#  define OFF(T, m)   (((const char*)&((T*)0)->m) - ((const char*)(T*)0))
+#endif // !defined HAVE_OFFSETOF
+
+// prevent IBM xlC 5.0 errors caused by using /usr/include/string.h
+// which #defines these (and other) names to undeclared symbols
+#undef strlen],
+[
+  FILE* f = fopen ("conftest.val", "w");
+  if (!f) return 1;
+
+  fprintf (f, "{   /* sizeof (struct lconv) == %u */ \\\",
+           sizeof (struct lconv));
+  fputc ('\n', f);
+
+  struct {
+    size_t      offset;
+    size_t      size;
+    const char *type;
+    const char *name;
+    const char *comment;
+  } info[[]] = {
+
+#define ENTRY(type, member, comment)   \
+    {                                  \
+        OFF (lconv, member),           \
+        sizeof ((lconv*)0)->member,    \
+        type,                          \
+        # member,                      \
+        "/* " comment " */"            \
+    }
+
+    // C90 and POSIX.1 members
+    ENTRY ("char*", decimal_point, ""),
+    ENTRY ("char*", thousands_sep, ""),
+    ENTRY ("char*", grouping, ""),
+    ENTRY ("char*", int_curr_symbol, ""),
+    ENTRY ("char*", currency_symbol, ""),
+    ENTRY ("char*", mon_decimal_point, ""),
+    ENTRY ("char*", mon_thousands_sep, ""),
+    ENTRY ("char*", mon_grouping, ""),
+    ENTRY ("char*", positive_sign, ""),
+    ENTRY ("char*", negative_sign, ""),
+    ENTRY ("char", int_frac_digits, ""),
+    ENTRY ("char", frac_digits, ""),
+    ENTRY ("char", p_cs_precedes, ""),
+    ENTRY ("char", p_sep_by_space, ""),
+    ENTRY ("char", n_cs_precedes, ""),
+    ENTRY ("char", n_sep_by_space, ""),
+    ENTRY ("char", p_sign_posn, ""),
+    ENTRY ("char", n_sign_posn, "")
+
+#ifndef _RWSTD_NO_LCONV_INT_FMAT
+
+    // C99 and POSIX.2 members
+    , ENTRY ("char", int_p_cs_precedes, ""),
+    ENTRY ("char", int_n_cs_precedes, ""),
+    ENTRY ("char", int_p_sep_by_space, ""),
+    ENTRY ("char", int_n_sep_by_space, ""),
+    ENTRY ("char", int_p_sign_posn, ""),
+    ENTRY ("char", int_n_sign_posn, "")
+
+#endif   // _RWSTD_NO_LCONV_INT_FMAT
+
+  };
+
+  const size_t N = sizeof info / sizeof *info;
+
+  size_t curoff = 0;   // current offset
+  size_t size   = 0;   // cumulative size
+
+  for (size_t i = 0; i != N; ++i) {
+    for (size_t j = 0; j != N; ++j) {
+      if (curoff == info [[j]].offset) {
+
+        fprintf (f, "    %s %s;  \\\",
+                 info [[j]].type, info [[j]].name);
+        fputc ('\n', f);
+
+        // invalidate offset
+        info [[j]].offset = size_t (-1);
+        curoff += info [[j]].size;
+        size   += info [[j]].size;
+
+        break;
+      }
+    }
+  }
+
+  if (size != sizeof (lconv)) {
+    fprintf (f, "    char _C_fill [[%u]];   /* fill to size */ \\\",
+             sizeof (lconv) - size);
+    fputc ('\n', f);
+  }
+
+  fputc ('}', f);
+
+  return ferror (f) || fclose (f) != 0;
+])])
+
+
+# AC_STRUCT_LCONV_DEF(VARIABLE)
+# ----------------------
+# Define VARIABLE as the 'lconv' structure in VARIABLE.
+#
+AC_DEFUN([AC_STRUCT_LCONV_DEF],
+[
+  AC_PREREQ(2.62)dnl
+
+  AC_CACHE_CHECK([definition of struct lconv],
+                 AS_TR_SH([ac_cv_struct_lconv_def]),
+  [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+
+    _AC_RUN_IFELSE([_AC_LANG_LCONV_STRUCT],
+      [ac_cv_struct_lconv_def=`cat conftest.val`
+       rm conftest.val],
+      [AC_MSG_FAILURE([cannot determine definition of 'lconv' structure, 77])])
+
+    AC_LANG_RESTORE
+  ])dnl
+
+  AC_DEFINE_UNQUOTED(AS_TR_CPP($1), [$ac_cv_struct_lconv_def],
+                     [Definition of the `lconv' structure.])
+])# AC_STRUCT_LCONV_DEF
+
diff --git a/etc/config/macros/ac_struct_tm_def.m4 b/etc/config/macros/ac_struct_tm_def.m4
new file mode 100644
index 0000000..5fc508f
--- /dev/null
+++ b/etc/config/macros/ac_struct_tm_def.m4
@@ -0,0 +1,133 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# _AC_LANG_TM_STRUCT
+# -----------------
+# Expands into program source code that outputs the 'tm' structure.
+AC_DEFUN([_AC_LANG_TM_STRUCT],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+m4_define([_AC_LANG_TM_STRUCT(C++)],
+[AC_LANG_PROGRAM([
+@%:@include <stddef.h> // offsetof, size_t
+@%:@include <stdio.h> // file I/O
+@%:@include <string.h> // strlen
+@%:@include <time.h> // 'tm' structure
+
+#if defined HAVE_OFFSETOF
+#  define OFF(T, m)   offsetof (T, m)
+#else
+   // provide own equivalent when offsetof() macro doesn't work
+   // (e.g., when using the EDG eccp front end with an incompatible
+   // version of gcc)
+#  define OFF(T, m)   (((const char*)&((T*)0)->m) - ((const char*)(T*)0))
+#endif // !defined HAVE_OFFSETOF
+
+// prevent IBM xlC 5.0 errors caused by using /usr/include/string.h
+// which #defines these (and other) names to undeclared symbols
+#undef strlen],
+[
+  FILE* f = fopen ("conftest.val", "w");
+  if (!f) return 1;
+
+  fprintf (f, "{   /* sizeof (struct tm) == %u */ \\\",
+           sizeof (struct tm));
+  fputc ('\n', f);
+
+  struct {
+    size_t      offset;
+    const char *name;
+    const char *comment;
+  } info[[]] = {
+
+#define ENTRY(member, comment) \
+        { OFF (struct tm, member), # member ";", "   /* " comment " */" }
+
+    ENTRY (tm_sec,   "seconds after the minute [[O..61]] "),
+    ENTRY (tm_min,   "minutes after the hour   [[0..59]] "),
+    ENTRY (tm_hour,  "hours since midnight     [[0..23]] "),
+    ENTRY (tm_mday,  "day of the month         [[1..31]] "),
+    ENTRY (tm_mon,   "months since January     [[0..11]] "),
+    ENTRY (tm_year,  "years since 1900                 "),
+    ENTRY (tm_wday,  "days since Sunday        [[0..6]]  "),
+    ENTRY (tm_yday,  "days since January 1     [[0..365]]"),
+    ENTRY (tm_isdst, "Daylight Saving Time             "),
+  };
+
+  const size_t N = sizeof info / sizeof *info;
+  size_t curoff = 0;   // current offset
+
+  // assume contiguous standard members
+  // optionally followed by non-standard ones
+  for (size_t i = 0; i != N; ++i) {
+    for (size_t j = 0; j != N; ++j) {
+      if (curoff == info [[j]].offset) {
+        fprintf (f, "    int %-10s        %s \\\",
+                 info [[j]].name, info [[j]].comment);
+        fputc ('\n', f);
+
+        info [[j]].offset = size_t (-1);
+        curoff += sizeof (int);
+        break;
+      }
+    }
+
+    if (!curoff) {
+      curoff = sizeof (struct tm) - N * sizeof (int);
+    }
+  }
+
+  if (N * sizeof (int) != sizeof (struct tm)) {
+    fprintf (f, "    char _C_fill [[%u]];   /* fill to size */ \\\",
+             sizeof (struct tm) - N * sizeof (int));
+    fputc ('\n', f);
+  }
+
+  fputc ('}', f);
+
+  return ferror (f) || fclose (f) != 0;
+])])
+
+
+# AC_STRUCT_TM_DEF(VARIABLE)
+# ----------------------
+# Define VARIABLE as the 'tm' structure from <time.h> in VARIABLE.
+#
+AC_DEFUN([AC_STRUCT_TM_DEF],
+[
+  AC_PREREQ(2.62)dnl
+
+  AC_CACHE_CHECK([definition of struct tm],
+                 AS_TR_SH([ac_cv_struct_tm_def]),
+  [AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+
+  _AC_RUN_IFELSE([_AC_LANG_TM_STRUCT],
+      [ac_cv_struct_tm_def=`cat conftest.val`
+       rm conftest.val],
+      [AC_MSG_FAILURE([cannot determine definition of 'tm' structure, 77])])
+
+  AC_LANG_RESTORE
+  ])dnl
+
+  AC_DEFINE_UNQUOTED(AS_TR_CPP($1), [$ac_cv_struct_tm_def],
+                     [Definition of the `tm' structure.])
+])# AC_STRUCT_TM_DEF
+
diff --git a/etc/config/macros/ac_type_limits.m4 b/etc/config/macros/ac_type_limits.m4
new file mode 100644
index 0000000..aeee3d1
--- /dev/null
+++ b/etc/config/macros/ac_type_limits.m4
@@ -0,0 +1,145 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# AC_LANG_LIMITS_SAVE(min/max, TYPE, [INCLUDES = DEFAULT-INCLUDES])
+# -----------------------------------------------------------------
+# Expands to source code for a program that calculates the minimum
+# or maximum value, dependending on the first argument, of the
+# specified TYPE expression.
+m4_define([AC_LANG_LIMITS_SAVE],
+[AC_LANG_PROGRAM([$3
+// volatile to foil aggressive optimizers
+volatile int zero            = 0;
+volatile int one             = zero + 1;
+volatile int two             = one + 1;
+volatile int zero_complement = ~zero;
+
+template <class T>
+T compute_max (T *pval)
+{
+    T min = T (-one);
+    T max = T (one);
+
+    int is_signed = T (min - one) < T (zero);
+    if (!is_signed)
+        max = min;
+
+    // compute the maximum representable value
+    for (; T (max * two) > max; max *= two);
+    for (*pval = max / (two + two); *pval; ) {
+        if (T (max + *pval) < max) {
+            if (*pval > T (two))
+                *pval /= two;
+            else if (max < T (max + one))
+                *pval = one;
+            else
+                break;
+        }
+        else
+            max += *pval;
+    }
+
+    return max;
+}
+
+template <class T>
+T compute_min (T *pval)
+{
+    T min = T (-one);
+    T max = compute_max(pval);
+
+    // compute the minimum representable value
+    for (min = -max; T (min * two) < min; min *= two);
+
+    // prevents overzealous gcc optimizer from invoking
+    // undefined behavior on signed integer over/underflow
+    for (T tmp; ; --min) {
+        tmp = T (min - one);
+        if (tmp >= min)
+            break;
+    }
+
+    return min;
+}
+
+@%:@include <stdio.h>
+@%:@include <stdlib.h>
+], [
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  $2 m;
+  m = compute_$1 (&m);
+  fprintf (f, "%d\n", m);
+  return ferror (f) || fclose (f) != 0;
+])])
+
+# AC_TYPE_MIN(TYPE, VARIABLE, [INCLUDES = DEFAULT-INCLUDES])
+# -----------------------------------------------------------
+# Defines VARIABLE as the minimum value of scalar TYPE expression,
+# using INCLUDES if given or standard headers if omitted.
+AC_DEFUN([AC_TYPE_MIN],
+[
+  AS_VAR_PUSHDEF([ac_Var], [ac_cv_limit_$1_min])
+  AC_CACHE_CHECK([minimum value of $1], [ac_Var], [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+
+    AC_RUN_IFELSE([AC_LANG_LIMITS_SAVE([min], [$1],
+                                       [AC_INCLUDES_DEFAULT([$3])])],
+                  [AS_VAR_SET([ac_Var], [`cat conftest.val`])],
+                  [AC_MSG_FAILURE([cannot determine min. value of ($1), 77])])
+    rm -f conftest.val[]dnl
+
+    AC_LANG_RESTORE
+  ])dnl
+
+  AC_DEFINE_UNQUOTED(AS_TR_CPP([$2]), AS_VAR_GET([ac_Var]),
+                     [Minimum value of type expression `$1'.])
+
+  AS_VAR_POPDEF([ac_Var])dnl
+])# AC_TYPE_MIN
+
+# AC_TYPE_MAX(TYPE, VARIABLE, [INCLUDES = DEFAULT-INCLUDES])
+# -----------------------------------------------------------
+# Defines VARIABLE as the maximum value of scalar TYPE expression,
+# using INCLUDES if given or standard headers if omitted.
+AC_DEFUN([AC_TYPE_MAX],
+[
+  AS_VAR_PUSHDEF([ac_Var], [ac_cv_limit_$1_max])
+  AC_CACHE_CHECK([maximum value of $1], [ac_Var], [
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+
+    AC_RUN_IFELSE([AC_LANG_LIMITS_SAVE([max], [$1],
+                                       [AC_INCLUDES_DEFAULT([$3])])],
+                  [AS_VAR_SET([ac_Var], [`cat conftest.val`])],
+                  [AC_MSG_FAILURE([cannot determine max. value of ($1), 77])])
+    rm -f conftest.val[]dnl
+
+    AC_LANG_RESTORE
+  ])dnl
+
+  AC_DEFINE_UNQUOTED(AS_TR_CPP([$2]), AS_VAR_GET([ac_Var]),
+                     [Maximum value of type expression `$1'.])
+
+  AS_VAR_POPDEF([ac_Var])dnl
+])# AC_TYPE_MAX
+
diff --git a/etc/config/macros/rw_check_funcs.m4 b/etc/config/macros/rw_check_funcs.m4
new file mode 100644
index 0000000..31afdf7
--- /dev/null
+++ b/etc/config/macros/rw_check_funcs.m4
@@ -0,0 +1,37 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# RW_CHECK_FUNCS(FUNC..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND)
+# ----------------------------------------------------------------
+# Just like AC_CHECK_FUNCS except this macro defines _RWSTD_NO_{FUNC}
+# if not found instead of defining HAVE_{FUNC} if found.
+AC_DEFUN([RW_CHECK_FUNCS],
+[
+  m4_foreach_w([AC_Func], [$1],
+      [AH_TEMPLATE(AS_TR_CPP([_RWSTD_NO_]m4_defn([AC_Func])),
+[Define to 1 if you do not have the `]m4_defn([AC_Func])[' function.])])dnl
+
+  for ac_func in $1
+  do
+    AC_CHECK_FUNC($ac_func, [$2],
+                 [AC_DEFINE_UNQUOTED(AS_TR_CPP([_RWSTD_NO_$ac_func])) $3])dnl
+  done
+])# RW_CHECK_FUNCS
+
diff --git a/etc/config/macros/rw_stdc_float.m4 b/etc/config/macros/rw_stdc_float.m4
new file mode 100644
index 0000000..32a55d4
--- /dev/null
+++ b/etc/config/macros/rw_stdc_float.m4
@@ -0,0 +1,59 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_FLOAT
+# -------------
+# Performs all standard C library config checks for <float.h> header.
+AC_DEFUN([RW_STDC_FLOAT],
+[
+  AC_CHECK_HEADER([float.h],
+                  [AC_PATH_HEADER([_RWSTD_ANSI_C_FLOAT_H], [float.h])
+
+      AC_FOREACH([rw_Value], [FLT_ROUNDS FLT_RADIX
+DBL_DIG DBL_MANT_DIG DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MIN_EXP
+FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MIN_EXP
+LDBL_DIG LDBL_MANT_DIG LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN_10_EXP LDBL_MIN_EXP],
+        [_AC_CACHE_CHECK_INT([value of rw_Value],
+                            [AS_TR_SH([rw_cv_float_]rw_Value)],
+                            [(long int)(]rw_Value[)],
+                            [@%:@include <float.h>])
+         if test $AS_TR_SH([rw_cv_float_]rw_Value) -gt 0 ; then
+           AC_DEFINE_UNQUOTED([_RWSTD_]rw_Value,
+                              $AS_TR_SH([rw_cv_float_]rw_Value),
+[Value of ]rw_Value[ symbol defined in <float.h> header.])
+         fi
+        ])
+
+      AC_FOREACH([rw_Value], [DBL_MAX FLT_MAX LDBL_MAX DBL_EPSILON
+                  DBL_MIN FLT_EPSILON FLT_MIN LDBL_EPSILON LDBL_MIN],
+        [_AC_CACHE_CHECK_FLOAT([value of rw_Value],
+                               [AS_TR_SH([rw_cv_float_]rw_Value)],
+                               [(long double)(]rw_Value[)],
+                               [@%:@include <float.h>])
+         if test "$AS_TR_SH([rw_cv_float_]rw_Value)" ; then
+           AC_DEFINE_UNQUOTED([_RWSTD_]rw_Value,
+                              $AS_TR_SH([rw_cv_float_]rw_Value),
+[Value of ]rw_Value[ symbol defined in <float.h> header.])
+         fi
+        ])],
+                  [AC_DEFINE([_RWSTD_NO_FLOAT_H], [1],
+[Define to 1 if you don't have the <float.h> header file.])])
+])# RW_STDC_FLOAT
+
diff --git a/etc/config/macros/rw_stdc_locale.m4 b/etc/config/macros/rw_stdc_locale.m4
new file mode 100644
index 0000000..1f16942
--- /dev/null
+++ b/etc/config/macros/rw_stdc_locale.m4
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_LOCALE
+# -------------
+# Performs all standard C library config checks for <locale.h> header.
+AC_DEFUN([RW_STDC_LOCALE],
+[
+  AC_CHECK_HEADER([locale.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_LOCALE_H], [locale.h])
+
+    RW_CHECK_FUNCS([setlocale])
+
+    # TODO: Define _RWSTD_NO_LCONV_INT_FMAT
+    # TODO: Define _RWSTD_NO_LCONV
+
+    AC_STRUCT_LCONV_DEF([_RWSTD_LCONV])
+  ], [])
+])# RW_STDC_LOCALE
+
diff --git a/etc/config/macros/rw_stdc_math.m4 b/etc/config/macros/rw_stdc_math.m4
new file mode 100644
index 0000000..9a10af3
--- /dev/null
+++ b/etc/config/macros/rw_stdc_math.m4
@@ -0,0 +1,41 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_MATH
+# ------------
+# Performs all standard C library config checks for <math.h> header.
+AC_DEFUN([RW_STDC_MATH],
+[
+  AC_CHECK_HEADER([math.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_MATH_H], [math.h])
+
+    RW_CHECK_FUNCS([acos acosf acosl asin asinf asinl atan atan2 \
+atan2f atan2l atanf atanl ceil ceilf ceill cos cosf cosh coshf coshl \
+cosl exp expf expl fabs fabsf fabsl floor floorf floorl fmod fmodf \
+fmodl frexp frexpf frexpl ldexp ldexpf ldexpl log log10 log10f log10l \
+logf logl modf modff modfl pow powf powl sin sinf sinh sinhf sinhl \
+sinl sqrt sqrtf sqrtl tan tanf tanh tanhf tanhl tanl])
+  ], [
+    AC_DEFINE([_RWSTD_NO_MATH_H], [1],
+[Define to 1 if the <math.h> header file is not present.])
+  ])
+])# RW_STDC_MATH
+
diff --git a/etc/config/macros/rw_stdc_signal.m4 b/etc/config/macros/rw_stdc_signal.m4
new file mode 100644
index 0000000..58849db
--- /dev/null
+++ b/etc/config/macros/rw_stdc_signal.m4
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_SIGNAL
+# --------------
+# Performs all standard C library config checks for <signal.h> header.
+AC_DEFUN([RW_STDC_SIGNAL],
+[
+  AC_CHECK_HEADER([signal.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_SIGNAL_H], [signal.h])
+
+    AC_FOREACH([rw_Value],
+        [SIG_DFL SIG_ERR SIG_IGN SIGABRT SIGFPE SIGILL SIGINT \
+         SIGSEGV SIGTERM],
+        [_AC_CACHE_CHECK_INT([value of rw_Value],
+                             [AS_TR_SH([rw_cv_signal_]rw_Value)],
+                             [(long int)(]rw_Value[)],
+                             [@%:@include <signal.h>])
+         if test $AS_TR_SH([rw_cv_signal_]rw_Value) -gt 0 ; then
+           AC_DEFINE_UNQUOTED([_RWSTD_]rw_Value,
+                              $AS_TR_SH([rw_cv_signal_]rw_Value),
+[Value of ]rw_Value[ symbol defined in <signal.h> header.])
+         fi
+        ])
+
+    AC_CHECK_TYPE([sig_atomic_t],
+                  [AC_TYPE_MIN([sig_atomic_t],
+                               [_RWSTD_SIG_ATOMIC_MIN],
+                               [@%:@include <signal.h>])
+                   AC_TYPE_MAX([sig_atomic_t],
+                               [_RWSTD_SIG_ATOMIC_MAX],
+                               [@%:@include <signal.h>])],
+                  [AC_DEFINE([_RWSTD_NO_SIG_ATOMIC_T], [1],
+[Define if <signal.h> header does not define `sig_atomic_t' type.])],
+                  [@%:@include <signal.h>])
+  ], [])
+])# RW_STDC_SIGNAL
+
diff --git a/etc/config/macros/rw_stdc_stdarg.m4 b/etc/config/macros/rw_stdc_stdarg.m4
new file mode 100644
index 0000000..1a73606
--- /dev/null
+++ b/etc/config/macros/rw_stdc_stdarg.m4
@@ -0,0 +1,39 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_STDARG
+# --------------
+# Performs all standard C library config checks for <stdarg.h> header.
+AC_DEFUN([RW_STDC_STDARG],
+[
+  AC_CHECK_HEADER([stdarg.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_STDARG_H], [stdarg.h])
+
+    AC_CHECK_TYPE([va_list], [],
+                  [AC_DEFINE([_RWSTD_NO_VA_LIST], [1],
+[Define if <stdarg.h> header does not define `va_list' type.])],
+                  [@%:@include <stdarg.h>])
+
+    # TODO: Define _RWSTD_NO_VA_COPY.
+    # TODO: Define _RWSTD_NO_VA_LIST_ARRAY.
+  ], [])
+])# RW_STDC_STDARG
+
diff --git a/etc/config/macros/rw_stdc_stddef.m4 b/etc/config/macros/rw_stdc_stddef.m4
new file mode 100644
index 0000000..6e2315b
--- /dev/null
+++ b/etc/config/macros/rw_stdc_stddef.m4
@@ -0,0 +1,56 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_STDDEF
+# --------------
+# Performs all standard C library config checks for <stddef.h> header.
+AC_DEFUN([RW_STDC_STDDEF],
+[
+  AC_CHECK_HEADER([stddef.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_STDDEF_H], [stddef.h])
+
+    AC_CHECK_TYPE([ptrdiff_t],
+                  [AC_CHECK_TYPEOF([ptrdiff_t], [_RWSTD_PTRDIFF_T])
+                   AC_TYPE_MIN([ptrdiff_t], [_RWSTD_PTRDIFF_MIN])
+                   AC_TYPE_MAX([ptrdiff_t], [_RWSTD_PTRDIFF_MAX])])
+
+    AC_CHECK_TYPE([size_t],
+                  [AC_CHECK_TYPEOF([size_t], [_RWSTD_SIZE_T])
+                   AC_TYPE_MIN([size_t], [_RWSTD_SIZE_MIN])
+                   AC_TYPE_MAX([size_t], [_RWSTD_SIZE_MAX])],
+                  [AC_DEFINE([_RWSTD_NO_SIZE_T], [1],
+[Define to 1 if standard headers do not define `size_t' type.])])
+
+    AC_CHECK_TYPE([wchar_t],
+                  [RW_CHECK_SIZEOF([wchar_t])
+                   AC_TYPE_MIN([wchar_t], [_RWSTD_WCHAR_MIN])
+                   AC_TYPE_MAX([wchar_t], [_RWSTD_WCHAR_MAX])],
+                  [AC_DEFINE([_RWSTD_NO_WCHAR_T], [1],
+[Define to 1 if standard headers do not define `wchar_t' type.])])
+
+    AC_C89_OFFSETOF([], [AC_DEFINE([_RWSTD_NO_OFFSETOF], [1],
+[Define if 1 if standard headers do not define `offsetof()' macro.])])
+  ], [
+    AC_DEFINE([_RWSTD_NO_STDDEF_H], [1],
+[Define to 1 if you don't have the <stddef.h> header file.])
+  ])
+])# RW_STDC_STDDEF
+
diff --git a/etc/config/macros/rw_stdc_stdint.m4 b/etc/config/macros/rw_stdc_stdint.m4
new file mode 100644
index 0000000..11ebb92
--- /dev/null
+++ b/etc/config/macros/rw_stdc_stdint.m4
@@ -0,0 +1,105 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_TYPE_INT(BITS, MACRO)
+# ------------------------
+# Just like the internal Autoconf _AC_TYPE_INT macro except that this
+# version defines MACRO instead of `int{BITS}_t'.
+AC_DEFUN([RW_TYPE_INT],
+[
+  AC_CACHE_CHECK([for int$1_t], [ac_cv_c_int$1_t],
+    [ac_cv_c_int$1_t=no
+     for ac_type in 'int$1_t' 'int' 'long int' \
+         'long long int' 'short int' 'signed char'; do
+       AC_COMPILE_IFELSE(
+         [AC_LANG_BOOL_COMPILE_TRY(
+            [AC_INCLUDES_DEFAULT],
+            [[0 < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1)]])],
+         [AC_COMPILE_IFELSE(
+            [AC_LANG_BOOL_COMPILE_TRY(
+               [AC_INCLUDES_DEFAULT],
+               [[($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 1)
+                 < ($ac_type) (((($ac_type) 1 << ($1 - 2)) - 1) * 2 + 2)]])],
+            [],
+            [AS_CASE([$ac_type], [int$1_t],
+               [ac_cv_c_int$1_t=yes],
+               [ac_cv_c_int$1_t=$ac_type])])])
+       test "$ac_cv_c_int$1_t" != no && break
+     done])
+  case $ac_cv_c_int$1_t in #(
+  no|yes) ;; #(
+  *)
+    AC_DEFINE_UNQUOTED([$2], [$ac_cv_c_int$1_t],
+      [Define to the type of a signed integer type of width exactly $1 bits
+       if such a type exists and the standard includes do not define it.]);;
+  esac
+])# RW_TYPE_INT
+
+# RW_TYPE_UINT(BITS, MACRO)
+# -------------------------
+# Just like the internal Autoconf _AC_TYPE_UNSIGNED_INT macro except
+# that this version defines MACRO instead of `intBITS_t'.
+AC_DEFUN([RW_TYPE_UINT],
+[
+  AC_CACHE_CHECK([for uint$1_t], [ac_cv_c_uint$1_t],
+    [ac_cv_c_uint$1_t=no
+     for ac_type in 'uint$1_t' 'unsigned int' 'unsigned long int' \
+         'unsigned long long int' 'unsigned short int' 'unsigned char'; do
+       AC_COMPILE_IFELSE(
+         [AC_LANG_BOOL_COMPILE_TRY(
+            [AC_INCLUDES_DEFAULT],
+            [[($ac_type) -1 >> ($1 - 1) == 1]])],
+         [AS_CASE([$ac_type], [uint$1_t],
+            [ac_cv_c_uint$1_t=yes],
+            [ac_cv_c_uint$1_t=$ac_type])])
+       test "$ac_cv_c_uint$1_t" != no && break
+     done])
+  case $ac_cv_c_uint$1_t in #(
+  no|yes) ;; #(
+  *)
+    AC_DEFINE_UNQUOTED([$2], [$ac_cv_c_uint$1_t],
+      [Define to the type of an unsigned integer type of width exactly $1 bits
+       if such a type exists and the standard includes do not define it.]);;
+  esac
+])# RW_TYPE_UINT
+
+# RW_STDC_STDINT
+# --------------
+# Performs all standard C library config checks for <stdint.h> header.
+AC_DEFUN([RW_STDC_STDINT],
+[
+  AC_CHECK_HEADER([stdint.h], [
+      m4_foreach_w([rw_bits], [8 16 32 64], [
+        # These two are not required by the standard so the best fit
+        # is actually calculated.
+        RW_TYPE_INT(rw_bits, [_RWSTD_INT]rw_bits[_T])
+        RW_TYPE_UINT(rw_bits, [_RWSTD_UINT]rw_bits[_T])
+
+        # These two are required by the standard.  The actual types
+        # are just deduced from the respective type definition.
+        AC_CHECK_TYPEOF([int_least]rw_bits[_t],
+                        [_RWSTD_INT_LEAST]rw_bits[_T],
+                        [@%:@include <stdint.h>])
+        AC_CHECK_TYPEOF([uint_least]rw_bits[_t],
+                        [_RWSTD_UINT_LEAST]rw_bits[_T],
+                        [@%:@include <stdint.h>])
+      ])], [])
+])# RW_STDC_STDINT
+
diff --git a/etc/config/macros/rw_stdc_stdio.m4 b/etc/config/macros/rw_stdc_stdio.m4
new file mode 100644
index 0000000..e65773c
--- /dev/null
+++ b/etc/config/macros/rw_stdc_stdio.m4
@@ -0,0 +1,55 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_STDIO
+# -------------
+# Performs all standard C library config checks for <stdio.h> header.
+AC_DEFUN([RW_STDC_STDIO],
+[
+  AC_CHECK_HEADER([stdio.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_STDIO_H], [stdio.h])
+
+    AC_FOREACH([rw_Value],
+        [EOF L_tmpnam _IOFBF _IOLBF _IONBF BUFSIZ FOPEN_MAX \
+         FILENAME_MAX TMP_MAX],
+        [_AC_CACHE_CHECK_INT([value of rw_Value],
+                             [AS_TR_SH([rw_cv_stdio_]rw_Value)],
+                             [(long int)(]rw_Value[)],
+                             [@%:@include <stdio.h>])
+
+         if test $AS_TR_SH([rw_cv_stdio_]rw_Value) -gt 0 ; then
+           AC_DEFINE_UNQUOTED([_RWSTD_]rw_Value,
+                              $AS_TR_SH([rw_cv_stdio_]rw_Value),
+[Value of ]rw_Value[ symbol defined in <stdio.h> header.])
+         fi
+        ])
+
+    RW_CHECK_FUNCS([clearerr fclose feof ferror fflush fgetc \
+fgetpos fgets fopen fprintf fputc fputs fread freopen fscanf fseek \
+fsetpos ftell fwrite getc getchar gets perror printf putc putchar puts \
+remove rename rewind scanf setbuf setvbuf snprintf sprintf sscanf \
+tmpfile tmpnam ungetc vfprintf vprintf vsnprintf vsprintf])
+  ], [
+    AC_DEFINE([_RWSTD_NO_STDIO_H], [1],
+[Define to 1 if you don't have the <stdio.h> header file.])
+  ])
+])# RW_STDC_STDIO
+
diff --git a/etc/config/macros/rw_stdc_stdlib.m4 b/etc/config/macros/rw_stdc_stdlib.m4
new file mode 100644
index 0000000..b1d3b0e
--- /dev/null
+++ b/etc/config/macros/rw_stdc_stdlib.m4
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_STDLIB
+# -------------
+# Performs all standard C library config checks for <stdlib.h> header.
+AC_DEFUN([RW_STDC_STDLIB],
+[
+  AC_CHECK_HEADER([stdlib.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_STDLIB_H], [stdlib.h])
+
+    _AC_CACHE_CHECK_INT([value of RAND_MAX],
+                        [rw_cv_stdlib_rand_max],
+                        [(long int)(RAND_MAX)],
+                        [@%:@include <stdlib.h>])
+
+    if test $rw_cv_stdlib_rand_max -gt 0 ; then
+      AC_DEFINE_UNQUOTED([_RWSTD_RAND_MAX],
+                         $rw_cv_stdlib_rand_max,
+[Value of RAND_MAX symbol defined in <stdlib.h> header.])
+    fi
+
+    RW_CHECK_FUNCS([abort abs atexit atof atoi atol atoll bsearch \
+calloc div exit free getenv labs ldiv llabs lldiv malloc mblen mbstowcs \
+mbtowc qsort rand realloc srand strtod strtof strtol strtold strtoll \
+strtoul strtoull system wcstombs wctomb])
+  ], [
+    AC_DEFINE([_RWSTD_NO_STDLIB_H], [1],
+[Define to 1 if you don't have the <stdlib.h> header file.])
+  ])
+])# RW_STDC_STDLIB
+
diff --git a/etc/config/macros/rw_stdc_string.m4 b/etc/config/macros/rw_stdc_string.m4
new file mode 100644
index 0000000..6b68630
--- /dev/null
+++ b/etc/config/macros/rw_stdc_string.m4
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_STRING
+# -------------
+# Performs all standard C library config checks for <string.h> header.
+AC_DEFUN([RW_STDC_STRING],
+[
+  AC_CHECK_HEADER([string.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_STRING_H], [string.h])
+
+    RW_CHECK_FUNCS([memchr memcmp memcpy memmove memset strcat \
+strchr strcmp strcoll strcpy strcspn strerror strlen strncat strncmp \
+strncpy strpbrk strrchr strspn strstr strtok strxfrm])
+  ], [
+    AC_DEFINE([_RWSTD_NO_STRING_H], [1],
+[Define to 1 if you don't have the <string.h> header file.])
+  ])
+])# RW_STDC_STRING
+
diff --git a/etc/config/macros/rw_stdc_time.m4 b/etc/config/macros/rw_stdc_time.m4
new file mode 100644
index 0000000..c6e269a
--- /dev/null
+++ b/etc/config/macros/rw_stdc_time.m4
@@ -0,0 +1,48 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+ 
+# RW_STDC_TIME
+# -------------
+# Performs all standard C library config checks for <time.h> header.
+AC_DEFUN([RW_STDC_TIME],
+[
+  AC_CHECK_HEADER([time.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_TIME_H], [time.h])
+
+    AC_CHECK_TYPEOF([clock_t], [_RWSTD_CLOCK_T],
+                    [@%:@include <time.h>])
+    AC_CHECK_TYPEOF([time_t], [_RWSTD_TIME_T],
+                    [@%:@include <time.h>])
+
+    _AC_CACHE_CHECK_INT([value of CLOCKS_PER_SEC],
+                        [AS_TR_SH([rw_cv_time_clocks_per_sec])],
+                        [(long int)(CLOCKS_PER_SEC)],
+                        [@%:@include <time.h>])
+    if test $AS_TR_SH([rw_cv_time_clocks_per_sec]) -gt 0 ; then
+      AC_DEFINE_UNQUOTED([_RWSTD_CLOCKS_PER_SEC],
+                         $AS_TR_SH([rw_cv_time_clocks_per_sec]),
+[Value of CLOCKS_PER_SEC symbol defined in <time.h> header.])
+    fi
+
+    AC_STRUCT_TM_DEF([_RWSTD_STRUCT_TM])
+  ], [])
+])# RW_STDC_TIME
+
diff --git a/etc/config/macros/rw_stdc_types.m4 b/etc/config/macros/rw_stdc_types.m4
new file mode 100644
index 0000000..9c59c55
--- /dev/null
+++ b/etc/config/macros/rw_stdc_types.m4
@@ -0,0 +1,120 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# TODO: Write _RW_TR_CPP_PREPARE version of _AS_TR_CPP_PREPARE macro for
+# pattern substitution in shell script and replace _AS_TR_CPP_PREPARE
+# and as_tr_cpp in RW_TR_CPP macro below.
+
+# RW_TR_CPP(EXPRESSION)
+# ---------------------
+# Much like AC_TR_CPP except that certain intrinsic types are converted
+# into abbreviated form used in macro defines (e.g. `short' is converted
+# to `SHRT', `long double' becomes `LDBL').
+# TODO: An m4 guru could probably simplify the pattern substitution.
+m4_defun([RW_TR_CPP],
+[AS_REQUIRE([_AS_TR_CPP_PREPARE])dnl
+AS_LITERAL_IF([$1],
+              [m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(
+               m4_bpatsubst(m4_translit([[$1]],
+                                        [*abcdefghijklmnopqrstuvwxyz],
+                                        [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+                            [UNSIGNED CHAR], [UCHAR]),
+                            [SIGNED CHAR], [SCHAR]),
+                            [UNSIGNED SHORT], [USHRT]),
+                            [SHORT], [SHRT]),
+                            [UNSIGNED INT], [UINT]),
+                            [UNSIGNED LONG LONG], [ULLONG]),
+                            [UNSIGNED LONG], [ULONG]),
+                            [LONG LONG], [LLONG]),
+                            [FLOAT], [FLT]),
+                            [LONG DOUBLE], [LDBL]),
+                            [DOUBLE], [DBL]),
+                            [VOID(P)()], [FUNPTR]),
+                            [VOIDP], [PTR]),
+                            [WCHAR_T], [WCHAR]),
+                            [[^A-Z0-9_]], [_])],
+              [`echo "$1" | $as_tr_cpp`])])
+])# RW_TR_CPP
+
+# RW_CHECK_SIZEOF
+# ---------------
+# Just like AC_CHECK_SIZEOF except that this macro defines
+# _RWSTD_{TYPE}_SIZE instead of SIZEOF_{TYPE}.
+AC_DEFUN([RW_CHECK_SIZEOF],
+[AS_LITERAL_IF([$1], [],
+	       [AC_FATAL([$0: requires literal arguments])])dnl
+# The cast to long int works around a bug in the HP C Compiler
+# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
+# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
+# This bug is HP SR number 8606223364.
+_AC_CACHE_CHECK_INT([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])],
+  [(long int) (sizeof ($1))],
+  [AC_INCLUDES_DEFAULT([$3])],
+  [if test "$AS_TR_SH([ac_cv_type_$1])" = yes; then
+     AC_MSG_FAILURE([cannot compute sizeof ($1)], 77)
+   else
+     AS_TR_SH([ac_cv_sizeof_$1])=0
+   fi])
+
+AC_DEFINE_UNQUOTED(RW_TR_CPP(_rwstd_$1_size), $AS_TR_SH([ac_cv_sizeof_$1]),
+		   [The size of `$1', as computed by sizeof.])
+])# RW_CHECK_SIZEOF
+
+# RW_STDC_TYPES
+# -------------
+# Performs all config checks related to intrinisic types in standard C.
+AC_DEFUN([RW_STDC_TYPES],
+[
+  AC_CHECK_TYPE([long long], [], [AC_DEFINE([_RWSTD_NO_LONG_LONG], [1],
+  [Define if compiler does not support native `long long' type.])])
+  AC_CHECK_TYPE([long double], [], [AC_DEFINE([_RWSTD_NO_LONG_DOUBLE], [1],
+  [Define if compiler does not support native `long double' type.])])
+
+  RW_CHECK_SIZEOF([char])
+  RW_CHECK_SIZEOF([short])
+  RW_CHECK_SIZEOF([int])
+  RW_CHECK_SIZEOF([long])
+  if test $ac_cv_type_long_long = yes; then
+    RW_CHECK_SIZEOF([long long])
+    RW_CHECK_SIZEOF([unsigned long long])
+  fi
+
+  RW_CHECK_SIZEOF([float])
+  RW_CHECK_SIZEOF([double])
+  RW_CHECK_SIZEOF([long double])
+
+  RW_CHECK_SIZEOF([void*])
+  RW_CHECK_SIZEOF([void(*)()])
+  dnl See C++ Language section for size check of member function type.
+])# RW_STDC_TYPES
+
diff --git a/etc/config/macros/rw_stdc_wchar.m4 b/etc/config/macros/rw_stdc_wchar.m4
new file mode 100644
index 0000000..bb1ab66
--- /dev/null
+++ b/etc/config/macros/rw_stdc_wchar.m4
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# RW_STDC_WCHAR
+# -------------
+# Performs all standard C library config checks for <wchar.h> header.
+AC_DEFUN([RW_STDC_WCHAR],
+[
+  AC_CHECK_HEADER([wchar.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_WCHAR_H], [wchar.h])
+
+    AC_FOREACH([rw_Value], [WCHAR_MIN WCHAR_MAX WEOF],
+    [
+      _AC_CACHE_CHECK_INT([value of rw_Value],
+                          [AS_TR_SH([rw_cv_wchar_]rw_Value)],
+                          [(long int)(]rw_Value[)],
+                          [@%:@include <wchar.h>])
+      if test $AS_TR_SH([rw_cv_wchar_]rw_Value) -gt 0 ; then
+        AC_DEFINE_UNQUOTED([_RWSTD_]rw_Value,
+                           $AS_TR_SH([rw_cv_wchar_]rw_Value),
+[Value of ]rw_Value[ symbol defined in <wchar.h> header.])
+      fi
+    ])
+
+    AC_CHECK_TYPE([mbstate_t],
+                  [RW_CHECK_SIZEOF([mbstate_t], [],
+                                   [@%:@include <wchar.h>])],
+                  [AC_DEFINE([_RWSTD_NO_MBSTATE_T], [1],
+[Define if <wchar.h> header does not define `mbstate_t' type.])],
+                  [@%:@include <wchar.h>])
+
+    AC_CHECK_TYPE([wint_t],
+                  [AC_CHECK_TYPEOF([wint_t], [_RWSTD_WCINT_T],
+                                   [@%:@include <wchar.h>])
+                   AC_TYPE_MIN([wint_t], [_RWSTD_WINT_MIN],
+                               [@%:@include <wchar.h>])
+                   AC_TYPE_MAX([wint_t], [_RWSTD_WINT_MAX],
+                               [@%:@include <wchar.h>])],
+                  [AC_DEFINE([_RWSTD_NO_WINT_T], [1],
+[Define if 1 if <wchar.h> header does not define `wint_t' type.])],
+                  [@%:@include <wchar.h>])
+
+    RW_CHECK_FUNCS([btowc fgetwc fgetws fputwc fputws fwide fwprintf \
+fwscanf getwc getwchar mbrlen mbrtowc mbsinit mbsrtowcs putwc putwchar \
+swprintf swscanf ungetwc vfwprintf vfwscanf vswprintf vswscanf vwprintf \
+vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime \
+wcslen wcsncat wcsncmp wcsncpy wcspbrk wcsrchr wcsrtombs wcsspn wcsstr \
+wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcsxfrm \
+wctob wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf])
+  ], [
+    AC_DEFINE([_RWSTD_NO_WCHAR_H], [1],
+[Define to 1 if you don't have the <wchar.h> header file.])
+  ])
+])# RW_STDC_WCHAR
+
diff --git a/etc/config/macros/rw_stdc_wctype.m4 b/etc/config/macros/rw_stdc_wctype.m4
new file mode 100644
index 0000000..c5bd98a
--- /dev/null
+++ b/etc/config/macros/rw_stdc_wctype.m4
@@ -0,0 +1,52 @@
+#
+# Licensed to the Apache Software  Foundation (ASF) under one or more
+# contributor  license agreements.  See  the NOTICE  file distributed
+# with  this  work  for  additional information  regarding  copyright
+# ownership.   The ASF  licenses this  file to  you under  the Apache
+# License, Version  2.0 (the  License); you may  not use  this file
+# except in  compliance with the License.   You may obtain  a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the  License is distributed on an  "AS IS" BASIS,
+# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+# implied.   See  the License  for  the  specific language  governing
+# permissions and limitations under the License.
+#
+# Copyright 1999-2008 Rogue Wave Software, Inc.
+#
+
+# RW_STDC_WCTYPE
+# -------------
+# Performs all standard C library config checks for <wctype.h> header.
+AC_DEFUN([RW_STDC_WCTYPE],
+[
+  AC_CHECK_HEADER([wctype.h],
+  [
+    AC_PATH_HEADER([_RWSTD_ANSI_C_WCTYPE_H], [wctype.h])
+
+    AC_CHECK_TYPE([wctype_t],
+                  [AC_CHECK_TYPEOF([wctype_t], [_RWSTD_WCTYPE_T],
+                                   [@%:@include <wctype.h>])],
+                  [AC_DEFINE([_RWSTD_NO_WCTYPE_T], [1],
+[Define if 1 if <wctype.h> header does not define `wctype_t' type.])],
+                  [@%:@include <wctype.h>])
+
+    AC_CHECK_TYPE([wctrans_t],
+                  [AC_CHECK_TYPEOF([wctrans_t], [_RWSTD_WCTRANS_T],
+                                   [@%:@include <wctype.h>])],
+                  [AC_DEFINE([_RWSTD_NO_WCTRANS_T], [1],
+[Define if 1 if <wctype.h> header does not define `wctrans_t' type.])],
+                  [@%:@include <wctype.h>])
+
+    RW_CHECK_FUNCS([iswalnum iswalpha iswblank iswcntrl iswctype \
+iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper iswxdigit \
+towctrans towlower towupper wctrans wctype])
+  ], [
+    AC_DEFINE([_RWSTD_NO_WCTYPE_H], [1],
+[Define to 1 if you don't have the <wctype.h> header file.])
+  ])
+])# RW_STDC_WCTYPE
+
diff --git a/etc/config/macros/rw_sys_atomic_ops.m4 b/etc/config/macros/rw_sys_atomic_ops.m4
index 7c3e6df..e558956 100644
--- a/etc/config/macros/rw_sys_atomic_ops.m4
+++ b/etc/config/macros/rw_sys_atomic_ops.m4
@@ -15,7 +15,7 @@
 # implied.   See  the License  for  the  specific language  governing
 # permissions and limitations under the License.
 #
-# Copyright 1999-2007 Rogue Wave Software, Inc.
+# Copyright 1999-2008 Rogue Wave Software, Inc.
 #
 
 # RW_SYS_ATOMIC_OPS
@@ -43,7 +43,7 @@
   case $build_cpu in
     ia64) ;;
     sparc) ;;
-    x86|i686) ;;
+    x86|i386|i686) ;;
     x86_64) ;;
     *) AC_MSG_ERROR([unsupported build architecture $build_cpu])
        exit ;;
diff --git a/include/Makefile.am b/include/Makefile.am
index 10dccc1..27771b3 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -15,7 +15,7 @@
 # implied.   See  the License  for  the  specific language  governing
 # permissions and limitations under the License.
 #
-# Copyright 1999-2007 Rogue Wave Software, Inc.
+# Copyright 1999-2008 Rogue Wave Software, Inc.
 #
 
 # TODO: Remove config.old.h once all Autoconf macros are working.
@@ -24,7 +24,57 @@
 	algorithm \
 	algorithm.c \
 	algorithm.cc \
-	ansi \
+	ansi/_cassert.h \
+	ansi/_cctype.h \
+	ansi/_cerrno.h \
+	ansi/_cfloat.h \
+	ansi/_clocale.h \
+	ansi/_cmath.h \
+	ansi/_csetjmp.h \
+	ansi/_csignal.h \
+	ansi/_cstdarg.h \
+	ansi/_cstddef.h \
+	ansi/_cstdio.h \
+	ansi/_cstdlib.h \
+	ansi/_cstring.h \
+	ansi/_ctime.h \
+	ansi/_cwchar.h \
+	ansi/_cwctype.h \
+	ansi/assert.h \
+	ansi/cassert \
+	ansi/cctype \
+	ansi/cerrno \
+	ansi/cfloat \
+	ansi/ciso646 \
+	ansi/climits \
+	ansi/clocale \
+	ansi/cmath \
+	ansi/csetjmp \
+	ansi/csignal \
+	ansi/cstdarg \
+	ansi/cstddef \
+	ansi/cstdio \
+	ansi/cstdlib \
+	ansi/cstring \
+	ansi/ctime \
+	ansi/ctype.h \
+	ansi/cwchar \
+	ansi/cwctype \
+	ansi/errno.h \
+	ansi/float.h \
+	ansi/limits.h \
+	ansi/locale.h \
+	ansi/math.h \
+	ansi/setjmp.h \
+	ansi/signal.h \
+	ansi/stdarg.h \
+	ansi/stddef.h \
+	ansi/stdio.h \
+	ansi/stdlib.h \
+	ansi/string.h \
+	ansi/time.h \
+	ansi/wchar.h \
+	ansi/wctype.h \
 	bitset \
 	bitset.c \
 	bitset.cc \
@@ -57,7 +107,49 @@
 	list.c \
 	list.cc \
 	list_spec.h \
-	loc \
+	loc/_codecvt.c \
+	loc/_codecvt.cc \
+	loc/_codecvt.h \
+	loc/_collate.c \
+	loc/_collate.cc \
+	loc/_collate.h \
+	loc/_convenience.h \
+	loc/_ctype.c \
+	loc/_ctype.cc \
+	loc/_ctype.h \
+	loc/_facet.h \
+	loc/_locale.h \
+	loc/_localedef.h \
+	loc/_messages.c \
+	loc/_messages.cc \
+	loc/_messages.h \
+	loc/_money_get.c \
+	loc/_money_get.cc \
+	loc/_money_get.h \
+	loc/_money_put.c \
+	loc/_money_put.cc \
+	loc/_money_put.h \
+	loc/_moneypunct.c \
+	loc/_moneypunct.cc \
+	loc/_moneypunct.h \
+	loc/_num_get.c \
+	loc/_num_get.cc \
+	loc/_num_get.h \
+	loc/_num_put.c \
+	loc/_num_put.cc \
+	loc/_num_put.h \
+	loc/_numpunct.c \
+	loc/_numpunct.cc \
+	loc/_numpunct.h \
+	loc/_punct.c \
+	loc/_punct.cc \
+	loc/_punct.h \
+	loc/_time_get.c \
+	loc/_time_get.cc \
+	loc/_time_get.h \
+	loc/_time_put.c \
+	loc/_time_put.cc \
+	loc/_time_put.h \
 	locale \
 	map \
 	memory \
@@ -67,7 +159,59 @@
 	ostream.c \
 	ostream.cc \
 	queue \
-	rw \
+	rw/_algobase.c \
+	rw/_algobase.cc \
+	rw/_algobase.h \
+	rw/_allocator.h \
+	rw/_array.h \
+	rw/_autoptr.h \
+	rw/_basic_ios.c \
+	rw/_basic_ios.cc \
+	rw/_basic_ios.h \
+	rw/_bitmask.h \
+	rw/_config-acc.h \
+	rw/_config-deccxx.h \
+	rw/_config-eccp.h \
+	rw/_config-gcc.h \
+	rw/_config-icc.h \
+	rw/_config-mipspro.h \
+	rw/_config-msvc.h \
+	rw/_config-msvcrt.h \
+	rw/_config-sunpro.h \
+	rw/_config-xlc.h \
+	rw/_config.h \
+	rw/_defs.h \
+	rw/_error.h \
+	rw/_exception.h \
+	rw/_file.h \
+	rw/_funcbase.h \
+	rw/_heap.c \
+	rw/_heap.cc \
+	rw/_heap.h \
+	rw/_ioinsert.c \
+	rw/_ioinsert.cc \
+	rw/_ioinsert.h \
+	rw/_ioiter.h \
+	rw/_iosbase.h \
+	rw/_iosfailure.h \
+	rw/_iosfwd.h \
+	rw/_iterator.h \
+	rw/_iterbase.h \
+	rw/_math.h \
+	rw/_mbstate.h \
+	rw/_mutex.h \
+	rw/_new.h \
+	rw/_pair.h \
+	rw/_rawiter.h \
+	rw/_relops.h \
+	rw/_select.h \
+	rw/_specialized.h \
+	rw/_streamiter.h \
+	rw/_strref.h \
+	rw/_traits.h \
+	rw/_tree.c \
+	rw/_tree.cc \
+	rw/_tree.h \
 	set \
 	sstream \
 	sstream.c \
@@ -81,7 +225,10 @@
 	string.c \
 	string.cc \
 	strstream \
-	tr1 \
+	tr1/_smartptr.h \
+	tr1/array \
+	tr1/cstdint \
+	tr1/stdint.h \
 	typeinfo \
 	utility \
 	valarray \