[Pkg-mono-svn-commits] [SCM] mono branch, master, updated. debian/2.4.2.3+dfsg-3-11-g34193d3

Mirco Bauer meebey at meebey.net
Sat Dec 12 19:05:57 UTC 2009


The following commit has been merged in the master branch:
commit f61d205923b75b9159ca84e5aaa15053328f8519
Author: Mirco Bauer <meebey at meebey.net>
Date:   Sat Dec 12 19:51:58 2009 +0100

    Imported Upstream version 2.4.3+dfsg

diff --git a/ChangeLog b/ChangeLog
index eabfc63..7b0a01c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-11  Zoltan Varga  <vargaz at gmail.com>
+
+	* configure.in: Disable dtrace support if dtrace doesn't support the
+	-h option.
+
 2009-06-18  Marek Habersack  <mhabersack at novell.com>
 
 	* data/browscap.ini: applied Mono modifications to the upstream
@@ -5,11 +10,6 @@
 	Added ecmascriptversion, msdomversion and w3cdomversion to the IE
 	8.0 entry. Fixes bug #513965
 
-2009-06-15  Andreia Gaita  <avidigal at novell.com>
-
-	* data/config.in: add libcups dllmap entry
-	[Fixes #511414, backported from r136039]
-
 2009-05-27  Zoltan Varga  <vargaz at gmail.com>
 
 	* configure.in: Disable USE_MUNMAP on ppc to work around #504411.
diff --git a/Makefile.in b/Makefile.in
index b65e459..f6636d3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -40,7 +40,10 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	AUTHORS COPYING.LIB ChangeLog NEWS config.guess config.sub \
 	depcomp install-sh ltmain.sh missing mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -98,10 +101,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -111,14 +110,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -136,6 +134,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -144,6 +143,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -155,11 +155,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -188,8 +191,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -229,6 +231,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -252,6 +255,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
diff --git a/aclocal.m4 b/aclocal.m4
index 083dcc6..6e6dacb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -13,6648 +13,12 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_if(AC_AUTOCONF_VERSION, [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-
-# serial 52 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-	         [m4_ifdef([AC_PROVIDE_$1],
-		           [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-	[AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-	     [define([LT_AC_PROG_GCJ],
-		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-_LT_REQUIRED_DARWIN_CHECKS
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# --------------------------
-# Check for some things on darwin
-AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
-  case $host_os in
-    rhapsody* | darwin*)
-    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
-    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
-
-    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
-      [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-   # By default we will add the -single_module flag. You can override
-   # by either setting the environment variable LT_MULTI_MODULE
-   # non-empty at configure time, or by adding -multi_module to the
-   # link flags.
-   echo "int foo(void){return 1;}" > conftest.c
-   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-     -dynamiclib ${wl}-single_module conftest.c
-   if test -f libconftest.dylib; then
-     lt_cv_apple_cc_single_mod=yes
-     rm -rf libconftest.dylib*
-   fi
-   rm conftest.c
-      fi])
-    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
-      [lt_cv_ld_exported_symbols_list],
-      [lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-   [lt_cv_ld_exported_symbols_list=yes],
-   [lt_cv_ld_exported_symbols_list=no])
-   LDFLAGS="$save_LDFLAGS"
-    ])
-    case $host_os in
-    rhapsody* | darwin1.[[0123]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*)
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-   10.[[012]]*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-   10.*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
-    fi
-    if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil="~$DSYMUTIL \$lib || :"
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-])
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-	 [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-[$]*
-EOF
-  exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
-
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-	# maybe with a smaller string...
-	prev=:
-
-	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
-
-	if test "$prev" != 'sed 50q "[$]0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
-      fi
-    fi
-  fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
-  fi
-  rm -rf conftest*
-  ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_i386_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_x86_64_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-  ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
-else
-    ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
-else
-    ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
-
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	      lt_cv_sys_max_cmd_len=$new_result &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on massive
-      # amounts of additional arguments before passing them to the linker.
-      # It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-#  define LT_DLGLOBAL		RTLD_GLOBAL
-#else
-#  ifdef DL_GLOBAL
-#    define LT_DLGLOBAL		DL_GLOBAL
-#  else
-#    define LT_DLGLOBAL		0
-#  endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
-   find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-#  ifdef RTLD_LAZY
-#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
-#  else
-#    ifdef DL_LAZY
-#      define LT_DLLAZY_OR_NOW		DL_LAZY
-#    else
-#      ifdef RTLD_NOW
-#        define LT_DLLAZY_OR_NOW	RTLD_NOW
-#      else
-#        ifdef DL_NOW
-#          define LT_DLLAZY_OR_NOW	DL_NOW
-#        else
-#          define LT_DLLAZY_OR_NOW	0
-#        endif
-#      endif
-#    endif
-#  endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
-  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
-  int status = $lt_dlunknown;
-
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
-  else
-    puts (dlerror ());
-
-    exit (status);
-}]
-EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_dlunknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
-  fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
-
-  case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-   ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
-	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
-	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
-	      ])
-	    ])
-	  ])
-	])
-      ])
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-	  lt_cv_dlopen_self, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-    	  lt_cv_dlopen_self_static, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
-	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         old_striplib="$STRIP -S"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-m4_if($1,[],[
-if test "$GCC" = yes; then
-  case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
-  else
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-  fi
-  # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
-  lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
-  for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
-      test -d "$lt_sys_path" && \
-	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
-    fi
-  done
-  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
-  for (lt_i = NF; lt_i > 0; lt_i--) {
-    if ($lt_i != "" && $lt_i != ".") {
-      if ($lt_i == "..") {
-        lt_count++;
-      } else {
-        if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
-        } else {
-          lt_count--;
-        }
-      }
-    }
-  }
-  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
-  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
-  sys_lib_search_path_spec=`echo $lt_search_path_spec`
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[[4-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[[45]]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
-  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[[3-9]]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
-[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
-[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-	;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  AC_LIBTOOL_LANG_CXX_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-	  AC_LIBTOOL_LANG_F77_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-	  AC_LIBTOOL_LANG_GCJ_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      RC)
-	AC_LIBTOOL_LANG_RC_CONFIG
-	;;
-
-      *)
-	AC_MSG_ERROR([Unsupported tag name: $tagname])
-	;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognize shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognize a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
-  else
-    MAGIC_CMD=:
-  fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-bsdi[[45]]*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
-  ;;
-
-cygwin*)
-  # func_win32_libid is a shell function defined in ltmain.sh
-  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-  lt_cv_file_magic_cmd='func_win32_libid'
-  ;;
-
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
-  ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
-
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-hpux10.20* | hpux11*)
-  lt_cv_file_magic_cmd=/usr/bin/file
-  case $host_cpu in
-  ia64*)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
-    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
-    ;;
-  hppa*64*)
-    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
-    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
-    ;;
-  *)
-    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
-    lt_cv_file_magic_test_file=/usr/lib/libc.sl
-    ;;
-  esac
-  ;;
-
-interix[[3-9]]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
-  fi
-  ;;
-
-newos6*)
-  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
-  lt_cv_file_magic_cmd=/usr/bin/file
-  lt_cv_file_magic_test_file=/usr/lib/libnls.so
-  ;;
-
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
-  ;;
-
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
-  else
-    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
-  fi
-  ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
-	#   nm: unknown option "B" ignored
-	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
-	  lt_cv_path_NM="$tmp_nm -B"
-	  break
-	  ;;
-	*)
-	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-	  */dev/null*)
-	    lt_cv_path_NM="$tmp_nm -p"
-	    break
-	    ;;
-	  *)
-	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	    continue # so that we can try to find one that supports BSD flags
-	    ;;
-	  esac
-	  ;;
-	esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix[[4-9]]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-  AC_PROG_LD
-
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
-
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
-
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  aix[[4-9]]*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    _LT_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  :
-	else
-	  # We have old collect2
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
-    fi
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	_LT_AC_SYS_LIBPATH_AIX
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-      if test "$GXX" = yes ; then
-      output_verbose_link_cmd='echo'
-      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-      fi
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
-
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-      case $host_cpu in
-      hppa*64*|ia64*) ;;
-      *)
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
-
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
-	    case $host_cpu in
-	    hppa*64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    ia64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    *)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  interix[[3-9]]*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-	;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux* | k*bsd*-gnu)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	esac
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	;;
-      pgCC* | pgcpp*)
-        # Portland Group C++ compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	runpath_var=LD_RUN_PATH
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C++ 5.9
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
-	  # Not sure whether something based on
-	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	  # would be better.
-	  output_verbose_link_cmd='echo'
-
-	  # Archives containing C++ object files must be created using
-	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	  # necessary to make sure instantiated templates are included
-	  # in the archive.
-	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	  ;;
-	esac
-	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    if test -f /usr/libexec/ld.so; then
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      fi
-      output_verbose_link_cmd='echo'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	case $host_os in
-	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	  *)
-	    # The compiler driver will combine and reorder linker options,
-	    # but understands `-z linker_flag'.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	    ;;
-	esac
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-	output_verbose_link_cmd='echo'
-
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	# The C++ compiler must be used to create the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
-      *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	  case $host_os in
-	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	  *)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	    ;;
-	  esac
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
-	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
-	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_AC_TAGVAR(predep_objects,$1)=
-  _LT_AC_TAGVAR(postdep_objects,$1)=
-  _LT_AC_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-    #
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
-      program t
-      end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix[[4-9]]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars.  Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
-
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
-
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
-
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-])
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
-    lt_cv_prog_compiler_rtti_exceptions,
-    [-fno-rtti -fno-exceptions], [],
-    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([LT_AC_PROG_SED])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[[BCDT]]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[[ABCDGISTW]]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDEGRST]]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux* | k*bsd*-gnu)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDGIRSTW]]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[[BCDEGRST]]'
-  ;;
-osf*)
-  symcode='[[BCDEGQRST]]'
-  ;;
-solaris*)
-  symcode='[[BDRT]]'
-  ;;
-sco3.2v5*)
-  symcode='[[DT]]'
-  ;;
-sysv4.2uw2*)
-  symcode='[[DT]]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[[ABDT]]'
-  ;;
-sysv4)
-  symcode='[[DFNSTU]]'
-  ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
-  if AC_TRY_EVAL(ac_compile); then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
-
-      # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
-    fi
-  else
-    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
-
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  AC_MSG_RESULT(failed)
-else
-  AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-      ;;
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[[4-9]]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	else
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler.
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-	;;
-    esac
-  fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
-
-    interix[[3-9]]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      icc* | ecc*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      *)
-        case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    rdos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
-  $lt_tmp_static_flag,
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[[4-9]]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-],[
-  runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_AC_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[[3-9]]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    interix[[3-9]]*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
-	esac
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
-
-    aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-	else
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      _LT_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[[012]]|aix4.[[012]].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  :
-	  else
-  	  # We have old collect2
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 _LT_AC_SYS_LIBPATH_AIX
-	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-        fi
-      else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-
-    os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
-
-    solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-        ;;
-	motorola)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-
-    *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-        then
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-        else
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-        fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-
-# Cheap backport of AS_EXECUTABLE_P and required macros
-# from Autoconf 2.59; we should not use $as_executable_p directly.
-
-# _AS_TEST_PREPARE
-# ----------------
-m4_ifndef([_AS_TEST_PREPARE],
-[m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
-  as_executable_p='test -x'
-else
-  as_executable_p='test -f'
-fi
-])])# _AS_TEST_PREPARE
-
-# AS_EXECUTABLE_P
-# ---------------
-# Check whether a file is executable.
-m4_ifndef([AS_EXECUTABLE_P],
-[m4_defun([AS_EXECUTABLE_P],
-[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
-])])# AS_EXECUTABLE_P
-
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])
-
 # Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
@@ -7605,6 +969,11 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([libtool.m4])
+m4_include([ltoptions.m4])
+m4_include([ltsugar.m4])
+m4_include([ltversion.m4])
+m4_include([lt~obsolete.m4])
 m4_include([nls.m4])
 m4_include([po.m4])
 m4_include([progtest.m4])
diff --git a/config.guess b/config.guess
index f32079a..e6b5d5b 100755
--- a/config.guess
+++ b/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-23'
+timestamp='2008-01-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -139,6 +139,16 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_MACHINE}" in
+    i?86)
+	test -z "$VENDOR" && VENDOR=pc
+	;;
+    *)
+	test -z "$VENDOR" && VENDOR=unknown
+	;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -840,13 +850,13 @@ EOF
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
@@ -855,16 +865,16 @@ EOF
 	echo crisv32-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+    	echo frv-${VENDOR}-linux-gnu
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
@@ -887,7 +897,7 @@ EOF
 		s: ::g
 		p
 	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
 	;;
     mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -910,16 +920,16 @@ EOF
 		s: ::g
 		p
 	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo or32-${VENDOR}-linux-gnu
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-${VENDOR}-linux-gnu
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-${VENDOR}-linux-gnu
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -933,39 +943,39 @@ EOF
         esac
 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
+	  PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
+	  *)    echo hppa-${VENDOR}-linux-gnu ;;
 	esac
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-${VENDOR}-linux-gnu
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo x86_64-${VENDOR}-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
@@ -980,18 +990,18 @@ EOF
 				    p'`
         case "$ld_supported_targets" in
 	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
 		;;
 	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
 		exit ;;
 	  coff-i386)
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnucoff"
 		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
 		exit ;;
 	esac
 	# Determine whether the default compiler is a.out or elf
@@ -1025,7 +1035,7 @@ EOF
 		p
 	    }'`"
 	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
 		exit
 	}
 	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
@@ -1484,9 +1494,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/config.h.in b/config.h.in
index 8ffa0ca..870c74d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -564,6 +564,10 @@
 /* Have system zlib */
 #undef HAVE_ZLIB
 
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
 /* Architecture uses registers for Parameters */
 #undef MONO_ARCH_REGPARMS
 
diff --git a/configure b/configure
index 230e6da..5842664 100755
--- a/configure
+++ b/configure
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.63.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -15,7 +15,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -37,17 +37,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -63,8 +91,6 @@ fi
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -87,7 +113,7 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -100,17 +126,10 @@ PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -132,7 +151,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -158,7 +177,7 @@ else
   as_have_required=no
 fi
 
-  if test $as_have_required = yes && 	 (eval ":
+  if test $as_have_required = yes &&	 (eval ":
 (as_func_return () {
   (exit \$1)
 }
@@ -240,7 +259,7 @@ IFS=$as_save_IFS
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -261,7 +280,7 @@ _ASEOF
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -341,10 +360,10 @@ fi
 
       if test "x$CONFIG_SHELL" != x; then
   for as_var in BASH_ENV ENV
-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-        done
-        export CONFIG_SHELL
-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
 
@@ -413,9 +432,10 @@ fi
 
 test \$exitcode = 0") || {
   echo No shell found that supports shell functions.
-  echo Please tell autoconf at gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
 }
 
 
@@ -451,7 +471,7 @@ test \$exitcode = 0") || {
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -479,7 +499,6 @@ case `echo -n x` in
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -492,19 +511,22 @@ if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -529,10 +551,10 @@ else
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -553,22 +575,22 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 # Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$ECHO in
+case X$lt_ECHO in
 X*--fallback-echo)
   # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
   ;;
 esac
 
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
 if test "X$1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
   shift
 elif test "X$1" = X--fallback-echo; then
   # Avoid inline document here, it may be left over
   :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
   :
 else
   # Restart under the correct shell.
@@ -578,9 +600,9 @@ fi
 if test "X$1" = X--fallback-echo; then
   # used as fallback echo
   shift
-  cat <<EOF
+  cat <<_LT_EOF
 $*
-EOF
+_LT_EOF
   exit 0
 fi
 
@@ -588,121 +610,116 @@ fi
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
 
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
 
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
     IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
 
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL $0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL $0 --fallback-echo"
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
       else
-	# maybe with a smaller string...
-	prev=:
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
 
-	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
+	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
 
-	if test "$prev" != 'sed 50q "$0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
+	  if test "$prev" != 'sed 50q "$0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
       fi
     fi
   fi
 fi
-fi
 
 # Copy echo and quote the copy suitably for passing to libtool from
 # the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
 fi
 
 
 
 
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
 exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
@@ -767,264 +784,303 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-target
-target_cpu
-target_vendor
-target_os
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-MAINTAINER_MODE_TRUE
-MAINTAINER_MODE_FALSE
-MAINT
-API_VER
-LN_S
-libmono_cflags
-libmono_ldflags
-reloc_libdir
-PLATFORM_WIN32_TRUE
-PLATFORM_WIN32_FALSE
-PLATFORM_LINUX_TRUE
-PLATFORM_LINUX_FALSE
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-CCAS
-CCASFLAGS
-CCASDEPMODE
-am__fastdepCCAS_TRUE
-am__fastdepCCAS_FALSE
-BISON
-CC_FOR_BUILD
-CFLAGS_FOR_BUILD
-HOST_CC
-BUILD_EXEEXT
-CROSS_COMPILING_TRUE
-CROSS_COMPILING_FALSE
-USE_BATCH_FILES_TRUE
-USE_BATCH_FILES_FALSE
-CPP
-GREP
-EGREP
-SED
-ECHO
-AR
-RANLIB
-DSYMUTIL
+enable_option_checking=no
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+mono_cfg_dir
+mono_runtime
+mono_build_root
+arch_target
+X11
+SQLITE3
+SQLITE
+INTL
+LIBC
+INTERP_SUPPORTED_FALSE
+INTERP_SUPPORTED_TRUE
+JIT_SUPPORTED_FALSE
+JIT_SUPPORTED_TRUE
+HPPA_FALSE
+HPPA_TRUE
+S390x_FALSE
+S390x_TRUE
+S390_FALSE
+S390_TRUE
+ARM_FALSE
+ARM_TRUE
+POWERPC64_FALSE
+POWERPC64_TRUE
+POWERPC_FALSE
+POWERPC_TRUE
+MIPS_FALSE
+MIPS_TRUE
+M68K_FALSE
+M68K_TRUE
+IA64_FALSE
+IA64_TRUE
+ALPHA_FALSE
+ALPHA_TRUE
+AMD64_FALSE
+AMD64_TRUE
+X86_FALSE
+X86_TRUE
+SPARC64_FALSE
+SPARC64_TRUE
+SPARC_FALSE
+SPARC_TRUE
+MIPS_SGI_FALSE
+MIPS_SGI_TRUE
+MIPS_GCC_FALSE
+MIPS_GCC_TRUE
+INSTALL_2_1_FALSE
+INSTALL_2_1_TRUE
+INSTALL_2_0_FALSE
+INSTALL_2_0_TRUE
+OPROFILE_LIBS
+OPROFILE_CFLAGS
+HAVE_OPROFILE_FALSE
+HAVE_OPROFILE_TRUE
+MONO_DEBUGGER_SUPPORTED_FALSE
+MONO_DEBUGGER_SUPPORTED_TRUE
+libsuffix
+XMKMF
+USE_JIT_FALSE
+USE_JIT_TRUE
+DTRACE_G_REQUIRED_FALSE
+DTRACE_G_REQUIRED_TRUE
+ENABLE_DTRACE_FALSE
+ENABLE_DTRACE_TRUE
+DTRACEFLAGS
+DTRACE
+ENABLE_NUNIT_TESTS_FALSE
+ENABLE_NUNIT_TESTS_TRUE
+DISABLE_SHARED_HANDLES
+XATTR_LIB
+ikvm_native_dir
+MONO_DL_NEED_USCORE
+libgc_dir
+LIBGC_STATIC_LIBS
+LIBGC_LIBS
+LIBGC_CFLAGS
+INCLUDED_LIBGC_FALSE
+INCLUDED_LIBGC_TRUE
+HAVE_BOEHM_GC
+DISABLE_JIT_FALSE
+DISABLE_JIT_TRUE
+DISABLE_PROFILER_FALSE
+DISABLE_PROFILER_TRUE
+STATIC_MONO_FALSE
+STATIC_MONO_TRUE
+eglib_dir
+BUILD_GLIB_LIBS
+BUILD_GLIB_CFLAGS
+GMODULE_LIBS
+GMODULE_CFLAGS
+GLIB_LIBS
+GLIB_CFLAGS
+EGLIB_BUILD_FALSE
+EGLIB_BUILD_TRUE
+subdirs
+PKG_CONFIG
+libgdiplus_loc
+HAVE_MSGFMT
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+MSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
+mcs_topdir_from_srcdir
+mcs_topdir
+BUILD_MCS_FALSE
+BUILD_MCS_TRUE
+HAVE_ZLIB_FALSE
+HAVE_ZLIB_TRUE
+NO_VERSION_SCRIPT_FALSE
+NO_VERSION_SCRIPT_TRUE
+export_ldflags
+LTCXXCOMPILE
+LTCOMPILE
+DOLT_BASH
+OTOOL64
+OTOOL
+LIPO
 NMEDIT
+DSYMUTIL
+lt_ECHO
+RANLIB
+AR
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+SED
+LIBTOOL
+OBJDUMP
 DLLTOOL
 AS
-OBJDUMP
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CXXCPP
-F77
-FFLAGS
-ac_ct_F77
-LIBTOOL
-DOLT_BASH
-LTCOMPILE
-LTCXXCOMPILE
-export_ldflags
-NO_VERSION_SCRIPT_TRUE
-NO_VERSION_SCRIPT_FALSE
-HAVE_ZLIB_TRUE
-HAVE_ZLIB_FALSE
-BUILD_MCS_TRUE
-BUILD_MCS_FALSE
-mcs_topdir
-mcs_topdir_from_srcdir
-USE_NLS
-GETTEXT_MACRO_VERSION
-MSGFMT
-GMSGFMT
-MSGFMT_015
-GMSGFMT_015
-XGETTEXT
-XGETTEXT_015
-MSGMERGE
-XGETTEXT_EXTRA_OPTIONS
-HAVE_MSGFMT
-libgdiplus_loc
-PKG_CONFIG
-subdirs
-EGLIB_BUILD_TRUE
-EGLIB_BUILD_FALSE
-GLIB_CFLAGS
-GLIB_LIBS
-GMODULE_CFLAGS
-GMODULE_LIBS
-BUILD_GLIB_CFLAGS
-BUILD_GLIB_LIBS
-eglib_dir
-STATIC_MONO_TRUE
-STATIC_MONO_FALSE
-DISABLE_PROFILER_TRUE
-DISABLE_PROFILER_FALSE
-DISABLE_JIT_TRUE
-DISABLE_JIT_FALSE
-HAVE_BOEHM_GC
-INCLUDED_LIBGC_TRUE
-INCLUDED_LIBGC_FALSE
-LIBGC_CFLAGS
-LIBGC_LIBS
-LIBGC_STATIC_LIBS
-libgc_dir
-MONO_DL_NEED_USCORE
-ikvm_native_dir
-XATTR_LIB
-DISABLE_SHARED_HANDLES
-ENABLE_NUNIT_TESTS_TRUE
-ENABLE_NUNIT_TESTS_FALSE
-DTRACE
-DTRACEFLAGS
-ENABLE_DTRACE_TRUE
-ENABLE_DTRACE_FALSE
-DTRACE_G_REQUIRED_TRUE
-DTRACE_G_REQUIRED_FALSE
-USE_JIT_TRUE
-USE_JIT_FALSE
-XMKMF
-libsuffix
-MONO_DEBUGGER_SUPPORTED_TRUE
-MONO_DEBUGGER_SUPPORTED_FALSE
-HAVE_OPROFILE_TRUE
-HAVE_OPROFILE_FALSE
-OPROFILE_CFLAGS
-OPROFILE_LIBS
-INSTALL_2_0_TRUE
-INSTALL_2_0_FALSE
-INSTALL_2_1_TRUE
-INSTALL_2_1_FALSE
-MIPS_GCC_TRUE
-MIPS_GCC_FALSE
-MIPS_SGI_TRUE
-MIPS_SGI_FALSE
-SPARC_TRUE
-SPARC_FALSE
-SPARC64_TRUE
-SPARC64_FALSE
-X86_TRUE
-X86_FALSE
-AMD64_TRUE
-AMD64_FALSE
-ALPHA_TRUE
-ALPHA_FALSE
-IA64_TRUE
-IA64_FALSE
-M68K_TRUE
-M68K_FALSE
-MIPS_TRUE
-MIPS_FALSE
-POWERPC_TRUE
-POWERPC_FALSE
-POWERPC64_TRUE
-POWERPC64_FALSE
-ARM_TRUE
-ARM_FALSE
-S390_TRUE
-S390_FALSE
-S390x_TRUE
-S390x_FALSE
-HPPA_TRUE
-HPPA_FALSE
-JIT_SUPPORTED_TRUE
-JIT_SUPPORTED_FALSE
-INTERP_SUPPORTED_TRUE
-INTERP_SUPPORTED_FALSE
-LIBC
-INTL
-SQLITE
-SQLITE3
-X11
-arch_target
-mono_build_root
-mono_runtime
-mono_cfg_dir
-LIBOBJS
-LTLIBOBJS'
+EGREP
+GREP
+CPP
+USE_BATCH_FILES_FALSE
+USE_BATCH_FILES_TRUE
+CROSS_COMPILING_FALSE
+CROSS_COMPILING_TRUE
+BUILD_EXEEXT
+HOST_CC
+CFLAGS_FOR_BUILD
+CC_FOR_BUILD
+BISON
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+PLATFORM_LINUX_FALSE
+PLATFORM_LINUX_TRUE
+PLATFORM_WIN32_FALSE
+PLATFORM_WIN32_TRUE
+reloc_libdir
+libmono_ldflags
+libmono_cflags
+LN_S
+API_VER
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+enable_solaris_tar_check
+enable_nls
+with_libgdiplus
+with_crosspkgdir
+with_glib
+with_gc
+with_tls
+with_sigaltstack
+with_static_mono
+enable_mcs_build
+with_xen_opt
+enable_quiet_build
+enable_minimal
+enable_parallel_mark
+with_large_heap
+with_ikvm_native
+enable_dev_random
+enable_shared_handles
+enable_nunit_tests
+enable_big_arrays
+enable_dtrace
+with_jit
+with_interp
+with_x
+with_preview
+with_moonlight
+with_oprofile
+with_malloc_mempools
+'
       ac_precious_vars='build_alias
 host_alias
 target_alias
@@ -1036,12 +1092,6 @@ CPPFLAGS
 CCAS
 CCASFLAGS
 CPP
-CXX
-CXXFLAGS
-CCC
-CXXCPP
-F77
-FFLAGS
 XMKMF'
 ac_subdirs_all='eglib
 libgc'
@@ -1049,6 +1099,8 @@ libgc'
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -1147,13 +1199,21 @@ do
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
@@ -1166,13 +1226,21 @@ do
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1363,22 +1431,38 @@ do
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1398,7 +1482,7 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; }
     ;;
@@ -1407,16 +1491,16 @@ Try \`$0 --help' for more information." >&2
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1425,22 +1509,38 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
 		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; }
 done
 
@@ -1455,7 +1555,7 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1471,10 +1571,10 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { echo "$as_me: error: Working directory cannot be determined" >&2
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { echo "$as_me: error: pwd does not report name of working directory" >&2
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
    { (exit 1); exit 1; }; }
 
 
@@ -1482,12 +1582,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -1514,12 +1614,12 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
 	pwd)`
 # When building in place, set srcdir=.
@@ -1568,9 +1668,9 @@ Configuration:
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1580,25 +1680,25 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1624,6 +1724,7 @@ if test -n "$ac_init_help"; then
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --enable-maintainer-mode  enable make rules and dependencies not useful
@@ -1652,10 +1753,9 @@ Optional Features:
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-tags[=TAGS]      include additional configurations [automatic]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-libgdiplus=installed|sibling|<path>	Override the libgdiplus used for System.Drawing tests (defaults to NO)
   --with-crosspkgdir=/path/to/pkg-config/dir
   --with-glib=embedded|system       Choose glib API: system or embedded (default to system)
@@ -1685,11 +1785,6 @@ Some influential environment variables:
   CCAS        assembler compiler command (defaults to CC)
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
   CPP         C preprocessor
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
-  CXXCPP      C++ preprocessor
-  F77         Fortran 77 compiler command
-  FFLAGS      Fortran 77 compiler flags
   XMKMF       Path to xmkmf, Makefile generator for X Window System
 
 Use these variables to override the choices made by `configure' or to help
@@ -1702,15 +1797,17 @@ fi
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1746,7 +1843,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
@@ -1756,10 +1853,10 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 configure
-generated by GNU Autoconf 2.61
+generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1770,7 +1867,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -1806,7 +1903,7 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
+  $as_echo "PATH: $as_dir"
 done
 IFS=$as_save_IFS
 
@@ -1841,7 +1938,7 @@ do
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1893,11 +1990,12 @@ _ASBOX
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -1927,9 +2025,9 @@ _ASBOX
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
@@ -1944,9 +2042,9 @@ _ASBOX
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	echo "$ac_var='\''$ac_val'\''"
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1962,8 +2060,8 @@ _ASBOX
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -2005,21 +2103,24 @@ _ACEOF
 
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
-  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
 else
-  set x "$ac_default_prefix/share/config.site" \
-	"$ac_default_prefix/etc/config.site"
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
+  test "x$ac_site_file" = xNONE && continue
   if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -2029,16 +2130,16 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
@@ -2052,29 +2153,38 @@ for ac_var in $ac_precious_vars; do
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -2084,10 +2194,12 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -2131,8 +2243,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -2147,34 +2259,34 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
 if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
    { (exit 1); exit 1; }; };;
 esac
 build=$ac_cv_build
@@ -2191,27 +2303,27 @@ IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
 if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
    { (exit 1); exit 1; }; };;
 esac
 host=$ac_cv_host
@@ -2228,27 +2340,27 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-{ echo "$as_me:$LINENO: checking target system type" >&5
-echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
 if test "${ac_cv_target+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "x$target_alias" = x; then
   ac_cv_target=$ac_cv_host
 else
   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
-echo "${ECHO_T}$ac_cv_target" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
 case $ac_cv_target in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
-echo "$as_me: error: invalid value of canonical target" >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
    { (exit 1); exit 1; }; };;
 esac
 target=$ac_cv_target
@@ -2293,11 +2405,12 @@ am__api_version='1.10'
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2326,17 +2439,29 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
+
 done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -2349,8 +2474,8 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -2360,8 +2485,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
@@ -2384,9 +2509,9 @@ if (
       # if, for instance, CONFIG_SHELL is bash and it inherits a
       # broken ls alias from the environment.  This has actually
       # happened.  Such a system could not be considered "sane".
-      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
 alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
 alias in your environment" >&2;}
    { (exit 1); exit 1; }; }
    fi
@@ -2397,26 +2522,23 @@ then
    # Ok.
    :
 else
-   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
 Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
+$as_echo "$as_me: error: newly created file is older than distributed files!
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
+# Double any \ or $.
 # By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -2427,15 +2549,15 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
   if test "${ac_cv_path_mkdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
@@ -2470,8 +2592,8 @@ fi
     MKDIR_P="$ac_install_sh -d"
   fi
 fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
 
 mkdir_p="$MKDIR_P"
 case $mkdir_p in
@@ -2483,10 +2605,10 @@ for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -2499,7 +2621,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2510,22 +2632,23 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
   test -n "$AWK" && break
 done
 
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
 SHELL = /bin/sh
@@ -2542,12 +2665,12 @@ esac
 rm -f conftest.make
 fi
 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
   SET_MAKE=
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -2566,8 +2689,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
    { (exit 1); exit 1; }; }
   fi
 fi
@@ -2584,7 +2707,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=mono
- VERSION=2.4.2.3
+ VERSION=2.4.3
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2622,10 +2745,10 @@ if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
@@ -2638,7 +2761,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2649,11 +2772,11 @@ fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2662,10 +2785,10 @@ if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
@@ -2678,7 +2801,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2689,11 +2812,11 @@ fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_STRIP" = x; then
@@ -2701,12 +2824,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     STRIP=$ac_ct_STRIP
@@ -2725,8 +2844,8 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AMTAR=${AMTAR-"${am_missing_run}tar"}
 
 
-{ echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5
-echo $ECHO_N "checking how to create a ustar tar archive... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to create a ustar tar archive" >&5
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
 # Loop over all known methods to create a tar archive until one works.
 _am_tools='gnutar plaintar pax cpio none'
 _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
@@ -2799,20 +2918,20 @@ done
 rm -rf conftest.dir
 
 if test "${am_cv_prog_tar_ustar+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   am_cv_prog_tar_ustar=$_am_tool
 fi
 
-{ echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5
-echo "${ECHO_T}$am_cv_prog_tar_ustar" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_prog_tar_ustar" >&5
+$as_echo "$am_cv_prog_tar_ustar" >&6; }
 
 
 
 
 
-{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
     # Check whether --enable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
@@ -2820,8 +2939,8 @@ else
   USE_MAINTAINER_MODE=no
 fi
 
-  { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
    if test $USE_MAINTAINER_MODE = yes; then
   MAINTAINER_MODE_TRUE=
   MAINTAINER_MODE_FALSE='#'
@@ -2837,15 +2956,15 @@ fi
 API_VER=1.0
 
 
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
 
 
@@ -2892,8 +3011,8 @@ no_version_script=no
 need_link_unlink=no
 
 # Thread configuration inspired by sleepycat's db
-{ echo "$as_me:$LINENO: checking host platform characteristics" >&5
-echo $ECHO_N "checking host platform characteristics... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking host platform characteristics" >&5
+$as_echo_n "checking host platform characteristics... " >&6; }
 libgc_threads=no
 has_dtrace=no
 
@@ -2920,6 +3039,7 @@ _ACEOF
 		HOST_CC="gcc"
 		# Windows 2000 is required that includes Internet Explorer 5.01
 		CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
+		LDFLAGS="$LDFLAGS -lmswsock"
 		libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
 		libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
 		libdl=
@@ -3055,14 +3175,14 @@ _ACEOF
 		fi
 		;;
 	*)
-		{ echo "$as_me:$LINENO: WARNING: *** Please add $host to configure.in checks!" >&5
-echo "$as_me: WARNING: *** Please add $host to configure.in checks!" >&2;}
+		{ $as_echo "$as_me:$LINENO: WARNING: *** Please add $host to configure.in checks!" >&5
+$as_echo "$as_me: WARNING: *** Please add $host to configure.in checks!" >&2;}
 		platform_win32=no
 		libdl="-ldl"
 		;;
 esac
-{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 
 if test x$need_link_unlink = xyes; then
 
@@ -3092,10 +3212,10 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3108,7 +3228,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3119,11 +3239,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3132,10 +3252,10 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3148,7 +3268,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3159,11 +3279,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -3171,12 +3291,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -3193,10 +3309,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3209,7 +3325,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3220,11 +3336,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3233,10 +3349,10 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3249,7 +3365,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3260,11 +3376,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -3272,12 +3388,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -3290,10 +3402,10 @@ if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3306,7 +3418,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3317,11 +3429,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3330,10 +3442,10 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3351,7 +3463,7 @@ do
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3374,11 +3486,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3389,10 +3501,10 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -3405,7 +3517,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3416,11 +3528,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3433,10 +3545,10 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -3449,7 +3561,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3460,11 +3572,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3476,12 +3588,8 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -3491,44 +3599,50 @@ fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
 { (ac_try="$ac_compiler --version >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -v >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -V >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -3547,27 +3661,22 @@ main ()
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort.  b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions.  Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
 ac_rmfiles=
 for ac_file in $ac_files
 do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
   esac
 done
@@ -3578,10 +3687,11 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
@@ -3592,7 +3702,7 @@ for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
@@ -3619,25 +3729,27 @@ else
   ac_file=''
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
+$as_echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
 
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
@@ -3646,49 +3758,53 @@ if test "$cross_compiling" != yes; then
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
+$as_echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
 
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -3697,31 +3813,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
 if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3744,40 +3862,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3803,20 +3924,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_compiler_gnu=no
@@ -3826,15 +3948,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
@@ -3861,20 +3987,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	CFLAGS=""
@@ -3899,20 +4026,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_c_werror_flag=$ac_save_c_werror_flag
@@ -3938,20 +4066,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3966,8 +4095,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -3983,10 +4112,10 @@ else
     CFLAGS=
   fi
 fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
 if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
@@ -4057,20 +4186,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_c89=$ac_arg
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -4086,15 +4216,15 @@ fi
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
 
@@ -4115,8 +4245,8 @@ am__doit:
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
 _am_result=none
@@ -4143,8 +4273,8 @@ if test "$am__include" = "#"; then
 fi
 
 
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
 rm -f confinc confmf
 
 # Check whether --enable-dependency-tracking was given.
@@ -4168,10 +4298,10 @@ fi
 
 depcc="$CC"   am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -4259,8 +4389,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
@@ -4283,10 +4413,10 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 
 depcc="$CCAS"   am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -4374,8 +4504,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
 CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
 
  if
@@ -4397,10 +4527,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -4413,7 +4543,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4424,11 +4554,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4437,10 +4567,10 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -4453,7 +4583,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4464,11 +4594,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -4476,12 +4606,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -4494,10 +4620,10 @@ if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -4510,7 +4636,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4521,11 +4647,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4534,10 +4660,10 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -4555,7 +4681,7 @@ do
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4578,11 +4704,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4593,10 +4719,10 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -4609,7 +4735,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4620,11 +4746,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4637,10 +4763,10 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -4653,7 +4779,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4664,11 +4790,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4680,12 +4806,8 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -4695,50 +4817,56 @@ fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
 { (ac_try="$ac_compiler --version >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -v >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -V >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4764,20 +4892,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_compiler_gnu=no
@@ -4787,15 +4916,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
@@ -4822,20 +4955,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	CFLAGS=""
@@ -4860,20 +4994,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_c_werror_flag=$ac_save_c_werror_flag
@@ -4899,20 +5034,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -4927,8 +5063,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -4944,10 +5080,10 @@ else
     CFLAGS=
   fi
 fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
 if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
@@ -5018,20 +5154,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_c89=$ac_arg
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -5047,15 +5184,15 @@ fi
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
 
@@ -5067,10 +5204,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CC"   am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -5158,8 +5295,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
@@ -5189,11 +5326,12 @@ am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -5222,17 +5360,29 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
+
 done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -5245,8 +5395,8 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -5260,10 +5410,10 @@ for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -5276,7 +5426,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -5287,11 +5437,11 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -5306,10 +5456,10 @@ done
 
 # Extract the first word of "bison", so it can be a program name with args.
 set dummy bison; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_BISON+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$BISON"; then
   ac_cv_prog_BISON="$BISON" # Let the user override the test.
@@ -5322,7 +5472,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_BISON="yes"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -5334,18 +5484,18 @@ fi
 fi
 BISON=$ac_cv_prog_BISON
 if test -n "$BISON"; then
-  { echo "$as_me:$LINENO: result: $BISON" >&5
-echo "${ECHO_T}$BISON" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $BISON" >&5
+$as_echo "$BISON" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 if test "x$BISON" = "xno";
 then
-	{ { echo "$as_me:$LINENO: error: You need to install bison" >&5
-echo "$as_me: error: You need to install bison" >&2;}
+	{ { $as_echo "$as_me:$LINENO: error: You need to install bison" >&5
+$as_echo "$as_me: error: You need to install bison" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -5386,15 +5536,15 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
   if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -5426,20 +5576,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -5463,13 +5614,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -5477,7 +5629,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -5502,8 +5654,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -5531,20 +5683,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -5568,13 +5721,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -5582,7 +5736,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -5598,11 +5752,13 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -5612,42 +5768,37 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
 if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
+  if test -z "$GREP"; then
   ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in grep ggrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-    # Check for GNU ac_path_GREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'GREP' >> "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -5662,74 +5813,60 @@ case `"$ac_path_GREP" --version 2>&1` in
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_GREP_found && break 3
+      $ac_path_GREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-fi
-
+  fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
-
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
 if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
-     # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+     if test -z "$EGREP"; then
   ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in egrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-    # Check for GNU ac_path_EGREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'EGREP' >> "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -5744,40 +5881,31 @@ case `"$ac_path_EGREP" --version 2>&1` in
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_EGREP_found && break 3
+      $ac_path_EGREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-fi
-
+  fi
 else
   ac_cv_path_EGREP=$EGREP
 fi
 
-
    fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -5804,20 +5932,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_stdc=no
@@ -5909,37 +6038,40 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5948,140 +6080,507 @@ _ACEOF
 
 fi
 
+enable_win32_dll=yes
 
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AS+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-# This causes monodis to not link correctly
-#AC_DISABLE_FAST_INSTALL
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval=$enable_shared; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:$LINENO: result: $AS" >&5
+$as_echo "$AS" >&6; }
 else
-  enable_shared=yes
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  enable_static=yes
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+  if test "x$ac_ct_AS" = x; then
+    AS="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
 
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  enable_fast_install=yes
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
 else
-  # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+  ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+# This causes monodis to not link correctly
+#AC_DISABLE_FAST_INSTALL
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.6'
+macro_revision='1.3012'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
     done
   done
 done
 IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
+  if test -z "$ac_cv_path_SED"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
   done
 done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
 
+   fi
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
-SED=$lt_cv_path_SED
 
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
 
 
 # Check whether --with-gnu-ld was given.
@@ -6094,8 +6593,8 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -6108,9 +6607,9 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -6124,14 +6623,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -6161,19 +6660,19 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
@@ -6185,40 +6684,22 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
 
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
 if test "${lt_cv_path_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
   # Let the user override the test.
@@ -6261,17 +6742,479 @@ else
     done
     IFS="$lt_save_ifs"
   done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:6873: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:6876: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:6879: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
 
-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
 if test "${lt_cv_deplibs_check_method+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_file_magic_cmd='$MAGIC_CMD'
 lt_cv_file_magic_test_file=
@@ -6321,12 +7264,18 @@ mingw* | pw32*)
   fi
   ;;
 
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
 darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
 freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
@@ -6384,7 +7333,7 @@ linux* | k*bsd*-gnu)
   ;;
 
 netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
@@ -6397,12 +7346,12 @@ newos6*)
   lt_cv_file_magic_test_file=/usr/lib/libnls.so
   ;;
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6421,6 +7370,10 @@ solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
@@ -6448,14 +7401,14 @@ sysv4 | sysv4.3*)
   esac
   ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -6463,241 +7416,24 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval=$enable_libtool_lock;
-fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '#line 6506 "configure"' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
-  fi
-  rm -rf conftest*
-  ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_i386_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_x86_64_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
-if test "${lt_cv_cc_needs_belf+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-     cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  lt_cv_cc_needs_belf=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	lt_cv_cc_needs_belf=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-     ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
-  ;;
-sparc*-*solaris*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    case `/usr/bin/file conftest.o` in
-    *64-bit*)
-      case $lt_cv_prog_gnu_ld in
-      yes*) LD="${LD-ld} -m elf64_sparc" ;;
-      *)
-        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
-	  LD="${LD-ld} -64"
-	fi
-	;;
-      esac
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-
-*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_DLLTOOL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$DLLTOOL"; then
-  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6706,8 +7442,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6716,28 +7452,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
-  { echo "$as_me:$LINENO: result: $DLLTOOL" >&5
-echo "${ECHO_T}$DLLTOOL" >&6; }
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
-  ac_ct_DLLTOOL=$DLLTOOL
-  # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_DLLTOOL"; then
-  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6746,8 +7482,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6756,140 +7492,53 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
-echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; }
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_DLLTOOL" = x; then
-    DLLTOOL="false"
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    DLLTOOL=$ac_ct_DLLTOOL
+    AR=$ac_ct_AR
   fi
 else
-  DLLTOOL="$ac_cv_prog_DLLTOOL"
+  AR="$ac_cv_prog_AR"
 fi
 
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AS"; then
-  ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AS="${ac_tool_prefix}as"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
 
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
-  { echo "$as_me:$LINENO: result: $AS" >&5
-echo "${ECHO_T}$AS" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-fi
-if test -z "$ac_cv_prog_AS"; then
-  ac_ct_AS=$AS
-  # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_AS"; then
-  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AS="as"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
-echo "${ECHO_T}$ac_ct_AS" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
-  if test "x$ac_ct_AS" = x; then
-    AS="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    AS=$ac_ct_AS
-  fi
-else
-  AS="$ac_cv_prog_AS"
-fi
 
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$OBJDUMP"; then
-  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6898,8 +7547,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6908,28 +7557,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
-  { echo "$as_me:$LINENO: result: $OBJDUMP" >&5
-echo "${ECHO_T}$OBJDUMP" >&6; }
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
-  ac_ct_OBJDUMP=$OBJDUMP
-  # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_OBJDUMP"; then
-  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -6938,8 +7587,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_OBJDUMP="objdump"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6948,271 +7597,47 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
-echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; }
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_OBJDUMP" = x; then
-    OBJDUMP="false"
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    OBJDUMP=$ac_ct_OBJDUMP
+    STRIP=$ac_ct_STRIP
   fi
 else
-  OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-  ;;
-
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-for ac_header in dlfcn.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_header_compiler=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
+  STRIP="$ac_cv_prog_STRIP"
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+test -z "$STRIP" && STRIP=:
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
 
-fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
-fi
 
-done
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -7221,8 +7646,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -7231,32 +7656,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-    test -n "$CXX" && break
-  done
 fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -7265,8 +7686,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -7275,1021 +7696,102 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_compiler_gnu=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cxx_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	CXXFLAGS=""
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_cxx_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-depcc="$CXX"  am_compiler_list=
-
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
-if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+    RANLIB=$ac_ct_RANLIB
   fi
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
-    case $depmode in
-    nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    none) break ;;
-    esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
-    if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
-
-  cd ..
-  rm -rf conftest.dir
 else
-  am_cv_CXX_dependencies_compiler_type=none
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+test -z "$RANLIB" && RANLIB=:
 
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
 
 
 
 
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
-if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-      # Double quotes because CXXCPP needs to be expanded
-    for CXXCPP in "$CXX -E" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
 
-    done
-    ac_cv_prog_CXXCPP=$CXXCPP
 
-fi
-  CXXCPP=$ac_cv_prog_CXXCPP
-else
-  ac_cv_prog_CXXCPP=$CXXCPP
-fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
-ac_preproc_ok=false
-for ac_cxx_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  :
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Broken: fails on valid input.
-continue
-fi
 
-rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
 
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-fi
 
 
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$F77"; then
-  ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
-  { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-    test -n "$F77" && break
-  done
-fi
-if test -z "$F77"; then
-  ac_ct_F77=$F77
-  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_F77"; then
-  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_F77="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-  test -n "$ac_ct_F77" && break
-done
 
-  if test "x$ac_ct_F77" = x; then
-    F77=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    F77=$ac_ct_F77
-  fi
-fi
 
 
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-rm -f a.out
 
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file.  (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-      program main
-#ifndef __GNUC__
-       choke me
-#endif
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_compiler_gnu=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
-      program main
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_f77_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_prog_f77_g=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
-  FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-g -O2"
-  else
-    FFLAGS="-g"
-  fi
-else
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-O2"
-  else
-    FFLAGS=
-  fi
-fi
-
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
 
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
 
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	      lt_cv_sys_max_cmd_len=$new_result &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on massive
-      # amounts of additional arguments before passing them to the linker.
-      # It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
 
-fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
-fi
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
+# Allow CC to be a program name with arguments.
+compiler=$CC
 
 
 # Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 # These are sane defaults that work on at least a few old systems.
@@ -8301,33 +7803,18 @@ symcode='[BCDEGRST]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
 # Define system-specific variables.
 case $host_os in
 aix*)
   symcode='[BCDT]'
   ;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   symcode='[ABCDGISTW]'
   ;;
-hpux*) # Its linker distinguishes data from code symbols
+hpux*)
   if test "$host_cpu" = ia64; then
     symcode='[ABCDEGRST]'
   fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux* | k*bsd*-gnu)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDGIRSTW]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
   ;;
 irix* | nonstopux*)
   symcode='[BCDEGRST]'
@@ -8352,56 +7839,84 @@ sysv4)
   ;;
 esac
 
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
 # Handle CRLF in mingw tool chain
 opt_cr=
 case $build_os in
 mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
   ;;
 esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
+# Try without a prefix underscore, then with it.
 for ac_symprfx in "" "_"; do
 
   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
   symxfrm="\\1 $ac_symprfx\\2 \\2"
 
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
 
   # Check to see that the pipe works correctly.
   pipe_works=no
 
   rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
+  cat > conftest.$ac_ext <<_LT_EOF
 #ifdef __cplusplus
 extern "C" {
 #endif
 char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
 #ifdef __cplusplus
 }
 #endif
 int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
+_LT_EOF
 
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
     # Now try to grab the symbols.
     nlist=conftest.nm
     if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
   (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s "$nlist"; then
       # Try sorting and uniquifying the output.
       if sort "$nlist" | uniq > "$nlist"T; then
@@ -8411,42 +7926,44 @@ EOF
       fi
 
       # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-EOF
+_LT_EOF
 	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
 
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+	  cat <<_LT_EOF >> conftest.$ac_ext
 
-/* The mapping between symbol names and symbols. */
+/* The mapping between symbol names and symbols.  */
 const struct {
   const char *name;
-  lt_ptr_t address;
+  void       *address;
 }
-lt_preloaded_symbols[] =
+lt__PROGRAM__LTX_preloaded_symbols[] =
 {
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
 };
 
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-EOF
+_LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_save_LIBS="$LIBS"
@@ -8456,7 +7973,7 @@ EOF
 	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
@@ -8491,87 +8008,269 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then
   lt_cv_sys_global_symbol_to_cdecl=
 fi
 if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
+  { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
 else
-  { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
-if test "${lt_cv_objdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
 
 
 
 
 
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
   fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 8070 "configure"' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
   ;;
-esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
+int
+main ()
+{
 
-# Constants:
-rm="rm -f"
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  lt_cv_cc_needs_belf=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+	lt_cv_cc_needs_belf=no
+fi
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8580,8 +8279,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8590,28 +8289,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8620,8 +8319,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8630,44 +8329,40 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    AR=$ac_ct_AR
+    DSYMUTIL=$ac_ct_DSYMUTIL
   fi
 else
-  AR="$ac_cv_prog_AR"
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
 fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8676,8 +8371,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8686,28 +8381,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8716,8 +8411,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8726,44 +8421,40 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    RANLIB=$ac_ct_RANLIB
+    NMEDIT=$ac_ct_NMEDIT
   fi
 else
-  RANLIB="$ac_cv_prog_RANLIB"
+  NMEDIT="$ac_cv_prog_NMEDIT"
 fi
 
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8772,8 +8463,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8782,28 +8473,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -8812,8 +8503,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -8822,232 +8513,40 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    STRIP=$ac_ct_STRIP
+    LIPO=$ac_ct_LIPO
   fi
 else
-  STRIP="$ac_cv_prog_STRIP"
+  LIPO="$ac_cv_prog_LIPO"
 fi
 
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
-if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $MAGIC_CMD in
-[\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
-      if test -n "$file_magic_test_file"; then
-	case $deplibs_check_method in
-	"file_magic "*)
-	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-	    $EGREP "$file_magic_regex" > /dev/null; then
-	    :
-	  else
-	    cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool at gnu.org
-
-EOF
-	  fi ;;
-	esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac
-fi
-
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  else
-    MAGIC_CMD=:
-  fi
-fi
-
-  fi
-  ;;
-esac
-
-
-  case $host_os in
-    rhapsody* | darwin*)
     if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -9056,8 +8555,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -9066,28 +8565,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
-echo "${ECHO_T}$DSYMUTIL" >&6; }
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -9096,8 +8595,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -9106,44 +8605,40 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
-echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
+    OTOOL=$ac_ct_OTOOL
   fi
 else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+  OTOOL="$ac_cv_prog_OTOOL"
 fi
 
     if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -9152,8 +8647,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -9162,28 +8657,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { echo "$as_me:$LINENO: result: $NMEDIT" >&5
-echo "${ECHO_T}$NMEDIT" >&6; }
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -9192,8 +8687,8 @@ do
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -9202,62 +8697,89 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
-echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    NMEDIT=$ac_ct_NMEDIT
+    OTOOL64=$ac_ct_OTOOL64
   fi
 else
-  NMEDIT="$ac_cv_prog_NMEDIT"
+  OTOOL64="$ac_cv_prog_OTOOL64"
 fi
 
 
-    { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
-echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
 if test "${lt_cv_apple_cc_single_mod+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
       if test -z "${LT_MULTI_MODULE}"; then
-   # By default we will add the -single_module flag. You can override
-   # by either setting the environment variable LT_MULTI_MODULE
-   # non-empty at configure time, or by adding -multi_module to the
-   # link flags.
-   echo "int foo(void){return 1;}" > conftest.c
-   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-     -dynamiclib ${wl}-single_module conftest.c
-   if test -f libconftest.dylib; then
-     lt_cv_apple_cc_single_mod=yes
-     rm -rf libconftest.dylib*
-   fi
-   rm conftest.c
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
       fi
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
-echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }
-    { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
-echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_ld_exported_symbols_list=no
       save_LDFLAGS=$LDFLAGS
@@ -9284,49 +8806,53 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   lt_cv_ld_exported_symbols_list=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	lt_cv_ld_exported_symbols_list=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-   LDFLAGS="$save_LDFLAGS"
+	LDFLAGS="$save_LDFLAGS"
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
-echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
     case $host_os in
-    rhapsody* | darwin1.[0123])
+    rhapsody* | darwin1.[012])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-   10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-   10.[012]*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-   10.*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
@@ -9336,26 +8862,222 @@ echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
     if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
       _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
     else
-      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
     if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil="~$DSYMUTIL \$lib || :"
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
     fi
     ;;
   esac
 
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
-enable_dlopen=no
-enable_win32_dll=yes
 
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval=$enable_libtool_lock;
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
 
 
 # Check whether --with-pic was given.
@@ -9365,10 +9087,343 @@ else
   pic_mode=default
 fi
 
+
 test -z "$pic_mode" && pic_mode=default
 
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if test "${lt_cv_objdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
 # Use C for the default configuration in the libtool script
-tagname=
+
 lt_save_CC="$CC"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -9391,6 +9446,11 @@ lt_simple_compile_test_code="int some_variable = 0;"
 lt_simple_link_test_code='int main(){return(0);}'
 
 
+
+
+
+
+
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
@@ -9400,35 +9460,42 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
 
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
+$RM -r conftest*
 
 
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
 if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
+   ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="-fno-rtti -fno-exceptions"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -9440,25 +9507,25 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9443: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9510: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9447: \$? = $ac_status" >&5
+   echo "$as_me:9514: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -9468,12 +9535,17 @@ fi
 
 fi
 
-lt_prog_compiler_wl=
+
+
+
+
+
+  lt_prog_compiler_wl=
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -9489,17 +9561,25 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       ;;
 
     amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
 
     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -9513,6 +9593,20 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
     interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -9525,25 +9619,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       enable_shared=no
       ;;
 
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
     sysv4*MP*)
       if test -d /usr/nec; then
 	lt_prog_compiler_pic=-Kconform_pic
       fi
       ;;
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
-
     *)
       lt_prog_compiler_pic='-fPIC'
       ;;
@@ -9560,18 +9647,8 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic='-qnocommon'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-       esac
-       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -9599,18 +9676,27 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
     linux* | k*bsd*-gnu)
       case $cc_basename in
-      icc* | ecc*)
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -9623,8 +9709,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static='-non_shared'
         ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
       *)
-        case `$CC -V 2>&1 | sed 5q` in
+	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)
 	  # Sun C 5.9
 	  lt_prog_compiler_pic='-KPIC'
@@ -9642,6 +9734,17 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       esac
       ;;
 
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
     osf3* | osf4* | osf5*)
       lt_prog_compiler_wl='-Wl,'
       # All OSF/1 code is PIC.
@@ -9704,21 +9807,34 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
     esac
   fi
 
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works=no
-  ac_outfile=conftest.$ac_objext
+   ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -9730,25 +9846,25 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9733: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9849: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9737: \$? = $ac_status" >&5
+   echo "$as_me:9853: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
     case $lt_prog_compiler_pic in
@@ -9761,24 +9877,20 @@ else
 fi
 
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
+
+
+
+
+
 
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
 if test "${lt_cv_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
    save_LDFLAGS="$LDFLAGS"
@@ -9790,7 +9902,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works=yes
@@ -9799,12 +9911,12 @@ else
        lt_cv_prog_compiler_static_works=yes
      fi
    fi
-   $rm -r conftest*
+   $RM -r conftest*
    LDFLAGS="$save_LDFLAGS"
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
     :
@@ -9813,13 +9925,73 @@ else
 fi
 
 
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:9954: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:9958: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
-   $rm -r conftest 2>/dev/null
+   $RM -r conftest 2>/dev/null
    mkdir conftest
    cd conftest
    mkdir out
@@ -9834,83 +10006,93 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9837: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10009: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9841: \$? = $ac_status" >&5
+   echo "$as_me:10013: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
    chmod u+w . 2>&5
-   $rm conftest*
+   $RM conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
    cd ..
-   rmdir conftest
-   $rm conftest*
+   $RM -r conftest
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
   hard_links=yes
-  $rm conftest*
+  $RM conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
   if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
   need_locks=no
 fi
 
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   runpath_var=
   allow_undefined_flag=
-  enable_shared_with_static_runtimes=no
+  always_export_symbols=no
   archive_cmds=
   archive_expsym_cmds=
-  old_archive_From_new_cmds=
-  old_archive_from_expsyms_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
   export_dynamic_flag_spec=
-  whole_archive_flag_spec=
-  thread_safe_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
   hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
-  hardcode_direct=no
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
   link_all_deplibs=unknown
-  hardcode_automatic=no
   module_cmds=
   module_expsym_cmds=
-  always_export_symbols=no
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
   # include_expsyms should be a list of space-separated symbols to be *always*
   # included in the symbol list
   include_expsyms=
@@ -9926,19 +10108,9 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # preloaded symbol tables.
   # Exclude shared library initialization/finalization symbols.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
-  cygwin* | mingw* | pw32*)
+  cygwin* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -9964,16 +10136,16 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     export_dynamic_flag_spec='${wl}--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
+    case `$LD -v 2>&1` in
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -9987,7 +10159,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
       # On AIX/PPC, the GNU linker is very broken
       if test "$host_cpu" != ia64; then
 	ld_shlibs=no
-	cat <<EOF 1>&2
+	cat <<_LT_EOF 1>&2
 
 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
 *** to be unable to reliably create shared libraries on AIX.
@@ -9995,26 +10167,27 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 *** really care for shared libraries, you may want to modify your PATH
 *** so that a non-GNU linker is found, and then restart.
 
-EOF
+_LT_EOF
       fi
       ;;
 
     amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
       ;;
 
     beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
@@ -10024,16 +10197,16 @@ EOF
       fi
       ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
@@ -10064,48 +10237,78 @@ EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
 	tmp_addflag=
+	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
 	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
 	  tmp_addflag=' -i_dynamic -nofor_main' ;;
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
 	esac
 	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec=
+	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
       else
-	ld_shlibs=no
+        ld_shlibs=no
       fi
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
@@ -10115,9 +10318,9 @@ EOF
       ;;
 
     solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
 	ld_shlibs=no
-	cat <<EOF 1>&2
+	cat <<_LT_EOF 1>&2
 
 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
 *** create shared libraries on Solaris systems.  Therefore, libtool
@@ -10126,8 +10329,8 @@ EOF
 *** your PATH or compiler configuration so that the native linker is
 *** used, and then restart.
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
@@ -10151,10 +10354,14 @@ EOF
 _LT_EOF
 	;;
 	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -10170,7 +10377,7 @@ _LT_EOF
       ;;
 
     *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
@@ -10212,10 +10419,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
@@ -10224,10 +10431,10 @@ _LT_EOF
 	# need to do runtime linking.
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
 	  done
 	  ;;
 	esac
@@ -10244,28 +10451,30 @@ _LT_EOF
 
       archive_cmds=''
       hardcode_direct=yes
+      hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
 
       if test "$GCC" = yes; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
-  	  # We have reworked collect2
-  	  :
+	  # We have reworked collect2
+	  :
 	  else
-  	  # We have old collect2
-  	  hardcode_direct=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L=yes
-  	  hardcode_libdir_flag_spec='-L$libdir'
-  	  hardcode_libdir_separator=
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
 	  fi
 	  ;;
 	esac
@@ -10276,8 +10485,8 @@ _LT_EOF
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
 	  if test "$aix_use_runtimelinking" = yes; then
@@ -10288,6 +10497,7 @@ _LT_EOF
 	fi
       fi
 
+      export_dynamic_flag_spec='${wl}-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
@@ -10295,8 +10505,9 @@ _LT_EOF
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10317,18 +10528,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -10343,25 +10557,27 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
 	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
-	 # Determine the default libpath from the value encoded in an empty executable.
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10383,18 +10599,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -10409,12 +10628,13 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
@@ -10434,18 +10654,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
       ;;
 
     bsdi[45]*)
       export_dynamic_flag_spec=-rdynamic
       ;;
 
-    cygwin* | mingw* | pw32*)
+    cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -10457,9 +10684,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # Tell ltmain to make .dll files, not .so files.
       shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds='true'
+      old_archive_from_new_cmds='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
       fix_srcfile_path='`cygpath -w "$srcfile"`'
@@ -10467,52 +10694,30 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc=no
-      hardcode_direct=no
-      hardcode_automatic=yes
-      hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec=''
-      link_all_deplibs=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs=no
-          ;;
-      esac
-    fi
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  whole_archive_flag_spec=''
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
       ;;
 
     dgux*)
@@ -10554,9 +10759,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     hpux9*)
       if test "$GCC" = yes; then
-	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
       hardcode_libdir_separator=:
@@ -10576,11 +10781,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       if test "$with_gnu_ld" = no; then
 	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld='+b $libdir'
 	hardcode_libdir_separator=:
-
 	hardcode_direct=yes
+	hardcode_direct_absolute=yes
 	export_dynamic_flag_spec='${wl}-E'
-
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -10594,7 +10799,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -10619,12 +10824,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
 	case $host_cpu in
 	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld='+b $libdir'
 	  hardcode_direct=no
 	  hardcode_shlibpath_var=no
 	  ;;
 	*)
 	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
 	  export_dynamic_flag_spec='${wl}-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
@@ -10637,18 +10842,62 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
       else
-	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
+      inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
 	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
@@ -10666,11 +10915,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       ;;
 
+    *nto* | *qnx*)
+      ;;
+
     openbsd*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -10686,7 +10939,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
 	     ;;
 	  esac
-        fi
+	fi
       else
 	ld_shlibs=no
       fi
@@ -10696,18 +10949,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
@@ -10715,32 +10969,43 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_separator=:
       ;;
 
     solaris*)
-      no_undefined_flag=' -z text'
+      no_undefined_flag=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
-	wlarc=''
-	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
       fi
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_shlibpath_var=no
@@ -10750,7 +11015,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# The compiler driver will combine and reorder linker options,
 	# but understands `-z linker_flag'.  GCC discards it without `$wl',
 	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
 	if test "$GCC" = yes; then
 	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	else
@@ -10839,18 +11104,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       allow_undefined_flag='${wl}-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
       export_dynamic_flag_spec='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
 
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -10864,12 +11129,36 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs=no
       ;;
     esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
   fi
 
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
 test "$ld_shlibs" = no && can_build_shared=no
 
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 #
 # Do we need to explicitly link libc?
 #
@@ -10887,15 +11176,15 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $RM conftest*
       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } 2>conftest.err; then
         soname=conftest
         lib=conftest
@@ -10910,10 +11199,10 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libname=conftest
         lt_save_allow_undefined_flag=$allow_undefined_flag
         allow_undefined_flag=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
         then
 	  archive_cmds_need_lc=no
@@ -10924,30 +11213,173 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
       else
         cat conftest.err 1>&5
       fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+      $RM conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
 
 if test "$GCC" = yes; then
   case $host_os in
@@ -10955,14 +11387,14 @@ if test "$GCC" = yes; then
     *) lt_awk_arg="/^libraries:/" ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
   else
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
   fi
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
@@ -10976,7 +11408,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -10996,10 +11428,23 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[lt_foo]++; }
   if (lt_freq[lt_foo] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`echo $lt_search_path_spec`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -11036,7 +11481,7 @@ aix[4-9]*)
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
@@ -11062,9 +11507,18 @@ aix[4-9]*)
   ;;
 
 amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
   ;;
 
 beos*)
@@ -11087,25 +11541,28 @@ bsdi[45]*)
   # libtool to hard-code these into programs
   ;;
 
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
   shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
   case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
-       $rm \$dlpath'
+       $RM \$dlpath'
     shlibpath_overrides_runpath=yes
 
     case $host_os in
@@ -11114,20 +11571,20 @@ cygwin* | mingw* | pw32*)
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    mingw*)
+    mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH printed by
         # mingw gcc, but we are running on Cygwin. Gcc prints its search
         # path with ; separators, and with drive letters. We can handle the
         # drive letters (cygwin fileutils understands them), so leave them,
         # especially as we might pass files found there to a mingw objdump,
         # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
       else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
       fi
       ;;
     pw32*)
@@ -11151,7 +11608,7 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
@@ -11250,18 +11707,18 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
     shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
@@ -11338,6 +11795,64 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  shlibpath_overrides_runpath=yes
+fi
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
@@ -11345,7 +11860,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -11362,7 +11877,7 @@ netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
@@ -11383,14 +11898,16 @@ newsos6)
   shlibpath_overrides_runpath=yes
   ;;
 
-nto-qnx*)
-  version_type=linux
+*nto* | *qnx*)
+  version_type=qnx
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
   ;;
 
 openbsd*)
@@ -11399,13 +11916,13 @@ openbsd*)
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
       openbsd2.[89] | openbsd2.[89].*)
 	shlibpath_overrides_runpath=no
@@ -11477,7 +11994,6 @@ sysv4 | sysv4.3*)
     sni)
       shlibpath_overrides_runpath=no
       need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
       runpath_var=LD_RUN_PATH
       ;;
     siemens)
@@ -11508,13 +12024,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
   if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
     case $host_os in
       sco3.2v5*)
         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -11524,6 +12039,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   sys_lib_dlsearch_path_spec='/usr/lib'
   ;;
 
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -11535,43 +12061,121 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
 
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
 
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var" || \
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
    test "X$hardcode_automatic" = "Xyes" ; then
 
-  # We can hardcode non-existant directories.
+  # We can hardcode non-existent directories.
   if test "$hardcode_direct" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
      test "$hardcode_minus_L" != no; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
@@ -11584,10 +12188,11 @@ else
   # directories.
   hardcode_action=unsupported
 fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink; then
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
   # Fast installation is not supported
   enable_fast_install=no
 elif test "$shlibpath_overrides_runpath" = yes ||
@@ -11596,37 +12201,12 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         old_striplib="$STRIP -S"
-         { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-       else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-       ;;
-   *)
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-    ;;
-  esac
-fi
 
-if test "x$enable_dlopen" != xyes; then
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -11641,22 +12221,22 @@ else
     lt_cv_dlopen_self=yes
     ;;
 
-  mingw* | pw32*)
+  mingw* | pw32* | cegcc*)
     lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   cygwin*)
     lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   darwin*)
   # if libdl is installed we need to link against it
-    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -11688,33 +12268,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
 
@@ -11724,13 +12308,13 @@ else
 
 fi
 
-   ;;
+    ;;
 
   *)
-    { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
 if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -11783,38 +12367,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_shl_load=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_shl_load=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
   lt_cv_dlopen="shl_load"
 else
-  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
@@ -11846,39 +12434,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dld_shl_load=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dld_shl_load=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
 else
-  { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
 if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -11931,38 +12523,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen"
 else
-  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -11994,39 +12590,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
-  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsvld  $LIBS"
@@ -12058,39 +12658,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_svld_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_svld_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
-  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
@@ -12122,33 +12726,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dld_dld_link=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dld_dld_link=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
 fi
 
@@ -12187,18 +12795,18 @@ fi
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 12201 "configure"
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 12809 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12239,10 +12847,6 @@ else
 #  endif
 #endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
 void fnord() { int i=42;}
 int main ()
 {
@@ -12258,13 +12862,13 @@ int main ()
   else
     puts (dlerror ());
 
-    exit (status);
+  return status;
 }
-EOF
+_LT_EOF
   if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
@@ -12282,23 +12886,23 @@ rm -fr conftest*
 
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
 
     if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 12301 "configure"
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 12905 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12339,10 +12943,6 @@ else
 #  endif
 #endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
 void fnord() { int i=42;}
 int main ()
 {
@@ -12358,13 +12958,13 @@ int main ()
   else
     puts (dlerror ());
 
-    exit (status);
+  return status;
 }
-EOF
+_LT_EOF
   if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
@@ -12382,8 +12982,8 @@ rm -fr conftest*
 
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
     CPPFLAGS="$save_CPPFLAGS"
@@ -12404,9304 +13004,103 @@ echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
 fi
 
 
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix[4-9]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler \
-    CC \
-    LD \
-    lt_prog_compiler_wl \
-    lt_prog_compiler_pic \
-    lt_prog_compiler_static \
-    lt_prog_compiler_no_builtin_flag \
-    export_dynamic_flag_spec \
-    thread_safe_flag_spec \
-    whole_archive_flag_spec \
-    enable_shared_with_static_runtimes \
-    old_archive_cmds \
-    old_archive_from_new_cmds \
-    predep_objects \
-    postdep_objects \
-    predeps \
-    postdeps \
-    compiler_lib_search_path \
-    compiler_lib_search_dirs \
-    archive_cmds \
-    archive_expsym_cmds \
-    postinstall_cmds \
-    postuninstall_cmds \
-    old_archive_from_expsyms_cmds \
-    allow_undefined_flag \
-    no_undefined_flag \
-    export_symbols_cmds \
-    hardcode_libdir_flag_spec \
-    hardcode_libdir_flag_spec_ld \
-    hardcode_libdir_separator \
-    hardcode_automatic \
-    module_cmds \
-    module_expsym_cmds \
-    lt_cv_prog_compiler_c_o \
-    fix_srcfile_path \
-    exclude_expsyms \
-    include_expsyms; do
-
-    case $var in
-    old_archive_cmds | \
-    old_archive_from_new_cmds | \
-    archive_cmds | \
-    archive_expsym_cmds | \
-    module_cmds | \
-    module_expsym_cmds | \
-    old_archive_from_expsyms_cmds | \
-    export_symbols_cmds | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
-
-  cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
-
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
-  withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
-    else
-      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
-    "") ;;
-    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-
-archive_cmds_need_lc_CXX=no
-allow_undefined_flag_CXX=
-always_export_symbols_CXX=no
-archive_expsym_cmds_CXX=
-export_dynamic_flag_spec_CXX=
-hardcode_direct_CXX=no
-hardcode_libdir_flag_spec_CXX=
-hardcode_libdir_flag_spec_ld_CXX=
-hardcode_libdir_separator_CXX=
-hardcode_minus_L_CXX=no
-hardcode_shlibpath_var_CXX=unsupported
-hardcode_automatic_CXX=no
-module_cmds_CXX=
-module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
-old_archive_cmds_CXX=$old_archive_cmds
-no_undefined_flag_CXX=
-whole_archive_flag_spec_CXX=
-enable_shared_with_static_runtimes_CXX=no
-
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-compiler_lib_search_dirs_CXX=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-objext_CXX=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
-  lt_prog_compiler_no_builtin_flag_CXX=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
-else
-  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
-fi
-if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
-	;;
-      *)
-	test "$with_gnu_ld" != yes && break
-	;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
-
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec_CXX=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
-
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  aix[4-9]*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    archive_cmds_CXX=''
-    hardcode_direct_CXX=yes
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
-
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  :
-	else
-	  # We have old collect2
-	  hardcode_direct_CXX=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L_CXX=yes
-	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  hardcode_libdir_separator_CXX=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
-    fi
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    always_export_symbols_CXX=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag_CXX='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-	allow_undefined_flag_CXX="-z nodefs"
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	no_undefined_flag_CXX=' ${wl}-bernotok'
-	allow_undefined_flag_CXX=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	whole_archive_flag_spec_CXX='$convenience'
-	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag_CXX=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs_CXX=no
-    fi
-    ;;
-
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-    # as there is no search path for DLLs.
-    hardcode_libdir_flag_spec_CXX='-L$libdir'
-    allow_undefined_flag_CXX=unsupported
-    always_export_symbols_CXX=no
-    enable_shared_with_static_runtimes_CXX=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      ld_shlibs_CXX=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-      archive_cmds_need_lc_CXX=no
-      hardcode_direct_CXX=no
-      hardcode_automatic_CXX=yes
-      hardcode_shlibpath_var_CXX=unsupported
-      whole_archive_flag_spec_CXX=''
-      link_all_deplibs_CXX=yes
-      allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
-      if test "$GXX" = yes ; then
-      output_verbose_link_cmd='echo'
-      archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-      module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-      module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-        archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-        archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-      fi
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_CXX=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  freebsd[12]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    ld_shlibs_CXX=no
-    ;;
-  freebsd-elf*)
-    archive_cmds_need_lc_CXX=no
-    ;;
-  freebsd* | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    ld_shlibs_CXX=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    hardcode_direct_CXX=yes
-    hardcode_minus_L_CXX=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
-
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      ld_shlibs_CXX=no
-      ;;
-    aCC*)
-      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        ld_shlibs_CXX=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_CXX=:
-
-      case $host_cpu in
-      hppa*64*|ia64*) ;;
-      *)
-	export_dynamic_flag_spec_CXX='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      ;;
-    *)
-      hardcode_direct_CXX=yes
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
-
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
-	    case $host_cpu in
-	    hppa*64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    ia64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    *)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  interix[3-9]*)
-    hardcode_direct_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	link_all_deplibs_CXX=yes
-	;;
-    esac
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    ;;
-  linux* | k*bsd*-gnu)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	esac
-	archive_cmds_need_lc_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	;;
-      pgCC* | pgcpp*)
-        # Portland Group C++ compiler
-	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	runpath_var=LD_RUN_PATH
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C++ 5.9
-	  no_undefined_flag_CXX=' -zdefs'
-	  archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	  hardcode_libdir_flag_spec_CXX='-R$libdir'
-	  whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
-	  # Not sure whether something based on
-	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	  # would be better.
-	  output_verbose_link_cmd='echo'
-
-	  # Archives containing C++ object files must be created using
-	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	  # necessary to make sure instantiated templates are included
-	  # in the archive.
-	  old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	  ;;
-	esac
-	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      hardcode_libdir_flag_spec_CXX='-R$libdir'
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    ld_shlibs_CXX=no
-    ;;
-  openbsd*)
-    if test -f /usr/libexec/ld.so; then
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=no
-      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	export_dynamic_flag_spec_CXX='${wl}-E'
-	whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      fi
-      output_verbose_link_cmd='echo'
-    else
-      ld_shlibs_CXX=no
-    fi
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
-
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        archive_cmds_need_lc_CXX=yes
-	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-R$libdir'
-	hardcode_shlibpath_var_CXX=no
-	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
-	  *)
-	    # The compiler driver will combine and reorder linker options,
-	    # but understands `-z linker_flag'.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
-	    ;;
-	esac
-	link_all_deplibs_CXX=yes
-
-	output_verbose_link_cmd='echo'
-
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	# The C++ compiler must be used to create the archive.
-	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
-      *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
-
-	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-	  case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
-	  *)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	    ;;
-	  esac
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-    no_undefined_flag_CXX='${wl}-z,text'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    no_undefined_flag_CXX='${wl}-z,text'
-    allow_undefined_flag_CXX='${wl}-z,nodefs'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
-    export_dynamic_flag_spec_CXX='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
-
-cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
-	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
-	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
-	 else
-	   predep_objects_CXX="$predep_objects_CXX $p"
-	 fi
-       else
-	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
-	 else
-	   postdep_objects_CXX="$postdep_objects_CXX $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling CXX test program"
-fi
-
-$rm -f confest.$objext
-
-compiler_lib_search_dirs_CXX=
-if test -n "$compiler_lib_search_path_CXX"; then
-  compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-# PORTME: override above test on systems where it is broken
-case $host_os in
-interix[3-9]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  predep_objects_CXX=
-  postdep_objects_CXX=
-  postdeps_CXX=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-    #
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-
-case " $postdeps_CXX " in
-*" -lc "*) archive_cmds_need_lc_CXX=no ;;
-esac
-
-lt_prog_compiler_wl_CXX=
-lt_prog_compiler_pic_CXX=
-lt_prog_compiler_static_CXX=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
-  # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
-    lt_prog_compiler_wl_CXX='-Wl,'
-    lt_prog_compiler_static_CXX='-static'
-
-    case $host_os in
-    aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_CXX='-Bstatic'
-      fi
-      ;;
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
-      ;;
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-    mingw* | cygwin* | os2* | pw32*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
-      ;;
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
-      ;;
-    *djgpp*)
-      # DJGPP does not support shared libraries at all
-      lt_prog_compiler_pic_CXX=
-      ;;
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_CXX=-Kconform_pic
-      fi
-      ;;
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	;;
-      *)
-	lt_prog_compiler_pic_CXX='-fPIC'
-	;;
-      esac
-      ;;
-    *)
-      lt_prog_compiler_pic_CXX='-fPIC'
-      ;;
-    esac
-  else
-    case $host_os in
-      aix[4-9]*)
-	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
-	  # AIX 5 now supports IA64 processor
-	  lt_prog_compiler_static_CXX='-Bstatic'
-	else
-	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
-	fi
-	;;
-      chorus*)
-	case $cc_basename in
-	cxch68*)
-	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
-	  ;;
-	esac
-	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           lt_prog_compiler_pic_CXX='-qnocommon'
-           lt_prog_compiler_wl_CXX='-Wl,'
-           ;;
-         esac
-       ;;
-      dgux*)
-	case $cc_basename in
-	  ec++*)
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  ghcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      freebsd* | dragonfly*)
-	# FreeBSD uses GNU C++
-	;;
-      hpux9* | hpux10* | hpux11*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
-	      lt_prog_compiler_pic_CXX='+Z'
-	    fi
-	    ;;
-	  aCC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    case $host_cpu in
-	    hppa*64*|ia64*)
-	      # +Z the default
-	      ;;
-	    *)
-	      lt_prog_compiler_pic_CXX='+Z'
-	      ;;
-	    esac
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      interix*)
-	# This is c89, which is MS Visual C++ (no shared libs)
-	# Anyone wants to do a port?
-	;;
-      irix5* | irix6* | nonstopux*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    # CC pic flag -KPIC is the default.
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      linux* | k*bsd*-gnu)
-	case $cc_basename in
-	  KCC*)
-	    # KAI C++ Compiler
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    lt_prog_compiler_pic_CXX='-fPIC'
-	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-static'
-	    ;;
-	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler.
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-fpic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  cxx*)
-	    # Compaq C++
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    case `$CC -V 2>&1 | sed 5q` in
-	    *Sun\ C*)
-	      # Sun C++ 5.9
-	      lt_prog_compiler_pic_CXX='-KPIC'
-	      lt_prog_compiler_static_CXX='-Bstatic'
-	      lt_prog_compiler_wl_CXX='-Qoption ld '
-	      ;;
-	    esac
-	    ;;
-	esac
-	;;
-      lynxos*)
-	;;
-      m88k*)
-	;;
-      mvs*)
-	case $cc_basename in
-	  cxx*)
-	    lt_prog_compiler_pic_CXX='-W c,exportall'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      netbsd*)
-	;;
-      osf3* | osf4* | osf5*)
-	case $cc_basename in
-	  KCC*)
-	    lt_prog_compiler_wl_CXX='--backend -Wl,'
-	    ;;
-	  RCC*)
-	    # Rational C++ 2.4.1
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  cxx*)
-	    # Digital/Compaq C++
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    # Make sure the PIC flag is empty.  It appears that all Alpha
-	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    lt_prog_compiler_pic_CXX=
-	    lt_prog_compiler_static_CXX='-non_shared'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      psos*)
-	;;
-      solaris*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.2, 5.x and Centerline C++
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    lt_prog_compiler_wl_CXX='-Qoption ld '
-	    ;;
-	  gcx*)
-	    # Green Hills C++ Compiler
-	    lt_prog_compiler_pic_CXX='-PIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sunos4*)
-	case $cc_basename in
-	  CC*)
-	    # Sun C++ 4.x
-	    lt_prog_compiler_pic_CXX='-pic'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	  lcc*)
-	    # Lucid
-	    lt_prog_compiler_pic_CXX='-pic'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      tandem*)
-	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  *)
-	    ;;
-	esac
-	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
-	    ;;
-	esac
-	;;
-      vxworks*)
-	;;
-      *)
-	lt_prog_compiler_can_build_shared_CXX=no
-	;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_pic_works_CXX=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14702: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:14706: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_CXX=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
-    case $lt_prog_compiler_pic_CXX in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
-     esac
-else
-    lt_prog_compiler_pic_CXX=
-     lt_prog_compiler_can_build_shared_CXX=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_CXX=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_CXX=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
-    :
-else
-    lt_prog_compiler_static_CXX=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_CXX=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14806: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:14810: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_CXX=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
 
-  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix[4-9]*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
 
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_CXX" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_CXX=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_CXX in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_CXX
-	pic_flag=$lt_prog_compiler_pic_CXX
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
-        allow_undefined_flag_CXX=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_CXX=no
-        else
-	  archive_cmds_need_lc_CXX=yes
-        fi
-        allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
 
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
 
-need_lib_prefix=unknown
-hardcode_into_libs=no
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
 
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var_CXX" || \
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_CXX \
-    CC_CXX \
-    LD_CXX \
-    lt_prog_compiler_wl_CXX \
-    lt_prog_compiler_pic_CXX \
-    lt_prog_compiler_static_CXX \
-    lt_prog_compiler_no_builtin_flag_CXX \
-    export_dynamic_flag_spec_CXX \
-    thread_safe_flag_spec_CXX \
-    whole_archive_flag_spec_CXX \
-    enable_shared_with_static_runtimes_CXX \
-    old_archive_cmds_CXX \
-    old_archive_from_new_cmds_CXX \
-    predep_objects_CXX \
-    postdep_objects_CXX \
-    predeps_CXX \
-    postdeps_CXX \
-    compiler_lib_search_path_CXX \
-    compiler_lib_search_dirs_CXX \
-    archive_cmds_CXX \
-    archive_expsym_cmds_CXX \
-    postinstall_cmds_CXX \
-    postuninstall_cmds_CXX \
-    old_archive_from_expsyms_cmds_CXX \
-    allow_undefined_flag_CXX \
-    no_undefined_flag_CXX \
-    export_symbols_cmds_CXX \
-    hardcode_libdir_flag_spec_CXX \
-    hardcode_libdir_flag_spec_ld_CXX \
-    hardcode_libdir_separator_CXX \
-    hardcode_automatic_CXX \
-    module_cmds_CXX \
-    module_expsym_cmds_CXX \
-    lt_cv_prog_compiler_c_o_CXX \
-    fix_srcfile_path_CXX \
-    exclude_expsyms_CXX \
-    include_expsyms_CXX; do
-
-    case $var in
-    old_archive_cmds_CXX | \
-    old_archive_from_new_cmds_CXX | \
-    archive_cmds_CXX | \
-    archive_expsym_cmds_CXX | \
-    module_cmds_CXX | \
-    module_expsym_cmds_CXX | \
-    old_archive_from_expsyms_cmds_CXX | \
-    export_symbols_cmds_CXX | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
-      program t
-      end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix[4-9]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-GCC_F77="$G77"
-LD_F77="$LD"
-
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_F77='-Wl,'
-    lt_prog_compiler_static_F77='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_F77='-fno-common'
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_F77=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_F77=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_F77='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      else
-	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_F77='-qnocommon'
-         lt_prog_compiler_wl_F77='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-KPIC'
-	lt_prog_compiler_static_F77='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-fpic'
-	lt_prog_compiler_static_F77='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_F77='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_F77='-non_shared'
-        ;;
-      *)
-        case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic_F77='-KPIC'
-	  lt_prog_compiler_static_F77='-Bstatic'
-	  lt_prog_compiler_wl_F77='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic_F77='-KPIC'
-	  lt_prog_compiler_static_F77='-Bstatic'
-	  lt_prog_compiler_wl_F77=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_F77='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_F77='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl_F77='-Qoption ld '
-      lt_prog_compiler_pic_F77='-PIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_F77='-Kconform_pic'
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic_F77='-pic'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_pic_works_F77=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_F77"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16389: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:16393: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_F77=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
-    case $lt_prog_compiler_pic_F77 in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
-     esac
-else
-    lt_prog_compiler_pic_F77=
-     lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_F77=
-    ;;
-  *)
-    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_static_works_F77=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_F77=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_F77=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
-    :
-else
-    lt_prog_compiler_static_F77=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_F77=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16493: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:16497: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_F77=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
-  runpath_var=
-  allow_undefined_flag_F77=
-  enable_shared_with_static_runtimes_F77=no
-  archive_cmds_F77=
-  archive_expsym_cmds_F77=
-  old_archive_From_new_cmds_F77=
-  old_archive_from_expsyms_cmds_F77=
-  export_dynamic_flag_spec_F77=
-  whole_archive_flag_spec_F77=
-  thread_safe_flag_spec_F77=
-  hardcode_libdir_flag_spec_F77=
-  hardcode_libdir_flag_spec_ld_F77=
-  hardcode_libdir_separator_F77=
-  hardcode_direct_F77=no
-  hardcode_minus_L_F77=no
-  hardcode_shlibpath_var_F77=unsupported
-  link_all_deplibs_F77=unknown
-  hardcode_automatic_F77=no
-  module_cmds_F77=
-  module_expsym_cmds_F77=
-  always_export_symbols_F77=no
-  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_F77=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_F77=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_F77=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_F77=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_F77=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=no
-      enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_F77='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
-	esac
-	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_F77=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_F77=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs_F77" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_F77=
-      export_dynamic_flag_spec_F77=
-      whole_archive_flag_spec_F77=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=yes
-      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_F77=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_F77=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds_F77=''
-      hardcode_direct_F77=yes
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  :
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_F77=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_F77=yes
-  	  hardcode_libdir_flag_spec_F77='-L$libdir'
-  	  hardcode_libdir_separator_F77=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_F77=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_F77='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_F77="-z nodefs"
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_F77=' ${wl}-bernotok'
-	  allow_undefined_flag_F77=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_F77='$convenience'
-	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_F77=no
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec_F77=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_F77=' '
-      allow_undefined_flag_F77=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_F77='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_F77=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_F77=no
-      hardcode_direct_F77=no
-      hardcode_automatic_F77=yes
-      hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77=''
-      link_all_deplibs_F77=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_F77=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_F77=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_direct_F77=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	hardcode_direct_F77=yes
-	export_dynamic_flag_spec_F77='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_F77=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-	  ;;
-	*)
-	  hardcode_direct_F77=yes
-	  export_dynamic_flag_spec_F77='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      link_all_deplibs_F77=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    newsos6)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct_F77=yes
-	hardcode_shlibpath_var_F77=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec_F77='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec_F77='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-        fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      allow_undefined_flag_F77=unsupported
-      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    solaris*)
-      no_undefined_flag_F77=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_shlibpath_var_F77=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs_F77=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_F77='$CC -r -o $output$reload_objs'
-	  hardcode_direct_F77=no
-        ;;
-	motorola)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_F77=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_F77=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_F77='${wl}-z,text'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_F77='${wl}-z,text'
-      allow_undefined_flag_F77='${wl}-z,nodefs'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      ld_shlibs_F77=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_F77=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_F77 in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_F77
-	pic_flag=$lt_prog_compiler_pic_F77
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
-        allow_undefined_flag_F77=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_F77=no
-        else
-	  archive_cmds_need_lc_F77=yes
-        fi
-        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
+# FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
     else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
     ;;
   *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var_F77" || \
-   test "X$hardcode_automatic_F77" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_F77" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
-     test "$hardcode_minus_L_F77" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_F77=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_F77=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_F77 \
-    CC_F77 \
-    LD_F77 \
-    lt_prog_compiler_wl_F77 \
-    lt_prog_compiler_pic_F77 \
-    lt_prog_compiler_static_F77 \
-    lt_prog_compiler_no_builtin_flag_F77 \
-    export_dynamic_flag_spec_F77 \
-    thread_safe_flag_spec_F77 \
-    whole_archive_flag_spec_F77 \
-    enable_shared_with_static_runtimes_F77 \
-    old_archive_cmds_F77 \
-    old_archive_from_new_cmds_F77 \
-    predep_objects_F77 \
-    postdep_objects_F77 \
-    predeps_F77 \
-    postdeps_F77 \
-    compiler_lib_search_path_F77 \
-    compiler_lib_search_dirs_F77 \
-    archive_cmds_F77 \
-    archive_expsym_cmds_F77 \
-    postinstall_cmds_F77 \
-    postuninstall_cmds_F77 \
-    old_archive_from_expsyms_cmds_F77 \
-    allow_undefined_flag_F77 \
-    no_undefined_flag_F77 \
-    export_symbols_cmds_F77 \
-    hardcode_libdir_flag_spec_F77 \
-    hardcode_libdir_flag_spec_ld_F77 \
-    hardcode_libdir_separator_F77 \
-    hardcode_automatic_F77 \
-    module_cmds_F77 \
-    module_expsym_cmds_F77 \
-    lt_cv_prog_compiler_c_o_F77 \
-    fix_srcfile_path_F77 \
-    exclude_expsyms_F77 \
-    include_expsyms_F77; do
-
-    case $var in
-    old_archive_cmds_F77 | \
-    old_archive_from_new_cmds_F77 | \
-    archive_cmds_F77 | \
-    archive_expsym_cmds_F77 | \
-    module_cmds_F77 | \
-    module_expsym_cmds_F77 | \
-    old_archive_from_expsyms_cmds_F77 | \
-    export_symbols_cmds_F77 | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
     ;;
   esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
 fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
 
-# Source file extension for Java test sources.
-ac_ext=java
 
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
 
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
 
-old_archive_cmds_GCJ=$old_archive_cmds
 
 
-lt_prog_compiler_no_builtin_flag_GCJ=
 
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+  # Report which library types will actually be built
+  { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
 
+  { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
 
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18700: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:18704: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_GCJ='-Wl,'
-    lt_prog_compiler_static_GCJ='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_GCJ='-fno-common'
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_GCJ=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_GCJ=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_GCJ='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_GCJ='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      else
-	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_GCJ='-qnocommon'
-         lt_prog_compiler_wl_GCJ='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_GCJ='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-KPIC'
-	lt_prog_compiler_static_GCJ='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-fpic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_GCJ='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_GCJ='-non_shared'
-        ;;
-      *)
-        case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic_GCJ='-KPIC'
-	  lt_prog_compiler_static_GCJ='-Bstatic'
-	  lt_prog_compiler_wl_GCJ='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic_GCJ='-KPIC'
-	  lt_prog_compiler_static_GCJ='-Bstatic'
-	  lt_prog_compiler_wl_GCJ=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_GCJ='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl_GCJ='-Qoption ld '
-      lt_prog_compiler_pic_GCJ='-PIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_GCJ='-Kconform_pic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic_GCJ='-pic'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_pic_works_GCJ=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18990: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:18994: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_GCJ=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
-    case $lt_prog_compiler_pic_GCJ in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
-     esac
-else
-    lt_prog_compiler_pic_GCJ=
-     lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_GCJ=
-    ;;
-  *)
-    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_static_works_GCJ=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_GCJ=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_GCJ=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
-    :
-else
-    lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_GCJ=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19094: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:19098: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_GCJ=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
-  runpath_var=
-  allow_undefined_flag_GCJ=
-  enable_shared_with_static_runtimes_GCJ=no
-  archive_cmds_GCJ=
-  archive_expsym_cmds_GCJ=
-  old_archive_From_new_cmds_GCJ=
-  old_archive_from_expsyms_cmds_GCJ=
-  export_dynamic_flag_spec_GCJ=
-  whole_archive_flag_spec_GCJ=
-  thread_safe_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_ld_GCJ=
-  hardcode_libdir_separator_GCJ=
-  hardcode_direct_GCJ=no
-  hardcode_minus_L_GCJ=no
-  hardcode_shlibpath_var_GCJ=unsupported
-  link_all_deplibs_GCJ=unknown
-  hardcode_automatic_GCJ=no
-  module_cmds_GCJ=
-  module_expsym_cmds_GCJ=
-  always_export_symbols_GCJ=no
-  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_GCJ=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
   case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_GCJ=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_GCJ=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_GCJ=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=no
-      enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
-	esac
-	archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_GCJ=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_GCJ=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs_GCJ" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_GCJ=
-      export_dynamic_flag_spec_GCJ=
-      whole_archive_flag_spec_GCJ=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=yes
-      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_GCJ=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_GCJ=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds_GCJ=''
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  :
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_GCJ=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_GCJ=yes
-  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
-  	  hardcode_libdir_separator_GCJ=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_GCJ=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_GCJ='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_GCJ="-z nodefs"
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_GCJ=' ${wl}-bernotok'
-	  allow_undefined_flag_GCJ=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_GCJ='$convenience'
-	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_GCJ=no
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec_GCJ=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ=' '
-      allow_undefined_flag_GCJ=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_GCJ='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_GCJ=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_GCJ=no
-      hardcode_direct_GCJ=no
-      hardcode_automatic_GCJ=yes
-      hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ=''
-      link_all_deplibs_GCJ=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_GCJ=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_GCJ=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_direct_GCJ=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
-
-	hardcode_direct_GCJ=yes
-	export_dynamic_flag_spec_GCJ='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_GCJ=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-	  hardcode_direct_GCJ=no
-	  hardcode_shlibpath_var_GCJ=no
-	  ;;
-	*)
-	  hardcode_direct_GCJ=yes
-	  export_dynamic_flag_spec_GCJ='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_GCJ=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      link_all_deplibs_GCJ=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    newsos6)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct_GCJ=yes
-	hardcode_shlibpath_var_GCJ=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec_GCJ='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec_GCJ='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-        fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      allow_undefined_flag_GCJ=unsupported
-      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_GCJ=:
-      ;;
-
-    solaris*)
-      no_undefined_flag_GCJ=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs_GCJ=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
-	  hardcode_direct_GCJ=no
-        ;;
-	motorola)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_GCJ=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_GCJ=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_GCJ='${wl}-z,text'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_GCJ='${wl}-z,text'
-      allow_undefined_flag_GCJ='${wl}-z,nodefs'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    *)
-      ld_shlibs_GCJ=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_GCJ=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_GCJ in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_GCJ
-	pic_flag=$lt_prog_compiler_pic_GCJ
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
-        allow_undefined_flag_GCJ=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_GCJ=no
-        else
-	  archive_cmds_need_lc_GCJ=yes
-        fi
-        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
     fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
     ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var_GCJ" || \
-   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_GCJ" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
-     test "$hardcode_minus_L_GCJ" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_GCJ=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_GCJ=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_GCJ=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_GCJ \
-    CC_GCJ \
-    LD_GCJ \
-    lt_prog_compiler_wl_GCJ \
-    lt_prog_compiler_pic_GCJ \
-    lt_prog_compiler_static_GCJ \
-    lt_prog_compiler_no_builtin_flag_GCJ \
-    export_dynamic_flag_spec_GCJ \
-    thread_safe_flag_spec_GCJ \
-    whole_archive_flag_spec_GCJ \
-    enable_shared_with_static_runtimes_GCJ \
-    old_archive_cmds_GCJ \
-    old_archive_from_new_cmds_GCJ \
-    predep_objects_GCJ \
-    postdep_objects_GCJ \
-    predeps_GCJ \
-    postdeps_GCJ \
-    compiler_lib_search_path_GCJ \
-    compiler_lib_search_dirs_GCJ \
-    archive_cmds_GCJ \
-    archive_expsym_cmds_GCJ \
-    postinstall_cmds_GCJ \
-    postuninstall_cmds_GCJ \
-    old_archive_from_expsyms_cmds_GCJ \
-    allow_undefined_flag_GCJ \
-    no_undefined_flag_GCJ \
-    export_symbols_cmds_GCJ \
-    hardcode_libdir_flag_spec_GCJ \
-    hardcode_libdir_flag_spec_ld_GCJ \
-    hardcode_libdir_separator_GCJ \
-    hardcode_automatic_GCJ \
-    module_cmds_GCJ \
-    module_expsym_cmds_GCJ \
-    lt_cv_prog_compiler_c_o_GCJ \
-    fix_srcfile_path_GCJ \
-    exclude_expsyms_GCJ \
-    include_expsyms_GCJ; do
-
-    case $var in
-    old_archive_cmds_GCJ | \
-    old_archive_from_new_cmds_GCJ | \
-    archive_cmds_GCJ | \
-    archive_expsym_cmds_GCJ | \
-    module_cmds_GCJ | \
-    module_expsym_cmds_GCJ | \
-    old_archive_from_expsyms_cmds_GCJ | \
-    export_symbols_cmds_GCJ | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_RC \
-    CC_RC \
-    LD_RC \
-    lt_prog_compiler_wl_RC \
-    lt_prog_compiler_pic_RC \
-    lt_prog_compiler_static_RC \
-    lt_prog_compiler_no_builtin_flag_RC \
-    export_dynamic_flag_spec_RC \
-    thread_safe_flag_spec_RC \
-    whole_archive_flag_spec_RC \
-    enable_shared_with_static_runtimes_RC \
-    old_archive_cmds_RC \
-    old_archive_from_new_cmds_RC \
-    predep_objects_RC \
-    postdep_objects_RC \
-    predeps_RC \
-    postdeps_RC \
-    compiler_lib_search_path_RC \
-    compiler_lib_search_dirs_RC \
-    archive_cmds_RC \
-    archive_expsym_cmds_RC \
-    postinstall_cmds_RC \
-    postuninstall_cmds_RC \
-    old_archive_from_expsyms_cmds_RC \
-    allow_undefined_flag_RC \
-    no_undefined_flag_RC \
-    export_symbols_cmds_RC \
-    hardcode_libdir_flag_spec_RC \
-    hardcode_libdir_flag_spec_ld_RC \
-    hardcode_libdir_separator_RC \
-    hardcode_automatic_RC \
-    module_cmds_RC \
-    module_expsym_cmds_RC \
-    lt_cv_prog_compiler_c_o_RC \
-    fix_srcfile_path_RC \
-    exclude_expsyms_RC \
-    include_expsyms_RC; do
-
-    case $var in
-    old_archive_cmds_RC | \
-    old_archive_from_new_cmds_RC | \
-    archive_cmds_RC | \
-    archive_expsym_cmds_RC | \
-    module_cmds_RC | \
-    module_expsym_cmds_RC | \
-    old_archive_from_expsyms_cmds_RC | \
-    export_symbols_cmds_RC | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
     ;;
   esac
+  { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
 
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
+  { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
 fi
-
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -21710,46 +13109,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 CC="$lt_save_CC"
 
-	;;
-
-      *)
-	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
 
 
 
@@ -21762,10 +13121,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
+        ac_config_commands="$ac_config_commands libtool"
 
 
 
 
+# Only expand once:
 
 
 # Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
@@ -21775,10 +13136,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 # Josh Triplett <josh at freedesktop.org>
 # Extract the first word of "bash", so it can be a program name with args.
 set dummy bash; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_DOLT_BASH+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $DOLT_BASH in
   [\\/]* | ?:[\\/]*)
@@ -21793,7 +13154,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DOLT_BASH="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -21805,16 +13166,16 @@ esac
 fi
 DOLT_BASH=$ac_cv_path_DOLT_BASH
 if test -n "$DOLT_BASH"; then
-  { echo "$as_me:$LINENO: result: $DOLT_BASH" >&5
-echo "${ECHO_T}$DOLT_BASH" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $DOLT_BASH" >&5
+$as_echo "$DOLT_BASH" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-{ echo "$as_me:$LINENO: checking if dolt supports this host" >&5
-echo $ECHO_N "checking if dolt supports this host... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if dolt supports this host" >&5
+$as_echo_n "checking if dolt supports this host... " >&6; }
 dolt_supported=yes
 if test x$DOLT_BASH = x; then
     dolt_supported=no
@@ -21835,13 +13196,13 @@ i?86-apple-darwin*)
     ;;
 esac
 if test x$dolt_supported = xno ; then
-    { echo "$as_me:$LINENO: result: no, falling back to libtool" >&5
-echo "${ECHO_T}no, falling back to libtool" >&6; }
+    { $as_echo "$as_me:$LINENO: result: no, falling back to libtool" >&5
+$as_echo "no, falling back to libtool" >&6; }
     LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
     LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
 else
-    { echo "$as_me:$LINENO: result: yes, replacing libtool" >&5
-echo "${ECHO_T}yes, replacing libtool" >&6; }
+    { $as_echo "$as_me:$LINENO: result: yes, replacing libtool" >&5
+$as_echo "yes, replacing libtool" >&6; }
 
     cat <<__DOLTCOMPILE__EOF__ >doltcompile
 #!$DOLT_BASH
@@ -21973,6 +13334,7 @@ export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec)
 
 # Test whenever ld supports -version-script
 
+
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then
   withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
@@ -21983,8 +13345,8 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -21997,9 +13359,9 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -22013,14 +13375,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -22050,19 +13412,19 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
@@ -22074,29 +13436,15 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
 
 if test "x$lt_cv_prog_gnu_ld" = "xno"; then
    no_version_script=yes
@@ -22123,20 +13471,21 @@ fi
 
 for ac_header in sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22152,32 +13501,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22191,69 +13541,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -22270,20 +13624,21 @@ done
 
 for ac_header in sys/user.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22299,32 +13654,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22338,69 +13694,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -22409,17 +13769,17 @@ done
 
 
 if test "${ac_cv_header_zlib_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
 if test "${ac_cv_header_zlib_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking zlib.h usability" >&5
-echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5
+$as_echo_n "checking zlib.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22435,32 +13795,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking zlib.h presence" >&5
-echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5
+$as_echo_n "checking zlib.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22474,66 +13835,67 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: zlib.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: zlib.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for zlib.h" >&5
-echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5
+$as_echo_n "checking for zlib.h... " >&6; }
 if test "${ac_cv_header_zlib_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_zlib_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
+$as_echo "$ac_cv_header_zlib_h" >&6; }
 
 fi
-if test $ac_cv_header_zlib_h = yes; then
+if test "x$ac_cv_header_zlib_h" = x""yes; then
   have_zlib=yes
 else
   have_zlib=no
@@ -22569,29 +13931,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-	{ echo "$as_me:$LINENO: result: Using system zlib" >&5
-echo "${ECHO_T}Using system zlib" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: Using system zlib" >&5
+$as_echo "Using system zlib" >&6; }
 	zlib_msg="system zlib"
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-	{ echo "$as_me:$LINENO: result: Using embedded zlib" >&5
-echo "${ECHO_T}Using embedded zlib" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: Using embedded zlib" >&5
+$as_echo "Using embedded zlib" >&6; }
 	have_zlib=no
 	zlib_msg="bundled zlib"
 
@@ -22618,20 +13981,21 @@ _ACEOF
 
 for ac_header in elf.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22647,32 +14011,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22686,69 +14051,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -22760,20 +14129,21 @@ done
 
 for ac_header in poll.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22789,32 +14159,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22828,69 +14199,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -22900,20 +14275,21 @@ done
 
 for ac_header in sys/poll.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22929,32 +14305,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22968,69 +14345,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -23040,20 +14421,21 @@ done
 
 for ac_header in sys/wait.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23069,32 +14451,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23108,69 +14491,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -23180,20 +14567,21 @@ done
 
 for ac_header in grp.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23209,32 +14597,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23248,69 +14637,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -23320,20 +14713,21 @@ done
 
 for ac_header in syslog.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23349,32 +14743,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23388,69 +14783,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -23462,20 +14861,21 @@ done
 
 for ac_header in wchar.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23491,32 +14891,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23530,69 +14931,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -23602,20 +15007,21 @@ done
 
 for ac_header in ieeefp.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23631,32 +15037,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23670,77 +15077,81 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
 done
 
-{ echo "$as_me:$LINENO: checking for isinf" >&5
-echo $ECHO_N "checking for isinf... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for isinf" >&5
+$as_echo_n "checking for isinf... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -23764,21 +15175,24 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ISINF 1
@@ -23786,83 +15200,30 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 	# We'll have to use signals
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 
 # not 64 bit clean in cross-compile
-{ echo "$as_me:$LINENO: checking for void *" >&5
-echo $ECHO_N "checking for void *... $ECHO_C" >&6; }
-if test "${ac_cv_type_void_p+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef void * ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_void_p=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_void_p=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
-echo "${ECHO_T}$ac_cv_type_void_p" >&6; }
-
 # 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.
-{ echo "$as_me:$LINENO: checking size of void *" >&5
-echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of void *" >&5
+$as_echo_n "checking size of void *... " >&6; }
 if test "${ac_cv_sizeof_void_p+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -23873,11 +15234,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -23890,13 +15250,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -23910,11 +15271,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -23927,20 +15287,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -23954,7 +15315,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -23964,11 +15325,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)];
 test_array [0] = 0
 
   ;
@@ -23981,13 +15341,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -24001,11 +15362,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24018,20 +15378,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -24045,7 +15406,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -24065,11 +15426,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -24082,20 +15442,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -24106,11 +15467,13 @@ done
 case $ac_lo in
 ?*) ac_cv_sizeof_void_p=$ac_lo;;
 '') if test "$ac_cv_type_void_p" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
+$as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi ;;
@@ -24123,9 +15486,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef void * ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (void *)); }
+static unsigned long int ulongval () { return (long int) (sizeof (void *)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -24135,20 +15497,22 @@ main ()
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (void *))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (void *))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (void *))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -24161,43 +15525,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_void_p=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_void_p" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (void *)
+$as_echo "$as_me: error: cannot compute sizeof (void *)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_void_p=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
-echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
+$as_echo "$ac_cv_sizeof_void_p" >&6; }
 
 
 
@@ -24215,8 +15584,8 @@ if test x"$GCC" = xyes; then
 
 		ORIG_CFLAGS=$CFLAGS
 		CFLAGS="$CFLAGS -Wdeclaration-after-statement"
-		{ echo "$as_me:$LINENO: checking for -Wdeclaration-after-statement option to gcc" >&5
-echo $ECHO_N "checking for -Wdeclaration-after-statement option to gcc... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for -Wdeclaration-after-statement option to gcc" >&5
+$as_echo_n "checking for -Wdeclaration-after-statement option to gcc... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24240,28 +15609,29 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-		   { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		   { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		   { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		   { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 		   CFLAGS=$ORIG_CFLAGS
 
 fi
@@ -24299,16 +15669,16 @@ fi
 
 
 if test x"$do_solaris_tar_check" = xyes; then
-   	{ echo "$as_me:$LINENO: checking integrity of package" >&5
-echo $ECHO_N "checking integrity of package... $ECHO_C" >&6; }
+   	{ $as_echo "$as_me:$LINENO: checking integrity of package" >&5
+$as_echo_n "checking integrity of package... " >&6; }
    	if test -f $srcdir/$mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
    	then
-		{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
    	else
 		errorm="Your mono distribution is incomplete;  if unpacking from a tar file, make sure you use GNU tar;  see http://www.mono-project.com/IncompletePackage for more details"
-		{ { echo "$as_me:$LINENO: error: $errorm" >&5
-echo "$as_me: error: $errorm" >&2;}
+		{ { $as_echo "$as_me:$LINENO: error: $errorm" >&5
+$as_echo "$as_me: error: $errorm" >&2;}
    { (exit 1); exit 1; }; }
 	fi
 fi
@@ -24343,8 +15713,8 @@ fi
 # gettext: prepare the translation directories.
 # we do not configure the full gettext, as we consume it dynamically from C#
 
-  { echo "$as_me:$LINENO: checking whether NLS is requested" >&5
-echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
     # Check whether --enable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval=$enable_nls; USE_NLS=$enableval
@@ -24352,8 +15722,8 @@ else
   USE_NLS=yes
 fi
 
-  { echo "$as_me:$LINENO: result: $USE_NLS" >&5
-echo "${ECHO_T}$USE_NLS" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $USE_NLS" >&5
+$as_echo "$USE_NLS" >&6; }
 
 
 
@@ -24393,10 +15763,10 @@ rm -f conf$$.file
 
 # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_MSGFMT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case "$MSGFMT" in
   [\\/]* | ?:[\\/]*)
@@ -24425,19 +15795,19 @@ esac
 fi
 MSGFMT="$ac_cv_path_MSGFMT"
 if test "$MSGFMT" != ":"; then
-  { echo "$as_me:$LINENO: result: $MSGFMT" >&5
-echo "${ECHO_T}$MSGFMT" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $MSGFMT" >&5
+$as_echo "$MSGFMT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_GMSGFMT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $GMSGFMT in
   [\\/]* | ?:[\\/]*)
@@ -24452,7 +15822,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -24465,11 +15835,11 @@ esac
 fi
 GMSGFMT=$ac_cv_path_GMSGFMT
 if test -n "$GMSGFMT"; then
-  { echo "$as_me:$LINENO: result: $GMSGFMT" >&5
-echo "${ECHO_T}$GMSGFMT" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $GMSGFMT" >&5
+$as_echo "$GMSGFMT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -24516,10 +15886,10 @@ rm -f conf$$.file
 
 # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_XGETTEXT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case "$XGETTEXT" in
   [\\/]* | ?:[\\/]*)
@@ -24548,11 +15918,11 @@ esac
 fi
 XGETTEXT="$ac_cv_path_XGETTEXT"
 if test "$XGETTEXT" != ":"; then
-  { echo "$as_me:$LINENO: result: $XGETTEXT" >&5
-echo "${ECHO_T}$XGETTEXT" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $XGETTEXT" >&5
+$as_echo "$XGETTEXT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
     rm -f messages.po
@@ -24594,10 +15964,10 @@ rm -f conf$$.file
 
 # Extract the first word of "msgmerge", so it can be a program name with args.
 set dummy msgmerge; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_MSGMERGE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case "$MSGMERGE" in
   [\\/]* | ?:[\\/]*)
@@ -24625,11 +15995,11 @@ esac
 fi
 MSGMERGE="$ac_cv_path_MSGMERGE"
 if test "$MSGMERGE" != ":"; then
-  { echo "$as_me:$LINENO: result: $MSGMERGE" >&5
-echo "${ECHO_T}$MSGMERGE" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $MSGMERGE" >&5
+$as_echo "$MSGMERGE" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -24646,10 +16016,10 @@ fi
 if test "x$USE_NLS" = "xyes"; then
    # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_HAVE_MSGFMT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$HAVE_MSGFMT"; then
   ac_cv_prog_HAVE_MSGFMT="$HAVE_MSGFMT" # Let the user override the test.
@@ -24662,7 +16032,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_HAVE_MSGFMT="yes"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -24674,18 +16044,18 @@ fi
 fi
 HAVE_MSGFMT=$ac_cv_prog_HAVE_MSGFMT
 if test -n "$HAVE_MSGFMT"; then
-  { echo "$as_me:$LINENO: result: $HAVE_MSGFMT" >&5
-echo "${ECHO_T}$HAVE_MSGFMT" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $HAVE_MSGFMT" >&5
+$as_echo "$HAVE_MSGFMT" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 
    if test "x$HAVE_MSGFMT" = "xno"; then
-	  { { echo "$as_me:$LINENO: error: msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure." >&5
-echo "$as_me: error: msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure." >&2;}
+	  { { $as_echo "$as_me:$LINENO: error: msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure." >&5
+$as_echo "$as_me: error: msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure." >&2;}
    { (exit 1); exit 1; }; }
    fi
 fi
@@ -24709,10 +16079,10 @@ esac
 
 # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
   [\\/]* | ?:[\\/]*)
@@ -24727,7 +16097,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -24740,17 +16110,17 @@ esac
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
 if test "x$PKG_CONFIG" = "xno"; then
-	{ { echo "$as_me:$LINENO: error: You need to install pkg-config" >&5
-echo "$as_me: error: You need to install pkg-config" >&2;}
+	{ { $as_echo "$as_me:$LINENO: error: You need to install pkg-config" >&5
+$as_echo "$as_me: error: You need to install pkg-config" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -24791,7 +16161,9 @@ embedded)
   GMODULE_CFLAGS="$GLIB_CFLAGS"
   GMODULE_LIBS="$GLIB_LIBS"
   eglib_dir=eglib
-  subdirs="$subdirs eglib"
+
+
+subdirs="$subdirs eglib"
 
   ;;
 system)
@@ -24815,14 +16187,14 @@ system)
     GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
     GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
   else
-    { { echo "$as_me:$LINENO: error: You need at least glib-2.0 $GLIB_REQUIRED_VERSION" >&5
-echo "$as_me: error: You need at least glib-2.0 $GLIB_REQUIRED_VERSION" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: You need at least glib-2.0 $GLIB_REQUIRED_VERSION" >&5
+$as_echo "$as_me: error: You need at least glib-2.0 $GLIB_REQUIRED_VERSION" >&2;}
    { (exit 1); exit 1; }; }
   fi
   ;;
 *)
-  { { echo "$as_me:$LINENO: error: Invalid argument to --with-glib." >&5
-echo "$as_me: error: Invalid argument to --with-glib." >&2;}
+  { { $as_echo "$as_me:$LINENO: error: Invalid argument to --with-glib." >&5
+$as_echo "$as_me: error: Invalid argument to --with-glib." >&2;}
    { (exit 1); exit 1; }; }
 esac
  if test x$with_glib = xembedded; then
@@ -24843,34 +16215,34 @@ fi
 
 
 if test x$cross_compiling$platform_win32 = xnoyes; then
-   { echo "$as_me:$LINENO: checking for cygwin glib2-dev package" >&5
-echo $ECHO_N "checking for cygwin glib2-dev package... $ECHO_C" >&6; }
+   { $as_echo "$as_me:$LINENO: checking for cygwin glib2-dev package" >&5
+$as_echo_n "checking for cygwin glib2-dev package... " >&6; }
    if  cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ; then
-      { echo "$as_me:$LINENO: result: found" >&5
-echo "${ECHO_T}found" >&6; }
-	  { { echo "$as_me:$LINENO: error: Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure." >&5
-echo "$as_me: error: Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure." >&2;}
+      { $as_echo "$as_me:$LINENO: result: found" >&5
+$as_echo "found" >&6; }
+	  { { $as_echo "$as_me:$LINENO: error: Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure." >&5
+$as_echo "$as_me: error: Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure." >&2;}
    { (exit 1); exit 1; }; }
    else
-      { echo "$as_me:$LINENO: result: not found" >&5
-echo "${ECHO_T}not found" >&6; }
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
+$as_echo "not found" >&6; }
    fi
 
-   { echo "$as_me:$LINENO: checking for broken gwin32.h" >&5
-echo $ECHO_N "checking for broken gwin32.h... $ECHO_C" >&6; }
+   { $as_echo "$as_me:$LINENO: checking for broken gwin32.h" >&5
+$as_echo_n "checking for broken gwin32.h... " >&6; }
    glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
    if test -f $glib_include/glib/gwin32.h; then
 	  if  grep ftruncate $glib_include/glib/gwin32.h | grep -q define ; then
-		 { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
+		 { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
 		 hashmark='#'
-		 { { echo "$as_me:$LINENO: error: Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark   define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure." >&5
-echo "$as_me: error: Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark   define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure." >&2;}
+		 { { $as_echo "$as_me:$LINENO: error: Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark   define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure." >&5
+$as_echo "$as_me: error: Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark   define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure." >&2;}
    { (exit 1); exit 1; }; }
 	  fi
    fi
-   { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+   { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 fi
 
 
@@ -24954,8 +16326,8 @@ _ACEOF
 
 	ORIG_CFLAGS=$CFLAGS
 	CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
-	{ echo "$as_me:$LINENO: checking for -mno-tls-direct-seg-refs option to gcc" >&5
-echo $ECHO_N "checking for -mno-tls-direct-seg-refs option to gcc... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for -mno-tls-direct-seg-refs option to gcc" >&5
+$as_echo_n "checking for -mno-tls-direct-seg-refs option to gcc... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -24979,30 +16351,31 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-	   { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	   { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 	   # Pass it to libgc as well
 	   CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs"
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-	   { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	   { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 	   CFLAGS=$ORIG_CFLAGS
 
 fi
@@ -25025,8 +16398,8 @@ if test "${enable_minimal+set}" = set; then
   enableval=$enable_minimal;
 	for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
 		eval "mono_feature_disable_$feature='yes'"
-		{ echo "$as_me:$LINENO: Disabled support for feature: $feature" >&5
-echo "$as_me: Disabled support for feature: $feature" >&6;}
+		{ $as_echo "$as_me:$LINENO: Disabled support for feature: $feature" >&5
+$as_echo "$as_me: Disabled support for feature: $feature" >&6;}
 	done
 	DISABLED_FEATURES=$enable_minimal
 	disabled="Disabled:    $enable_minimal"
@@ -25178,8 +16551,8 @@ _ACEOF
 
 fi
 
-{ echo "$as_me:$LINENO: checking for visibility __attribute__" >&5
-echo $ECHO_N "checking for visibility __attribute__... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for visibility __attribute__" >&5
+$as_echo_n "checking for visibility __attribute__... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25204,30 +16577,31 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
    have_visibility_hidden=yes
-   { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+   { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
    have_visibility_hidden=no
-   { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+   { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -25252,20 +16626,21 @@ case "x$gc" in
 
 for ac_header in gc.h gc/gc.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25281,32 +16656,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -25320,79 +16696,83 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
  gc_headers=yes
 fi
 
 done
 
-		{ echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5
-echo $ECHO_N "checking for GC_malloc in -lgc... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for GC_malloc in -lgc" >&5
+$as_echo_n "checking for GC_malloc in -lgc... " >&6; }
 if test "${ac_cv_lib_gc_GC_malloc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgc $libdl $LIBS"
@@ -25424,45 +16804,49 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_gc_GC_malloc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_gc_GC_malloc=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5
-echo "${ECHO_T}$ac_cv_lib_gc_GC_malloc" >&6; }
-if test $ac_cv_lib_gc_GC_malloc = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_malloc" >&5
+$as_echo "$ac_cv_lib_gc_GC_malloc" >&6; }
+if test "x$ac_cv_lib_gc_GC_malloc" = x""yes; then
   found_boehm="yes"
 fi
 
 
 		if test "x$found_boehm" != "xyes"; then
-			{ { echo "$as_me:$LINENO: error: \"GC requested but libgc not found! Install libgc or run configure with --with-gc=none.\"" >&5
-echo "$as_me: error: \"GC requested but libgc not found! Install libgc or run configure with --with-gc=none.\"" >&2;}
+			{ { $as_echo "$as_me:$LINENO: error: \"GC requested but libgc not found! Install libgc or run configure with --with-gc=none.\"" >&5
+$as_echo "$as_me: error: \"GC requested but libgc not found! Install libgc or run configure with --with-gc=none.\"" >&2;}
    { (exit 1); exit 1; }; }
 		fi
 		if test "x$gc_headers" != "xyes"; then
-			{ { echo "$as_me:$LINENO: error: \"GC requested but header files not found! You may need to install them by hand.\"" >&5
-echo "$as_me: error: \"GC requested but header files not found! You may need to install them by hand.\"" >&2;}
+			{ { $as_echo "$as_me:$LINENO: error: \"GC requested but header files not found! You may need to install them by hand.\"" >&5
+$as_echo "$as_me: error: \"GC requested but header files not found! You may need to install them by hand.\"" >&2;}
    { (exit 1); exit 1; }; }
 		fi
 
@@ -25476,10 +16860,10 @@ _ACEOF
 		LIBGC_STATIC_LIBS="$LIBGC_LIBS"
 
 		# AC_CHECK_FUNCS does not work for some reason...
-		{ echo "$as_me:$LINENO: checking for GC_gcj_malloc in -lgc" >&5
-echo $ECHO_N "checking for GC_gcj_malloc in -lgc... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for GC_gcj_malloc in -lgc" >&5
+$as_echo_n "checking for GC_gcj_malloc in -lgc... " >&6; }
 if test "${ac_cv_lib_gc_GC_gcj_malloc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgc $libdl $LIBS"
@@ -25511,33 +16895,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_gc_GC_gcj_malloc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_gc_GC_gcj_malloc=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_gcj_malloc" >&5
-echo "${ECHO_T}$ac_cv_lib_gc_GC_gcj_malloc" >&6; }
-if test $ac_cv_lib_gc_GC_gcj_malloc = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_gcj_malloc" >&5
+$as_echo "$ac_cv_lib_gc_GC_gcj_malloc" >&6; }
+if test "x$ac_cv_lib_gc_GC_gcj_malloc" = x""yes; then
   found_gcj_malloc="yes"
 fi
 
@@ -25559,10 +16947,10 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 		fi
-		{ echo "$as_me:$LINENO: checking for GC_enable in -lgc" >&5
-echo $ECHO_N "checking for GC_enable in -lgc... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for GC_enable in -lgc" >&5
+$as_echo_n "checking for GC_enable in -lgc... " >&6; }
 if test "${ac_cv_lib_gc_GC_enable+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgc $libdl $LIBS"
@@ -25594,33 +16982,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_gc_GC_enable=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_gc_GC_enable=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_enable" >&5
-echo "${ECHO_T}$ac_cv_lib_gc_GC_enable" >&6; }
-if test $ac_cv_lib_gc_GC_enable = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gc_GC_enable" >&5
+$as_echo "$ac_cv_lib_gc_GC_enable" >&6; }
+if test "x$ac_cv_lib_gc_GC_enable" = x""yes; then
   found_gc_enable="yes"
 fi
 
@@ -25714,8 +17106,8 @@ _ACEOF
 		;;
 
 	xnone)
-		{ echo "$as_me:$LINENO: WARNING: \"Compiling mono without GC.\"" >&5
-echo "$as_me: WARNING: \"Compiling mono without GC.\"" >&2;}
+		{ $as_echo "$as_me:$LINENO: WARNING: \"Compiling mono without GC.\"" >&5
+$as_echo "$as_me: WARNING: \"Compiling mono without GC.\"" >&2;}
 
 cat >>confdefs.h <<_ACEOF
 #define USED_GC_NAME "none"
@@ -25728,8 +17120,8 @@ _ACEOF
 
 		;;
 	*)
-		{ { echo "$as_me:$LINENO: error: Invalid argument to --with-gc." >&5
-echo "$as_me: error: Invalid argument to --with-gc." >&2;}
+		{ { $as_echo "$as_me:$LINENO: error: Invalid argument to --with-gc." >&5
+$as_echo "$as_me: error: Invalid argument to --with-gc." >&2;}
    { (exit 1); exit 1; }; }
 		;;
 esac
@@ -25763,10 +17155,10 @@ fi
 
 if test x$platform_win32 = xno; then
 
-		{ echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
-echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
 if test "${ac_cv_search_clock_gettime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -25804,26 +17196,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_clock_gettime=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_clock_gettime+set}" = set; then
@@ -25838,8 +17234,8 @@ fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5
-echo "${ECHO_T}$ac_cv_search_clock_gettime" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
 ac_res=$ac_cv_search_clock_gettime
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -25847,10 +17243,10 @@ if test "$ac_res" != no; then
 fi
 
 
-		{ echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
 if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -25903,38 +17299,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
   DL_LIB=""
 else
-  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -25966,33 +17366,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   DL_LIB="-ldl"
 else
   dl_support=no
@@ -26002,8 +17406,8 @@ fi
 fi
 
 	if test x$dl_support = xno; then
-		{ echo "$as_me:$LINENO: WARNING: No dynamic loading support available" >&5
-echo "$as_me: WARNING: No dynamic loading support available" >&2;}
+		{ $as_echo "$as_me:$LINENO: WARNING: No dynamic loading support available" >&5
+$as_echo "$as_me: WARNING: No dynamic loading support available" >&2;}
 	else
 		LIBS="$LIBS $DL_LIB"
 
@@ -26011,18 +17415,20 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_DL_LOADER 1
 _ACEOF
 
-				{ echo "$as_me:$LINENO: checking for preceeding underscore in symbols" >&5
-echo $ECHO_N "checking for preceeding underscore in symbols... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for preceeding underscore in symbols" >&5
+$as_echo_n "checking for preceeding underscore in symbols... " >&6; }
 if test "${mono_cv_uscore+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
 
 			if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26047,47 +17453,50 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   mono_cv_uscore=yes
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 mono_cv_uscore=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 
 fi
-{ echo "$as_me:$LINENO: result: $mono_cv_uscore" >&5
-echo "${ECHO_T}$mono_cv_uscore" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $mono_cv_uscore" >&5
+$as_echo "$mono_cv_uscore" >&6; }
 		if test "x$mono_cv_uscore" = "xyes"; then
 			MONO_DL_NEED_USCORE=1
 		else
 			MONO_DL_NEED_USCORE=0
 		fi
 
-		{ echo "$as_me:$LINENO: checking for dlerror" >&5
-echo $ECHO_N "checking for dlerror... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for dlerror" >&5
+$as_echo_n "checking for dlerror... " >&6; }
 if test "${ac_cv_func_dlerror+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26140,31 +17549,35 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_dlerror=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_dlerror=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlerror" >&5
-echo "${ECHO_T}$ac_cv_func_dlerror" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlerror" >&5
+$as_echo "$ac_cv_func_dlerror" >&6; }
 
 	fi
 
@@ -26188,20 +17601,21 @@ fi
 
 for ac_header in execinfo.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -26217,32 +17631,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -26256,69 +17671,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26329,11 +17748,11 @@ done
 
 for ac_func in getgrgid_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26386,35 +17805,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26423,11 +17849,11 @@ done
 
 for ac_func in getgrnam_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26480,35 +17906,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26517,11 +17950,11 @@ done
 
 for ac_func in getpwnam_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26574,35 +18007,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26611,11 +18051,11 @@ done
 
 for ac_func in getpwuid_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26668,35 +18108,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26705,11 +18152,11 @@ done
 
 for ac_func in getresuid
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26762,35 +18209,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26799,11 +18253,11 @@ done
 
 for ac_func in setresuid
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26856,35 +18310,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26893,11 +18354,11 @@ done
 
 for ac_func in kqueue
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26950,35 +18411,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -26987,11 +18455,11 @@ done
 
 for ac_func in backtrace_symbols
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27044,35 +18512,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27081,11 +18556,11 @@ done
 
 for ac_func in mkstemp
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27138,35 +18613,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27175,11 +18657,11 @@ done
 
 for ac_func in mmap
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27232,35 +18714,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27269,11 +18758,11 @@ done
 
 for ac_func in madvise
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27326,35 +18815,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27363,11 +18859,11 @@ done
 
 for ac_func in getrusage
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27420,35 +18916,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27457,11 +18960,11 @@ done
 
 for ac_func in getpriority
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27514,35 +19017,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27551,11 +19061,11 @@ done
 
 for ac_func in setpriority
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27608,35 +19118,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27646,11 +19163,11 @@ done
 
 for ac_func in sched_setaffinity
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -27703,35 +19220,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -27745,8 +19269,8 @@ done
 	large_offt=no
 
 
-	{ echo "$as_me:$LINENO: checking if off_t is 64 bits wide" >&5
-echo $ECHO_N "checking if off_t is 64 bits wide... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking if off_t is 64 bits wide" >&5
+$as_echo_n "checking if off_t is 64 bits wide... " >&6; }
 
 		large_CPPFLAGS=$CPPFLAGS
 		CPPFLAGS="$CPPFLAGS """
@@ -27781,23 +19305,25 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LARGE_FILE_SUPPORT 1
@@ -27807,16 +19333,17 @@ _ACEOF
 			large_offt=yes
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -27824,8 +19351,8 @@ fi
 		CPPFLAGS=$large_CPPFLAGS
 
 	if test $large_offt = no; then
-		{ echo "$as_me:$LINENO: checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t" >&5
-echo $ECHO_N "checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t" >&5
+$as_echo_n "checking if _FILE_OFFSET_BITS=64 gives 64 bit off_t... " >&6; }
 
 		large_CPPFLAGS=$CPPFLAGS
 		CPPFLAGS="$CPPFLAGS "-D_FILE_OFFSET_BITS=64""
@@ -27860,23 +19387,25 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-			{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LARGE_FILE_SUPPORT 1
@@ -27886,16 +19415,17 @@ _ACEOF
 			large_offt=yes
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -27904,14 +19434,14 @@ fi
 
 	fi
 	if test $large_offt = no; then
-		{ echo "$as_me:$LINENO: WARNING: No 64 bit file size support available" >&5
-echo "$as_me: WARNING: No 64 bit file size support available" >&2;}
+		{ $as_echo "$as_me:$LINENO: WARNING: No 64 bit file size support available" >&5
+$as_echo "$as_me: WARNING: No 64 bit file size support available" >&2;}
 	fi
 
-				{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
-echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5
+$as_echo_n "checking for socket in -lsocket... " >&6; }
 if test "${ac_cv_lib_socket_socket+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket  $LIBS"
@@ -27943,39 +19473,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_socket_socket=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_socket_socket=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
-echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; }
-if test $ac_cv_lib_socket_socket = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
+$as_echo "$ac_cv_lib_socket_socket" >&6; }
+if test "x$ac_cv_lib_socket_socket" = x""yes; then
   LIBS="$LIBS -lsocket"
 fi
 
 
-				{ echo "$as_me:$LINENO: checking for MSG_NOSIGNAL" >&5
-echo $ECHO_N "checking for MSG_NOSIGNAL... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for MSG_NOSIGNAL" >&5
+$as_echo_n "checking for MSG_NOSIGNAL... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -27999,21 +19533,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_MSG_NOSIGNAL 1
@@ -28021,20 +19556,20 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll have to use signals
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for SOL_IP" >&5
-echo $ECHO_N "checking for SOL_IP... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for SOL_IP" >&5
+$as_echo_n "checking for SOL_IP... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28058,21 +19593,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOL_IP 1
@@ -28080,20 +19616,20 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll have to use getprotobyname
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for SOL_IPV6" >&5
-echo $ECHO_N "checking for SOL_IPV6... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for SOL_IPV6" >&5
+$as_echo_n "checking for SOL_IPV6... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28117,21 +19653,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOL_IPV6 1
@@ -28139,20 +19676,20 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll have to use getprotobyname
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for SOL_TCP" >&5
-echo $ECHO_N "checking for SOL_TCP... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for SOL_TCP" >&5
+$as_echo_n "checking for SOL_TCP... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28176,21 +19713,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOL_TCP 1
@@ -28198,20 +19736,20 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll have to use getprotobyname
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for IP_PKTINFO" >&5
-echo $ECHO_N "checking for IP_PKTINFO... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for IP_PKTINFO" >&5
+$as_echo_n "checking for IP_PKTINFO... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28235,21 +19773,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_IP_PKTINFO 1
@@ -28257,19 +19796,19 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for IPV6_PKTINFO" >&5
-echo $ECHO_N "checking for IPV6_PKTINFO... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for IPV6_PKTINFO" >&5
+$as_echo_n "checking for IPV6_PKTINFO... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28293,21 +19832,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_IPV6_PKTINFO 1
@@ -28315,19 +19855,19 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for IP_DONTFRAGMENT" >&5
-echo $ECHO_N "checking for IP_DONTFRAGMENT... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for IP_DONTFRAGMENT" >&5
+$as_echo_n "checking for IP_DONTFRAGMENT... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28351,21 +19891,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_IP_DONTFRAGMENT 1
@@ -28373,19 +19914,19 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for IP_MTU_DISCOVER" >&5
-echo $ECHO_N "checking for IP_MTU_DISCOVER... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for IP_MTU_DISCOVER" >&5
+$as_echo_n "checking for IP_MTU_DISCOVER... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28409,21 +19950,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_IP_MTU_DISCOVER 1
@@ -28431,19 +19973,19 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
- 				{ echo "$as_me:$LINENO: checking for struct ip_mreqn" >&5
-echo $ECHO_N "checking for struct ip_mreqn... $ECHO_C" >&6; }
+ 				{ $as_echo "$as_me:$LINENO: checking for struct ip_mreqn" >&5
+$as_echo_n "checking for struct ip_mreqn... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28468,21 +20010,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_IP_MREQN 1
@@ -28490,15 +20033,15 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll just have to try and use struct ip_mreq
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-		{ echo "$as_me:$LINENO: checking for struct ip_mreq" >&5
-echo $ECHO_N "checking for struct ip_mreq... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for struct ip_mreq" >&5
+$as_echo_n "checking for struct ip_mreq... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28523,21 +20066,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 			# Yes, we have it...
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_IP_MREQ 1
@@ -28545,13 +20089,13 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 			# No multicast support
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -28561,8 +20105,8 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for gethostbyname2_r" >&5
-echo $ECHO_N "checking for gethostbyname2_r... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for gethostbyname2_r" >&5
+$as_echo_n "checking for gethostbyname2_r... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28586,22 +20130,25 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_GETHOSTBYNAME2_R 1
@@ -28609,22 +20156,23 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-				{ echo "$as_me:$LINENO: checking for gethostbyaddr" >&5
-echo $ECHO_N "checking for gethostbyaddr... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for gethostbyaddr" >&5
+$as_echo_n "checking for gethostbyaddr... " >&6; }
 if test "${ac_cv_func_gethostbyaddr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28677,38 +20225,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_gethostbyaddr=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_gethostbyaddr=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyaddr" >&5
-echo "${ECHO_T}$ac_cv_func_gethostbyaddr" >&6; }
-if test $ac_cv_func_gethostbyaddr = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyaddr" >&5
+$as_echo "$ac_cv_func_gethostbyaddr" >&6; }
+if test "x$ac_cv_func_gethostbyaddr" = x""yes; then
   :
 else
-  { echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
-echo $ECHO_N "checking for gethostbyaddr in -lnsl... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for gethostbyaddr in -lnsl" >&5
+$as_echo_n "checking for gethostbyaddr in -lnsl... " >&6; }
 if test "${ac_cv_lib_nsl_gethostbyaddr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
@@ -28740,33 +20292,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_nsl_gethostbyaddr=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_nsl_gethostbyaddr=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
-echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyaddr" >&6; }
-if test $ac_cv_lib_nsl_gethostbyaddr = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyaddr" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyaddr" = x""yes; then
   LIBS="$LIBS -lnsl"
 fi
 
@@ -28777,11 +20333,11 @@ fi
 
 for ac_func in inet_pton inet_aton
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -28834,35 +20390,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -28870,10 +20433,10 @@ done
 
 
 				# AC_CHECK_SIZEOF can't cope with struct members :-(
-	{ echo "$as_me:$LINENO: checking size of sockaddr_un.sun_path" >&5
-echo $ECHO_N "checking size of sockaddr_un.sun_path... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking size of sockaddr_un.sun_path" >&5
+$as_echo_n "checking size of sockaddr_un.sun_path... " >&6; }
 	if test "${mono_cv_sizeof_sunpath+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   mono_cv_sizeof_sunpath=0
@@ -28904,44 +20467,47 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   mono_cv_sizeof_sunpath=`cat conftestval`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 mono_cv_sizeof_sunpath=0
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
-	{ echo "$as_me:$LINENO: result: $mono_cv_sizeof_sunpath" >&5
-echo "${ECHO_T}$mono_cv_sizeof_sunpath" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: $mono_cv_sizeof_sunpath" >&5
+$as_echo "$mono_cv_sizeof_sunpath" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define MONO_SIZEOF_SUNPATH $mono_cv_sizeof_sunpath
 _ACEOF
 
 
-				{ echo "$as_me:$LINENO: checking whether $CC supports zero length arrays" >&5
-echo $ECHO_N "checking whether $CC supports zero length arrays... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking whether $CC supports zero length arrays" >&5
+$as_echo_n "checking whether $CC supports zero length arrays... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28968,20 +20534,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define MONO_ZERO_ARRAY_LENGTH 0
@@ -28989,12 +20556,12 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define MONO_ZERO_ARRAY_LENGTH 1
@@ -29007,18 +20574,18 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 				case "${host}" in
 		*solaris* )
-			{ echo "$as_me:$LINENO: checking for Solaris XPG4 support" >&5
-echo $ECHO_N "checking for Solaris XPG4 support... $ECHO_C" >&6; }
+			{ $as_echo "$as_me:$LINENO: checking for Solaris XPG4 support" >&5
+$as_echo_n "checking for Solaris XPG4 support... " >&6; }
 			if test -f /usr/lib/libxnet.so; then
 				CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
 	    			CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
 				CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
            			LIBS="$LIBS -lxnet"
-  	    			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  	    			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 			else
-  	    			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  	    			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 			fi
 
 			if test "$GCC" = "yes"; then
@@ -29032,10 +20599,10 @@ echo "${ECHO_T}no" >&6; }
 #
 	case "${host}" in
 		*-*-*freebsd*)
-			{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
+			{ $as_echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+$as_echo_n "checking for main in -lpthread... " >&6; }
 if test "${ac_cv_lib_pthread_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
@@ -29061,42 +20628,46 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_pthread_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_pthread_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
-if test $ac_cv_lib_pthread_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+$as_echo "$ac_cv_lib_pthread_main" >&6; }
+if test "x$ac_cv_lib_pthread_main" = x""yes; then
   LIBS="$LIBS -pthread"
 fi
 
 		;;
 		*)
-			{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
+			{ $as_echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+$as_echo_n "checking for main in -lpthread... " >&6; }
 if test "${ac_cv_lib_pthread_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpthread  $LIBS"
@@ -29122,33 +20693,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_pthread_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_pthread_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
-if test $ac_cv_lib_pthread_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+$as_echo "$ac_cv_lib_pthread_main" >&6; }
+if test "x$ac_cv_lib_pthread_main" = x""yes; then
   LIBS="$LIBS -lpthread"
 fi
 
@@ -29157,20 +20732,21 @@ fi
 
 for ac_header in pthread.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29186,32 +20762,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29225,69 +20802,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -29297,11 +20878,11 @@ done
 
 for ac_func in pthread_mutex_timedlock
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29354,35 +20935,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -29392,11 +20980,11 @@ done
 
 for ac_func in pthread_getattr_np pthread_attr_get_np
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29449,42 +21037,49 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 done
 
-	{ echo "$as_me:$LINENO: checking for PTHREAD_MUTEX_RECURSIVE" >&5
-echo $ECHO_N "checking for PTHREAD_MUTEX_RECURSIVE... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for PTHREAD_MUTEX_RECURSIVE" >&5
+$as_echo_n "checking for PTHREAD_MUTEX_RECURSIVE... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -29509,30 +21104,31 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-		{ echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-		{ echo "$as_me:$LINENO: WARNING: Using mono_mutex_t for recursive mutexes" >&5
-echo "$as_me: WARNING: Using mono_mutex_t for recursive mutexes" >&2;}
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+		{ $as_echo "$as_me:$LINENO: WARNING: Using mono_mutex_t for recursive mutexes" >&5
+$as_echo "$as_me: WARNING: Using mono_mutex_t for recursive mutexes" >&2;}
 
 cat >>confdefs.h <<\_ACEOF
 #define USE_MONO_MUTEX 1
@@ -29545,11 +21141,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 for ac_func in pthread_attr_setstacksize
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29602,35 +21198,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -29639,11 +21242,11 @@ done
 
 for ac_func in pthread_attr_getstack
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29696,35 +21299,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -29734,11 +21344,11 @@ done
 
 for ac_func in pthread_get_stacksize_np pthread_get_stackaddr_np
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29791,53 +21401,62 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 done
 
 
-				{ echo "$as_me:$LINENO: checking for working __thread" >&5
-echo $ECHO_N "checking for working __thread... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for working __thread" >&5
+$as_echo_n "checking for working __thread... " >&6; }
 	if test "x$with_tls" != "x__thread"; then
-		{ echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: disabled" >&5
+$as_echo "disabled" >&6; }
 	else
 		if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -29881,54 +21500,59 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-				{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+				{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 
-				{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+				{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 				with_tls=pthread
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 	fi
 
-				{ echo "$as_me:$LINENO: checking for working sigaltstack" >&5
-echo $ECHO_N "checking for working sigaltstack... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for working sigaltstack" >&5
+$as_echo_n "checking for working sigaltstack... " >&6; }
 	if test "x$with_sigaltstack" != "xyes"; then
-		{ echo "$as_me:$LINENO: result: disabled" >&5
-echo "${ECHO_T}disabled" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: disabled" >&5
+$as_echo "disabled" >&6; }
 	else
 		if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run test program while cross compiling
+$as_echo "$as_me: error: cannot run test program while cross compiling
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30030,23 +21654,25 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-				{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+				{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_WORKING_SIGALTSTACK 1
@@ -30054,17 +21680,18 @@ _ACEOF
 
 
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 
 				with_sigaltstack=no
-				{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+				{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
@@ -30074,10 +21701,10 @@ fi
 				# 'Real Time' functions on Solaris
 	# posix4 on Solaris 2.6
 	# pthread (first!) on Linux
-	{ echo "$as_me:$LINENO: checking for library containing sem_init" >&5
-echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5
+$as_echo_n "checking for library containing sem_init... " >&6; }
 if test "${ac_cv_search_sem_init+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -30115,26 +21742,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_sem_init=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_sem_init+set}" = set; then
@@ -30149,8 +21780,8 @@ fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5
-echo "${ECHO_T}$ac_cv_search_sem_init" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5
+$as_echo "$ac_cv_search_sem_init" >&6; }
 ac_res=$ac_cv_search_sem_init
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -30158,10 +21789,10 @@ if test "$ac_res" != no; then
 fi
 
 
-	{ echo "$as_me:$LINENO: checking for library containing shm_open" >&5
-echo $ECHO_N "checking for library containing shm_open... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for library containing shm_open" >&5
+$as_echo_n "checking for library containing shm_open... " >&6; }
 if test "${ac_cv_search_shm_open+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_func_search_save_LIBS=$LIBS
 cat >conftest.$ac_ext <<_ACEOF
@@ -30199,26 +21830,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_search_shm_open=$ac_res
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext
   if test "${ac_cv_search_shm_open+set}" = set; then
@@ -30233,8 +21868,8 @@ fi
 rm conftest.$ac_ext
 LIBS=$ac_func_search_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_shm_open" >&5
-echo "${ECHO_T}$ac_cv_search_shm_open" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_shm_open" >&5
+$as_echo "$ac_cv_search_shm_open" >&6; }
 ac_res=$ac_cv_search_shm_open
 if test "$ac_res" != no; then
   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
@@ -30244,11 +21879,11 @@ fi
 
 for ac_func in shm_open
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30301,45 +21936,52 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 done
 
 
-				{ echo "$as_me:$LINENO: checking for tm_gmtoff in struct tm" >&5
-echo $ECHO_N "checking for tm_gmtoff in struct tm... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for tm_gmtoff in struct tm" >&5
+$as_echo_n "checking for tm_gmtoff in struct tm... " >&6; }
 if test "${ac_cv_struct_tm_gmtoff+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30367,20 +22009,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_struct_tm_gmtoff=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_struct_tm_gmtoff=no
@@ -30388,8 +22031,8 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm_gmtoff" >&5
-echo "${ECHO_T}$ac_cv_struct_tm_gmtoff" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm_gmtoff" >&5
+$as_echo "$ac_cv_struct_tm_gmtoff" >&6; }
 	if test $ac_cv_struct_tm_gmtoff = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -30397,10 +22040,10 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 	else
-		{ echo "$as_me:$LINENO: checking for timezone variable" >&5
-echo $ECHO_N "checking for timezone variable... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for timezone variable" >&5
+$as_echo_n "checking for timezone variable... " >&6; }
 if test "${ac_cv_var_timezone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30427,20 +22070,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_var_timezone=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_var_timezone=no
@@ -30448,8 +22092,8 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_var_timezone" >&5
-echo "${ECHO_T}$ac_cv_var_timezone" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_timezone" >&5
+$as_echo "$ac_cv_var_timezone" >&6; }
 		if test $ac_cv_var_timezone = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -30457,8 +22101,8 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 		else
-			{ { echo "$as_me:$LINENO: error: unable to find a way to determine timezone" >&5
-echo "$as_me: error: unable to find a way to determine timezone" >&2;}
+			{ { $as_echo "$as_me:$LINENO: error: unable to find a way to determine timezone" >&5
+$as_echo "$as_me: error: unable to find a way to determine timezone" >&2;}
    { (exit 1); exit 1; }; }
 		fi
 	fi
@@ -30468,11 +22112,11 @@ echo "$as_me: error: unable to find a way to determine timezone" >&2;}
 
 for ac_func in finite
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30525,40 +22169,47 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking for finite in math.h" >&5
-echo $ECHO_N "checking for finite in math.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for finite in math.h" >&5
+$as_echo_n "checking for finite in math.h... " >&6; }
 	                cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30580,32 +22231,36 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FINITE 1
 _ACEOF
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
@@ -30615,11 +22270,11 @@ done
 
 for ac_func in isfinite
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30672,40 +22327,47 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking for isfinite in math.h" >&5
-echo $ECHO_N "checking for isfinite in math.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for isfinite in math.h" >&5
+$as_echo_n "checking for isfinite in math.h... " >&6; }
                 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30727,32 +22389,36 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ISFINITE 1
 _ACEOF
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
@@ -30762,11 +22428,11 @@ done
 
 for ac_func in poll
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -30819,43 +22485,50 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 done
 
 
-				{ echo "$as_me:$LINENO: checking for signbit" >&5
-echo $ECHO_N "checking for signbit... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for signbit" >&5
+$as_echo_n "checking for signbit... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30879,21 +22552,24 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SIGNBIT 1
@@ -30901,35 +22577,37 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 
 for ac_header in sys/epoll.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30945,32 +22623,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30984,69 +22663,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -31057,11 +22740,11 @@ done
 
 for ac_func in epoll_ctl
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -31114,35 +22797,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
  haveepoll=yes
 fi
@@ -31159,20 +22849,21 @@ _ACEOF
 
 for ac_header in sys/ioctl.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31188,32 +22879,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31227,69 +22919,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -31299,20 +22995,21 @@ done
 
 for ac_header in net/if.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31328,32 +23025,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31367,77 +23065,81 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
 done
 
-	{ echo "$as_me:$LINENO: checking for ifreq" >&5
-echo $ECHO_N "checking for ifreq... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for ifreq" >&5
+$as_echo_n "checking for ifreq... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31470,20 +23172,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SIOCGIFCONF 1
@@ -31491,18 +23194,18 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-				{ echo "$as_me:$LINENO: checking for sockaddr_in.sin_len" >&5
-echo $ECHO_N "checking for sockaddr_in.sin_len... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for sockaddr_in.sin_len" >&5
+$as_echo_n "checking for sockaddr_in.sin_len... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31529,20 +23232,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKADDR_IN_SIN_LEN 1
@@ -31550,18 +23254,18 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-				{ echo "$as_me:$LINENO: checking for sockaddr_in6.sin6_len" >&5
-echo $ECHO_N "checking for sockaddr_in6.sin6_len... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for sockaddr_in6.sin6_len" >&5
+$as_echo_n "checking for sockaddr_in6.sin6_len... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31588,20 +23292,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKADDR_IN6_SIN_LEN 1
@@ -31609,12 +23314,12 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -31622,20 +23327,21 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 for ac_header in checklist.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31651,32 +23357,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31690,69 +23397,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -31762,20 +23473,21 @@ done
 
 for ac_header in fstab.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31791,32 +23503,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31830,69 +23543,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -31902,20 +23619,21 @@ done
 
 for ac_header in attr/xattr.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31931,32 +23649,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -31970,69 +23689,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32042,20 +23765,21 @@ done
 
 for ac_header in sys/extattr.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32071,32 +23795,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32110,69 +23835,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32182,20 +23911,21 @@ done
 
 for ac_header in sys/sendfile.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32211,32 +23941,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32250,69 +23981,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32322,20 +24057,21 @@ done
 
 for ac_header in sys/statvfs.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32351,32 +24087,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32390,69 +24127,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32462,20 +24203,21 @@ done
 
 for ac_header in sys/statfs.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32491,32 +24233,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32530,69 +24273,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32602,20 +24349,21 @@ done
 
 for ac_header in sys/vfstab.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32631,32 +24379,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32670,69 +24419,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32742,20 +24495,21 @@ done
 
 for ac_header in sys/xattr.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32771,32 +24525,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32810,69 +24565,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -32882,20 +24641,21 @@ done
 
 for ac_header in sys/mman.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32911,32 +24671,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -32950,69 +24711,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33022,20 +24787,21 @@ done
 
 for ac_header in sys/param.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33051,32 +24817,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33090,69 +24857,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33162,20 +24933,21 @@ done
 
 for ac_header in sys/mount.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33191,32 +24963,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -33230,69 +25003,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33302,11 +25079,11 @@ done
 
 for ac_func in getdomainname
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33359,35 +25136,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33396,11 +25180,11 @@ done
 
 for ac_func in setdomainname
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33453,35 +25237,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33490,11 +25281,11 @@ done
 
 for ac_func in fgetgrent
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33547,35 +25338,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33584,11 +25382,11 @@ done
 
 for ac_func in fgetpwent
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33641,35 +25439,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33678,11 +25483,11 @@ done
 
 for ac_func in fgetpwent
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33735,35 +25540,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33772,11 +25584,11 @@ done
 
 for ac_func in getfsstat
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33829,35 +25641,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33866,11 +25685,11 @@ done
 
 for ac_func in lutimes
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -33923,35 +25742,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -33960,11 +25786,11 @@ done
 
 for ac_func in mremap
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34017,35 +25843,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34054,11 +25887,11 @@ done
 
 for ac_func in remap_file_pages
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34111,35 +25944,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34148,11 +25988,11 @@ done
 
 for ac_func in posix_fadvise
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34205,35 +26045,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34242,11 +26089,11 @@ done
 
 for ac_func in posix_fallocate
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34299,35 +26146,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34336,11 +26190,11 @@ done
 
 for ac_func in posix_madvise
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34393,35 +26247,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34430,11 +26291,11 @@ done
 
 for ac_func in vsnprintf
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34487,35 +26348,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34524,11 +26392,11 @@ done
 
 for ac_func in sendfile
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34581,35 +26449,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34618,11 +26493,11 @@ done
 
 for ac_func in sethostid
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34675,35 +26550,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34712,11 +26594,11 @@ done
 
 for ac_func in statfs
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34769,35 +26651,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34806,11 +26695,11 @@ done
 
 for ac_func in fstatfs
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34863,35 +26752,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34900,11 +26796,11 @@ done
 
 for ac_func in statvfs
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -34957,35 +26853,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -34994,11 +26897,11 @@ done
 
 for ac_func in fstatvfs
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -35051,35 +26954,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -35088,11 +26998,11 @@ done
 
 for ac_func in stime
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -35145,35 +27055,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -35182,11 +27099,11 @@ done
 
 for ac_func in strerror_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -35239,35 +27156,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -35276,11 +27200,11 @@ done
 
 for ac_func in ttyname_r
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -35333,102 +27257,55 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 done
 
-	{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-typedef size_t ac__type_new_;
-int
-main ()
-{
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
-  return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_type_size_t=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_cv_type_size_t=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
-
-# The cast to long int works around a bug in the HP C Compiler
+	# 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.
-{ echo "$as_me:$LINENO: checking size of size_t" >&5
-echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
 if test "${ac_cv_sizeof_size_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
   # Depending upon the size, compute the lo and hi bounds.
@@ -35439,11 +27316,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -35456,13 +27332,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -35476,11 +27353,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -35493,20 +27369,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr $ac_mid + 1`
@@ -35520,7 +27397,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -35530,11 +27407,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -35547,13 +27423,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -35567,11 +27444,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -35584,20 +27460,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_lo=$ac_mid; break
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_hi=`expr '(' $ac_mid ')' - 1`
@@ -35611,7 +27488,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo= ac_hi=
@@ -35631,11 +27508,10 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -35648,20 +27524,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_hi=$ac_mid
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_lo=`expr '(' $ac_mid ')' + 1`
@@ -35672,11 +27549,13 @@ done
 case $ac_lo in
 ?*) ac_cv_sizeof_size_t=$ac_lo;;
 '') if test "$ac_cv_type_size_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t)
+$as_echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_size_t=0
    fi ;;
@@ -35689,9 +27568,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-   typedef size_t ac__type_sizeof_;
-static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); }
+static long int longval () { return (long int) (sizeof (size_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -35701,20 +27579,22 @@ main ()
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (ac__type_sizeof_))) < 0)
+  if (((long int) (sizeof (size_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (size_t))))
 	return 1;
-      fprintf (f, "%ld\n", i);
+      fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ac__type_sizeof_))))
+      if (i != ((long int) (sizeof (size_t))))
 	return 1;
-      fprintf (f, "%lu\n", i);
+      fprintf (f, "%lu", i);
     }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
   return ferror (f) || fclose (f) != 0;
 
   ;
@@ -35727,43 +27607,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   ac_cv_sizeof_size_t=`cat conftest.val`
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 if test "$ac_cv_type_size_t" = yes; then
-     { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute sizeof (size_t)
+$as_echo "$as_me: error: cannot compute sizeof (size_t)
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_size_t=0
    fi
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 rm -f conftest.val
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
-echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
 
 
 
@@ -35772,12 +27657,13 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
-	{ echo "$as_me:$LINENO: checking for blksize_t" >&5
-echo $ECHO_N "checking for blksize_t... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for blksize_t" >&5
+$as_echo_n "checking for blksize_t... " >&6; }
 if test "${ac_cv_type_blksize_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_blksize_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -35787,14 +27673,48 @@ cat >>conftest.$ac_ext <<_ACEOF
 		 #include <sys/stat.h>
 		 #include <unistd.h>
 
-typedef blksize_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (blksize_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <sys/stat.h>
+		 #include <unistd.h>
+
+int
+main ()
+{
+if (sizeof ((blksize_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -35805,30 +27725,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_blksize_t=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_blksize_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_blksize_t=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_blksize_t" >&5
-echo "${ECHO_T}$ac_cv_type_blksize_t" >&6; }
-if test $ac_cv_type_blksize_t = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_blksize_t" >&5
+$as_echo "$ac_cv_type_blksize_t" >&6; }
+if test "x$ac_cv_type_blksize_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_BLKSIZE_T 1
@@ -35840,12 +27769,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for blkcnt_t" >&5
-echo $ECHO_N "checking for blkcnt_t... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for blkcnt_t" >&5
+$as_echo_n "checking for blkcnt_t... " >&6; }
 if test "${ac_cv_type_blkcnt_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_blkcnt_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -35855,14 +27785,48 @@ cat >>conftest.$ac_ext <<_ACEOF
 		 #include <sys/stat.h>
 		 #include <unistd.h>
 
-typedef blkcnt_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (blkcnt_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <sys/stat.h>
+		 #include <unistd.h>
+
+int
+main ()
+{
+if (sizeof ((blkcnt_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -35873,30 +27837,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_blkcnt_t=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_blkcnt_t=no
+	ac_cv_type_blkcnt_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_blkcnt_t" >&5
-echo "${ECHO_T}$ac_cv_type_blkcnt_t" >&6; }
-if test $ac_cv_type_blkcnt_t = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_blkcnt_t" >&5
+$as_echo "$ac_cv_type_blkcnt_t" >&6; }
+if test "x$ac_cv_type_blkcnt_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_BLKCNT_T 1
@@ -35908,12 +27881,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for suseconds_t" >&5
-echo $ECHO_N "checking for suseconds_t... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for suseconds_t" >&5
+$as_echo_n "checking for suseconds_t... " >&6; }
 if test "${ac_cv_type_suseconds_t+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_suseconds_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -35921,14 +27895,46 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/time.h>
 
-typedef suseconds_t ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (suseconds_t))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+
+int
+main ()
+{
+if (sizeof ((suseconds_t)))
+	  return 0;
   ;
   return 0;
 }
@@ -35939,30 +27945,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_suseconds_t=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_suseconds_t=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_suseconds_t=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_suseconds_t" >&5
-echo "${ECHO_T}$ac_cv_type_suseconds_t" >&6; }
-if test $ac_cv_type_suseconds_t = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_suseconds_t" >&5
+$as_echo "$ac_cv_type_suseconds_t" >&6; }
+if test "x$ac_cv_type_suseconds_t" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_SUSECONDS_T 1
@@ -35974,12 +27989,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct flock" >&5
-echo $ECHO_N "checking for struct flock... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct flock" >&5
+$as_echo_n "checking for struct flock... " >&6; }
 if test "${ac_cv_type_struct_flock+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_flock=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -35988,14 +28004,47 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <unistd.h>
 		 #include <fcntl.h>
 
-typedef struct flock ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct flock))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <unistd.h>
+		 #include <fcntl.h>
+
+int
+main ()
+{
+if (sizeof ((struct flock)))
+	  return 0;
   ;
   return 0;
 }
@@ -36006,30 +28055,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_flock=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_struct_flock=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_flock=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_flock" >&5
-echo "${ECHO_T}$ac_cv_type_struct_flock" >&6; }
-if test $ac_cv_type_struct_flock = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_flock" >&5
+$as_echo "$ac_cv_type_struct_flock" >&6; }
+if test "x$ac_cv_type_struct_flock" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_FLOCK 1
@@ -36041,12 +28099,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct pollfd" >&5
-echo $ECHO_N "checking for struct pollfd... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct pollfd" >&5
+$as_echo_n "checking for struct pollfd... " >&6; }
 if test "${ac_cv_type_struct_pollfd+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_pollfd=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36054,14 +28113,46 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/poll.h>
 
-typedef struct pollfd ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct pollfd))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/poll.h>
+
+int
+main ()
+{
+if (sizeof ((struct pollfd)))
+	  return 0;
   ;
   return 0;
 }
@@ -36072,30 +28163,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_pollfd=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_pollfd=no
+	ac_cv_type_struct_pollfd=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_pollfd" >&5
-echo "${ECHO_T}$ac_cv_type_struct_pollfd" >&6; }
-if test $ac_cv_type_struct_pollfd = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_pollfd" >&5
+$as_echo "$ac_cv_type_struct_pollfd" >&6; }
+if test "x$ac_cv_type_struct_pollfd" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_POLLFD 1
@@ -36107,12 +28207,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct stat" >&5
-echo $ECHO_N "checking for struct stat... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct stat" >&5
+$as_echo_n "checking for struct stat... " >&6; }
 if test "${ac_cv_type_struct_stat+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_stat=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36122,14 +28223,48 @@ cat >>conftest.$ac_ext <<_ACEOF
 		 #include <sys/stat.h>
 		 #include <unistd.h>
 
-typedef struct stat ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct stat))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <sys/stat.h>
+		 #include <unistd.h>
+
+int
+main ()
+{
+if (sizeof ((struct stat)))
+	  return 0;
   ;
   return 0;
 }
@@ -36140,30 +28275,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_stat=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_stat=no
+	ac_cv_type_struct_stat=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_stat" >&5
-echo "${ECHO_T}$ac_cv_type_struct_stat" >&6; }
-if test $ac_cv_type_struct_stat = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_stat" >&5
+$as_echo "$ac_cv_type_struct_stat" >&6; }
+if test "x$ac_cv_type_struct_stat" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT 1
@@ -36175,12 +28319,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct timespec" >&5
-echo $ECHO_N "checking for struct timespec... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct timespec" >&5
+$as_echo_n "checking for struct timespec... " >&6; }
 if test "${ac_cv_type_struct_timespec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_timespec=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36188,14 +28333,46 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <time.h>
 
-typedef struct timespec ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct timespec))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <time.h>
+
+int
+main ()
+{
+if (sizeof ((struct timespec)))
+	  return 0;
   ;
   return 0;
 }
@@ -36206,30 +28383,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_timespec=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_timespec=no
+	ac_cv_type_struct_timespec=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_timespec" >&5
-echo "${ECHO_T}$ac_cv_type_struct_timespec" >&6; }
-if test $ac_cv_type_struct_timespec = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_timespec" >&5
+$as_echo "$ac_cv_type_struct_timespec" >&6; }
+if test "x$ac_cv_type_struct_timespec" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TIMESPEC 1
@@ -36241,12 +28427,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct timeval" >&5
-echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct timeval" >&5
+$as_echo_n "checking for struct timeval... " >&6; }
 if test "${ac_cv_type_struct_timeval+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_timeval=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36256,14 +28443,48 @@ cat >>conftest.$ac_ext <<_ACEOF
 		 #include <sys/types.h>
 		 #include <utime.h>
 
-typedef struct timeval ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct timeval))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+		 #include <sys/types.h>
+		 #include <utime.h>
+
+int
+main ()
+{
+if (sizeof ((struct timeval)))
+	  return 0;
   ;
   return 0;
 }
@@ -36274,30 +28495,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_timeval=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_struct_timeval=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_timeval=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_timeval" >&5
-echo "${ECHO_T}$ac_cv_type_struct_timeval" >&6; }
-if test $ac_cv_type_struct_timeval = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_timeval" >&5
+$as_echo "$ac_cv_type_struct_timeval" >&6; }
+if test "x$ac_cv_type_struct_timeval" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TIMEVAL 1
@@ -36309,12 +28539,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct timezone" >&5
-echo $ECHO_N "checking for struct timezone... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct timezone" >&5
+$as_echo_n "checking for struct timezone... " >&6; }
 if test "${ac_cv_type_struct_timezone+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_timezone=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36322,14 +28553,46 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/time.h>
 
-typedef struct timezone ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct timezone))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/time.h>
+
+int
+main ()
+{
+if (sizeof ((struct timezone)))
+	  return 0;
   ;
   return 0;
 }
@@ -36340,30 +28603,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_timezone=yes
+  :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_timezone=no
+	ac_cv_type_struct_timezone=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_timezone" >&5
-echo "${ECHO_T}$ac_cv_type_struct_timezone" >&6; }
-if test $ac_cv_type_struct_timezone = yes; then
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_timezone" >&5
+$as_echo "$ac_cv_type_struct_timezone" >&6; }
+if test "x$ac_cv_type_struct_timezone" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_TIMEZONE 1
@@ -36375,12 +28647,13 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct utimbuf" >&5
-echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct utimbuf" >&5
+$as_echo_n "checking for struct utimbuf... " >&6; }
 if test "${ac_cv_type_struct_utimbuf+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_struct_utimbuf=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -36389,14 +28662,47 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/types.h>
 		 #include <utime.h>
 
-typedef struct utimbuf ac__type_new_;
 int
 main ()
 {
-if ((ac__type_new_ *) 0)
-  return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (struct utimbuf))
+       return 0;
+  ;
   return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+		 #include <utime.h>
+
+int
+main ()
+{
+if (sizeof ((struct utimbuf)))
+	  return 0;
   ;
   return 0;
 }
@@ -36407,30 +28713,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_type_struct_utimbuf=yes
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_struct_utimbuf=yes
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_type_struct_utimbuf=no
+
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_utimbuf" >&5
-echo "${ECHO_T}$ac_cv_type_struct_utimbuf" >&6; }
-if test $ac_cv_type_struct_utimbuf = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_utimbuf" >&5
+$as_echo "$ac_cv_type_struct_utimbuf" >&6; }
+if test "x$ac_cv_type_struct_utimbuf" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_UTIMBUF 1
@@ -36442,10 +28757,10 @@ _ACEOF
 
 fi
 
-	{ echo "$as_me:$LINENO: checking for struct dirent.d_off" >&5
-echo $ECHO_N "checking for struct dirent.d_off... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for struct dirent.d_off" >&5
+$as_echo_n "checking for struct dirent.d_off... " >&6; }
 if test "${ac_cv_member_struct_dirent_d_off+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -36472,20 +28787,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_off=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -36513,20 +28829,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_off=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_dirent_d_off=no
@@ -36537,9 +28854,9 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_off" >&5
-echo "${ECHO_T}$ac_cv_member_struct_dirent_d_off" >&6; }
-if test $ac_cv_member_struct_dirent_d_off = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_off" >&5
+$as_echo "$ac_cv_member_struct_dirent_d_off" >&6; }
+if test "x$ac_cv_member_struct_dirent_d_off" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_DIRENT_D_OFF 1
@@ -36547,10 +28864,10 @@ _ACEOF
 
 
 fi
-{ echo "$as_me:$LINENO: checking for struct dirent.d_reclen" >&5
-echo $ECHO_N "checking for struct dirent.d_reclen... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct dirent.d_reclen" >&5
+$as_echo_n "checking for struct dirent.d_reclen... " >&6; }
 if test "${ac_cv_member_struct_dirent_d_reclen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -36577,20 +28894,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_reclen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -36618,20 +28936,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_reclen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_dirent_d_reclen=no
@@ -36642,9 +28961,9 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_reclen" >&5
-echo "${ECHO_T}$ac_cv_member_struct_dirent_d_reclen" >&6; }
-if test $ac_cv_member_struct_dirent_d_reclen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_reclen" >&5
+$as_echo "$ac_cv_member_struct_dirent_d_reclen" >&6; }
+if test "x$ac_cv_member_struct_dirent_d_reclen" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_DIRENT_D_RECLEN 1
@@ -36652,10 +28971,10 @@ _ACEOF
 
 
 fi
-{ echo "$as_me:$LINENO: checking for struct dirent.d_type" >&5
-echo $ECHO_N "checking for struct dirent.d_type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for struct dirent.d_type" >&5
+$as_echo_n "checking for struct dirent.d_type... " >&6; }
 if test "${ac_cv_member_struct_dirent_d_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -36682,20 +29001,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_type=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -36723,20 +29043,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_dirent_d_type=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_dirent_d_type=no
@@ -36747,9 +29068,9 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_type" >&5
-echo "${ECHO_T}$ac_cv_member_struct_dirent_d_type" >&6; }
-if test $ac_cv_member_struct_dirent_d_type = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_type" >&5
+$as_echo "$ac_cv_member_struct_dirent_d_type" >&6; }
+if test "x$ac_cv_member_struct_dirent_d_type" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_DIRENT_D_TYPE 1
@@ -36759,10 +29080,10 @@ _ACEOF
 fi
 
 
-		{ echo "$as_me:$LINENO: checking for lsetxattr" >&5
-echo $ECHO_N "checking for lsetxattr... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for lsetxattr" >&5
+$as_echo_n "checking for lsetxattr... " >&6; }
 if test "${ac_cv_func_lsetxattr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -36815,38 +29136,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_lsetxattr=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_lsetxattr=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_lsetxattr" >&5
-echo "${ECHO_T}$ac_cv_func_lsetxattr" >&6; }
-if test $ac_cv_func_lsetxattr = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lsetxattr" >&5
+$as_echo "$ac_cv_func_lsetxattr" >&6; }
+if test "x$ac_cv_func_lsetxattr" = x""yes; then
   :
 else
-  { echo "$as_me:$LINENO: checking for lsetxattr in -lattr" >&5
-echo $ECHO_N "checking for lsetxattr in -lattr... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for lsetxattr in -lattr" >&5
+$as_echo_n "checking for lsetxattr in -lattr... " >&6; }
 if test "${ac_cv_lib_attr_lsetxattr+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lattr  $LIBS"
@@ -36878,33 +29203,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_attr_lsetxattr=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_attr_lsetxattr=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_attr_lsetxattr" >&5
-echo "${ECHO_T}$ac_cv_lib_attr_lsetxattr" >&6; }
-if test $ac_cv_lib_attr_lsetxattr = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_attr_lsetxattr" >&5
+$as_echo "$ac_cv_lib_attr_lsetxattr" >&6; }
+if test "x$ac_cv_lib_attr_lsetxattr" = x""yes; then
   XATTR_LIB="-lattr"
 fi
 
@@ -36913,10 +29242,10 @@ fi
 
 
 
-		{ echo "$as_me:$LINENO: checking for struct kinfo_proc.kp_proc" >&5
-echo $ECHO_N "checking for struct kinfo_proc.kp_proc... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for struct kinfo_proc.kp_proc" >&5
+$as_echo_n "checking for struct kinfo_proc.kp_proc... " >&6; }
 if test "${ac_cv_member_struct_kinfo_proc_kp_proc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -36945,20 +29274,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_kinfo_proc_kp_proc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	cat >conftest.$ac_ext <<_ACEOF
@@ -36988,20 +29318,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_kinfo_proc_kp_proc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_member_struct_kinfo_proc_kp_proc=no
@@ -37012,9 +29343,9 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_kinfo_proc_kp_proc" >&5
-echo "${ECHO_T}$ac_cv_member_struct_kinfo_proc_kp_proc" >&6; }
-if test $ac_cv_member_struct_kinfo_proc_kp_proc = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_kinfo_proc_kp_proc" >&5
+$as_echo "$ac_cv_member_struct_kinfo_proc_kp_proc" >&6; }
+if test "x$ac_cv_member_struct_kinfo_proc_kp_proc" = x""yes; then
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_KINFO_PROC_KP_PROC 1
@@ -37027,20 +29358,21 @@ fi
 
 for ac_header in sys/time.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37056,32 +29388,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37095,69 +29428,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37167,20 +29504,21 @@ done
 
 for ac_header in sys/param.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37196,32 +29534,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37235,69 +29574,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37307,20 +29650,21 @@ done
 
 for ac_header in dirent.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37336,32 +29680,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37375,69 +29720,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37448,20 +29797,21 @@ done
 
 for ac_header in curses.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37477,32 +29827,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37516,69 +29867,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37588,11 +29943,11 @@ done
 
 for ac_header in term.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -37613,20 +29968,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_Header=no"
@@ -37634,12 +29990,15 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37649,20 +30008,21 @@ done
 
 for ac_header in termios.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37678,32 +30038,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -37717,69 +30078,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -37794,10 +30159,10 @@ _ACEOF
 
 else
 	jdk_headers_found=no
-	{ echo "$as_me:$LINENO: checking for main in -lws2_32" >&5
-echo $ECHO_N "checking for main in -lws2_32... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -lws2_32" >&5
+$as_echo_n "checking for main in -lws2_32... " >&6; }
 if test "${ac_cv_lib_ws2_32_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lws2_32  $LIBS"
@@ -37823,44 +30188,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_ws2_32_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_ws2_32_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ws2_32_main" >&6; }
-if test $ac_cv_lib_ws2_32_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ws2_32_main" >&5
+$as_echo "$ac_cv_lib_ws2_32_main" >&6; }
+if test "x$ac_cv_lib_ws2_32_main" = x""yes; then
   LIBS="$LIBS -lws2_32"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -lpsapi" >&5
-echo $ECHO_N "checking for main in -lpsapi... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -lpsapi" >&5
+$as_echo_n "checking for main in -lpsapi... " >&6; }
 if test "${ac_cv_lib_psapi_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpsapi  $LIBS"
@@ -37886,44 +30255,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_psapi_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_psapi_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_psapi_main" >&5
-echo "${ECHO_T}$ac_cv_lib_psapi_main" >&6; }
-if test $ac_cv_lib_psapi_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_psapi_main" >&5
+$as_echo "$ac_cv_lib_psapi_main" >&6; }
+if test "x$ac_cv_lib_psapi_main" = x""yes; then
   LIBS="$LIBS -lpsapi"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -lole32" >&5
-echo $ECHO_N "checking for main in -lole32... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -lole32" >&5
+$as_echo_n "checking for main in -lole32... " >&6; }
 if test "${ac_cv_lib_ole32_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lole32  $LIBS"
@@ -37949,44 +30322,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_ole32_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_ole32_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_ole32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_ole32_main" >&6; }
-if test $ac_cv_lib_ole32_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ole32_main" >&5
+$as_echo "$ac_cv_lib_ole32_main" >&6; }
+if test "x$ac_cv_lib_ole32_main" = x""yes; then
   LIBS="$LIBS -lole32"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -lwinmm" >&5
-echo $ECHO_N "checking for main in -lwinmm... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -lwinmm" >&5
+$as_echo_n "checking for main in -lwinmm... " >&6; }
 if test "${ac_cv_lib_winmm_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lwinmm  $LIBS"
@@ -38012,44 +30389,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_winmm_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_winmm_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_winmm_main" >&5
-echo "${ECHO_T}$ac_cv_lib_winmm_main" >&6; }
-if test $ac_cv_lib_winmm_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_winmm_main" >&5
+$as_echo "$ac_cv_lib_winmm_main" >&6; }
+if test "x$ac_cv_lib_winmm_main" = x""yes; then
   LIBS="$LIBS -lwinmm"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -loleaut32" >&5
-echo $ECHO_N "checking for main in -loleaut32... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -loleaut32" >&5
+$as_echo_n "checking for main in -loleaut32... " >&6; }
 if test "${ac_cv_lib_oleaut32_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-loleaut32  $LIBS"
@@ -38075,44 +30456,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_oleaut32_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_oleaut32_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_oleaut32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_oleaut32_main" >&6; }
-if test $ac_cv_lib_oleaut32_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_oleaut32_main" >&5
+$as_echo "$ac_cv_lib_oleaut32_main" >&6; }
+if test "x$ac_cv_lib_oleaut32_main" = x""yes; then
   LIBS="$LIBS -loleaut32"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5
-echo $ECHO_N "checking for main in -ladvapi32... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5
+$as_echo_n "checking for main in -ladvapi32... " >&6; }
 if test "${ac_cv_lib_advapi32_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ladvapi32  $LIBS"
@@ -38138,44 +30523,48 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_advapi32_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_advapi32_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5
-echo "${ECHO_T}$ac_cv_lib_advapi32_main" >&6; }
-if test $ac_cv_lib_advapi32_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5
+$as_echo "$ac_cv_lib_advapi32_main" >&6; }
+if test "x$ac_cv_lib_advapi32_main" = x""yes; then
   LIBS="$LIBS -ladvapi32"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for main in -lversion" >&5
-echo $ECHO_N "checking for main in -lversion... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for main in -lversion" >&5
+$as_echo_n "checking for main in -lversion... " >&6; }
 if test "${ac_cv_lib_version_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lversion  $LIBS"
@@ -38201,43 +30590,47 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_version_main=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_version_main=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_version_main" >&5
-echo "${ECHO_T}$ac_cv_lib_version_main" >&6; }
-if test $ac_cv_lib_version_main = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_version_main" >&5
+$as_echo "$ac_cv_lib_version_main" >&6; }
+if test "x$ac_cv_lib_version_main" = x""yes; then
   LIBS="$LIBS -lversion"
 else
-  { { echo "$as_me:$LINENO: error: bad mingw install?" >&5
-echo "$as_me: error: bad mingw install?" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: bad mingw install?" >&5
+$as_echo "$as_me: error: bad mingw install?" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 
-				{ echo "$as_me:$LINENO: checking for struct ip_mreqn" >&5
-echo $ECHO_N "checking for struct ip_mreqn... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking for struct ip_mreqn" >&5
+$as_echo_n "checking for struct ip_mreqn... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38262,36 +30655,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 		# Yes, we have it...
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 		cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_IP_MREQN 1
 _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 		# We'll just have to try and use struct ip_mreq
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-		{ echo "$as_me:$LINENO: checking for struct ip_mreq" >&5
-echo $ECHO_N "checking for struct ip_mreq... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for struct ip_mreq" >&5
+$as_echo_n "checking for struct ip_mreq... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38316,34 +30710,35 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 			# Yes, we have it...
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 			cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRUCT_IP_MREQ 1
 _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 			# No multicast support
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -38355,11 +30750,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 for ac_func in GetProcessId
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38412,35 +30807,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -38448,8 +30850,8 @@ done
 
 fi
 
-{ echo "$as_me:$LINENO: checking for socklen_t" >&5
-echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5
+$as_echo_n "checking for socklen_t... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38476,13 +30878,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -38494,23 +30897,23 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_SOCKLEN_T 1
 _ACEOF
 
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-{ echo "$as_me:$LINENO: checking for array element initalizer support" >&5
-echo $ECHO_N "checking for array element initalizer support... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for array element initalizer support" >&5
+$as_echo_n "checking for array element initalizer support... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -38534,21 +30937,22 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
 	# Yes, we have it...
-	{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_ARRAY_ELEM_INIT 1
@@ -38556,13 +30960,13 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 	# We'll have to use signals
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -38571,11 +30975,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 for ac_func in trunc
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38628,40 +31032,47 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  { echo "$as_me:$LINENO: checking for trunc in math.h" >&5
-echo $ECHO_N "checking for trunc in math.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for trunc in math.h" >&5
+$as_echo_n "checking for trunc in math.h... " >&6; }
 	# Simply calling trunc (0.0) is no good since gcc will optimize the call away
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38684,35 +31095,39 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 		cat >>confdefs.h <<\_ACEOF
 #define HAVE_TRUNC 1
 _ACEOF
 
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 		ac_cv_trunc=yes
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
@@ -38720,10 +31135,10 @@ done
 
 
 if test "x$ac_cv_truncl" != "xyes"; then
-   { echo "$as_me:$LINENO: checking for aintl in -lsunmath" >&5
-echo $ECHO_N "checking for aintl in -lsunmath... $ECHO_C" >&6; }
+   { $as_echo "$as_me:$LINENO: checking for aintl in -lsunmath" >&5
+$as_echo_n "checking for aintl in -lsunmath... " >&6; }
 if test "${ac_cv_lib_sunmath_aintl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsunmath  $LIBS"
@@ -38755,33 +31170,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_sunmath_aintl=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_sunmath_aintl=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_sunmath_aintl" >&5
-echo "${ECHO_T}$ac_cv_lib_sunmath_aintl" >&6; }
-if test $ac_cv_lib_sunmath_aintl = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sunmath_aintl" >&5
+$as_echo "$ac_cv_lib_sunmath_aintl" >&6; }
+if test "x$ac_cv_lib_sunmath_aintl" = x""yes; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_AINTL 1
@@ -38794,11 +31213,11 @@ fi
 
 for ac_func in round
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38851,35 +31270,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -38888,11 +31314,11 @@ done
 
 for ac_func in rint
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38945,35 +31371,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   eval "$as_ac_var=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_var=no"
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_var'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_var'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -38981,8 +31414,8 @@ done
 
 
 
-{ echo "$as_me:$LINENO: checking if usage of random device is requested" >&5
-echo $ECHO_N "checking if usage of random device is requested... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if usage of random device is requested" >&5
+$as_echo_n "checking if usage of random device is requested... " >&6; }
 # Check whether --enable-dev-random was given.
 if test "${enable_dev_random+set}" = set; then
   enableval=$enable_dev_random; try_dev_random=$enableval
@@ -38990,8 +31423,8 @@ else
   try_dev_random=yes
 fi
 
-{ echo "$as_me:$LINENO: result: $try_dev_random" >&5
-echo "${ECHO_T}$try_dev_random" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $try_dev_random" >&5
+$as_echo "$try_dev_random" >&6; }
 
 case "{$target}" in
     *-openbsd*)
@@ -39017,16 +31450,16 @@ _ACEOF
 
 
 if test "x$try_dev_random" = "xyes"; then
-    { echo "$as_me:$LINENO: checking for random device" >&5
-echo $ECHO_N "checking for random device... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for random device" >&5
+$as_echo_n "checking for random device... " >&6; }
 if test "${ac_cv_have_dev_random+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -r "$NAME_DEV_RANDOM" ; then
         ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_dev_random" >&5
-echo "${ECHO_T}$ac_cv_have_dev_random" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_dev_random" >&5
+$as_echo "$ac_cv_have_dev_random" >&6; }
     if test "x$ac_cv_have_dev_random" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -39035,11 +31468,11 @@ _ACEOF
 
     fi
 else
-    { echo "$as_me:$LINENO: checking for random device" >&5
-echo $ECHO_N "checking for random device... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for random device" >&5
+$as_echo_n "checking for random device... " >&6; }
     ac_cv_have_dev_random=no
-    { echo "$as_me:$LINENO: result: has been disabled" >&5
-echo "${ECHO_T}has been disabled" >&6; }
+    { $as_echo "$as_me:$LINENO: result: has been disabled" >&5
+$as_echo "has been disabled" >&6; }
 fi
 
 if test "x$platform_win32" = "xyes"; then
@@ -39051,7 +31484,7 @@ fi
 
 if test "x$ac_cv_have_dev_random" = "xno" \
     && test "x$platform_win32" = "xno"; then
-    { echo "$as_me:$LINENO: WARNING:
+    { $as_echo "$as_me:$LINENO: WARNING:
 ***
 *** A system-provided entropy source was not found on this system.
 *** Because of this, the System.Security.Cryptography random number generator
@@ -39064,7 +31497,7 @@ if test "x$ac_cv_have_dev_random" = "xno" \
 *** Otherwise you can install either egd or prngd and set the environment
 *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
 ***" >&5
-echo "$as_me: WARNING:
+$as_echo "$as_me: WARNING:
 ***
 *** A system-provided entropy source was not found on this system.
 *** Because of this, the System.Security.Cryptography random number generator
@@ -39079,8 +31512,8 @@ echo "$as_me: WARNING:
 ***" >&2;}
 fi
 
-{ echo "$as_me:$LINENO: checking if inter-process shared handles are requested" >&5
-echo $ECHO_N "checking if inter-process shared handles are requested... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if inter-process shared handles are requested" >&5
+$as_echo_n "checking if inter-process shared handles are requested... " >&6; }
 # Check whether --enable-shared-handles was given.
 if test "${enable_shared_handles+set}" = set; then
   enableval=$enable_shared_handles; try_shared_handles=$enableval
@@ -39088,8 +31521,8 @@ else
   try_shared_handles=yes
 fi
 
-{ echo "$as_me:$LINENO: result: $try_shared_handles" >&5
-echo "${ECHO_T}$try_shared_handles" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $try_shared_handles" >&5
+$as_echo "$try_shared_handles" >&6; }
 if test "x$try_shared_handles" != "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -39101,8 +31534,8 @@ fi
 
 if test x$gc = xsgen; then
    if test x$with_tls != x__thread; then
-	  { { echo "$as_me:$LINENO: error: The SGEN garbage collector depends on a working __thread implementation, and either --with-thread=pthread was passed to configure, or the configure test for __thread failed." >&5
-echo "$as_me: error: The SGEN garbage collector depends on a working __thread implementation, and either --with-thread=pthread was passed to configure, or the configure test for __thread failed." >&2;}
+	  { { $as_echo "$as_me:$LINENO: error: The SGEN garbage collector depends on a working __thread implementation, and either --with-thread=pthread was passed to configure, or the configure test for __thread failed." >&5
+$as_echo "$as_me: error: The SGEN garbage collector depends on a working __thread implementation, and either --with-thread=pthread was passed to configure, or the configure test for __thread failed." >&2;}
    { (exit 1); exit 1; }; }
    fi
 fi
@@ -39121,8 +31554,8 @@ else
 fi
 
 
-{ echo "$as_me:$LINENO: checking if big-arrays are to be enabled" >&5
-echo $ECHO_N "checking if big-arrays are to be enabled... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if big-arrays are to be enabled" >&5
+$as_echo_n "checking if big-arrays are to be enabled... " >&6; }
 # Check whether --enable-big-arrays was given.
 if test "${enable_big_arrays+set}" = set; then
   enableval=$enable_big_arrays; enable_big_arrays=$enableval
@@ -39138,13 +31571,13 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
     else
-        { { echo "$as_me:$LINENO: error: The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform." >&5
-echo "$as_me: error: The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform." >&2;}
+        { { $as_echo "$as_me:$LINENO: error: The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform." >&5
+$as_echo "$as_me: error: The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform." >&2;}
    { (exit 1); exit 1; }; }
     fi
 fi
-{ echo "$as_me:$LINENO: result: $enable_big_arrays" >&5
-echo "${ECHO_T}$enable_big_arrays" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $enable_big_arrays" >&5
+$as_echo "$enable_big_arrays" >&6; }
 
 
 # Check whether --enable-dtrace was given.
@@ -39157,16 +31590,16 @@ fi
 
 if test "x$enable_dtrace" = "xyes"; then
    if test "x$has_dtrace" = "xno"; then
-   	  { { echo "$as_me:$LINENO: error: DTrace probes are not supported on this platform." >&5
-echo "$as_me: error: DTrace probes are not supported on this platform." >&2;}
+   	  { { $as_echo "$as_me:$LINENO: error: DTrace probes are not supported on this platform." >&5
+$as_echo "$as_me: error: DTrace probes are not supported on this platform." >&2;}
    { (exit 1); exit 1; }; }
    fi
    # Extract the first word of "dtrace", so it can be a program name with args.
 set dummy dtrace; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_path_DTRACE+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $DTRACE in
   [\\/]* | ?:[\\/]*)
@@ -39182,7 +31615,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -39195,17 +31628,21 @@ esac
 fi
 DTRACE=$ac_cv_path_DTRACE
 if test -n "$DTRACE"; then
-  { echo "$as_me:$LINENO: result: $DTRACE" >&5
-echo "${ECHO_T}$DTRACE" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $DTRACE" >&5
+$as_echo "$DTRACE" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
    if test "x$DTRACE" = "xno"; then
-   	  { echo "$as_me:$LINENO: result: dtrace utility not found, dtrace support disabled." >&5
-echo "${ECHO_T}dtrace utility not found, dtrace support disabled." >&6; }
+   	  { $as_echo "$as_me:$LINENO: result: dtrace utility not found, dtrace support disabled." >&5
+$as_echo "dtrace utility not found, dtrace support disabled." >&6; }
+	  enable_dtrace=no
+   elif ! $DTRACE -h $srcdir/data/mono.d > /dev/null 2>&1; then
+	  { $as_echo "$as_me:$LINENO: result: dtrace doesn't support -h option, dtrace support disabled." >&5
+$as_echo "dtrace doesn't support -h option, dtrace support disabled." >&6; }
 	  enable_dtrace=no
    fi
 fi
@@ -39252,20 +31689,21 @@ _ACEOF
 
 for ac_header in sys/sdt.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -39281,32 +31719,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -39320,69 +31759,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -39434,8 +31877,8 @@ case "$host" in
 		JIT_SUPPORTED=yes
 		jit_wanted=true
 
-		{ echo "$as_me:$LINENO: checking for mips n32" >&5
-echo $ECHO_N "checking for mips n32... $ECHO_C" >&6; }
+		{ $as_echo "$as_me:$LINENO: checking for mips n32" >&5
+$as_echo_n "checking for mips n32... " >&6; }
 		cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -39463,29 +31906,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-		{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 		sizeof_register=8
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-		{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -39534,10 +31978,10 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 		LIBC="libc.so.6.1"
 		INTL="libc.so.6.1"
 
-{ echo "$as_me:$LINENO: checking for _U_dyn_register in -lunwind" >&5
-echo $ECHO_N "checking for _U_dyn_register in -lunwind... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for _U_dyn_register in -lunwind" >&5
+$as_echo_n "checking for _U_dyn_register in -lunwind... " >&6; }
 if test "${ac_cv_lib_unwind__U_dyn_register+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lunwind  $LIBS"
@@ -39569,33 +32013,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_unwind__U_dyn_register=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_unwind__U_dyn_register=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_unwind__U_dyn_register" >&5
-echo "${ECHO_T}$ac_cv_lib_unwind__U_dyn_register" >&6; }
-if test $ac_cv_lib_unwind__U_dyn_register = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_unwind__U_dyn_register" >&5
+$as_echo "$ac_cv_lib_unwind__U_dyn_register" >&6; }
+if test "x$ac_cv_lib_unwind__U_dyn_register" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUNWIND 1
 _ACEOF
@@ -39603,8 +32051,8 @@ _ACEOF
   LIBS="-lunwind $LIBS"
 
 else
-  { { echo "$as_me:$LINENO: error: library libunwind not found" >&5
-echo "$as_me: error: library libunwind not found" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: library libunwind not found" >&5
+$as_echo "$as_me: error: library libunwind not found" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -39631,8 +32079,8 @@ fi
 			CFLAGS="$CFLAGS -Wno-cast-align -mcpu=v9"
 		fi
 		if test x"$AR" = xfalse; then
-			{ { echo "$as_me:$LINENO: error: The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin." >&5
-echo "$as_me: error: The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin." >&2;}
+			{ { $as_echo "$as_me:$LINENO: error: The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin." >&5
+$as_echo "$as_me: error: The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin." >&2;}
    { (exit 1); exit 1; }; }
 		fi
 		;;
@@ -39825,8 +32273,8 @@ if test x$JIT_SUPPORTED = xyes; then
       if $interp_wanted; then
          jit_status="Building the JIT, defaulting to the interpreter"
       else
-         { { echo "$as_me:$LINENO: error: No JIT or interpreter support available or selected." >&5
-echo "$as_me: error: No JIT or interpreter support available or selected." >&2;}
+         { { $as_echo "$as_me:$LINENO: error: No JIT or interpreter support available or selected." >&5
+$as_echo "$as_me: error: No JIT or interpreter support available or selected." >&2;}
    { (exit 1); exit 1; }; }
       fi
    fi
@@ -39834,8 +32282,8 @@ else
    if test x$interp_wanted = xtrue; then
       jit_status="interpreter"
    else
-      { { echo "$as_me:$LINENO: error: No JIT or interpreter support available or selected." >&5
-echo "$as_me: error: No JIT or interpreter support available or selected." >&2;}
+      { { $as_echo "$as_me:$LINENO: error: No JIT or interpreter support available or selected." >&5
+$as_echo "$as_me: error: No JIT or interpreter support available or selected." >&2;}
    { (exit 1); exit 1; }; }
    fi
 fi
@@ -39873,8 +32321,8 @@ case "$host" in
 	INTL="libintl.so"
 	;;
     *-*-*linux*)
-	{ echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for X" >&5
+$as_echo_n "checking for X... " >&6; }
 
 
 # Check whether --with-x was given.
@@ -39888,11 +32336,11 @@ if test "x$with_x" = xno; then
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
-echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
    { (exit 1); exit 1; }; };; #(
     *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   # One or both of the vars are not set, and there is no cached value.
 ac_x_includes=no ac_x_libraries=no
@@ -39913,7 +32361,7 @@ _ACEOF
       eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
     done
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl; do
+    for ac_extension in a so sl dylib la dll; do
       if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
 	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
 	ac_im_usrlibdir=$ac_im_libdir; break
@@ -39927,7 +32375,7 @@ _ACEOF
 	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
     esac
     case $ac_im_usrlibdir in
-	/usr/lib | /lib) ;;
+	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
 	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
     esac
   fi
@@ -39988,13 +32436,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -40002,7 +32451,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # We can compile using X headers with no special include directory.
 ac_x_includes=
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   for ac_dir in $ac_x_header_dirs; do
@@ -40043,30 +32492,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
 ac_x_libraries=
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	LIBS=$ac_save_LIBS
-for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
-  for ac_extension in a so sl; do
+  for ac_extension in a so sl dylib la dll; do
     if test -r "$ac_dir/libX11.$ac_extension"; then
       ac_x_libraries=$ac_dir
       break 2
@@ -40075,6 +32527,7 @@ do
 done
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
@@ -40097,8 +32550,8 @@ fi
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  { echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$have_x" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
+$as_echo "$have_x" >&6; }
   no_x=yes
 else
   # If each of the values was on the command line, it overrides each guess.
@@ -40108,25 +32561,25 @@ else
   ac_cv_have_x="have_x=yes\
 	ac_x_includes='$x_includes'\
 	ac_x_libraries='$x_libraries'"
-  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
 fi
 
-	{ echo "$as_me:$LINENO: checking for the soname of libX11.so" >&5
-echo $ECHO_N "checking for the soname of libX11.so... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking for the soname of libX11.so" >&5
+$as_echo_n "checking for the soname of libX11.so... " >&6; }
 	for i in $x_libraries /usr/lib /usr/lib64; do
 		for r in 4 5 6; do
 			if test -f $i/libX11.so.$r; then
 				X11=libX11.so.$r
-				{ echo "$as_me:$LINENO: result: $X11" >&5
-echo "${ECHO_T}$X11" >&6; }
+				{ $as_echo "$as_me:$LINENO: result: $X11" >&5
+$as_echo "$X11" >&6; }
 			fi
 		done
 	done
 
 	if test "x$X11" = "xlibX11.so"; then
-		{ echo "$as_me:$LINENO: WARNING: Could not find X development libs. Do you have the -devel package installed? WinForms may not work..." >&5
-echo "$as_me: WARNING: Could not find X development libs. Do you have the -devel package installed? WinForms may not work..." >&2;};
+		{ $as_echo "$as_me:$LINENO: WARNING: Could not find X development libs. Do you have the -devel package installed? WinForms may not work..." >&5
+$as_echo "$as_me: WARNING: Could not find X development libs. Do you have the -devel package installed? WinForms may not work..." >&2;};
 	fi
 	;;
 esac
@@ -40137,20 +32590,21 @@ esac
 
 for ac_header in valgrind/memcheck.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -40166,32 +32620,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -40205,69 +32660,73 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -40287,8 +32746,8 @@ if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86"; then
 		$CC -fPIC --shared -o conftest.so conftest.c > /dev/null 2>&1
 		$CC -o conftest conftest.so > /dev/null 2>&1
 		if test ! -f conftest; then
-		   { echo "$as_me:$LINENO: WARNING: Disabling usage of __thread." >&5
-echo "$as_me: WARNING: Disabling usage of __thread." >&2;};
+		   { $as_echo "$as_me:$LINENO: WARNING: Disabling usage of __thread." >&5
+$as_echo "$as_me: WARNING: Disabling usage of __thread." >&2;};
 		   with_tls=pthread
 		fi
 		rm -f conftest.c conftest.so conftest
@@ -40306,8 +32765,8 @@ if test "x$TARGET" = "xAMD64" -o "x$TARGET" = "xX86" -o "x$TARGET" = "xALPHA"; t
 	fi
 fi
 
-{ echo "$as_me:$LINENO: checking if the Mono Debugger is supported on this platform" >&5
-echo $ECHO_N "checking if the Mono Debugger is supported on this platform... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if the Mono Debugger is supported on this platform" >&5
+$as_echo_n "checking if the Mono Debugger is supported on this platform... " >&6; }
 if test "x$mono_debugger_supported" = "xyes"; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -40315,8 +32774,8 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 fi
-{ echo "$as_me:$LINENO: result: $mono_debugger_supported" >&5
-echo "${ECHO_T}$mono_debugger_supported" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $mono_debugger_supported" >&5
+$as_echo "$mono_debugger_supported" >&6; }
  if test x$mono_debugger_supported = xyes; then
   MONO_DEBUGGER_SUPPORTED_TRUE=
   MONO_DEBUGGER_SUPPORTED_FALSE='#'
@@ -40334,8 +32793,8 @@ _ACEOF
 
 	# Pass the information to libgc
 	CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
-	{ echo "$as_me:$LINENO: checking if the tls_model attribute is supported" >&5
-echo $ECHO_N "checking if the tls_model attribute is supported... $ECHO_C" >&6; }
+	{ $as_echo "$as_me:$LINENO: checking if the tls_model attribute is supported" >&5
+$as_echo_n "checking if the tls_model attribute is supported... " >&6; }
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -40358,20 +32817,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
 
-			{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_TLS_MODEL_ATTR 1
@@ -40379,12 +32839,12 @@ _ACEOF
 
 
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
-			{ echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+			{ $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
 
@@ -40392,8 +32852,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
 if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
-				{ echo "$as_me:$LINENO: checking which FPU to use" >&5
-echo $ECHO_N "checking which FPU to use... $ECHO_C" >&6; }
+				{ $as_echo "$as_me:$LINENO: checking which FPU to use" >&5
+$as_echo_n "checking which FPU to use... " >&6; }
 
 	cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -40418,20 +32878,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   fpu=FPA
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	fpu=NONE
@@ -40439,16 +32900,16 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-	{ echo "$as_me:$LINENO: result: $fpu" >&5
-echo "${ECHO_T}$fpu" >&6; }
+	{ $as_echo "$as_me:$LINENO: result: $fpu" >&5
+$as_echo "$fpu" >&6; }
 	CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
 	unset fpu
 fi
 
 if test ${TARGET} = unknown; then
 	CPPFLAGS="$CPPFLAGS -DNO_PORT"
-	{ echo "$as_me:$LINENO: WARNING: \"mono has not been ported to $host: some things may not work.\"" >&5
-echo "$as_me: WARNING: \"mono has not been ported to $host: some things may not work.\"" >&2;}
+	{ $as_echo "$as_me:$LINENO: WARNING: \"mono has not been ported to $host: some things may not work.\"" >&5
+$as_echo "$as_me: WARNING: \"mono has not been ported to $host: some things may not work.\"" >&2;}
 fi
 
 if test ${ACCESS_UNALIGNED} = no; then
@@ -40506,8 +32967,8 @@ if test "${with_oprofile+set}" = set; then
 	if test x$with_oprofile != xno; then
 	    oprofile_include=$with_oprofile/include
 	    if test ! -f $oprofile_include/opagent.h; then
-	   	  { { echo "$as_me:$LINENO: error: oprofile include file not found at $oprofile_include/opagent.h" >&5
-echo "$as_me: error: oprofile include file not found at $oprofile_include/opagent.h" >&2;}
+	   	  { { $as_echo "$as_me:$LINENO: error: oprofile include file not found at $oprofile_include/opagent.h" >&5
+$as_echo "$as_me: error: oprofile include file not found at $oprofile_include/opagent.h" >&2;}
    { (exit 1); exit 1; }; }
 		fi
 	    OPROFILE=yes
@@ -40791,7 +33252,7 @@ if test x$enable_quiet_build = xyes; then
 
 fi
 
-ac_config_files="$ac_config_files Makefile mono-uninstalled.pc scripts/mono-find-provides scripts/mono-find-requires mono/Makefile mono/utils/Makefile mono/metadata/Makefile mono/dis/Makefile mono/cil/Makefile mono/arch/Makefile mono/os/Makefile mono/arch/x86/Makefile mono/arch/amd64/Makefile mono/arch/hppa/Makefile mono/arch/ppc/Makefile mono/arch/sparc/Makefile mono/arch/s390/Makefile mono/arch/s390x/Makefile mono/arch/arm/Makefile mono/arch/alpha/Makefile mono/arch/ia64/Makefile mono/arch/mips/Makefile mono/interpreter/Makefile mono/tests/Makefile mono/tests/tests-config mono/tests/assemblyresolve/Makefile mono/tests/cas/Makefile mono/tests/cas/assembly/Makefile mono/tests/cas/demand/Makefile mono/tests/cas/inheritance/Makefile mono/tests/cas/linkdemand/Makefile mono/tests/cas/threads/Makefile mono/benchmark/Makefile mono/monograph/Makefile mono/io-layer/Makefile mono/mini/Makefile mono/profiler/Makefile ikvm-native/Makefile scripts/Makefile man/Makefile web/Makefile docs/Makefile data/Makefile data/net_1_1/Makefile data/net_2_0/Makefile data/net_2_0/Browsers/Makefile data/mint.pc data/mono.pc data/mono-cairo.pc data/mono-nunit.pc data/mono-options.pc data/mono-lineeditor.pc data/monodoc.pc data/mono.web.pc data/dotnet.pc data/dotnet35.pc data/wcf.pc data/cecil.pc data/smcs.pc data/system.web.extensions_1.0.pc data/system.web.extensions.design_1.0.pc samples/Makefile support/Makefile data/config tools/Makefile tools/locale-builder/Makefile runtime/Makefile msvc/Makefile po/Makefile"
+ac_config_files="$ac_config_files Makefile mono-uninstalled.pc scripts/mono-find-provides scripts/mono-find-requires mono/Makefile mono/utils/Makefile mono/metadata/Makefile mono/dis/Makefile mono/cil/Makefile mono/arch/Makefile mono/os/Makefile mono/arch/x86/Makefile mono/arch/amd64/Makefile mono/arch/hppa/Makefile mono/arch/ppc/Makefile mono/arch/sparc/Makefile mono/arch/s390/Makefile mono/arch/s390x/Makefile mono/arch/arm/Makefile mono/arch/alpha/Makefile mono/arch/ia64/Makefile mono/arch/mips/Makefile mono/interpreter/Makefile mono/tests/Makefile mono/tests/tests-config mono/tests/assemblyresolve/Makefile mono/tests/cas/Makefile mono/tests/cas/assembly/Makefile mono/tests/cas/demand/Makefile mono/tests/cas/inheritance/Makefile mono/tests/cas/linkdemand/Makefile mono/tests/cas/threads/Makefile mono/benchmark/Makefile mono/monograph/Makefile mono/io-layer/Makefile mono/mini/Makefile mono/profiler/Makefile ikvm-native/Makefile scripts/Makefile man/Makefile web/Makefile docs/Makefile data/Makefile data/net_1_1/Makefile data/net_2_0/Makefile data/net_2_0/Browsers/Makefile data/mint.pc data/mono.pc data/mono-cairo.pc data/mono-nunit.pc data/mono-options.pc data/mono-lineeditor.pc data/monodoc.pc data/mono.web.pc data/dotnet.pc data/dotnet35.pc data/wcf.pc data/cecil.pc data/smcs.pc data/system.web.extensions_1.0.pc data/system.web.extensions.design_1.0.pc data/system.web.mvc.pc samples/Makefile support/Makefile data/config tools/Makefile tools/locale-builder/Makefile runtime/Makefile msvc/Makefile po/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -40820,11 +33281,12 @@ _ACEOF
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -40857,12 +33319,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -40878,7 +33340,7 @@ ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -40890,327 +33352,321 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${PLATFORM_WIN32_TRUE}" && test -z "${PLATFORM_WIN32_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"PLATFORM_WIN32\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"PLATFORM_WIN32\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PLATFORM_WIN32\" was never defined.
+$as_echo "$as_me: error: conditional \"PLATFORM_WIN32\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${PLATFORM_LINUX_TRUE}" && test -z "${PLATFORM_LINUX_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"PLATFORM_LINUX\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"PLATFORM_LINUX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"PLATFORM_LINUX\" was never defined.
+$as_echo "$as_me: error: conditional \"PLATFORM_LINUX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"CROSS_COMPILING\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
+$as_echo "$as_me: error: conditional \"CROSS_COMPILING\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${USE_BATCH_FILES_TRUE}" && test -z "${USE_BATCH_FILES_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"USE_BATCH_FILES\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"USE_BATCH_FILES\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"USE_BATCH_FILES\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+$as_echo "$as_me: error: conditional \"USE_BATCH_FILES\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${NO_VERSION_SCRIPT_TRUE}" && test -z "${NO_VERSION_SCRIPT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"NO_VERSION_SCRIPT\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"NO_VERSION_SCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"NO_VERSION_SCRIPT\" was never defined.
+$as_echo "$as_me: error: conditional \"NO_VERSION_SCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${HAVE_ZLIB_TRUE}" && test -z "${HAVE_ZLIB_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HAVE_ZLIB\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_ZLIB\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HAVE_ZLIB\" was never defined.
+$as_echo "$as_me: error: conditional \"HAVE_ZLIB\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${BUILD_MCS_TRUE}" && test -z "${BUILD_MCS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"BUILD_MCS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_MCS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"BUILD_MCS\" was never defined.
+$as_echo "$as_me: error: conditional \"BUILD_MCS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${EGLIB_BUILD_TRUE}" && test -z "${EGLIB_BUILD_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"EGLIB_BUILD\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"EGLIB_BUILD\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"EGLIB_BUILD\" was never defined.
+$as_echo "$as_me: error: conditional \"EGLIB_BUILD\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${STATIC_MONO_TRUE}" && test -z "${STATIC_MONO_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"STATIC_MONO\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"STATIC_MONO\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"STATIC_MONO\" was never defined.
+$as_echo "$as_me: error: conditional \"STATIC_MONO\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${DISABLE_PROFILER_TRUE}" && test -z "${DISABLE_PROFILER_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"DISABLE_PROFILER\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"DISABLE_PROFILER\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"DISABLE_PROFILER\" was never defined.
+$as_echo "$as_me: error: conditional \"DISABLE_PROFILER\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${DISABLE_JIT_TRUE}" && test -z "${DISABLE_JIT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"DISABLE_JIT\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"DISABLE_JIT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"DISABLE_JIT\" was never defined.
+$as_echo "$as_me: error: conditional \"DISABLE_JIT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${INCLUDED_LIBGC_TRUE}" && test -z "${INCLUDED_LIBGC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INCLUDED_LIBGC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"INCLUDED_LIBGC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INCLUDED_LIBGC\" was never defined.
+$as_echo "$as_me: error: conditional \"INCLUDED_LIBGC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${ENABLE_NUNIT_TESTS_TRUE}" && test -z "${ENABLE_NUNIT_TESTS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_NUNIT_TESTS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_NUNIT_TESTS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ENABLE_NUNIT_TESTS\" was never defined.
+$as_echo "$as_me: error: conditional \"ENABLE_NUNIT_TESTS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${ENABLE_DTRACE_TRUE}" && test -z "${ENABLE_DTRACE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DTRACE\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_DTRACE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ENABLE_DTRACE\" was never defined.
+$as_echo "$as_me: error: conditional \"ENABLE_DTRACE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${DTRACE_G_REQUIRED_TRUE}" && test -z "${DTRACE_G_REQUIRED_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"DTRACE_G_REQUIRED\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"DTRACE_G_REQUIRED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"DTRACE_G_REQUIRED\" was never defined.
+$as_echo "$as_me: error: conditional \"DTRACE_G_REQUIRED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${USE_JIT_TRUE}" && test -z "${USE_JIT_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"USE_JIT\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"USE_JIT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"USE_JIT\" was never defined.
+$as_echo "$as_me: error: conditional \"USE_JIT\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${MONO_DEBUGGER_SUPPORTED_TRUE}" && test -z "${MONO_DEBUGGER_SUPPORTED_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MONO_DEBUGGER_SUPPORTED\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MONO_DEBUGGER_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MONO_DEBUGGER_SUPPORTED\" was never defined.
+$as_echo "$as_me: error: conditional \"MONO_DEBUGGER_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${HAVE_OPROFILE_TRUE}" && test -z "${HAVE_OPROFILE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HAVE_OPROFILE\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_OPROFILE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HAVE_OPROFILE\" was never defined.
+$as_echo "$as_me: error: conditional \"HAVE_OPROFILE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${INSTALL_2_0_TRUE}" && test -z "${INSTALL_2_0_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INSTALL_2_0\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"INSTALL_2_0\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_2_0\" was never defined.
+$as_echo "$as_me: error: conditional \"INSTALL_2_0\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${INSTALL_2_1_TRUE}" && test -z "${INSTALL_2_1_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INSTALL_2_1\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"INSTALL_2_1\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INSTALL_2_1\" was never defined.
+$as_echo "$as_me: error: conditional \"INSTALL_2_1\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${MIPS_GCC_TRUE}" && test -z "${MIPS_GCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MIPS_GCC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MIPS_GCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MIPS_GCC\" was never defined.
+$as_echo "$as_me: error: conditional \"MIPS_GCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${MIPS_SGI_TRUE}" && test -z "${MIPS_SGI_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MIPS_SGI\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MIPS_SGI\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MIPS_SGI\" was never defined.
+$as_echo "$as_me: error: conditional \"MIPS_SGI\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${SPARC_TRUE}" && test -z "${SPARC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"SPARC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SPARC\" was never defined.
+$as_echo "$as_me: error: conditional \"SPARC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${SPARC64_TRUE}" && test -z "${SPARC64_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"SPARC64\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"SPARC64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"SPARC64\" was never defined.
+$as_echo "$as_me: error: conditional \"SPARC64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${X86_TRUE}" && test -z "${X86_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"X86\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"X86\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"X86\" was never defined.
+$as_echo "$as_me: error: conditional \"X86\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${AMD64_TRUE}" && test -z "${AMD64_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMD64\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMD64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMD64\" was never defined.
+$as_echo "$as_me: error: conditional \"AMD64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${ALPHA_TRUE}" && test -z "${ALPHA_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ALPHA\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"ALPHA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ALPHA\" was never defined.
+$as_echo "$as_me: error: conditional \"ALPHA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${IA64_TRUE}" && test -z "${IA64_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"IA64\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"IA64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"IA64\" was never defined.
+$as_echo "$as_me: error: conditional \"IA64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${M68K_TRUE}" && test -z "${M68K_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"M68K\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"M68K\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"M68K\" was never defined.
+$as_echo "$as_me: error: conditional \"M68K\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${MIPS_TRUE}" && test -z "${MIPS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MIPS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MIPS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MIPS\" was never defined.
+$as_echo "$as_me: error: conditional \"MIPS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${POWERPC_TRUE}" && test -z "${POWERPC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"POWERPC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC\" was never defined.
+$as_echo "$as_me: error: conditional \"POWERPC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${POWERPC64_TRUE}" && test -z "${POWERPC64_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"POWERPC64\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC64\" was never defined.
+$as_echo "$as_me: error: conditional \"POWERPC64\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${ARM_TRUE}" && test -z "${ARM_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"ARM\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"ARM\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"ARM\" was never defined.
+$as_echo "$as_me: error: conditional \"ARM\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${S390_TRUE}" && test -z "${S390_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"S390\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"S390\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"S390\" was never defined.
+$as_echo "$as_me: error: conditional \"S390\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${S390x_TRUE}" && test -z "${S390x_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"S390x\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"S390x\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"S390x\" was never defined.
+$as_echo "$as_me: error: conditional \"S390x\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${HPPA_TRUE}" && test -z "${HPPA_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HPPA\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"HPPA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HPPA\" was never defined.
+$as_echo "$as_me: error: conditional \"HPPA\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${JIT_SUPPORTED_TRUE}" && test -z "${JIT_SUPPORTED_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"JIT_SUPPORTED\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"JIT_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"JIT_SUPPORTED\" was never defined.
+$as_echo "$as_me: error: conditional \"JIT_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${INTERP_SUPPORTED_TRUE}" && test -z "${INTERP_SUPPORTED_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INTERP_SUPPORTED\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"INTERP_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INTERP_SUPPORTED\" was never defined.
+$as_echo "$as_me: error: conditional \"INTERP_SUPPORTED\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${INCLUDED_LIBGC_TRUE}" && test -z "${INCLUDED_LIBGC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"INCLUDED_LIBGC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"INCLUDED_LIBGC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"INCLUDED_LIBGC\" was never defined.
+$as_echo "$as_me: error: conditional \"INCLUDED_LIBGC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 : ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -41223,7 +33679,7 @@ ac_cs_silent=false
 SHELL=\${CONFIG_SHELL-$SHELL}
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -41233,7 +33689,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -41255,17 +33711,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -41281,8 +33765,6 @@ fi
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -41305,7 +33787,7 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -41318,17 +33800,10 @@ PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -41350,7 +33825,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -41401,7 +33876,7 @@ $as_unset CDPATH
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -41429,7 +33904,6 @@ case `echo -n x` in
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -41442,19 +33916,22 @@ if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -41479,10 +33956,10 @@ else
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -41505,7 +33982,7 @@ exec 6>&1
 # values after options handling.
 ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -41518,7 +33995,16 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
 config_headers="$ac_config_headers"
@@ -41526,22 +34012,23 @@ config_commands="$ac_config_commands"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
-  --header=FILE[:TEMPLATE]
-		   instantiate the configuration header FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
 
 Configuration files:
 $config_files
@@ -41555,13 +34042,13 @@ $config_commands
 Report bugs to <bug-autoconf at gnu.org>."
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.61,
-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2008 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -41569,11 +34056,12 @@ ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
 MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
@@ -41595,30 +34083,36 @@ do
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    $as_echo "$ac_cs_version"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
-    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    { echo "$as_me: error: ambiguous option: $1
+    { $as_echo "$as_me: error: ambiguous option: $1
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; };;
   --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { echo "$as_me: error: unrecognized option: $1
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
@@ -41637,31 +34131,289 @@ if $ac_cs_silent; then
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  CONFIG_SHELL=$SHELL
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  exec "\$@"
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 exec 5>>config.log
 {
   echo
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  echo "$ac_log"
+  $as_echo "$ac_log"
 } >&5
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+  ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
 # Capture the value of obsolete ALL_LINGUAS because we need it to compute
     # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
     # from automake < 1.5.
@@ -41678,7 +34430,7 @@ shell=$SHELL
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
@@ -41686,6 +34438,7 @@ do
   case $ac_config_target in
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
     "po/mcs/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/mcs/Makefile.in" ;;
     "runtime/mono-wrapper") CONFIG_FILES="$CONFIG_FILES runtime/mono-wrapper" ;;
@@ -41758,6 +34511,7 @@ do
     "data/smcs.pc") CONFIG_FILES="$CONFIG_FILES data/smcs.pc" ;;
     "data/system.web.extensions_1.0.pc") CONFIG_FILES="$CONFIG_FILES data/system.web.extensions_1.0.pc" ;;
     "data/system.web.extensions.design_1.0.pc") CONFIG_FILES="$CONFIG_FILES data/system.web.extensions.design_1.0.pc" ;;
+    "data/system.web.mvc.pc") CONFIG_FILES="$CONFIG_FILES data/system.web.mvc.pc" ;;
     "samples/Makefile") CONFIG_FILES="$CONFIG_FILES samples/Makefile" ;;
     "support/Makefile") CONFIG_FILES="$CONFIG_FILES support/Makefile" ;;
     "data/config") CONFIG_FILES="$CONFIG_FILES data/config" ;;
@@ -41767,8 +34521,8 @@ do
     "msvc/Makefile") CONFIG_FILES="$CONFIG_FILES msvc/Makefile" ;;
     "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;;
 
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
@@ -41809,404 +34563,144 @@ $debug ||
   (umask 077 && mkdir "$tmp")
 } ||
 {
-   echo "$me: cannot create a temporary directory in ." >&2
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-target!$target$ac_delim
-target_cpu!$target_cpu$ac_delim
-target_vendor!$target_vendor$ac_delim
-target_os!$target_os$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
-MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
-MAINT!$MAINT$ac_delim
-API_VER!$API_VER$ac_delim
-LN_S!$LN_S$ac_delim
-libmono_cflags!$libmono_cflags$ac_delim
-libmono_ldflags!$libmono_ldflags$ac_delim
-reloc_libdir!$reloc_libdir$ac_delim
-PLATFORM_WIN32_TRUE!$PLATFORM_WIN32_TRUE$ac_delim
-PLATFORM_WIN32_FALSE!$PLATFORM_WIN32_FALSE$ac_delim
-PLATFORM_LINUX_TRUE!$PLATFORM_LINUX_TRUE$ac_delim
-PLATFORM_LINUX_FALSE!$PLATFORM_LINUX_FALSE$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-_ACEOF
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
-    break
-  elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
 
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
 fi
 
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-CCAS!$CCAS$ac_delim
-CCASFLAGS!$CCASFLAGS$ac_delim
-CCASDEPMODE!$CCASDEPMODE$ac_delim
-am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim
-am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim
-BISON!$BISON$ac_delim
-CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim
-CFLAGS_FOR_BUILD!$CFLAGS_FOR_BUILD$ac_delim
-HOST_CC!$HOST_CC$ac_delim
-BUILD_EXEEXT!$BUILD_EXEEXT$ac_delim
-CROSS_COMPILING_TRUE!$CROSS_COMPILING_TRUE$ac_delim
-CROSS_COMPILING_FALSE!$CROSS_COMPILING_FALSE$ac_delim
-USE_BATCH_FILES_TRUE!$USE_BATCH_FILES_TRUE$ac_delim
-USE_BATCH_FILES_FALSE!$USE_BATCH_FILES_FALSE$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-SED!$SED$ac_delim
-ECHO!$ECHO$ac_delim
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-DSYMUTIL!$DSYMUTIL$ac_delim
-NMEDIT!$NMEDIT$ac_delim
-DLLTOOL!$DLLTOOL$ac_delim
-AS!$AS$ac_delim
-OBJDUMP!$OBJDUMP$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-DOLT_BASH!$DOLT_BASH$ac_delim
-LTCOMPILE!$LTCOMPILE$ac_delim
-LTCXXCOMPILE!$LTCXXCOMPILE$ac_delim
-export_ldflags!$export_ldflags$ac_delim
-NO_VERSION_SCRIPT_TRUE!$NO_VERSION_SCRIPT_TRUE$ac_delim
-NO_VERSION_SCRIPT_FALSE!$NO_VERSION_SCRIPT_FALSE$ac_delim
-HAVE_ZLIB_TRUE!$HAVE_ZLIB_TRUE$ac_delim
-HAVE_ZLIB_FALSE!$HAVE_ZLIB_FALSE$ac_delim
-BUILD_MCS_TRUE!$BUILD_MCS_TRUE$ac_delim
-BUILD_MCS_FALSE!$BUILD_MCS_FALSE$ac_delim
-mcs_topdir!$mcs_topdir$ac_delim
-mcs_topdir_from_srcdir!$mcs_topdir_from_srcdir$ac_delim
-USE_NLS!$USE_NLS$ac_delim
-GETTEXT_MACRO_VERSION!$GETTEXT_MACRO_VERSION$ac_delim
-MSGFMT!$MSGFMT$ac_delim
-GMSGFMT!$GMSGFMT$ac_delim
-MSGFMT_015!$MSGFMT_015$ac_delim
-GMSGFMT_015!$GMSGFMT_015$ac_delim
-XGETTEXT!$XGETTEXT$ac_delim
-XGETTEXT_015!$XGETTEXT_015$ac_delim
-MSGMERGE!$MSGMERGE$ac_delim
-XGETTEXT_EXTRA_OPTIONS!$XGETTEXT_EXTRA_OPTIONS$ac_delim
-HAVE_MSGFMT!$HAVE_MSGFMT$ac_delim
-libgdiplus_loc!$libgdiplus_loc$ac_delim
-PKG_CONFIG!$PKG_CONFIG$ac_delim
-subdirs!$subdirs$ac_delim
-EGLIB_BUILD_TRUE!$EGLIB_BUILD_TRUE$ac_delim
-EGLIB_BUILD_FALSE!$EGLIB_BUILD_FALSE$ac_delim
-GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim
-GLIB_LIBS!$GLIB_LIBS$ac_delim
-GMODULE_CFLAGS!$GMODULE_CFLAGS$ac_delim
-GMODULE_LIBS!$GMODULE_LIBS$ac_delim
-BUILD_GLIB_CFLAGS!$BUILD_GLIB_CFLAGS$ac_delim
-BUILD_GLIB_LIBS!$BUILD_GLIB_LIBS$ac_delim
-eglib_dir!$eglib_dir$ac_delim
-STATIC_MONO_TRUE!$STATIC_MONO_TRUE$ac_delim
-STATIC_MONO_FALSE!$STATIC_MONO_FALSE$ac_delim
-DISABLE_PROFILER_TRUE!$DISABLE_PROFILER_TRUE$ac_delim
-DISABLE_PROFILER_FALSE!$DISABLE_PROFILER_FALSE$ac_delim
-DISABLE_JIT_TRUE!$DISABLE_JIT_TRUE$ac_delim
-DISABLE_JIT_FALSE!$DISABLE_JIT_FALSE$ac_delim
-HAVE_BOEHM_GC!$HAVE_BOEHM_GC$ac_delim
-INCLUDED_LIBGC_TRUE!$INCLUDED_LIBGC_TRUE$ac_delim
-INCLUDED_LIBGC_FALSE!$INCLUDED_LIBGC_FALSE$ac_delim
-LIBGC_CFLAGS!$LIBGC_CFLAGS$ac_delim
-LIBGC_LIBS!$LIBGC_LIBS$ac_delim
-LIBGC_STATIC_LIBS!$LIBGC_STATIC_LIBS$ac_delim
-libgc_dir!$libgc_dir$ac_delim
-MONO_DL_NEED_USCORE!$MONO_DL_NEED_USCORE$ac_delim
-ikvm_native_dir!$ikvm_native_dir$ac_delim
-XATTR_LIB!$XATTR_LIB$ac_delim
-DISABLE_SHARED_HANDLES!$DISABLE_SHARED_HANDLES$ac_delim
-ENABLE_NUNIT_TESTS_TRUE!$ENABLE_NUNIT_TESTS_TRUE$ac_delim
-ENABLE_NUNIT_TESTS_FALSE!$ENABLE_NUNIT_TESTS_FALSE$ac_delim
-DTRACE!$DTRACE$ac_delim
-DTRACEFLAGS!$DTRACEFLAGS$ac_delim
-ENABLE_DTRACE_TRUE!$ENABLE_DTRACE_TRUE$ac_delim
-ENABLE_DTRACE_FALSE!$ENABLE_DTRACE_FALSE$ac_delim
-_ACEOF
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
-    break
-  elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
-
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
-_ACEOF
 
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-DTRACE_G_REQUIRED_TRUE!$DTRACE_G_REQUIRED_TRUE$ac_delim
-DTRACE_G_REQUIRED_FALSE!$DTRACE_G_REQUIRED_FALSE$ac_delim
-USE_JIT_TRUE!$USE_JIT_TRUE$ac_delim
-USE_JIT_FALSE!$USE_JIT_FALSE$ac_delim
-XMKMF!$XMKMF$ac_delim
-libsuffix!$libsuffix$ac_delim
-MONO_DEBUGGER_SUPPORTED_TRUE!$MONO_DEBUGGER_SUPPORTED_TRUE$ac_delim
-MONO_DEBUGGER_SUPPORTED_FALSE!$MONO_DEBUGGER_SUPPORTED_FALSE$ac_delim
-HAVE_OPROFILE_TRUE!$HAVE_OPROFILE_TRUE$ac_delim
-HAVE_OPROFILE_FALSE!$HAVE_OPROFILE_FALSE$ac_delim
-OPROFILE_CFLAGS!$OPROFILE_CFLAGS$ac_delim
-OPROFILE_LIBS!$OPROFILE_LIBS$ac_delim
-INSTALL_2_0_TRUE!$INSTALL_2_0_TRUE$ac_delim
-INSTALL_2_0_FALSE!$INSTALL_2_0_FALSE$ac_delim
-INSTALL_2_1_TRUE!$INSTALL_2_1_TRUE$ac_delim
-INSTALL_2_1_FALSE!$INSTALL_2_1_FALSE$ac_delim
-MIPS_GCC_TRUE!$MIPS_GCC_TRUE$ac_delim
-MIPS_GCC_FALSE!$MIPS_GCC_FALSE$ac_delim
-MIPS_SGI_TRUE!$MIPS_SGI_TRUE$ac_delim
-MIPS_SGI_FALSE!$MIPS_SGI_FALSE$ac_delim
-SPARC_TRUE!$SPARC_TRUE$ac_delim
-SPARC_FALSE!$SPARC_FALSE$ac_delim
-SPARC64_TRUE!$SPARC64_TRUE$ac_delim
-SPARC64_FALSE!$SPARC64_FALSE$ac_delim
-X86_TRUE!$X86_TRUE$ac_delim
-X86_FALSE!$X86_FALSE$ac_delim
-AMD64_TRUE!$AMD64_TRUE$ac_delim
-AMD64_FALSE!$AMD64_FALSE$ac_delim
-ALPHA_TRUE!$ALPHA_TRUE$ac_delim
-ALPHA_FALSE!$ALPHA_FALSE$ac_delim
-IA64_TRUE!$IA64_TRUE$ac_delim
-IA64_FALSE!$IA64_FALSE$ac_delim
-M68K_TRUE!$M68K_TRUE$ac_delim
-M68K_FALSE!$M68K_FALSE$ac_delim
-MIPS_TRUE!$MIPS_TRUE$ac_delim
-MIPS_FALSE!$MIPS_FALSE$ac_delim
-POWERPC_TRUE!$POWERPC_TRUE$ac_delim
-POWERPC_FALSE!$POWERPC_FALSE$ac_delim
-POWERPC64_TRUE!$POWERPC64_TRUE$ac_delim
-POWERPC64_FALSE!$POWERPC64_FALSE$ac_delim
-ARM_TRUE!$ARM_TRUE$ac_delim
-ARM_FALSE!$ARM_FALSE$ac_delim
-S390_TRUE!$S390_TRUE$ac_delim
-S390_FALSE!$S390_FALSE$ac_delim
-S390x_TRUE!$S390x_TRUE$ac_delim
-S390x_FALSE!$S390x_FALSE$ac_delim
-HPPA_TRUE!$HPPA_TRUE$ac_delim
-HPPA_FALSE!$HPPA_FALSE$ac_delim
-JIT_SUPPORTED_TRUE!$JIT_SUPPORTED_TRUE$ac_delim
-JIT_SUPPORTED_FALSE!$JIT_SUPPORTED_FALSE$ac_delim
-INTERP_SUPPORTED_TRUE!$INTERP_SUPPORTED_TRUE$ac_delim
-INTERP_SUPPORTED_FALSE!$INTERP_SUPPORTED_FALSE$ac_delim
-LIBC!$LIBC$ac_delim
-INTL!$INTL$ac_delim
-SQLITE!$SQLITE$ac_delim
-SQLITE3!$SQLITE3$ac_delim
-X11!$X11$ac_delim
-arch_target!$arch_target$ac_delim
-mono_build_root!$mono_build_root$ac_delim
-mono_runtime!$mono_runtime$ac_delim
-mono_cfg_dir!$mono_cfg_dir$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 63; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
 
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
 
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACAWK
 _ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
 _ACEOF
 
-
 # VPATH may cause trouble with some makes, so we remove $(srcdir),
 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
@@ -42222,19 +34716,133 @@ s/^[^=]*=[	 ]*$//
 }'
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
+    break
+  elif $ac_last_try; then
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
+fi # test -n "$CONFIG_HEADERS"
+
 
-for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
 do
   case $ac_tag in
   :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
    { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -42263,26 +34871,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
    { (exit 1); exit 1; }; };;
       esac
-      ac_file_inputs="$ac_file_inputs $ac_f"
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
-    configure_input="Generated from "`IFS=:
-	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
     esac
     ;;
   esac
@@ -42292,7 +34912,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42318,7 +34938,7 @@ echo X"$ac_file" |
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -42327,7 +34947,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42348,17 +34968,17 @@ echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
   ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -42403,12 +35023,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
   esac
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
 
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
   p
   q
 }
@@ -42417,13 +35038,14 @@ case `sed -n '/datarootdir/ {
 /@infodir@/p
 /@localedir@/p
 /@mandir@/p
-' $ac_file_inputs` in
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_datarootdir_hack='
   s&@datadir@&$datadir&g
   s&@docdir@&$docdir&g
@@ -42437,15 +35059,16 @@ _ACEOF
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
 # FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
 s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
 s&@srcdir@&$ac_srcdir&;t t
 s&@abs_srcdir@&$ac_abs_srcdir&;t t
 s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -42456,121 +35079,60 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
  ;;
   :H)
   #
   # CONFIG_HEADER
   #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status.  If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless.  But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
-ac_dB='\\)[	 (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
-  sed -n '
-	t rset
-	:rset
-	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
-	t ok
-	d
-	:ok
-	s/[\\&,]/\\&/g
-	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
-	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
-  ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments.  This is necessary, for
-# example, in the case of _POSIX_SOURCE, which is predefined and required
-# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[	 #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
-do
-  # Write a here document:
-    cat >>$CONFIG_STATUS <<_ACEOF
-    # First, check the format of the line:
-    cat >"\$tmp/defines.sed" <<\\CEOF
-/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
-/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
-b
-:def
-_ACEOF
-  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
-  echo 'CEOF
-    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
-  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
-  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
-  grep . conftest.tail >/dev/null || break
-  rm -f conftest.defines
-  mv conftest.tail conftest.defines
-done
-rm -f conftest.defines conftest.tail
-
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
-cat >>$CONFIG_STATUS <<\_ACEOF
   if test x"$ac_file" != x-; then
-    echo "/* $configure_input  */" >"$tmp/config.h"
-    cat "$ac_result" >>"$tmp/config.h"
-    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
-      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
-echo "$as_me: $ac_file is unchanged" >&6;}
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      rm -f $ac_file
-      mv "$tmp/config.h" $ac_file
+      rm -f "$ac_file"
+      mv "$tmp/config.h" "$ac_file" \
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
-    echo "/* $configure_input  */"
-    cat "$ac_result"
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  rm -f "$tmp/out12"
-# Compute $ac_file's index in $config_headers.
-_am_arg=$ac_file
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
 _am_stamp_count=1
 for _am_header in $config_headers :; do
   case $_am_header in
@@ -42585,7 +35147,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$_am_arg" : 'X\(//\)[^/]' \| \
 	 X"$_am_arg" : 'X\(//\)$' \| \
 	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$_am_arg" |
+$as_echo X"$_am_arg" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42605,8 +35167,8 @@ echo X"$_am_arg" |
 	  s/.*/./; q'`/stamp-h$_am_stamp_count
  ;;
 
-  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
  ;;
   esac
 
@@ -42628,7 +35190,7 @@ $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
 	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
+$as_echo X"$mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42672,7 +35234,7 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
 	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
+$as_echo X"$file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42698,7 +35260,7 @@ echo X"$file" |
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -42707,7 +35269,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -42728,14 +35290,655 @@ echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
     # echo "creating $dirpart/$file"
     echo '# dummy' > "$dirpart/$file"
   done
 done
  ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Assembler program.
+AS=$AS
+
+# DLL creation program.
+DLLTOOL=$DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$OBJDUMP
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+ ;;
     "po-directories":C)
     for ac_file in $CONFIG_FILES; do
       # Support "outfile[:infile[:infile...]]"
@@ -42923,6 +36126,11 @@ _ACEOF
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -42950,7 +36158,8 @@ fi
 #
 if test "$no_recursion" != yes; then
 
-  # Remove --cache-file and --srcdir arguments so they do not pile up.
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
   ac_sub_configure_args=
   ac_prev=
   eval "set x $ac_configure_args"
@@ -42979,9 +36188,11 @@ if test "$no_recursion" != yes; then
       ac_prev=prefix ;;
     -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
       ;;
+    --disable-option-checking)
+      ;;
     *)
       case $ac_arg in
-      *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
       esac
       ac_sub_configure_args="$ac_sub_configure_args '$ac_arg'" ;;
     esac
@@ -42991,7 +36202,7 @@ if test "$no_recursion" != yes; then
   # in subdir configurations.
   ac_arg="--prefix=$prefix"
   case $ac_arg in
-  *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
   esac
   ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
 
@@ -43000,6 +36211,10 @@ if test "$no_recursion" != yes; then
     ac_sub_configure_args="--silent $ac_sub_configure_args"
   fi
 
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
   ac_popdir=`pwd`
   for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
 
@@ -43008,8 +36223,8 @@ if test "$no_recursion" != yes; then
     test -d "$srcdir/$ac_dir" || continue
 
     ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
-    echo "$as_me:$LINENO: $ac_msg" >&5
-    echo "$ac_msg" >&6
+    $as_echo "$as_me:$LINENO: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
     { as_dir="$ac_dir"
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
@@ -43018,7 +36233,7 @@ if test "$no_recursion" != yes; then
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -43027,7 +36242,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -43048,17 +36263,17 @@ echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -43097,8 +36312,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
       # This should be Cygnus configure.
       ac_sub_configure=$ac_aux_dir/configure
     else
-      { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
-echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      { $as_echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
       ac_sub_configure=
     fi
 
@@ -43111,19 +36326,23 @@ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
 	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
       esac
 
-      { echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
-echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      { $as_echo "$as_me:$LINENO: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
       # The eval makes quoting arguments work.
       eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
 	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
-	{ { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
-echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
+	{ { $as_echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5
+$as_echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
    { (exit 1); exit 1; }; }
     fi
 
     cd "$ac_popdir"
   done
 fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
 
 if test x$platform_win32 = xyes; then
@@ -43231,8 +36450,8 @@ echo "
 
 "
 if test x$with_static_mono = xno -a "x$platform_win32" != "xyes"; then
-   { echo "$as_me:$LINENO: WARNING: Turning off static Mono is a risk" >&5
-echo "$as_me: WARNING: Turning off static Mono is a risk" >&2;}
+   { $as_echo "$as_me:$LINENO: WARNING: Turning off static Mono is a risk" >&5
+$as_echo "$as_me: WARNING: Turning off static Mono is a risk" >&2;}
 fi
 
 if test x$gc = xsgen; then
@@ -43243,3 +36462,4 @@ if test x$gc = xsgen; then
 	echo IMPORTANT:
 	echo IMPORTANT: There are known problems with it, use at your own risk.
 fi
+
diff --git a/configure.in b/configure.in
index 32b3763..2e066a9 100644
--- a/configure.in
+++ b/configure.in
@@ -6,7 +6,7 @@ AC_CANONICAL_SYSTEM
 m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
 
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(mono,2.4.2.3)
+AM_INIT_AUTOMAKE(mono,2.4.3)
 AM_MAINTAINER_MODE
 
 API_VER=1.0
@@ -84,6 +84,7 @@ case "$host" in
 		HOST_CC="gcc"
 		# Windows 2000 is required that includes Internet Explorer 5.01
 		CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
+		LDFLAGS="$LDFLAGS -lmswsock"
 		libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
 		libmono_ldflags="-mno-cygwin -mms-bitfields -mwindows"
 		libdl=
@@ -1730,6 +1731,9 @@ if test "x$enable_dtrace" = "xyes"; then
    if test "x$DTRACE" = "xno"; then
    	  AC_MSG_RESULT([dtrace utility not found, dtrace support disabled.])
 	  enable_dtrace=no
+   elif ! $DTRACE -h $srcdir/data/mono.d > /dev/null 2>&1; then
+	  AC_MSG_RESULT([dtrace doesn't support -h option, dtrace support disabled.])
+	  enable_dtrace=no
    fi
 fi
 
@@ -2411,6 +2415,7 @@ data/cecil.pc
 data/smcs.pc
 data/system.web.extensions_1.0.pc
 data/system.web.extensions.design_1.0.pc
+data/system.web.mvc.pc
 samples/Makefile
 support/Makefile
 data/config
@@ -2540,3 +2545,4 @@ if test x$gc = xsgen; then
 	echo IMPORTANT:
 	echo IMPORTANT: There are known problems with it, use at your own risk.
 fi
+
diff --git a/data/Makefile.am b/data/Makefile.am
index 671826a..9385456 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -8,24 +8,24 @@ EXTRA_DIST =  	\
 	mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
 	mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
 	mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
-	dtrace-prelink.sh mono.web.pc.in
+	dtrace-prelink.sh mono.web.pc.in system.web.mvc.pc.in
 
 pkgconfigdir = $(libdir)/pkgconfig
 
 if JIT_SUPPORTED
 if INTERP_SUPPORTED
 pkgconfig_DATA= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
-		system.web.extensions.design_1.0.pc mono.web.pc
+		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 else
 pkgconfig_DATA= mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
-		system.web.extensions.design_1.0.pc mono.web.pc
+		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 endif
 else
 pkgconfig_DATA= mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
 endif
 
 DISTCLEANFILES= mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
-		system.web.extensions.design_1.0.pc mono.web.pc
+		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 
 mono_DATA =  config \
 	     browscap.ini
diff --git a/data/Makefile.in b/data/Makefile.in
index fb54996..98c5471 100644
--- a/data/Makefile.in
+++ b/data/Makefile.in
@@ -43,9 +43,13 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/mono.web.pc.in $(srcdir)/monodoc.pc.in \
 	$(srcdir)/smcs.pc.in \
 	$(srcdir)/system.web.extensions.design_1.0.pc.in \
-	$(srcdir)/system.web.extensions_1.0.pc.in $(srcdir)/wcf.pc.in
+	$(srcdir)/system.web.extensions_1.0.pc.in \
+	$(srcdir)/system.web.mvc.pc.in $(srcdir)/wcf.pc.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -56,7 +60,7 @@ CONFIG_CLEAN_FILES = mint.pc mono.pc mono-cairo.pc mono-nunit.pc \
 	mono-options.pc mono-lineeditor.pc monodoc.pc mono.web.pc \
 	dotnet.pc dotnet35.pc wcf.pc cecil.pc smcs.pc \
 	system.web.extensions_1.0.pc \
-	system.web.extensions.design_1.0.pc config
+	system.web.extensions.design_1.0.pc system.web.mvc.pc config
 SOURCES =
 DIST_SOURCES =
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -105,10 +109,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -118,14 +118,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -143,6 +142,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -151,6 +151,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -162,11 +163,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -195,8 +199,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -236,6 +239,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -259,6 +263,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = net_1_1 net_2_0
@@ -269,18 +274,18 @@ EXTRA_DIST = \
 	mono.pc.in mint.pc.in dotnet.pc.in dotnet35.pc.in wcf.pc.in monodoc.pc.in \
 	mono-nunit.pc.in mono-cairo.pc.in mono-options.pc.in cecil.pc.in smcs.pc.in \
 	mono-lineeditor.pc.in system.web.extensions_1.0.pc.in system.web.extensions.design_1.0.pc.in\
-	dtrace-prelink.sh mono.web.pc.in
+	dtrace-prelink.sh mono.web.pc.in system.web.mvc.pc.in
 
 pkgconfigdir = $(libdir)/pkgconfig
 @INTERP_SUPPORTED_FALSE@@JIT_SUPPORTED_TRUE at pkgconfig_DATA = mono.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
- at INTERP_SUPPORTED_FALSE@@JIT_SUPPORTED_TRUE@		system.web.extensions.design_1.0.pc mono.web.pc
+ at INTERP_SUPPORTED_FALSE@@JIT_SUPPORTED_TRUE@		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 
 @INTERP_SUPPORTED_TRUE@@JIT_SUPPORTED_TRUE at pkgconfig_DATA = mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
- at INTERP_SUPPORTED_TRUE@@JIT_SUPPORTED_TRUE@		system.web.extensions.design_1.0.pc mono.web.pc
+ at INTERP_SUPPORTED_TRUE@@JIT_SUPPORTED_TRUE@		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 
 @JIT_SUPPORTED_FALSE at pkgconfig_DATA = mint.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc
 DISTCLEANFILES = mono.pc mint.pc dotnet.pc dotnet35.pc wcf.pc mono-nunit.pc mono-cairo.pc mono-options.pc cecil.pc smcs.pc monodoc.pc mono-lineeditor.pc system.web.extensions_1.0.pc \
-		system.web.extensions.design_1.0.pc mono.web.pc
+		system.web.extensions.design_1.0.pc mono.web.pc system.web.mvc.pc
 
 mono_DATA = config \
 	     browscap.ini
@@ -347,6 +352,8 @@ system.web.extensions_1.0.pc: $(top_builddir)/config.status $(srcdir)/system.web
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 system.web.extensions.design_1.0.pc: $(top_builddir)/config.status $(srcdir)/system.web.extensions.design_1.0.pc.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+system.web.mvc.pc: $(top_builddir)/config.status $(srcdir)/system.web.mvc.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 config: $(top_builddir)/config.status $(srcdir)/config.in
 	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 
diff --git a/data/config.in b/data/config.in
index a56f7d1..d14e0a8 100644
--- a/data/config.in
+++ b/data/config.in
@@ -17,7 +17,6 @@
 	<dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
 	<dllmap dll="libX11" target="@X11@" os="!windows" />
 	<dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
-	<dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
 	<dllmap dll="i:kernel32.dll">
 		<dllentry dll="__Internal" name="CopyMemory" target="mono_win32_compat_CopyMemory"/>
 		<dllentry dll="__Internal" name="FillMemory" target="mono_win32_compat_FillMemory"/>
diff --git a/data/net_1_1/Makefile.in b/data/net_1_1/Makefile.in
index 14f9980..0793216 100644
--- a/data/net_1_1/Makefile.in
+++ b/data/net_1_1/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = data/net_1_1
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,10 +82,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -92,14 +91,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -117,6 +115,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -125,6 +124,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -136,11 +136,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -169,8 +172,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -210,6 +212,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -233,6 +236,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 monodir = $(sysconfdir)/mono/1.0
diff --git a/data/net_2_0/Browsers/Makefile.in b/data/net_2_0/Browsers/Makefile.in
index 3730791..af37866 100644
--- a/data/net_2_0/Browsers/Makefile.in
+++ b/data/net_2_0/Browsers/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = data/net_2_0/Browsers
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,10 +82,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -92,14 +91,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -117,6 +115,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -125,6 +124,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -136,11 +136,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -169,8 +172,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -210,6 +212,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -233,6 +236,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 monodir = $(sysconfdir)/mono/2.0/Browsers
diff --git a/data/net_2_0/ChangeLog b/data/net_2_0/ChangeLog
index e6310b9..c499d71 100644
--- a/data/net_2_0/ChangeLog
+++ b/data/net_2_0/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DefaultWsdlHelpGenerator.aspx: the 'Message Layout' can now handle
+	self-referencing types. Fixes bug #529353.
+
 2009-03-31  Marek Habersack  <mhabersack at novell.com>
 
 	* DefaultWsdlHelpGenerator.aspx: the link element in <head> must
diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
index 6d02af3..4750b01 100644
--- a/data/net_2_0/DefaultWsdlHelpGenerator.aspx
+++ b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
@@ -10,6 +10,7 @@
 --%>
 
 <%@ Import Namespace="System.Collections" %>
+<%@ Import Namespace="System.Collections.Generic" %>
 <%@ Import Namespace="System.IO" %>
 <%@ Import Namespace="System.Xml.Serialization" %>
 <%@ Import Namespace="System.Xml" %>
@@ -1035,7 +1036,7 @@ public class HtmlSampleGenerator: SampleGenerator
 			if (elem == null) throw new InvalidOperationException ("Element not found: " + qname);
 			WriteElementSample (xtw, qname.Namespace, elem);
 		}
-		
+
 		void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
 		{
 			bool sharedAnnType = false;
@@ -1129,9 +1130,18 @@ public class HtmlSampleGenerator: SampleGenerator
 		{
 			WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
 		}
-		
+
+		Dictionary<XmlSchemaComplexType,int> recursed_types = new Dictionary<XmlSchemaComplexType,int> ();
 		void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype)
 		{
+			int prev = 0;
+			if (recursed_types.ContainsKey (stype))
+				prev = recursed_types [stype];
+
+			if (prev > 1)
+				return;
+			recursed_types [stype] = ++prev;
+
 			if (stype.Particle != null)
 				WriteParticleComplexContent (xtw, ns, stype.Particle);
 			else
@@ -1141,6 +1151,8 @@ public class HtmlSampleGenerator: SampleGenerator
 				else if (stype.ContentModel is XmlSchemaComplexContent)
 					WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel);
 			}
+			prev = recursed_types [stype];
+			recursed_types [stype] = --prev;
 		}
 
 		void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat)
diff --git a/data/net_2_0/Makefile.in b/data/net_2_0/Makefile.in
index 9e515ee..03b56de 100644
--- a/data/net_2_0/Makefile.in
+++ b/data/net_2_0/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = data/net_2_0
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -91,10 +94,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -104,14 +103,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -129,6 +127,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -137,6 +136,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -148,11 +148,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -181,8 +184,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -222,6 +224,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -245,6 +248,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = Browsers
diff --git a/data/net_2_0/machine.config b/data/net_2_0/machine.config
index 2015785..531be54 100644
--- a/data/net_2_0/machine.config
+++ b/data/net_2_0/machine.config
@@ -85,6 +85,7 @@
 			<section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 		</sectionGroup>
 		<section name="system.webServer" type="System.Configuration.IgnoreSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+		<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 	</configSections>
 
 	<connectionStrings>
diff --git a/data/system.web.mvc.pc.in b/data/system.web.mvc.pc.in
new file mode 100644
index 0000000..d012725
--- /dev/null
+++ b/data/system.web.mvc.pc.in
@@ -0,0 +1,4 @@
+Name: System.Web.Mvc
+Description: System.Web.Mvc - ASP.NET MVC
+Version: 1.0.0.0
+Libs: -r:@prefix@/lib/mono/gac/System.Web.Mvc/1.0.0.0__31bf3856ad364e35/System.Web.Mvc.dll
diff --git a/debian/libmono-system2.1-cil.debhelper.log b/debian/libmono-system2.1-cil.debhelper.log
new file mode 100644
index 0000000..4ec72ae
--- /dev/null
+++ b/debian/libmono-system2.1-cil.debhelper.log
@@ -0,0 +1 @@
+dh_makeclilibs
diff --git a/debian/libmono-web1.0-cil.debhelper.log b/debian/libmono-web1.0-cil.debhelper.log
new file mode 100644
index 0000000..4ec72ae
--- /dev/null
+++ b/debian/libmono-web1.0-cil.debhelper.log
@@ -0,0 +1 @@
+dh_makeclilibs
diff --git a/debian/libmono-web2.0-cil.debhelper.log b/debian/libmono-web2.0-cil.debhelper.log
new file mode 100644
index 0000000..4ec72ae
--- /dev/null
+++ b/debian/libmono-web2.0-cil.debhelper.log
@@ -0,0 +1 @@
+dh_makeclilibs
diff --git a/docs/Makefile.in b/docs/Makefile.in
index 9f2e1a7..05d64e5 100644
--- a/docs/Makefile.in
+++ b/docs/Makefile.in
@@ -37,7 +37,10 @@ subdir = docs
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -80,10 +83,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -93,14 +92,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -118,6 +116,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -126,6 +125,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -137,11 +137,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -170,8 +173,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -211,6 +213,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -234,6 +237,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 sourcesdir = $(prefix)/lib/monodoc/sources
diff --git a/ikvm-native/Makefile.in b/ikvm-native/Makefile.in
index 04ba50d..a8ef783 100644
--- a/ikvm-native/Makefile.in
+++ b/ikvm-native/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = ikvm-native
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -97,10 +100,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -110,14 +109,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -135,6 +133,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -143,6 +142,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -154,11 +154,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -187,8 +190,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -228,6 +230,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -251,6 +254,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GMODULE_CFLAGS)
diff --git a/libgc/ChangeLog b/libgc/ChangeLog
index bcfbdcd..6d8e282 100644
--- a/libgc/ChangeLog
+++ b/libgc/ChangeLog
@@ -1,3 +1,21 @@
+2009-09-25  Zoltan Varga  <vargaz at gmail.com>
+
+	* solaris_threads.c (GC_get_orig_stack_size): Remove the annoying 'Large stack
+	limit' warning.
+
+2009-07-02  jonas echterhoff <jonas at unity3d.com>
+
+	* darwin_stop_world.c: make debugger code compile on
+	OS X.
+
+	* pthread_support.c: give mach ports to the debugger instead of pthreads,
+	as those can be iterated over from another executable.
+
+2009-09-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* solaris_threads.c (GC_thr_daemon): Don't crash if GC_lookup_thread () returns
+	NULL.
+
 2009-04-28  Zoltan Varga  <vargaz at gmail.com>
 
 	* misc.c (GC_init): Avoid casting an lvalue. Fixes part of #498692.
diff --git a/libgc/Makefile.in b/libgc/Makefile.in
index a622ff8..7ad4e95 100644
--- a/libgc/Makefile.in
+++ b/libgc/Makefile.in
@@ -171,15 +171,14 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GC_CFLAGS = @GC_CFLAGS@
 GC_VERSION = @GC_VERSION@
 GREP = @GREP@
@@ -189,18 +188,24 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 MY_CFLAGS = @MY_CFLAGS@
+NM = @NM@
 NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -222,7 +227,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 addincludes = @addincludes@
 addlibs = @addlibs@
 addobjs = @addobjs@
@@ -257,6 +262,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -270,6 +276,7 @@ srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 target_all = @target_all@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
diff --git a/libgc/aclocal.m4 b/libgc/aclocal.m4
index 2379ffc..38e6698 100644
--- a/libgc/aclocal.m4
+++ b/libgc/aclocal.m4
@@ -13,108 +13,194 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(AC_AUTOCONF_VERSION, [2.61],,
-[m4_warning([this file was generated for autoconf 2.61.
+m4_if(AC_AUTOCONF_VERSION, [2.63],,
+[m4_warning([this file was generated for autoconf 2.63.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
 
-# serial 52 AC_PROG_LIBTOOL
+# serial 56 LT_INIT
 
 
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-	         [m4_ifdef([AC_PROVIDE_$1],
-		           [$2], [$3])])])
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
 
 
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-	[AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-	     [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-	     [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-	     [define([LT_AC_PROG_GCJ],
-		defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+LIBTOOL_DEPS="$ltmain"
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 AC_SUBST(LIBTOOL)dnl
 
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
+_LT_SETUP
 
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
 
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
 AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
 AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
 dnl
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
 
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
 
 case $host_os in
 aix3*)
@@ -130,116 +216,653 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
 
 # Sed substitution to delay expansion of an escaped shell variable in a
 # double_quote_subst'ed string.
 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
 # Sed substitution to avoid accidental globbing in evaled expressions
 no_glob_subst='s/\*/\\\*/g'
 
-# Constants:
-rm="rm -f"
-
 # Global variables:
-default_ofile=libtool
+ofile=libtool
 can_build_shared=yes
 
 # All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
 old_CC="$CC"
 old_CFLAGS="$CFLAGS"
 
 # Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
 test -z "$ac_objext" && ac_objext=o
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
 _LT_CC_BASENAME([$compiler])
 
 # Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
+    _LT_PATH_MAGIC
   fi
   ;;
 esac
 
-_LT_REQUIRED_DARWIN_CHECKS
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
 
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
 
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
 
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
 
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
 
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
 
-# _LT_AC_SYS_COMPILER
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
 # -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+  ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+  lt_cl_success=:
+  test "$silent" = yes &&
+    lt_config_lt_args="$lt_config_lt_args --quiet"
+  exec AS_MESSAGE_LOG_FD>/dev/null
+  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+  exec AS_MESSAGE_LOG_FD>>config.log
+  $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
 [AC_REQUIRE([AC_PROG_CC])dnl
 
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
@@ -248,36 +871,20 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
 # Allow CC to be a program name with arguments.
 compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
+])# _LT_TAG_COMPILER
 
 
 # _LT_COMPILER_BOILERPLATE
 # ------------------------
 # Check for compiler boilerplate output or warnings with
 # the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
 ])# _LT_COMPILER_BOILERPLATE
 
 
@@ -285,39 +892,57 @@ $rm conftest*
 # ----------------------
 # Check for linker boilerplate output or warnings with
 # the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
+$RM -r conftest*
 ])# _LT_LINKER_BOILERPLATE
 
 # _LT_REQUIRED_DARWIN_CHECKS
-# --------------------------
-# Check for some things on darwin
-AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
   case $host_os in
     rhapsody* | darwin*)
     AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
     AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
       if test -z "${LT_MULTI_MODULE}"; then
-   # By default we will add the -single_module flag. You can override
-   # by either setting the environment variable LT_MULTI_MODULE
-   # non-empty at configure time, or by adding -multi_module to the
-   # link flags.
-   echo "int foo(void){return 1;}" > conftest.c
-   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-     -dynamiclib ${wl}-single_module conftest.c
-   if test -f libconftest.dylib; then
-     lt_cv_apple_cc_single_mod=yes
-     rm -rf libconftest.dylib*
-   fi
-   rm conftest.c
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
       fi])
     AC_CACHE_CHECK([for -exported_symbols_list linker flag],
       [lt_cv_ld_exported_symbols_list],
@@ -326,26 +951,26 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
       echo "_main" > conftest.sym
       LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
-   [lt_cv_ld_exported_symbols_list=yes],
-   [lt_cv_ld_exported_symbols_list=no])
-   LDFLAGS="$save_LDFLAGS"
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
     ])
     case $host_os in
-    rhapsody* | darwin1.[[0123]])
+    rhapsody* | darwin1.[[012]])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
     darwin1.*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-   10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-   10.[[012]]*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-   10.*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
@@ -355,10 +980,10 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
     if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
       _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
     else
-      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
     fi
     if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil="~$DSYMUTIL \$lib || :"
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
     fi
@@ -366,16 +991,51 @@ AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
   esac
 ])
 
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
 # Links a minimal program and checks the executable
 # for the system default hardcoded library path. In most cases,
 # this is /usr/lib:/lib, but when the MPI compilers are used
 # the location of the communication and MPI libs are included too.
 # If we don't find anything, use the default library path according
 # to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
 AC_LINK_IFELSE(AC_LANG_PROGRAM,[
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -390,45 +1050,45 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi],[])
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
+])# _LT_SYS_MODULE_PATH_AIX
 
 
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
 [ifdef([AC_DIVERSION_NOTICE],
 	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
 	 [AC_DIVERT_PUSH(NOTICE)])
 $1
 AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
+])# _LT_SHELL_INIT
 
 
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
 # Add some code to the start of the generated configure script which
 # will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
 # Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$ECHO in
+case X$lt_ECHO in
 X*--fallback-echo)
   # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
   ;;
 esac
 
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
 if test "X[$]1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
   shift
 elif test "X[$]1" = X--fallback-echo; then
   # Avoid inline document here, it may be left over
   :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
   :
 else
   # Restart under the correct shell.
@@ -438,9 +1098,9 @@ fi
 if test "X[$]1" = X--fallback-echo; then
   # used as fallback echo
   shift
-  cat <<EOF
+  cat <<_LT_EOF
 [$]*
-EOF
+_LT_EOF
   exit 0
 fi
 
@@ -448,124 +1108,127 @@ fi
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
 
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
 
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
     IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
 
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL [$]0 --fallback-echo"
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
       else
-	# maybe with a smaller string...
-	prev=:
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
 
-	for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
+	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
 
-	if test "$prev" != 'sed 50q "[$]0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
+	  if test "$prev" != 'sed 50q "[$]0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
       fi
     fi
   fi
 fi
-fi
 
 # Copy echo and quote the copy suitably for passing to libtool from
 # the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
 fi
 
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+    [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
 
 
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
 [AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-	[avoid locking (might break parallel builds)])])
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
 test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
@@ -576,12 +1239,12 @@ ia64-*-hpux*)
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
     esac
   fi
   rm -rf conftest*
@@ -590,79 +1253,79 @@ ia64-*-hpux*)
   # Find out which ABI we are using.
   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
   fi
   rm -rf conftest*
   ;;
 
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_i386_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_x86_64_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
     esac
   fi
   rm -rf conftest*
@@ -674,7 +1337,7 @@ s390*-*linux*|sparc*-*linux*)
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
@@ -690,7 +1353,7 @@ sparc*-*solaris*)
       case $lt_cv_prog_gnu_ld in
       yes*) LD="${LD-ld} -m elf64_sparc" ;;
       *)
-        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
 	fi
 	;;
@@ -700,30 +1363,63 @@ sparc*-*solaris*)
   fi
   rm -rf conftest*
   ;;
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
-  ;;
-  ])
 esac
 
 need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
 
-])# _LT_AC_LOCK
 
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
 
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
 #		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
 # ----------------------------------------------------------------
 # Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$3"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -743,29 +1439,35 @@ AC_CACHE_CHECK([$1], [$2],
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        $2=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 ])
 
 if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
+    m4_if([$5], , :, [$5])
 else
-    ifelse([$6], , :, [$6])
+    m4_if([$6], , :, [$6])
 fi
-])# AC_LIBTOOL_COMPILER_OPTION
+])# _LT_COMPILER_OPTION
 
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
 
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
    save_LDFLAGS="$LDFLAGS"
@@ -777,7 +1479,7 @@ AC_CACHE_CHECK([$1], [$2],
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          $2=yes
@@ -786,22 +1488,28 @@ AC_CACHE_CHECK([$1], [$2],
        $2=yes
      fi
    fi
-   $rm -r conftest*
+   $RM -r conftest*
    LDFLAGS="$save_LDFLAGS"
 ])
 
 if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
+    m4_if([$4], , :, [$4])
 else
-    ifelse([$5], , :, [$5])
+    m4_if([$5], , :, [$5])
 fi
-])# AC_LIBTOOL_LINKER_OPTION
+])# _LT_LINKER_OPTION
 
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
 
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
@@ -823,7 +1531,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=-1;
     ;;
 
-  cygwin* | mingw*)
+  cygwin* | mingw* | cegcc*)
     # On Win9x/ME, this test blows up -- it succeeds, but takes
     # about 5 minutes as the teststring grows exponentially.
     # Worse, since 9x/ME are not pre-emptively multitasking,
@@ -878,7 +1586,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   sysv5* | sco5v6* | sysv4.2uw2*)
     kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
     if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ 	]]//'`
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
     else
       lt_cv_sys_max_cmd_len=32768
     fi
@@ -889,20 +1597,28 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	      lt_cv_sys_max_cmd_len=$new_result &&
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
       done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
       teststring=
-      # Add a significant safety factor because C++ compilers can tack on massive
-      # amounts of additional arguments before passing them to the linker.
-      # It appears as though 1/2 is a usable value.
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
     fi
     ;;
@@ -913,27 +1629,35 @@ if test -n $lt_cv_sys_max_cmd_len ; then
 else
   AC_MSG_RESULT(none)
 fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
 
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
 
-# _LT_AC_CHECK_DLFCN
-# ------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
 
 
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ---------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
 if test "$cross_compiling" = yes; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
+  cat > conftest.$ac_ext <<_LT_EOF
 [#line __oline__ "configure"
 #include "confdefs.h"
 
@@ -975,10 +1699,6 @@ else
 #  endif
 #endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
 void fnord() { int i=42;}
 int main ()
 {
@@ -994,9 +1714,9 @@ int main ()
   else
     puts (dlerror ());
 
-    exit (status);
+  return status;
 }]
-EOF
+_LT_EOF
   if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
@@ -1011,13 +1731,13 @@ EOF
   fi
 fi
 rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
+])# _LT_TRY_DLOPEN_SELF
 
 
-# AC_LIBTOOL_DLOPEN_SELF
-# ----------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
 if test "x$enable_dlopen" != xyes; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
@@ -1033,15 +1753,15 @@ else
     lt_cv_dlopen_self=yes
     ;;
 
-  mingw* | pw32*)
+  mingw* | pw32* | cegcc*)
     lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   cygwin*)
     lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   darwin*)
   # if libdl is installed we need to link against it
@@ -1051,7 +1771,7 @@ else
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
-   ;;
+    ;;
 
   *)
     AC_CHECK_FUNC([shl_load],
@@ -1093,7 +1813,7 @@ else
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
 	  lt_cv_dlopen_self, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
+	  _LT_TRY_DLOPEN_SELF(
 	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
@@ -1101,8 +1821,8 @@ else
     if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-    	  lt_cv_dlopen_self_static, [dnl
-	  _LT_AC_TRY_DLOPEN_SELF(
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
 	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
 	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
       ])
@@ -1124,19 +1844,32 @@ else
   *) enable_dlopen_self_static=unknown ;;
   esac
 fi
-])# AC_LIBTOOL_DLOPEN_SELF
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
 
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
 
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
 AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
    mkdir conftest
    cd conftest
    mkdir out
@@ -1160,37 +1893,41 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
      fi
    fi
    chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $rm conftest*
+   $RM conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
    cd ..
-   rmdir conftest
-   $rm conftest*
+   $RM -r conftest
+   $RM conftest*
 ])
-])# AC_LIBTOOL_PROG_CC_C_O
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
 
 
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
 # Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
 
 hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
-  $rm conftest*
+  $RM conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
@@ -1203,12 +1940,13 @@ if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks"
 else
   need_locks=no
 fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
 
 
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
 [AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
 [rm -f .libs 2>/dev/null
 mkdir .libs 2>/dev/null
@@ -1220,40 +1958,46 @@ else
 fi
 rmdir .libs 2>/dev/null])
 objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
 
 
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
 # Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
 [AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
 
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
     # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+    _LT_TAGVAR(hardcode_action, $1)=relink
   else
     # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+    _LT_TAGVAR(hardcode_action, $1)=immediate
   fi
 else
   # We cannot hardcode anything, or else we can only hardcode existing
   # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
 fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
   # Fast installation is not supported
   enable_fast_install=no
 elif test "$shlibpath_overrides_runpath" = yes ||
@@ -1261,73 +2005,70 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
 
 
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
 old_striplib=
 AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
   AC_MSG_RESULT([yes])
 else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         old_striplib="$STRIP -S"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
     ;;
   esac
 fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
 
 
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-m4_if($1,[],[
+m4_if([$1],
+	[], [
 if test "$GCC" = yes; then
   case $host_os in
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
   else
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
   fi
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
@@ -1341,7 +2082,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -1361,10 +2102,23 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`echo $lt_search_path_spec`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -1401,7 +2155,7 @@ aix[[4-9]]*)
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
@@ -1427,9 +2181,18 @@ aix[[4-9]]*)
   ;;
 
 amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
   ;;
 
 beos*)
@@ -1452,25 +2215,28 @@ bsdi[[45]]*)
   # libtool to hard-code these into programs
   ;;
 
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
   shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
   case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
-       $rm \$dlpath'
+       $RM \$dlpath'
     shlibpath_overrides_runpath=yes
 
     case $host_os in
@@ -1479,20 +2245,20 @@ cygwin* | mingw* | pw32*)
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    mingw*)
+    mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH printed by
         # mingw gcc, but we are running on Cygwin. Gcc prints its search
         # path with ; separators, and with drive letters. We can handle the
         # drive letters (cygwin fileutils understands them), so leave them,
         # especially as we might pass files found there to a mingw objdump,
         # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
       else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
       fi
       ;;
     pw32*)
@@ -1516,13 +2282,13 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  m4_if([$1], [],[
-  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) 
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
   sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
@@ -1615,18 +2381,18 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
     shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
@@ -1703,6 +2469,17 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+       [shlibpath_overrides_runpath=yes])])
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
@@ -1710,7 +2487,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -1727,7 +2504,7 @@ netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
@@ -1748,14 +2525,16 @@ newsos6)
   shlibpath_overrides_runpath=yes
   ;;
 
-nto-qnx*)
-  version_type=linux
+*nto* | *qnx*)
+  version_type=qnx
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
   ;;
 
 openbsd*)
@@ -1764,13 +2543,13 @@ openbsd*)
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
       openbsd2.[[89]] | openbsd2.[[89]].*)
 	shlibpath_overrides_runpath=no
@@ -1842,7 +2621,6 @@ sysv4 | sysv4.3*)
     sni)
       shlibpath_overrides_runpath=no
       need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
       runpath_var=LD_RUN_PATH
       ;;
     siemens)
@@ -1873,13 +2651,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
   if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
     case $host_os in
       sco3.2v5*)
         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -1889,6 +2666,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   sys_lib_dlsearch_path_spec='/usr/lib'
   ;;
 
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -1903,288 +2691,58 @@ esac
 AC_MSG_RESULT([$dynamic_linker])
 test "$dynamic_linker" = no && can_build_shared=no
 
-AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
-[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
-[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
 if test "$GCC" = yes; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-	;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  AC_LIBTOOL_LANG_CXX_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-	  AC_LIBTOOL_LANG_F77_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
-
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-	  AC_LIBTOOL_LANG_GCJ_CONFIG
-	else
-	  tagname=""
-	fi
-	;;
 
-      RC)
-	AC_LIBTOOL_LANG_RC_CONFIG
-	;;
-
-      *)
-	AC_MSG_ERROR([Unsupported tag name: $tagname])
-	;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-	[build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_shared=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-# set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-	[build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
 
-# AC_LIBTOOL_PICMODE([MODE])
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
 # find a file program which can recognize shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
@@ -2197,7 +2755,7 @@ AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
     IFS="$lt_save_ifs"
     test -z "$ac_dir" && ac_dir=.
@@ -2212,7 +2770,7 @@ dnl not every word.  This closes a longstanding sh security hole.
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
 	  else
-	    cat <<EOF 1>&2
+	    cat <<_LT_EOF 1>&2
 
 *** Warning: the command libtool uses to detect shared libraries,
 *** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -2223,7 +2781,7 @@ dnl not every word.  This closes a longstanding sh security hole.
 *** may want to report the problem to your system manager and/or to
 *** bug-libtool at gnu.org
 
-EOF
+_LT_EOF
 	  fi ;;
 	esac
       fi
@@ -2240,37 +2798,47 @@ if test -n "$MAGIC_CMD"; then
 else
   AC_MSG_RESULT(no)
 fi
-])# AC_PATH_TOOL_PREFIX
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
 
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
 
-# AC_PATH_MAGIC
-# -------------
+
+# _LT_PATH_MAGIC
+# --------------
 # find a file program which can recognize a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
   else
     MAGIC_CMD=:
   fi
 fi
-])# AC_PATH_MAGIC
+])# _LT_PATH_MAGIC
 
 
-# AC_PROG_LD
+# LT_PATH_LD
 # ----------
 # find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_HELP_STRING([--with-gnu-ld],
-	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
 AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
@@ -2287,9 +2855,9 @@ if test "$GCC" = yes; then
     [[\\/]]* | ?:[[\\/]]*)
       re_direlt='/[[^/]][[^/]]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -2339,15 +2907,24 @@ else
   AC_MSG_RESULT(no)
 fi
 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
 
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
 
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
 [# I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
@@ -2358,14 +2935,14 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac])
 with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
+])# _LT_PATH_LD_GNU
 
 
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
+# _LT_CMD_RELOAD
+# --------------
 # find reload flag for linker
 #   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+m4_defun([_LT_CMD_RELOAD],
 [AC_CACHE_CHECK([for $LD option to reload object files],
   lt_cv_ld_reload_flag,
   [lt_cv_ld_reload_flag='-r'])
@@ -2384,15 +2961,19 @@ case $host_os in
     fi
     ;;
 esac
-])# AC_PROG_LD_RELOAD_FLAG
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
 
 
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
 # how to check for library dependencies
 #  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognize dependent libraries],
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
 lt_cv_deplibs_check_method,
 [lt_cv_file_magic_cmd='$MAGIC_CMD'
 lt_cv_file_magic_test_file=
@@ -2442,12 +3023,18 @@ mingw* | pw32*)
   fi
   ;;
 
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
 darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
 freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
@@ -2505,7 +3092,7 @@ linux* | k*bsd*-gnu)
   ;;
 
 netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
@@ -2518,12 +3105,12 @@ newos6*)
   lt_cv_file_magic_test_file=/usr/lib/libnls.so
   ;;
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -2542,6 +3129,10 @@ solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
@@ -2569,7 +3160,7 @@ sysv4 | sysv4.3*)
   esac
   ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
@@ -2577,14 +3168,20 @@ esac
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
 
 
-# AC_PROG_NM
+# LT_PATH_NM
 # ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
   lt_cv_path_NM="$NM"
@@ -2626,16 +3223,51 @@ else
     done
     IFS="$lt_save_ifs"
   done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+  : ${lt_cv_path_NM=no}
 fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
 
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
 
-# AC_CHECK_LIBM
-# -------------
+
+# LT_LIB_M
+# --------
 # check for math library
-AC_DEFUN([AC_CHECK_LIBM],
+AC_DEFUN([LT_LIB_M],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 LIBM=
 case $host in
@@ -2650,2155 +3282,46 @@ case $host in
   AC_CHECK_LIB(m, cos, LIBM="-lm")
   ;;
 esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ------------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-	 [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-	   [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# -------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF
-
-# Report which library types will actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-
-aix[[4-9]]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
-
-  AC_PROG_LD
-
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
-
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
-
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  aix[[4-9]]*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
-
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
-
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-    _LT_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  :
-	else
-	  # We have old collect2
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
-    fi
-
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	_LT_AC_SYS_LIBPATH_AIX
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
-      if test "$GXX" = yes ; then
-      output_verbose_link_cmd='echo'
-      _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-      _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-      fi
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
-
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
-
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-      case $host_cpu in
-      hppa*64*|ia64*) ;;
-      *)
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
-
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
-	    case $host_cpu in
-	    hppa*64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    ia64*)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    *)
-	      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      ;;
-	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  interix[[3-9]]*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-	;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux* | k*bsd*-gnu)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	esac
-	_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-	;;
-      pgCC* | pgcpp*)
-        # Portland Group C++ compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
-	runpath_var=LD_RUN_PATH
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C++ 5.9
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
-	  # Not sure whether something based on
-	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	  # would be better.
-	  output_verbose_link_cmd='echo'
-
-	  # Archives containing C++ object files must be created using
-	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	  # necessary to make sure instantiated templates are included
-	  # in the archive.
-	  _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	  ;;
-	esac
-	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    if test -f /usr/libexec/ld.so; then
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      fi
-      output_verbose_link_cmd='echo'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	_LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      cxx*)
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	 _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-	else
-	  # FIXME: insert proper C++ library support
-	  _LT_AC_TAGVAR(ld_shlibs, $1)=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-	_LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	case $host_os in
-	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	  *)
-	    # The compiler driver will combine and reorder linker options,
-	    # but understands `-z linker_flag'.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
-	    ;;
-	esac
-	_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
-	output_verbose_link_cmd='echo'
-
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
-	# The C++ compiler must be used to create the archive.
-	_LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
-      *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
-
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-	  case $host_os in
-	  solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-	  *)
-	    _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	    ;;
-	  esac
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
-
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
-
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
-
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
-	 prev=$p
-	 continue
-       else
-	 prev=
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 case $p in
-	 -L* | -R*)
-	   # Internal compiler library paths should come after those
-	   # provided the user.  The postdeps already come after the
-	   # user supplied libs so there is no need to process them.
-	   if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-	   else
-	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-	   fi
-	   ;;
-	 # The "-l" case would never come before the object being
-	 # linked, so don't bother handling this case.
-	 esac
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
-	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-	 else
-	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-	 fi
-       fi
-       ;;
-
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-	 pre_test_object_deps_done=yes
-	 continue
-       fi
-
-       if test "$pre_test_object_deps_done" = no; then
-	 if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
-	   _LT_AC_TAGVAR(predep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-	 fi
-       else
-	 if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-	 else
-	   _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
-	 fi
-       fi
-       ;;
-
-    *) ;; # Ignore the rest.
-
-    esac
-  done
-
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-  _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-interix[[3-9]]*)
-  # Interix 3.5 installs completely hosed .la files for C++, so rather than
-  # hack all around it, let's just trust "g++" to DTRT.
-  _LT_AC_TAGVAR(predep_objects,$1)=
-  _LT_AC_TAGVAR(postdep_objects,$1)=
-  _LT_AC_TAGVAR(postdeps,$1)=
-  ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-    #
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-esac
-])
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
+AC_SUBST([LIBM])
+])# LT_LIB_M
 
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
 
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
-      program t
-      end
-"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix[[4-9]]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
 
-# AC_LIBTOOL_LANG_RC_CONFIG
-# -------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars.  Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(fix_srcfile_path, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
-
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
-
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
-
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
-  case $host_os in
-  aix3*)
-    cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
-    ;;
-  esac
-
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
-])
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
 if test "$GCC" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
 
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
     lt_cv_prog_compiler_rtti_exceptions,
     [-fno-rtti -fno-exceptions], [],
-    [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
 fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
 
 
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([LT_AC_PROG_SED])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
 # Check for command to grab the raw symbol name followed by C symbol from nm.
 AC_MSG_CHECKING([command to parse $NM output from $compiler object])
 AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
@@ -4812,33 +3335,18 @@ symcode='[[BCDEGRST]]'
 # Regexp to match symbols that can be accessed directly from C.
 sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-
 # Define system-specific variables.
 case $host_os in
 aix*)
   symcode='[[BCDT]]'
   ;;
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   symcode='[[ABCDGISTW]]'
   ;;
-hpux*) # Its linker distinguishes data from code symbols
+hpux*)
   if test "$host_cpu" = ia64; then
     symcode='[[ABCDEGRST]]'
   fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux* | k*bsd*-gnu)
-  if test "$host_cpu" = ia64; then
-    symcode='[[ABCDGIRSTW]]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
   ;;
 irix* | nonstopux*)
   symcode='[[BCDEGRST]]'
@@ -4863,44 +3371,72 @@ sysv4)
   ;;
 esac
 
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
 # Handle CRLF in mingw tool chain
 opt_cr=
 case $build_os in
 mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
   ;;
 esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
+# Try without a prefix underscore, then with it.
 for ac_symprfx in "" "_"; do
 
   # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
   symxfrm="\\1 $ac_symprfx\\2 \\2"
 
   # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ 	]]\($symcode$symcode*\)[[ 	]][[ 	]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
 
   # Check to see that the pipe works correctly.
   pipe_works=no
 
   rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
+  cat > conftest.$ac_ext <<_LT_EOF
 #ifdef __cplusplus
 extern "C" {
 #endif
 char nm_test_var;
-void nm_test_func(){}
+void nm_test_func(void);
+void nm_test_func(void){}
 #ifdef __cplusplus
 }
 #endif
 int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
+_LT_EOF
 
   if AC_TRY_EVAL(ac_compile); then
     # Now try to grab the symbols.
@@ -4914,48 +3450,50 @@ EOF
       fi
 
       # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-EOF
+_LT_EOF
 	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
 
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
+	  cat <<_LT_EOF >> conftest.$ac_ext
 
-/* The mapping between symbol names and symbols. */
+/* The mapping between symbol names and symbols.  */
 const struct {
   const char *name;
-  lt_ptr_t address;
+  void       *address;
 }
-lt_preloaded_symbols[[]] =
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
 {
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
 };
 
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
 #ifdef __cplusplus
 }
 #endif
-EOF
+_LT_EOF
 	  # Now try linking the two files.
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_save_LIBS="$LIBS"
 	  lt_save_CFLAGS="$CFLAGS"
 	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
 	    pipe_works=yes
 	  fi
@@ -4992,56 +3530,78 @@ if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; the
 else
   AC_MSG_RESULT(ok)
 fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
 
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
 
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
 
 AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
+m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
       if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
       ;;
+
     amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
+
     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
-    mingw* | cygwin* | os2* | pw32*)
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
       # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
     *djgpp*)
       # DJGPP does not support shared libraries at all
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
     interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
@@ -5049,22 +3609,28 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       ;;
     sysv4*MP*)
       if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
       fi
       ;;
     hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
       case $host_cpu in
-      hppa*64*|ia64*)
+      hppa*64*)
 	;;
       *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	;;
       esac
       ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
     *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
     esac
   else
@@ -5073,37 +3639,27 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	# All AIX code is PIC.
 	if test "$host_cpu" = ia64; then
 	  # AIX 5 now supports IA64 processor
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
 	fi
 	;;
       chorus*)
 	case $cc_basename in
 	cxch68*)
 	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
 	esac
 	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-           _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-           ;;
-         esac
-       ;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
 	  ghcx*)
 	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
 	  *)
 	    ;;
@@ -5115,21 +3671,21 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       hpux9* | hpux10* | hpux11*)
 	case $cc_basename in
 	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 	    if test "$host_cpu" != ia64; then
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
 	      ;;
 	    *)
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	      ;;
 	    esac
 	    ;;
@@ -5144,8 +3700,8 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       irix5* | irix6* | nonstopux*)
 	case $cc_basename in
 	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    # CC pic flag -KPIC is the default.
 	    ;;
 	  *)
@@ -5156,35 +3712,48 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	case $cc_basename in
 	  KCC*)
 	    # KAI C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 	    ;;
 	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler.
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    ;;
 	  cxx*)
 	    # Compaq C++
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC*)
+	    # IBM XL 8.0 on PPC
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
 	    ;;
 	  *)
 	    case `$CC -V 2>&1 | sed 5q` in
 	    *Sun\ C*)
 	      # Sun C++ 5.9
-	      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 	      ;;
 	    esac
 	    ;;
@@ -5197,7 +3766,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
       mvs*)
 	case $cc_basename in
 	  cxx*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
 	    ;;
 	  *)
 	    ;;
@@ -5205,22 +3774,27 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	;;
       netbsd*)
 	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
 	  KCC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
 	    ;;
 	  RCC*)
 	    # Rational C++ 2.4.1
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
 	  cxx*)
 	    # Digital/Compaq C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    # Make sure the PIC flag is empty.  It appears that all Alpha
 	    # Linux and Compaq Tru64 Unix objects are PIC.
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
 	    ;;
 	  *)
 	    ;;
@@ -5232,13 +3806,13 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	case $cc_basename in
 	  CC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
 	    ;;
 	  gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	    ;;
 	  *)
 	    ;;
@@ -5248,82 +3822,104 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	case $cc_basename in
 	  CC*)
 	    # Sun C++ 4.x
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	    ;;
 	  lcc*)
 	    # Lucid
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
 	    ;;
 	  *)
 	    ;;
 	esac
 	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
       tandem*)
 	case $cc_basename in
 	  NCC*)
 	    # NonStop-UX NCC 3.20
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    ;;
 	  *)
 	    ;;
 	esac
 	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-	case $cc_basename in
-	  CC*)
-	    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	    ;;
-	esac
-	;;
       vxworks*)
 	;;
       *)
-	_LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
 	;;
     esac
   fi
 ],
 [
   if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
       if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
       ;;
 
     amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
 
     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
       ;;
 
     darwin* | rhapsody*)
       # PIC is the default on this platform
       # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
       ;;
 
     interix[[3-9]]*)
@@ -5334,65 +3930,48 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
     msdosdjgpp*)
       # Just because we use GCC doesn't mean we suddenly get shared libraries
       # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
       enable_shared=no
       ;;
 
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
     sysv4*MP*)
       if test -d /usr/nec; then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
       fi
       ;;
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-	;;
-      esac
-      ;;
-
     *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
     esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
     aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       if test "$host_cpu" = ia64; then
 	# AIX 5 now supports IA64 processor
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       m4_if([$1], [GCJ], [],
-	[_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
       ;;
 
     hpux9* | hpux10* | hpux11*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
       # not for PA HP-UX.
       case $host_cpu in
@@ -5400,222 +3979,263 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
 	# +Z the default
 	;;
       *)
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
-
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
     linux* | k*bsd*-gnu)
       case $cc_basename in
-      icc* | ecc*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
         ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
         ;;
       ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
         # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
       *)
-        case `$CC -V 2>&1 | sed 5q` in
+	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)
 	  # Sun C 5.9
-	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	  ;;
 	*Sun\ F*)
 	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-	  _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-	  _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
 	  ;;
 	esac
 	;;
       esac
       ;;
 
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
     osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
       # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
     rdos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
       ;;
 
     solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       case $cc_basename in
       f77* | f90* | f95*)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
       *)
-	_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
       esac
       ;;
 
     sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
     sysv4 | sysv4.2uw2* | sysv4.3*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
     sysv4*MP*)
       if test -d /usr/nec ;then
-	_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-	_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
       ;;
 
     sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
     unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
       ;;
 
     uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       ;;
 
     *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
       ;;
     esac
   fi
 ])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
 case $host_os in
   # For platforms which do not support PIC, -DPIC is meaningless:
   *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
   *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
     ;;
 esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
 
 #
 # Check to make sure the static flag actually works.
 #
-wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
-  _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
   $lt_tmp_static_flag,
   [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-])
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
 
 
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
 # See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_REQUIRE([LT_AC_PROG_SED])dnl
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
   ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+  cygwin* | mingw* | cegcc*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   esac
-  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-],[
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
   runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
   # include_expsyms should be a list of space-separated symbols to be *always*
   # included in the symbol list
-  _LT_AC_TAGVAR(include_expsyms, $1)=
+  _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
   # it will be wrapped by ` (' and `)$', so one must not match beginning or
   # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
   # as well as any symbol that contains `d'.
-  _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
   # the symbol is explicitly referenced.  Since portable code cannot
@@ -5624,10 +4244,9 @@ ifelse([$1],[CXX],[
   # Exclude shared library initialization/finalization symbols.
 dnl Note also adjust exclude_expsyms for C++ above.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
+
   case $host_os in
-  cygwin* | mingw* | pw32*)
+  cygwin* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -5644,7 +4263,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     ;;
   esac
 
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  _LT_TAGVAR(ld_shlibs, $1)=yes
   if test "$with_gnu_ld" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
@@ -5653,16 +4272,16 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
+    case `$LD -v 2>&1` in
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -5675,8 +4294,8 @@ dnl Note also adjust exclude_expsyms for C++ above.
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
       if test "$host_cpu" != ia64; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
 
 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
 *** to be unable to reliably create shared libraries on AIX.
@@ -5684,49 +4303,50 @@ dnl Note also adjust exclude_expsyms for C++ above.
 *** really care for shared libraries, you may want to modify your PATH
 *** so that a non-GNU linker is found, and then restart.
 
-EOF
+_LT_EOF
       fi
       ;;
 
     amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
       ;;
 
     beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
 	  cp $export_symbols $output_objdir/$soname.def;
 	else
 	  echo EXPORTS > $output_objdir/$soname.def;
@@ -5734,79 +4354,109 @@ EOF
 	fi~
 	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     interix[[3-9]]*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
 	tmp_addflag=
+	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
 	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
 	  tmp_addflag=' -i_dynamic -nofor_main' ;;
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
 	esac
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-	if test $supports_anon_versioning = yes; then
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+        _LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
     solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
-	cat <<EOF 1>&2
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
 
 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
 *** create shared libraries on Solaris systems.  Therefore, libtool
@@ -5815,19 +4465,19 @@ EOF
 *** your PATH or compiler configuration so that the native linker is
 *** used, and then restart.
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
       case `$LD -v 2>&1` in
         *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
@@ -5840,54 +4490,58 @@ EOF
 _LT_EOF
 	;;
 	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
-	    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
 	;;
       esac
       ;;
 
     sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
       wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
       runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
   else
     # PORTME fill in a description of your system's linker (not GNU ld)
     case $host_os in
     aix3*)
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
       if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
-	_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
       fi
       ;;
 
@@ -5901,10 +4555,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
@@ -5913,10 +4567,10 @@ _LT_EOF
 	# need to do runtime linking.
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
 	  done
 	  ;;
 	esac
@@ -5931,30 +4585,32 @@ _LT_EOF
       # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
       # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
-      _LT_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
 
       if test "$GCC" = yes; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
-  	  # We have reworked collect2
-  	  :
+	  # We have reworked collect2
+	  :
 	  else
-  	  # We have old collect2
-  	  _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-  	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-  	  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
 	  fi
 	  ;;
 	esac
@@ -5965,8 +4621,8 @@ _LT_EOF
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
 	  if test "$aix_use_runtimelinking" = yes; then
@@ -5977,129 +4633,94 @@ _LT_EOF
 	fi
       fi
 
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(always_export_symbols, $1)=yes
       if test "$aix_use_runtimelinking" = yes; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
 	if test "$host_cpu" = ia64; then
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 _LT_AC_SYS_LIBPATH_AIX
-	 _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
 	  # Exported symbols can be pulled into shared objects from archives
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
 	fi
       fi
       ;;
 
     amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
       ;;
 
     bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
       ;;
 
-    cygwin* | mingw* | pw32*)
+    cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       # Tell ltmain to make .lib files, not .a files.
       libext=lib
       # Tell ltmain to make .dll files, not .so files.
       shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
       # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
+      _LT_DARWIN_LINKER_FEATURES($1)
       ;;
 
     dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      _LT_TAGVAR(ld_shlibs, $1)=no
       ;;
 
     # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
@@ -6107,60 +4728,60 @@ _LT_EOF
     # does not break anything, and helps significantly (at the cost of a little
     # extra space).
     freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     # Unfortunately, older versions of FreeBSD 2 do not have this feature.
     freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     hpux9*)
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       ;;
 
     hpux10*)
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
       if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
-	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
-	_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
       fi
       ;;
 
@@ -6168,45 +4789,45 @@ _LT_EOF
       if test "$GCC" = yes -a "$with_gnu_ld" = no; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       fi
       if test "$with_gnu_ld" = no; then
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-	_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
 	hppa*64*|ia64*)
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-	  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  ;;
 	*)
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
-	  _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
 	  ;;
 	esac
       fi
@@ -6214,194 +4835,221 @@ _LT_EOF
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
       ;;
 
     openbsd*)
       if test -f /usr/libexec/ld.so; then
-	_LT_AC_TAGVAR(hardcode_direct, $1)=yes
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
 	else
 	  case $host_os in
 	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	     ;;
 	   *)
-	     _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	     ;;
 	  esac
-        fi
+	fi
       else
-	_LT_AC_TAGVAR(ld_shlibs, $1)=no
+	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
       else
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
-	wlarc=''
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       case $host_os in
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
 	# but understands `-z linker_flag'.  GCC discards it without `$wl',
 	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
 	if test "$GCC" = yes; then
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	else
-	  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
 	;;
       esac
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
     sunos4*)
       if test "x$host_vendor" = xsequent; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     sysv4)
       case $host_vendor in
 	sni)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
 	;;
 	siemens)
 	  ## LD is ld it makes a PLAMLIB
 	  ## CC just makes a GrossModule.
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
         ;;
 	motorola)
-	  _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
 	;;
       esac
       runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
       ;;
 
     sysv4*MP*)
       if test -d /usr/nec; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	runpath_var=LD_RUN_PATH
 	hardcode_runpath_var=yes
-	_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
       fi
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -6412,50 +5060,65 @@ _LT_EOF
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
 
       if test "$GCC" = yes; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
 
     *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      _LT_TAGVAR(ld_shlibs, $1)=no
       ;;
     esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
   fi
 ])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
 
 #
 # Do we need to explicitly link libc?
 #
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
 x|xyes)
   # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
   if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
       ;;
@@ -6464,7 +5127,7 @@ x|xyes)
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
       AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
+      $RM conftest*
       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
@@ -6472,135 +5135,1916 @@ x|xyes)
         lib=conftest
         libobjs=conftest.$ac_objext
         deplibs=
-        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-	pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
         compiler_flags=-v
         linker_flags=-v
         verstring=
         output_objdir=.
         libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+        _LT_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
         then
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
         else
-	  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
         fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
       else
         cat conftest.err 1>&5
       fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      $RM conftest*
+      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
       ;;
     esac
   fi
   ;;
 esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
 
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
 
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
+# Source file extension for C test sources.
+ac_ext=c
 
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
 
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
 
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
 
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
 
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
 
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 will use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  xl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='echo'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=echo
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='echo'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
 ])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
 
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
 
-# Cheap backport of AS_EXECUTABLE_P and required macros
-# from Autoconf 2.59; we should not use $as_executable_p directly.
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
 
-# _AS_TEST_PREPARE
-# ----------------
-m4_ifndef([_AS_TEST_PREPARE],
-[m4_defun([_AS_TEST_PREPARE],
-[if test -x / >/dev/null 2>&1; then
-  as_executable_p='test -x'
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
 else
-  as_executable_p='test -f'
+  echo "libtool.m4: error: problem compiling $1 test program"
 fi
-])])# _AS_TEST_PREPARE
 
-# AS_EXECUTABLE_P
-# ---------------
-# Check whether a file is executable.
-m4_ifndef([AS_EXECUTABLE_P],
-[m4_defun([AS_EXECUTABLE_P],
-[AS_REQUIRE([_AS_TEST_PREPARE])dnl
-$as_executable_p $1[]dnl
-])])# AS_EXECUTABLE_P
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
 # NOTE: This macro has been submitted for inclusion into   #
 #  GNU Autoconf as AC_PROG_SED.  When it is available in   #
 #  a released version of Autoconf we should remove this    #
 #  macro and use it instead.                               #
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
+
+m4_defun([AC_PROG_SED],
 [AC_MSG_CHECKING([for a sed that does not truncate output])
 AC_CACHE_VAL(lt_cv_path_SED,
 [# Loop through the user's path and test for sed and gsed.
@@ -6612,7 +7056,7 @@ do
   test -z "$as_dir" && as_dir=.
   for lt_ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
         lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
       fi
     done
@@ -6653,8 +7097,874 @@ done
 SED=$lt_cv_path_SED
 AC_SUBST([SED])
 AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
+
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
 ])
 
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
+
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
+
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
+
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+
 # Copyright (C) 2002, 2003, 2005, 2006, 2007  Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
diff --git a/libgc/config.guess b/libgc/config.guess
index f32079a..e6b5d5b 100755
--- a/libgc/config.guess
+++ b/libgc/config.guess
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
 #   Free Software Foundation, Inc.
 
-timestamp='2008-01-23'
+timestamp='2008-01-08'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -139,6 +139,16 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_MACHINE}" in
+    i?86)
+	test -z "$VENDOR" && VENDOR=pc
+	;;
+    *)
+	test -z "$VENDOR" && VENDOR=unknown
+	;;
+esac
+test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -840,13 +850,13 @@ EOF
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	else
-	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    echo ${UNAME_MACHINE}-${VENDOR}-linux-gnueabi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
@@ -855,16 +865,16 @@ EOF
 	echo crisv32-axis-linux-gnu
 	exit ;;
     frv:Linux:*:*)
-    	echo frv-unknown-linux-gnu
+    	echo frv-${VENDOR}-linux-gnu
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     mips:Linux:*:*)
 	eval $set_cc_for_build
@@ -887,7 +897,7 @@ EOF
 		s: ::g
 		p
 	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
 	;;
     mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -910,16 +920,16 @@ EOF
 		s: ::g
 		p
 	    }'`"
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-${VENDOR}-linux-gnu"; exit; }
 	;;
     or32:Linux:*:*)
-	echo or32-unknown-linux-gnu
+	echo or32-${VENDOR}-linux-gnu
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-${VENDOR}-linux-gnu
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-${VENDOR}-linux-gnu
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -933,39 +943,39 @@ EOF
         esac
 	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-${VENDOR}-linux-gnu ;;
+	  PA8*) echo hppa2.0-${VENDOR}-linux-gnu ;;
+	  *)    echo hppa-${VENDOR}-linux-gnu ;;
 	esac
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-${VENDOR}-linux-gnu
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux
 	exit ;;
     sh64*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     vax:Linux:*:*)
 	echo ${UNAME_MACHINE}-dec-linux-gnu
 	exit ;;
     x86_64:Linux:*:*)
-	echo x86_64-unknown-linux-gnu
+	echo x86_64-${VENDOR}-linux-gnu
 	exit ;;
     xtensa*:Linux:*:*)
-    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    	echo ${UNAME_MACHINE}-${VENDOR}-linux-gnu
 	exit ;;
     i*86:Linux:*:*)
 	# The BFD linker knows what the default object file format is, so
@@ -980,18 +990,18 @@ EOF
 				    p'`
         case "$ld_supported_targets" in
 	  elf32-i386)
-		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+		TENTATIVE="${UNAME_MACHINE}-${VENDOR}-linux-gnu"
 		;;
 	  a.out-i386-linux)
-		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuaout"
 		exit ;;
 	  coff-i386)
-		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnucoff"
 		exit ;;
 	  "")
 		# Either a pre-BFD a.out linker (linux-gnuoldld) or
 		# one that does not give us useful --help.
-		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-gnuoldld"
 		exit ;;
 	esac
 	# Determine whether the default compiler is a.out or elf
@@ -1025,7 +1035,7 @@ EOF
 		p
 	    }'`"
 	test x"${LIBC}" != x && {
-		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+		echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}"
 		exit
 	}
 	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
@@ -1484,9 +1494,9 @@ This script, last modified $timestamp, has failed to recognize
 the operating system you are using. It is advised that you
 download the most up to date version of the config scripts from
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
 
 If the version you run ($0) is already up to date, please
 send the following data and any information you think might be
diff --git a/libgc/configure b/libgc/configure
index 2aa287f..49c1def 100755
--- a/libgc/configure
+++ b/libgc/configure
@@ -1,11 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libgc-mono 6.6.
+# Generated by GNU Autoconf 2.63 for libgc-mono 6.6.
 #
 # Report bugs to <Hans_Boehm at hp.com>.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
@@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -65,8 +93,6 @@ fi
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -89,7 +115,7 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -102,17 +128,10 @@ PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -160,7 +179,7 @@ else
   as_have_required=no
 fi
 
-  if test $as_have_required = yes && 	 (eval ":
+  if test $as_have_required = yes &&	 (eval ":
 (as_func_return () {
   (exit \$1)
 }
@@ -242,7 +261,7 @@ IFS=$as_save_IFS
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -263,7 +282,7 @@ _ASEOF
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -343,10 +362,10 @@ fi
 
       if test "x$CONFIG_SHELL" != x; then
   for as_var in BASH_ENV ENV
-        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-        done
-        export CONFIG_SHELL
-        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
 
@@ -415,9 +434,10 @@ fi
 
 test \$exitcode = 0") || {
   echo No shell found that supports shell functions.
-  echo Please tell autoconf at gnu.org about your system,
-  echo including any error possibly output before this
-  echo message
+  echo Please tell bug-autoconf at gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
 }
 
 
@@ -453,7 +473,7 @@ test \$exitcode = 0") || {
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -481,7 +501,6 @@ case `echo -n x` in
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -494,19 +513,22 @@ if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -531,10 +553,10 @@ else
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -555,22 +577,22 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 # Check that we are running under the correct shell.
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$ECHO in
+case X$lt_ECHO in
 X*--fallback-echo)
   # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','`
   ;;
 esac
 
-echo=${ECHO-echo}
+ECHO=${lt_ECHO-echo}
 if test "X$1" = X--no-reexec; then
   # Discard the --no-reexec flag, and continue.
   shift
 elif test "X$1" = X--fallback-echo; then
   # Avoid inline document here, it may be left over
   :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
   :
 else
   # Restart under the correct shell.
@@ -580,9 +602,9 @@ fi
 if test "X$1" = X--fallback-echo; then
   # used as fallback echo
   shift
-  cat <<EOF
+  cat <<_LT_EOF
 $*
-EOF
+_LT_EOF
   exit 0
 fi
 
@@ -590,121 +612,116 @@ fi
 # if CDPATH is set.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
-fi
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
 
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
-else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
 
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
     IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
 
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-	 test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-	 echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-	 test "X$echo_testing_string" = "X$echo_test_string"; then
-	# Cool, printf works
-	:
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-	export CONFIG_SHELL
-	SHELL="$CONFIG_SHELL"
-	export SHELL
-	echo="$CONFIG_SHELL $0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
-	   test "X$echo_testing_string" = 'X\t' &&
-	   echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-	   test "X$echo_testing_string" = "X$echo_test_string"; then
-	echo="$CONFIG_SHELL $0 --fallback-echo"
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
       else
-	# maybe with a smaller string...
-	prev=:
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL $0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
 
-	for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
-	  if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-	  then
-	    break
-	  fi
-	  prev="$cmd"
-	done
+	  for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
 
-	if test "$prev" != 'sed 50q "$0"'; then
-	  echo_test_string=`eval $prev`
-	  export echo_test_string
-	  exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
-	else
-	  # Oops.  We lost completely, so just stick with echo.
-	  echo=echo
-	fi
+	  if test "$prev" != 'sed 50q "$0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
       fi
     fi
   fi
 fi
-fi
 
 # Copy echo and quote the copy suitably for passing to libtool from
 # the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
 fi
 
 
 
 
-tagnames=${tagnames+${tagnames},}CXX
-
-tagnames=${tagnames+${tagnames},}F77
-
 exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
@@ -769,142 +786,169 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-am__isrc
-CYGPATH_W
-PACKAGE
-VERSION
-ACLOCAL
-AUTOCONF
-AUTOMAKE
-AUTOHEADER
-MAKEINFO
-install_sh
-STRIP
-INSTALL_STRIP_PROGRAM
-mkdir_p
-AWK
-SET_MAKE
-am__leading_dot
-AMTAR
-am__tar
-am__untar
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
-GC_VERSION
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-DEPDIR
-am__include
-am__quote
-AMDEP_TRUE
-AMDEP_FALSE
-AMDEPBACKSLASH
-CCDEPMODE
-am__fastdepCC_TRUE
-am__fastdepCC_FALSE
-CXX
-CXXFLAGS
-ac_ct_CXX
-CXXDEPMODE
-am__fastdepCXX_TRUE
-am__fastdepCXX_FALSE
-CCAS
-CCASFLAGS
-CCASDEPMODE
-am__fastdepCCAS_TRUE
-am__fastdepCCAS_FALSE
-AR
-RANLIB
-MAINTAINER_MODE_TRUE
-MAINTAINER_MODE_FALSE
-MAINT
-GC_CFLAGS
-THREADDLLIBS
-POWERPC_DARWIN_TRUE
-POWERPC_DARWIN_FALSE
-COMPILER_XLC_TRUE
-COMPILER_XLC_FALSE
-EXTRA_TEST_LIBS
-target_all
-CPLUSPLUS_TRUE
-CPLUSPLUS_FALSE
-INCLUDES
-CXXINCLUDES
-addobjs
-addincludes
-addlibs
-addtests
-SED
-GREP
-EGREP
-LN_S
-ECHO
-DSYMUTIL
-NMEDIT
-CPP
+ac_subst_vars='LTLIBOBJS
+LIBOBJS
+USE_LIBDIR_FALSE
+USE_LIBDIR_TRUE
+UNWINDLIBS
+MY_CFLAGS
 CXXCPP
-F77
-FFLAGS
-ac_ct_F77
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+lt_ECHO
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
 LIBTOOL
-MY_CFLAGS
-UNWINDLIBS
-USE_LIBDIR_TRUE
-USE_LIBDIR_FALSE
-LIBOBJS
-LTLIBOBJS'
+addtests
+addlibs
+addincludes
+addobjs
+CXXINCLUDES
+INCLUDES
+CPLUSPLUS_FALSE
+CPLUSPLUS_TRUE
+target_all
+EXTRA_TEST_LIBS
+COMPILER_XLC_FALSE
+COMPILER_XLC_TRUE
+POWERPC_DARWIN_FALSE
+POWERPC_DARWIN_TRUE
+THREADDLLIBS
+GC_CFLAGS
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+RANLIB
+AR
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+GC_VERSION
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
 ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+enable_maintainer_mode
+enable_win32_dllmain
+enable_parallel_mark
+enable_cplusplus
+with_ecos
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+enable_libtool_lock
+with_target_subdir
+with_cross_host
+enable_full_debug
+enable_redirect_malloc
+enable_gc_assertions
+'
       ac_precious_vars='build_alias
 host_alias
 target_alias
@@ -919,14 +963,14 @@ CCC
 CCAS
 CCASFLAGS
 CPP
-CXXCPP
-F77
-FFLAGS'
+CXXCPP'
 
 
 # Initialize some variables set by options.
 ac_init_help=
 ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
 # The variables have the same names as the options, with
 # dashes changed to underlines.
 cache_file=/dev/null
@@ -1025,13 +1069,21 @@ do
     datarootdir=$ac_optarg ;;
 
   -disable-* | --disable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
 
   -docdir | --docdir | --docdi | --doc | --do)
     ac_prev=docdir ;;
@@ -1044,13 +1096,21 @@ do
     dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
-    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
-    eval enable_$ac_feature=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -1241,22 +1301,38 @@ do
     ac_init_version=: ;;
 
   -with-* | --with-*)
-    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=\$ac_optarg ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
 
   -without-* | --without-*)
-    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid package name: $ac_package" >&2
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
-    eval with_$ac_package=no ;;
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -1276,7 +1352,7 @@ do
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) { echo "$as_me: error: unrecognized option: $ac_option
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; }
     ;;
@@ -1285,16 +1361,16 @@ Try \`$0 --help' for more information." >&2
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
-      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
@@ -1303,22 +1379,38 @@ done
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  { echo "$as_me: error: missing argument to $ac_option" >&2
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute directory names.
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
 		libdir localedir mandir
 do
   eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
   case $ac_val in
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
    { (exit 1); exit 1; }; }
 done
 
@@ -1333,7 +1425,7 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
     If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
@@ -1349,10 +1441,10 @@ test "$silent" = yes && exec 6>/dev/null
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  { echo "$as_me: error: Working directory cannot be determined" >&2
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
    { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  { echo "$as_me: error: pwd does not report name of working directory" >&2
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
    { (exit 1); exit 1; }; }
 
 
@@ -1360,12 +1452,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
 if test -z "$srcdir"; then
   ac_srcdir_defaulted=yes
   # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$0" ||
-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$0" : 'X\(//\)[^/]' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$0" |
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -1392,12 +1484,12 @@ else
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
 	pwd)`
 # When building in place, set srcdir=.
@@ -1446,9 +1538,9 @@ Configuration:
 
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
-			  [$ac_default_prefix]
+                          [$ac_default_prefix]
   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-			  [PREFIX]
+                          [PREFIX]
 
 By default, \`make install' will install all the files in
 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
@@ -1458,25 +1550,25 @@ for instance \`--prefix=\$HOME'.
 For better control, use the options below.
 
 Fine tuning of the installation directories:
-  --bindir=DIR           user executables [EPREFIX/bin]
-  --sbindir=DIR          system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
-  --libdir=DIR           object code libraries [EPREFIX/lib]
-  --includedir=DIR       C header files [PREFIX/include]
-  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR          info documentation [DATAROOTDIR/info]
-  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR           man documentation [DATAROOTDIR/man]
-  --docdir=DIR           documentation root [DATAROOTDIR/doc/libgc-mono]
-  --htmldir=DIR          html documentation [DOCDIR]
-  --dvidir=DIR           dvi documentation [DOCDIR]
-  --pdfdir=DIR           pdf documentation [DOCDIR]
-  --psdir=DIR            ps documentation [DOCDIR]
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/libgc-mono]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -1499,6 +1591,7 @@ if test -n "$ac_init_help"; then
   cat <<\_ACEOF
 
 Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-dependency-tracking  speeds up one-time build
@@ -1521,10 +1614,9 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-ecos             enable runtime eCos target support
-  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
-  --with-tags[=TAGS]      include additional configurations [automatic]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-target-subdir=SUBDIR
                           configuring with a cross compiler
   --with-cross-host=HOST  configuring with a cross compiler
@@ -1543,8 +1635,6 @@ Some influential environment variables:
   CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
   CPP         C preprocessor
   CXXCPP      C++ preprocessor
-  F77         Fortran 77 compiler command
-  FFLAGS      Fortran 77 compiler flags
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1557,15 +1647,17 @@ fi
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" || continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
     ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -1601,7 +1693,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
@@ -1611,10 +1703,10 @@ test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 libgc-mono configure 6.6
-generated by GNU Autoconf 2.61
+generated by GNU Autoconf 2.63
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1625,7 +1717,7 @@ This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by libgc-mono $as_me 6.6, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -1661,7 +1753,7 @@ for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  echo "PATH: $as_dir"
+  $as_echo "PATH: $as_dir"
 done
 IFS=$as_save_IFS
 
@@ -1696,7 +1788,7 @@ do
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
@@ -1748,11 +1840,12 @@ _ASBOX
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -1782,9 +1875,9 @@ _ASBOX
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      echo "$ac_var='\''$ac_val'\''"
+      $as_echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
@@ -1799,9 +1892,9 @@ _ASBOX
       do
 	eval ac_val=\$$ac_var
 	case $ac_val in
-	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
 	esac
-	echo "$ac_var='\''$ac_val'\''"
+	$as_echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1817,8 +1910,8 @@ _ASBOX
       echo
     fi
     test "$ac_signal" != 0 &&
-      echo "$as_me: caught signal $ac_signal"
-    echo "$as_me: exit $exit_status"
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -1860,21 +1953,24 @@ _ACEOF
 
 
 # Let the site file select an alternate cache file if it wants to.
-# Prefer explicitly selected file to automatically selected ones.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  set x "$CONFIG_SITE"
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
-  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
 else
-  set x "$ac_default_prefix/share/config.site" \
-	"$ac_default_prefix/etc/config.site"
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
 fi
-shift
-for ac_site_file
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
+  test "x$ac_site_file" = xNONE && continue
   if test -r "$ac_site_file"; then
-    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
-echo "$as_me: loading site script $ac_site_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file"
   fi
@@ -1884,16 +1980,16 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special
   # files actually), so we avoid doing that.
   if test -f "$cache_file"; then
-    { echo "$as_me:$LINENO: loading cache $cache_file" >&5
-echo "$as_me: loading cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
-echo "$as_me: creating cache $cache_file" >&6;}
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
@@ -1907,29 +2003,38 @@ for ac_var in $ac_precious_vars; do
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
       if test "x$ac_old_val" != "x$ac_new_val"; then
-	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
-echo "$as_me:   former value:  $ac_old_val" >&2;}
-	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
-echo "$as_me:   current value: $ac_new_val" >&2;}
-	ac_cache_corrupted=:
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1939,10 +2044,12 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
-echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -1997,8 +2104,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
-echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
@@ -2024,11 +2131,12 @@ ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2057,17 +2165,29 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
+
 done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -2080,8 +2200,8 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -2091,8 +2211,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
 # Just in case
 sleep 1
 echo timestamp > conftest.file
@@ -2115,9 +2235,9 @@ if (
       # if, for instance, CONFIG_SHELL is bash and it inherits a
       # broken ls alias from the environment.  This has actually
       # happened.  Such a system could not be considered "sane".
-      { { echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
+      { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail.  Make sure there is not a broken
 alias in your environment" >&5
-echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
+$as_echo "$as_me: error: ls -t appears to fail.  Make sure there is not a broken
 alias in your environment" >&2;}
    { (exit 1); exit 1; }; }
    fi
@@ -2128,26 +2248,23 @@ then
    # Ok.
    :
 else
-   { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+   { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files!
 Check your system clock" >&5
-echo "$as_me: error: newly created file is older than distributed files!
+$as_echo "$as_me: error: newly created file is older than distributed files!
 Check your system clock" >&2;}
    { (exit 1); exit 1; }; }
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
   program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.  echo might interpret backslashes.
+# Double any \ or $.
 # By default was `s,x,x', remove it if useless.
-cat <<\_ACEOF >conftest.sed
-s/[\\$]/&&/g;s/;s,x,x,$//
-_ACEOF
-program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm -f conftest.sed
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
 
 # expand $ac_aux_dir to an absolute path
 am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -2158,15 +2275,15 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
-echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
 fi
 
-{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
   if test "${ac_cv_path_mkdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
@@ -2201,8 +2318,8 @@ fi
     MKDIR_P="$ac_install_sh -d"
   fi
 fi
-{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-echo "${ECHO_T}$MKDIR_P" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
 
 mkdir_p="$MKDIR_P"
 case $mkdir_p in
@@ -2214,10 +2331,10 @@ for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AWK+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
@@ -2230,7 +2347,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2241,22 +2358,23 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
   test -n "$AWK" && break
 done
 
-{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
-set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
 if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
 SHELL = /bin/sh
@@ -2273,12 +2391,12 @@ esac
 rm -f conftest.make
 fi
 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
   SET_MAKE=
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -2297,8 +2415,8 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then
   am__isrc=' -I$(srcdir)'
   # test to see if srcdir already configured
   if test -f $srcdir/config.status; then
-    { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
-echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+$as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
    { (exit 1); exit 1; }; }
   fi
 fi
@@ -2344,10 +2462,10 @@ if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
@@ -2360,7 +2478,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2371,11 +2489,11 @@ fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2384,10 +2502,10 @@ if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
@@ -2400,7 +2518,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2411,11 +2529,11 @@ fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_STRIP" = x; then
@@ -2423,12 +2541,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     STRIP=$ac_ct_STRIP
@@ -2456,34 +2570,34 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
 
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-{ echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
 if test "${ac_cv_build+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-echo "$as_me: error: invalid value of canonical build" >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
    { (exit 1); exit 1; }; };;
 esac
 build=$ac_cv_build
@@ -2500,27 +2614,27 @@ IFS=$ac_save_IFS
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
 if test "${ac_cv_host+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-echo "$as_me: error: invalid value of canonical host" >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
    { (exit 1); exit 1; }; };;
 esac
 host=$ac_cv_host
@@ -2549,10 +2663,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2565,7 +2679,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2576,11 +2690,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2589,10 +2703,10 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2605,7 +2719,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2616,11 +2730,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -2628,12 +2742,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2646,10 +2756,10 @@ if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2662,7 +2772,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2673,11 +2783,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2686,10 +2796,10 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2707,7 +2817,7 @@ do
        continue
      fi
     ac_cv_prog_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2730,11 +2840,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2745,10 +2855,10 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2761,7 +2871,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2772,11 +2882,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2789,10 +2899,10 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
@@ -2805,7 +2915,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -2816,11 +2926,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -2832,12 +2942,8 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -2847,44 +2953,50 @@ fi
 fi
 
 
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&5
-echo "$as_me: error: no acceptable C compiler found in \$PATH
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
 { (ac_try="$ac_compiler --version >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -v >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -V >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
 cat >conftest.$ac_ext <<_ACEOF
@@ -2903,27 +3015,22 @@ main ()
 }
 _ACEOF
 ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.exe b.out"
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort.  b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions.  Remove them first so a
-# subsequent execution test works.
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
 ac_rmfiles=
 for ac_file in $ac_files
 do
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     * ) ac_rmfiles="$ac_rmfiles $ac_file";;
   esac
 done
@@ -2934,10 +3041,11 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
@@ -2948,7 +3056,7 @@ for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
 	;;
     [ab].out )
 	# We found the default executable, but exeext='' is most
@@ -2975,25 +3083,27 @@ else
   ac_file=''
 fi
 
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
 if test -z "$ac_file"; then
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
 See \`config.log' for more details." >&5
-echo "$as_me: error: C compiler cannot create executables
+$as_echo "$as_me: error: C compiler cannot create executables
 See \`config.log' for more details." >&2;}
-   { (exit 77); exit 77; }; }
+   { (exit 77); exit 77; }; }; }
 fi
 
 ac_exeext=$ac_cv_exeext
 
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
@@ -3002,49 +3112,53 @@ if test "$cross_compiling" != yes; then
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
 	cross_compiling=yes
     else
-	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot run C compiled programs.
+$as_echo "$as_me: error: cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
     fi
   fi
 fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-rm -f a.out a.exe conftest$ac_cv_exeext b.out
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
 
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
@@ -3053,31 +3167,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	  break;;
     * ) break;;
   esac
 done
 else
-  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
 if test "${ac_cv_objext+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3100,40 +3216,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
 done
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&5
-echo "$as_me: error: cannot compute suffix of object files: cannot compile
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3159,20 +3278,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_compiler_gnu=no
@@ -3182,15 +3302,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
-GCC=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
@@ -3217,20 +3341,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	CFLAGS=""
@@ -3255,20 +3380,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_c_werror_flag=$ac_save_c_werror_flag
@@ -3294,20 +3420,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3322,8 +3449,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
@@ -3339,10 +3466,10 @@ else
     CFLAGS=
   fi
 fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
 if test "${ac_cv_prog_cc_c89+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
@@ -3413,20 +3540,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_c89=$ac_arg
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3442,15 +3570,15 @@ fi
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
   xno)
-    { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
 
 
@@ -3471,8 +3599,8 @@ am__doit:
 .PHONY: am__doit
 END
 # If we don't find an include directive, just comment out the code.
-{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
 _am_result=none
@@ -3499,8 +3627,8 @@ if test "$am__include" = "#"; then
 fi
 
 
-{ echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
 rm -f confinc confmf
 
 # Check whether --enable-dependency-tracking was given.
@@ -3524,10 +3652,10 @@ fi
 
 depcc="$CC"   am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -3615,8 +3743,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
@@ -3644,10 +3772,10 @@ if test -z "$CXX"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
   ac_cv_prog_CXX="$CXX" # Let the user override the test.
@@ -3660,7 +3788,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3671,11 +3799,11 @@ fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  { echo "$as_me:$LINENO: result: $CXX" >&5
-echo "${ECHO_T}$CXX" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3688,10 +3816,10 @@ if test -z "$CXX"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
   ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
@@ -3704,7 +3832,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -3715,11 +3843,11 @@ fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
-echo "${ECHO_T}$ac_ct_CXX" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -3731,12 +3859,8 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CXX=$ac_ct_CXX
@@ -3746,43 +3870,47 @@ fi
   fi
 fi
 # Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C++ compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
 { (ac_try="$ac_compiler --version >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler --version >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -v >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -v >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 { (ac_try="$ac_compiler -V >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compiler -V >&5") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
 
-{ echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3808,20 +3936,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_compiler_gnu=no
@@ -3831,15 +3960,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; }
-GXX=`test $ac_compiler_gnu = yes && echo yes`
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-{ echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
-echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
 if test "${ac_cv_prog_cxx_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    ac_cxx_werror_flag=yes
@@ -3866,20 +3999,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cxx_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	CXXFLAGS=""
@@ -3904,20 +4038,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
@@ -3943,20 +4078,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_prog_cxx_g=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
@@ -3971,8 +4107,8 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
 elif test $ac_cv_prog_cxx_g = yes; then
@@ -3996,10 +4132,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 depcc="$CXX"  am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -4087,8 +4223,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
 CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
 
  if
@@ -4112,10 +4248,10 @@ test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 
 depcc="$CCAS"   am_compiler_list=
 
-{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
 if test "${am_cv_CCAS_dependencies_compiler_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
@@ -4203,8 +4339,8 @@ else
 fi
 
 fi
-{ echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CCAS_dependencies_compiler_type" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
 CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
 
  if
@@ -4221,10 +4357,10 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
@@ -4237,7 +4373,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4248,11 +4384,11 @@ fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4261,10 +4397,10 @@ if test -z "$ac_cv_prog_AR"; then
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_AR"; then
   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
@@ -4277,7 +4413,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_AR="ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4288,11 +4424,11 @@ fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_AR" = x; then
@@ -4300,12 +4436,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     AR=$ac_ct_AR
@@ -4317,10 +4449,10 @@ fi
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -4333,7 +4465,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4344,11 +4476,11 @@ fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4357,10 +4489,10 @@ if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
@@ -4373,7 +4505,7 @@ do
   for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4384,11 +4516,11 @@ fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
   if test "x$ac_ct_RANLIB" = x; then
@@ -4396,12 +4528,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
@@ -4424,11 +4552,12 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -4457,17 +4586,29 @@ case $as_dir/ in
 	    # program-specific install script used by HP pwplus--don't use.
 	    :
 	  else
-	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	    break 3
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
 	  fi
 	fi
       done
     done
     ;;
 esac
+
 done
 IFS=$as_save_IFS
 
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
@@ -4480,8 +4621,8 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -4492,8 +4633,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 
-{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
-echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
     # Check whether --enable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
@@ -4501,8 +4642,8 @@ else
   USE_MAINTAINER_MODE=no
 fi
 
-  { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
-echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
    if test $USE_MAINTAINER_MODE = yes; then
   MAINTAINER_MODE_TRUE=
   MAINTAINER_MODE_FALSE='#'
@@ -4531,8 +4672,8 @@ GC_CFLAGS=${gc_cflags}
 
 case $enable_embed_check in
 no) ;;
-*) { { echo "$as_me:$LINENO: error: This module is now part of 'mono' and cannot be built as a stand-alone module any longer." >&5
-echo "$as_me: error: This module is now part of 'mono' and cannot be built as a stand-alone module any longer." >&2;}
+*) { { $as_echo "$as_me:$LINENO: error: This module is now part of 'mono' and cannot be built as a stand-alone module any longer." >&5
+$as_echo "$as_me: error: This module is now part of 'mono' and cannot be built as a stand-alone module any longer." >&2;}
    { (exit 1); exit 1; }; } ;;
 esac
 
@@ -4548,8 +4689,8 @@ fi
 if test "${enable_parallel_mark+set}" = set; then
   enableval=$enable_parallel_mark; case "$THREADS" in
       no | none | single)
-	{ { echo "$as_me:$LINENO: error: Parallel mark requires --enable-threads=x spec" >&5
-echo "$as_me: error: Parallel mark requires --enable-threads=x spec" >&2;}
+	{ { $as_echo "$as_me:$LINENO: error: Parallel mark requires --enable-threads=x spec" >&5
+$as_echo "$as_me: error: Parallel mark requires --enable-threads=x spec" >&2;}
    { (exit 1); exit 1; }; }
 	;;
     esac
@@ -4615,8 +4756,8 @@ _ACEOF
 
 	;;
      *-*-hpux*)
-	{ echo "$as_me:$LINENO: WARNING: \"Only HP/UX 11 threads are supported.\"" >&5
-echo "$as_me: WARNING: \"Only HP/UX 11 threads are supported.\"" >&2;}
+	{ $as_echo "$as_me:$LINENO: WARNING: \"Only HP/UX 11 threads are supported.\"" >&5
+$as_echo "$as_me: WARNING: \"Only HP/UX 11 threads are supported.\"" >&2;}
 	cat >>confdefs.h <<\_ACEOF
 #define GC_HPUX_THREADS 1
 _ACEOF
@@ -4726,8 +4867,8 @@ _ACEOF
 	THREADDLLIBS="-lpthread -lrt"
 	;;
       *)
-	{ { echo "$as_me:$LINENO: error: \"Pthreads not supported by the GC on this platform.\"" >&5
-echo "$as_me: error: \"Pthreads not supported by the GC on this platform.\"" >&2;}
+	{ { $as_echo "$as_me:$LINENO: error: \"Pthreads not supported by the GC on this platform.\"" >&5
+$as_echo "$as_me: error: \"Pthreads not supported by the GC on this platform.\"" >&2;}
    { (exit 1); exit 1; }; }
 	;;
     esac
@@ -4750,8 +4891,8 @@ _ACEOF
     ;;
  dgux386)
     THREADS=dgux386
-    { echo "$as_me:$LINENO: result: $THREADDLLIBS" >&5
-echo "${ECHO_T}$THREADDLLIBS" >&6; }
+    { $as_echo "$as_me:$LINENO: result: $THREADDLLIBS" >&5
+$as_echo "$THREADDLLIBS" >&6; }
     # Use pthread GCC  switch
     THREADDLLIBS=-pthread
     if test "${enable_parallel_mark}" = yes; then
@@ -4788,13 +4929,13 @@ _ACEOF
 
     ;;
  decosf1 | irix | mach | os2 | solaris | dce | vxworks)
-    { { echo "$as_me:$LINENO: error: thread package $THREADS not yet supported" >&5
-echo "$as_me: error: thread package $THREADS not yet supported" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: thread package $THREADS not yet supported" >&5
+$as_echo "$as_me: error: thread package $THREADS not yet supported" >&2;}
    { (exit 1); exit 1; }; }
     ;;
  *)
-    { { echo "$as_me:$LINENO: error: $THREADS is an unknown thread package" >&5
-echo "$as_me: error: $THREADS is an unknown thread package" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: $THREADS is an unknown thread package" >&5
+$as_echo "$as_me: error: $THREADS is an unknown thread package" >&2;}
    { (exit 1); exit 1; }; }
     ;;
 esac
@@ -4814,8 +4955,8 @@ else
 fi
 
 
-{ echo "$as_me:$LINENO: checking for xlc" >&5
-echo $ECHO_N "checking for xlc... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for xlc" >&5
+$as_echo_n "checking for xlc... " >&6; }
 
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4842,28 +4983,29 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   compiler_xlc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	compiler_xlc=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $compiler_xlc" >&5
-echo "${ECHO_T}$compiler_xlc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $compiler_xlc" >&5
+$as_echo "$compiler_xlc" >&6; }
  if test $compiler_xlc = yes; then
   COMPILER_XLC_TRUE=
   COMPILER_XLC_FALSE='#'
@@ -4885,10 +5027,10 @@ fi
 case "$host" in
   *-*-darwin*) ;;
   *)
-    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -4920,33 +5062,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   THREADDLLIBS="$THREADDLLIBS -ldl"
 fi
 
@@ -5006,8 +5152,8 @@ fi
 
 # Configuration of shared libraries
 #
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
 # Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then
   enableval=$enable_shared; p=${PACKAGE-default}
@@ -5033,29 +5179,36 @@ fi
 
 
 
+
+
+
+
+
+
+
 case "$host" in
  alpha-*-openbsd*)
      enable_shared=no
-     { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+     { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
      ;;
  *)
-     { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+     { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
      ;;
 esac
 
 # Configuration of machine-dependent code
 #
-{ echo "$as_me:$LINENO: checking which machine-dependent code should be used" >&5
-echo $ECHO_N "checking which machine-dependent code should be used... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking which machine-dependent code should be used" >&5
+$as_echo_n "checking which machine-dependent code should be used... " >&6; }
 machdep=
 case "$host" in
  alpha-*-openbsd*)
     machdep="alpha_mach_dep.lo"
     if test x"${ac_cv_lib_dl_dlopen}" != xyes ; then
-       { echo "$as_me:$LINENO: WARNING: OpenBSD/Alpha without dlopen(). Shared library support is disabled" >&5
-echo "$as_me: WARNING: OpenBSD/Alpha without dlopen(). Shared library support is disabled" >&2;}
+       { $as_echo "$as_me:$LINENO: WARNING: OpenBSD/Alpha without dlopen(). Shared library support is disabled" >&5
+$as_echo "$as_me: WARNING: OpenBSD/Alpha without dlopen(). Shared library support is disabled" >&2;}
     fi
     ;;
  alpha*-*-linux*)
@@ -5110,8 +5263,8 @@ _ACEOF
     ;;
 esac
 if test x"$machdep" = x; then
-{ echo "$as_me:$LINENO: result: $machdep" >&5
-echo "${ECHO_T}$machdep" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $machdep" >&5
+$as_echo "$machdep" >&6; }
    machdep="mach_dep.lo"
 fi
 addobjs="$addobjs $machdep"
@@ -5120,149 +5273,146 @@ addobjs="$addobjs $machdep"
 
 
 
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval=$enable_static; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_static=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_static=yes
-fi
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
 
 
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
-  enableval=$enable_fast_install; p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-	IFS="$lt_save_ifs"
-	if test "X$pkg" = "X$p"; then
-	  enable_fast_install=yes
-	fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac
-else
-  enable_fast_install=yes
-fi
 
+macro_version='2.2.6'
+macro_revision='1.3012'
 
-{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
+  for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
     done
   done
 done
 IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
+  if test -z "$ac_cv_path_SED"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
   fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
+else
+  ac_cv_path_SED=$SED
+fi
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
 
-SED=$lt_cv_path_SED
 
-{ echo "$as_me:$LINENO: result: $SED" >&5
-echo "${ECHO_T}$SED" >&6; }
 
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
 if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
+  if test -z "$GREP"; then
   ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in grep ggrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
-    # Check for GNU ac_path_GREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'GREP' >> "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -5277,74 +5427,60 @@ case `"$ac_path_GREP" --version 2>&1` in
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_GREP_found && break 3
+      $ac_path_GREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+  if test -z "$ac_cv_path_GREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-fi
-
+  fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
-
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
 if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
-     # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
+     if test -z "$EGREP"; then
   ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_prog in egrep; do
-  for ac_exec_ext in '' $ac_executable_extensions; do
-    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
-    # Check for GNU ac_path_EGREP and select it if it is found.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
 *GNU*)
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  $as_echo_n 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    echo 'EGREP' >> "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     ac_count=`expr $ac_count + 1`
@@ -5359,34 +5495,113 @@ case `"$ac_path_EGREP" --version 2>&1` in
   rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
 esac
 
-
-    $ac_path_EGREP_found && break 3
+      $ac_path_EGREP_found && break 3
+    done
   done
 done
-
-done
 IFS=$as_save_IFS
-
-
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
 fi
 
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
-  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
+   fi
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
 
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_path_EGREP=$EGREP
-fi
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
+      $ac_path_FGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
 
    fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -5400,8 +5615,8 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -5414,9 +5629,9 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -5430,14 +5645,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -5467,19 +5682,19 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
@@ -5491,40 +5706,22 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
 
-{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
-echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; }
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
 if test "${lt_cv_path_NM+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
   # Let the user override the test.
@@ -5567,28 +5764,493 @@ else
     done
     IFS="$lt_save_ifs"
   done
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+  : ${lt_cv_path_NM=no}
 fi
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-echo "${ECHO_T}$lt_cv_path_NM" >&6; }
-NM="$lt_cv_path_NM"
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:5895: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:5898: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:5901: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
 fi
 
-{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; }
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
 if test "${lt_cv_deplibs_check_method+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_file_magic_cmd='$MAGIC_CMD'
 lt_cv_file_magic_test_file=
@@ -5638,12 +6300,18 @@ mingw* | pw32*)
   fi
   ;;
 
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
 darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
 freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
@@ -5701,7 +6369,7 @@ linux* | k*bsd*-gnu)
   ;;
 
 netbsd*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
@@ -5714,12 +6382,12 @@ newos6*)
   lt_cv_file_magic_test_file=/usr/lib/libnls.so
   ;;
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -5738,6 +6406,10 @@ solaris*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
 sysv4 | sysv4.3*)
   case $host_vendor in
   motorola)
@@ -5765,14 +6437,14 @@ sysv4 | sysv4.3*)
   esac
   ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 esac
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
 file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -5780,6 +6452,367 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
 
 
 
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
@@ -5789,6 +6822,256 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:$LINENO: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then
   enableval=$enable_libtool_lock;
@@ -5805,104 +7088,104 @@ ia64-*-hpux*)
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
     case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 5823 "configure"' > conftest.$ac_ext
+  echo '#line 7106 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
-      ;;
-    *N32*)
-      LD="${LD-ld} -n32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
-      ;;
-    esac
-   fi
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
   fi
   rm -rf conftest*
   ;;
 
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|sparc*-*linux*)
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
     case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_i386_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*kfreebsd*-gnu)
-          LD="${LD-ld} -m elf_x86_64_fbsd"
-          ;;
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
     esac
   fi
   rm -rf conftest*
@@ -5912,10 +7195,10 @@ s390*-*linux*|sparc*-*linux*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
-  { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
-echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
 if test "${lt_cv_cc_needs_belf+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -5944,26 +7227,30 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   lt_cv_cc_needs_belf=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	lt_cv_cc_needs_belf=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
      ac_ext=c
@@ -5973,8 +7260,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
-echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
     CFLAGS="$SAVE_CFLAGS"
@@ -5986,14 +7273,14 @@ sparc*-*solaris*)
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
     case `/usr/bin/file conftest.o` in
     *64-bit*)
       case $lt_cv_prog_gnu_ld in
       yes*) LD="${LD-ld} -m elf64_sparc" ;;
       *)
-        if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
 	  LD="${LD-ld} -64"
 	fi
 	;;
@@ -6003,27 +7290,638 @@ sparc*-*solaris*)
   fi
   rm -rf conftest*
   ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
 esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
 
-need_locks="$enable_libtool_lock"
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_LIPO+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OTOOL64+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  lt_cv_ld_exported_symbols_list=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	lt_cv_ld_exported_symbols_list=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
   if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
@@ -6055,20 +7953,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -6092,13 +7991,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -6106,7 +8006,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -6131,8 +8031,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -6160,20 +8060,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -6197,13 +8098,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
@@ -6211,7 +8113,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -6227,11 +8129,13 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=c
@@ -6241,10 +8145,10 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6271,20 +8175,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_header_stdc=no
@@ -6376,37 +8281,40 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
   { (case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
   :
 else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
+rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
 
 fi
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6428,11 +8336,11 @@ fi
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -6450,20 +8358,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	eval "$as_ac_Header=no"
@@ -6471,12 +8380,15 @@ fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
@@ -6487,27 +8399,20 @@ done
 
 for ac_header in dlfcn.h
 do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+  $as_echo_n "(cached) " >&6
 else
-  # Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
@@ -6516,119 +8421,523 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  eval "$as_ac_Header=yes"
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_header_compiler=no
+	eval "$as_ac_Header=no"
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+fi
+
+done
+
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+	ac_compiler_gnu=no
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    ( cat <<\_ASBOX
-## -------------------------------- ##
-## Report this to Hans_Boehm at hp.com ##
-## -------------------------------- ##
-_ASBOX
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cxx_g=yes
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
-	       { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
 
 
 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
@@ -6639,11 +8948,11 @@ ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
-echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
 if test -z "$CXXCPP"; then
   if test "${ac_cv_prog_CXXCPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
       # Double quotes because CXXCPP needs to be expanded
     for CXXCPP in "$CXX -E" "/lib/cpp"
@@ -6675,20 +8984,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -6712,13 +9022,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
@@ -6726,7 +9037,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -6751,8 +9062,8 @@ fi
 else
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-{ echo "$as_me:$LINENO: result: $CXXCPP" >&5
-echo "${ECHO_T}$CXXCPP" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
 ac_preproc_ok=false
 for ac_cxx_preproc_warn_flag in '' yes
 do
@@ -6780,20 +9091,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   :
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Broken: fails on valid input.
@@ -6817,13 +9129,14 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
@@ -6831,7 +9144,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
   # Broken: success on invalid input.
 continue
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   # Passes both tests.
@@ -6847,626 +9160,170 @@ rm -f conftest.err conftest.$ac_ext
 if $ac_preproc_ok; then
   :
 else
-  { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+_lt_caught_CXX_error=yes; }
 fi
 
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+else
+  _lt_caught_CXX_error=yes
 fi
 
 
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$F77"; then
-  ac_cv_prog_F77="$F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-fi
-fi
-F77=$ac_cv_prog_F77
-if test -n "$F77"; then
-  { echo "$as_me:$LINENO: result: $F77" >&5
-echo "${ECHO_T}$F77" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
 
 
-    test -n "$F77" && break
-  done
-fi
-if test -z "$F77"; then
-  ac_ct_F77=$F77
-  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_F77"; then
-  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_F77="$ac_prog"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+# Set options
 
-fi
-fi
-ac_ct_F77=$ac_cv_prog_ac_ct_F77
-if test -n "$ac_ct_F77"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
-echo "${ECHO_T}$ac_ct_F77" >&6; }
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  enable_static=yes
 fi
 
 
-  test -n "$ac_ct_F77" && break
-done
 
-  if test "x$ac_ct_F77" = x; then
-    F77=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    F77=$ac_ct_F77
-  fi
-fi
 
 
-# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for Fortran 77 compiler version" >&5
-ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler --version >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -v >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compiler -V >&5") 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-rm -f a.out
 
-# If we don't use `.F' as extension, the preprocessor is not run on the
-# input file.  (Note that this only needs to work for GNU compilers.)
-ac_save_ext=$ac_ext
-ac_ext=F
-{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; }
-if test "${ac_cv_f77_compiler_gnu+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-      program main
-#ifndef __GNUC__
-       choke me
-#endif
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_compiler_gnu=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_compiler_gnu=no
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_f77_compiler_gnu=$ac_compiler_gnu
 
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; }
-ac_ext=$ac_save_ext
-ac_test_FFLAGS=${FFLAGS+set}
-ac_save_FFLAGS=$FFLAGS
-FFLAGS=
-{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
-echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; }
-if test "${ac_cv_prog_f77_g+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then
+  withval=$with_pic; pic_mode="$withval"
 else
-  FFLAGS=-g
-cat >conftest.$ac_ext <<_ACEOF
-      program main
+  pic_mode=default
+fi
 
-      end
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_prog_f77_g=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-	ac_cv_prog_f77_g=no
-fi
+test -z "$pic_mode" && pic_mode=default
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
-echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; }
-if test "$ac_test_FFLAGS" = set; then
-  FFLAGS=$ac_save_FFLAGS
-elif test $ac_cv_prog_f77_g = yes; then
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-g -O2"
-  else
-    FFLAGS="-g"
-  fi
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
 else
-  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
-    FFLAGS="-O2"
-  else
-    FFLAGS=
-  fi
+  enable_fast_install=yes
 fi
 
-G77=`test $ac_compiler_gnu = yes && echo yes`
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-# find the maximum length of command line arguments
-{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-    i=0
-  teststring="ABCD"
 
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
 
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
 
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
-    else
-      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
-    fi
-    # And add a safety zone
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    ;;
 
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
 
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ 	]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
-    ;;
-  *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
-	       = "XX$teststring") >/dev/null 2>&1 &&
-	      new_result=`expr "X$teststring" : ".*" 2>&1` &&
-	      lt_cv_sys_max_cmd_len=$new_result &&
-	      test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on massive
-      # amounts of additional arguments before passing them to the linker.
-      # It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
-    ;;
-  esac
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
 
-fi
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { echo "$as_me:$LINENO: result: none" >&5
-echo "${ECHO_T}none" >&6; }
-fi
 
 
 
 
 
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
 
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
 
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
 
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*) # Its linker distinguishes data from code symbols
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-  lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  ;;
-linux* | k*bsd*-gnu)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDGIRSTW]'
-    lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-    lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (lt_ptr) \&\2},/p'"
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
 
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
 
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
 
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
 
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
 
-  # Write the raw and C identifiers.
-  lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ 	]\($symcode$symcode*\)[ 	][ 	]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
 
-  # Check to see that the pipe works correctly.
-  pipe_works=no
 
-  rm -f conftest*
-  cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
 
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; then
-    # Now try to grab the symbols.
-    nlist=conftest.nm
-    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
-  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s "$nlist"; then
-      # Try sorting and uniquifying the output.
-      if sort "$nlist" | uniq > "$nlist"T; then
-	mv -f "$nlist"T "$nlist"
-      else
-	rm -f "$nlist"T
-      fi
 
-      # Make sure that we snagged all the symbols we need.
-      if grep ' nm_test_var$' "$nlist" >/dev/null; then
-	if grep ' nm_test_func$' "$nlist" >/dev/null; then
-	  cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
 
-EOF
-	  # Now generate the symbol file.
-	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
 
-	  cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
 
-/* The mapping between symbol names and symbols. */
-const struct {
-  const char *name;
-  lt_ptr_t address;
-}
-lt_preloaded_symbols[] =
-{
-EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
-	  cat <<\EOF >> conftest.$ac_ext
-  {0, (lt_ptr_t) 0}
-};
 
-#ifdef __cplusplus
-}
-#endif
-EOF
-	  # Now try linking the two files.
-	  mv conftest.$ac_objext conftstm.$ac_objext
-	  lt_save_LIBS="$LIBS"
-	  lt_save_CFLAGS="$CFLAGS"
-	  LIBS="conftstm.$ac_objext"
-	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
-	  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && test -s conftest${ac_exeext}; then
-	    pipe_works=yes
-	  fi
-	  LIBS="$lt_save_LIBS"
-	  CFLAGS="$lt_save_CFLAGS"
-	else
-	  echo "cannot find nm_test_func in $nlist" >&5
-	fi
-      else
-	echo "cannot find nm_test_var in $nlist" >&5
-      fi
-    else
-      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
-    fi
-  else
-    echo "$progname: failed program was:" >&5
-    cat conftest.$ac_ext >&5
-  fi
-  rm -rf conftest* conftst*
+test -z "$LN_S" && LN_S="ln -s"
 
-  # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
-    break
-  else
-    lt_cv_sys_global_symbol_pipe=
-  fi
-done
 
-fi
 
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
-  lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
-  { echo "$as_me:$LINENO: result: failed" >&5
-echo "${ECHO_T}failed" >&6; }
-else
-  { echo "$as_me:$LINENO: result: ok" >&5
-echo "${ECHO_T}ok" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
 fi
 
-{ echo "$as_me:$LINENO: checking for objdir" >&5
-echo $ECHO_N "checking for objdir... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
 if test "${lt_cv_objdir+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   rm -f .libs 2>/dev/null
 mkdir .libs 2>/dev/null
@@ -7478,14 +9335,34 @@ else
 fi
 rmdir .libs 2>/dev/null
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
-echo "${ECHO_T}$lt_cv_objdir" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
 objdir=$lt_cv_objdir
 
 
 
 
 
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 case $host_os in
 aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
@@ -7500,360 +9377,41 @@ esac
 
 # Sed substitution that helps us do robust quoting.  It backslashifies
 # metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
 
 # Same as above, but do not quote variable references.
-double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
 # Sed substitution to delay expansion of an escaped shell variable in a
 # double_quote_subst'ed string.
 delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
 # Sed substitution to avoid accidental globbing in evaled expressions
 no_glob_subst='s/\*/\\\*/g'
 
-# Constants:
-rm="rm -f"
-
 # Global variables:
-default_ofile=libtool
+ofile=libtool
 can_build_shared=yes
 
 # All known linkers require a `.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_AR="${ac_tool_prefix}ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { echo "$as_me:$LINENO: result: $AR" >&5
-echo "${ECHO_T}$AR" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_AR="ar"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-echo "${ECHO_T}$ac_ct_AR" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
 
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
 old_CC="$CC"
 old_CFLAGS="$CFLAGS"
 
 # Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
 test -z "$CC" && CC=cc
 test -z "$LTCC" && LTCC=$CC
 test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$DLLTOOL" && DLLTOOL=dlltool
 test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
 test -z "$ac_objext" && ac_objext=o
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
 for cc_temp in $compiler""; do
   case $cc_temp in
     compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
@@ -7862,17 +9420,18 @@ for cc_temp in $compiler""; do
     *) break;;
   esac
 done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
 # Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
 case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
-echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
@@ -7896,7 +9455,7 @@ else
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
 	  else
-	    cat <<EOF 1>&2
+	    cat <<_LT_EOF 1>&2
 
 *** Warning: the command libtool uses to detect shared libraries,
 *** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7907,7 +9466,7 @@ else
 *** may want to report the problem to your system manager and/or to
 *** bug-libtool at gnu.org
 
-EOF
+_LT_EOF
 	  fi ;;
 	esac
       fi
@@ -7922,19 +9481,23 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
+
+
+
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
-    { echo "$as_me:$LINENO: checking for file" >&5
-echo $ECHO_N "checking for file... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
@@ -7958,7 +9521,7 @@ else
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
 	  else
-	    cat <<EOF 1>&2
+	    cat <<_LT_EOF 1>&2
 
 *** Warning: the command libtool uses to detect shared libraries,
 *** $file_magic_cmd, produces output that libtool cannot recognize.
@@ -7969,7 +9532,7 @@ else
 *** may want to report the problem to your system manager and/or to
 *** bug-libtool at gnu.org
 
-EOF
+_LT_EOF
 	  fi ;;
 	esac
       fi
@@ -7984,13 +9547,14 @@ fi
 
 MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
 if test -n "$MAGIC_CMD"; then
-  { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
-echo "${ECHO_T}$MAGIC_CMD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
   else
     MAGIC_CMD=:
   fi
@@ -8000,340 +9564,8 @@ fi
   ;;
 esac
 
-
-  case $host_os in
-    rhapsody* | darwin*)
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$DSYMUTIL"; then
-  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
-  { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
-echo "${ECHO_T}$DSYMUTIL" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
-  ac_ct_DSYMUTIL=$DSYMUTIL
-  # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_DSYMUTIL"; then
-  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
-echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_ct_DSYMUTIL" = x; then
-    DSYMUTIL=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    DSYMUTIL=$ac_ct_DSYMUTIL
-  fi
-else
-  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
-    if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_NMEDIT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$NMEDIT"; then
-  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
-  { echo "$as_me:$LINENO: result: $NMEDIT" >&5
-echo "${ECHO_T}$NMEDIT" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
-  ac_ct_NMEDIT=$NMEDIT
-  # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_NMEDIT"; then
-  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
-    ac_cv_prog_ac_ct_NMEDIT="nmedit"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
-  { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
-echo "${ECHO_T}$ac_ct_NMEDIT" >&6; }
-else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-
-  if test "x$ac_ct_NMEDIT" = x; then
-    NMEDIT=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet.  If you think this
-configuration is useful to you, please write to autoconf at gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
-    NMEDIT=$ac_ct_NMEDIT
-  fi
-else
-  NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
-
-    { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
-echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; }
-if test "${lt_cv_apple_cc_single_mod+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
-   # By default we will add the -single_module flag. You can override
-   # by either setting the environment variable LT_MULTI_MODULE
-   # non-empty at configure time, or by adding -multi_module to the
-   # link flags.
-   echo "int foo(void){return 1;}" > conftest.c
-   $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-     -dynamiclib ${wl}-single_module conftest.c
-   if test -f libconftest.dylib; then
-     lt_cv_apple_cc_single_mod=yes
-     rm -rf libconftest.dylib*
-   fi
-   rm conftest.c
-      fi
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
-echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; }
-    { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
-echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; }
-if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_ld_exported_symbols_list=no
-      save_LDFLAGS=$LDFLAGS
-      echo "_main" > conftest.sym
-      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
-      cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-  lt_cv_ld_exported_symbols_list=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	lt_cv_ld_exported_symbols_list=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
-echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; }
-    case $host_os in
-    rhapsody* | darwin1.[0123])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
-    darwin1.*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-    darwin*)
-      # if running on 10.5 or later, the deployment target defaults
-      # to the OS version, if on x86, and 10.4, the deployment
-      # target defaults to 10.4. Don't you love it?
-      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
-   10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-   10.[012]*)
-     _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
-   10.*)
-     _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-      esac
-    ;;
-  esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
-      _lt_dar_single_mod='$single_module'
-    fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
-    else
-      _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
-    fi
-    if test "$DSYMUTIL" != ":"; then
-      _lt_dsymutil="~$DSYMUTIL \$lib || :"
-    else
-      _lt_dsymutil=
-    fi
-    ;;
-  esac
-
-
-enable_dlopen=no
-enable_win32_dll=no
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
-  enableval=$enable_libtool_lock;
-fi
-
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then
-  withval=$with_pic; pic_mode="$withval"
-else
-  pic_mode=default
-fi
-
-test -z "$pic_mode" && pic_mode=default
-
 # Use C for the default configuration in the libtool script
-tagname=
+
 lt_save_CC="$CC"
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -8356,6 +9588,11 @@ lt_simple_compile_test_code="int some_variable = 0;"
 lt_simple_link_test_code='int main(){return(0);}'
 
 
+
+
+
+
+
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
 
@@ -8365,35 +9602,38 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 # Allow CC to be a program name with arguments.
 compiler=$CC
 
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
 
 # save warnings/boilerplate of simple test code
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
 
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
+$RM -r conftest*
 
 
+if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
 if test "$GCC" = yes; then
   lt_prog_compiler_no_builtin_flag=' -fno-builtin'
 
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
+   ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="-fno-rtti -fno-exceptions"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -8405,25 +9645,25 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8408: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9648: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8412: \$? = $ac_status" >&5
+   echo "$as_me:9652: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_rtti_exceptions=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
@@ -8433,12 +9673,17 @@ fi
 
 fi
 
-lt_prog_compiler_wl=
+
+
+
+
+
+  lt_prog_compiler_wl=
 lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   if test "$GCC" = yes; then
     lt_prog_compiler_wl='-Wl,'
@@ -8454,17 +9699,25 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       ;;
 
     amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
 
     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -8478,6 +9731,20 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_pic='-fno-common'
       ;;
 
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
     interix[3-9]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -8490,25 +9757,18 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       enable_shared=no
       ;;
 
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
     sysv4*MP*)
       if test -d /usr/nec; then
 	lt_prog_compiler_pic=-Kconform_pic
       fi
       ;;
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic='-fPIC'
-	;;
-      esac
-      ;;
-
     *)
       lt_prog_compiler_pic='-fPIC'
       ;;
@@ -8525,18 +9785,8 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
       fi
       ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic='-qnocommon'
-         lt_prog_compiler_wl='-Wl,'
-         ;;
-       esac
-       ;;
 
-    mingw* | cygwin* | pw32* | os2*)
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -8564,18 +9814,27 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       lt_prog_compiler_static='-non_shared'
       ;;
 
-    newsos6)
-      lt_prog_compiler_pic='-KPIC'
-      lt_prog_compiler_static='-Bstatic'
-      ;;
-
     linux* | k*bsd*-gnu)
       case $cc_basename in
-      icc* | ecc*)
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
 	lt_prog_compiler_static='-static'
         ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -8588,8 +9847,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
         # All Alpha code is PIC.
         lt_prog_compiler_static='-non_shared'
         ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
       *)
-        case `$CC -V 2>&1 | sed 5q` in
+	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)
 	  # Sun C 5.9
 	  lt_prog_compiler_pic='-KPIC'
@@ -8607,6 +9872,17 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       esac
       ;;
 
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
     osf3* | osf4* | osf5*)
       lt_prog_compiler_wl='-Wl,'
       # All OSF/1 code is PIC.
@@ -8669,21 +9945,34 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
     esac
   fi
 
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic" >&6; }
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works=no
-  ac_outfile=conftest.$ac_objext
+   ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -8695,25 +9984,25 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8698: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9987: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8702: \$? = $ac_status" >&5
+   echo "$as_me:9991: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
     case $lt_prog_compiler_pic in
@@ -8726,24 +10015,20 @@ else
 fi
 
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic=
-    ;;
-  *)
-    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
-    ;;
-esac
+
+
+
+
+
 
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
 if test "${lt_cv_prog_compiler_static_works+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
    save_LDFLAGS="$LDFLAGS"
@@ -8755,7 +10040,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works=yes
@@ -8764,12 +10049,12 @@ else
        lt_cv_prog_compiler_static_works=yes
      fi
    fi
-   $rm -r conftest*
+   $RM -r conftest*
    LDFLAGS="$save_LDFLAGS"
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
 if test x"$lt_cv_prog_compiler_static_works" = xyes; then
     :
@@ -8778,13 +10063,18 @@ else
 fi
 
 
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
 if test "${lt_cv_prog_compiler_c_o+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o=no
-   $rm -r conftest 2>/dev/null
+   $RM -r conftest 2>/dev/null
    mkdir conftest
    cd conftest
    mkdir out
@@ -8799,83 +10089,148 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8802: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10092: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8806: \$? = $ac_status" >&5
+   echo "$as_me:10096: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o=yes
      fi
    fi
    chmod u+w . 2>&5
-   $rm conftest*
+   $RM conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
    cd ..
-   rmdir conftest
-   $rm conftest*
+   $RM -r conftest
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:10147: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:10151: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
   hard_links=yes
-  $rm conftest*
+  $RM conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
   if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
   need_locks=no
 fi
 
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   runpath_var=
   allow_undefined_flag=
-  enable_shared_with_static_runtimes=no
+  always_export_symbols=no
   archive_cmds=
   archive_expsym_cmds=
-  old_archive_From_new_cmds=
-  old_archive_from_expsyms_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
   export_dynamic_flag_spec=
-  whole_archive_flag_spec=
-  thread_safe_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
   hardcode_libdir_flag_spec=
   hardcode_libdir_flag_spec_ld=
   hardcode_libdir_separator=
-  hardcode_direct=no
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
   link_all_deplibs=unknown
-  hardcode_automatic=no
   module_cmds=
   module_expsym_cmds=
-  always_export_symbols=no
-  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
   # include_expsyms should be a list of space-separated symbols to be *always*
   # included in the symbol list
   include_expsyms=
@@ -8891,19 +10246,9 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   # preloaded symbol tables.
   # Exclude shared library initialization/finalization symbols.
   extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
   case $host_os in
-  cygwin* | mingw* | pw32*)
+  cygwin* | mingw* | pw32* | cegcc*)
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
@@ -8929,16 +10274,16 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
     export_dynamic_flag_spec='${wl}--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec=
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
+    case `$LD -v 2>&1` in
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
       *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
@@ -8952,7 +10297,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
       # On AIX/PPC, the GNU linker is very broken
       if test "$host_cpu" != ia64; then
 	ld_shlibs=no
-	cat <<EOF 1>&2
+	cat <<_LT_EOF 1>&2
 
 *** Warning: the GNU linker, at least up to release 2.9.1, is reported
 *** to be unable to reliably create shared libraries on AIX.
@@ -8960,26 +10305,27 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 *** really care for shared libraries, you may want to modify your PATH
 *** so that a non-GNU linker is found, and then restart.
 
-EOF
+_LT_EOF
       fi
       ;;
 
     amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
       ;;
 
     beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
@@ -8989,16 +10335,16 @@ EOF
       fi
       ;;
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	# If the export-symbols file already is a .def file (1st line
 	# is EXPORTS), use it as is; otherwise, prepend...
@@ -9029,48 +10375,78 @@ EOF
       archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
 	tmp_addflag=
+	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
 	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
 	  tmp_addflag=' -i_dynamic -nofor_main' ;;
 	ifc* | ifort*)			# Intel Fortran compiler
 	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
 	esac
 	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec=
+	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
       else
-	ld_shlibs=no
+        ld_shlibs=no
       fi
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
@@ -9080,9 +10456,9 @@ EOF
       ;;
 
     solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
 	ld_shlibs=no
-	cat <<EOF 1>&2
+	cat <<_LT_EOF 1>&2
 
 *** Warning: The releases 2.8.* of the GNU linker cannot reliably
 *** create shared libraries on Solaris systems.  Therefore, libtool
@@ -9091,8 +10467,8 @@ EOF
 *** your PATH or compiler configuration so that the native linker is
 *** used, and then restart.
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
@@ -9116,10 +10492,14 @@ EOF
 _LT_EOF
 	;;
 	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9135,7 +10515,7 @@ _LT_EOF
       ;;
 
     *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
       else
@@ -9177,10 +10557,10 @@ _LT_EOF
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
 	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
@@ -9189,10 +10569,10 @@ _LT_EOF
 	# need to do runtime linking.
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
 	  done
 	  ;;
 	esac
@@ -9209,28 +10589,30 @@ _LT_EOF
 
       archive_cmds=''
       hardcode_direct=yes
+      hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
 
       if test "$GCC" = yes; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
 	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
-  	  # We have reworked collect2
-  	  :
+	  # We have reworked collect2
+	  :
 	  else
-  	  # We have old collect2
-  	  hardcode_direct=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L=yes
-  	  hardcode_libdir_flag_spec='-L$libdir'
-  	  hardcode_libdir_separator=
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
 	  fi
 	  ;;
 	esac
@@ -9241,8 +10623,8 @@ _LT_EOF
       else
 	# not using gcc
 	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
 	  if test "$aix_use_runtimelinking" = yes; then
@@ -9253,6 +10635,7 @@ _LT_EOF
 	fi
       fi
 
+      export_dynamic_flag_spec='${wl}-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
@@ -9260,8 +10643,9 @@ _LT_EOF
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -9282,18 +10666,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -9308,25 +10695,27 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-       hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
 	if test "$host_cpu" = ia64; then
 	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
 	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
 	else
-	 # Determine the default libpath from the value encoded in an empty executable.
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
 	 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9348,18 +10737,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -9374,12 +10766,13 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
@@ -9399,18 +10792,25 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     amigaos*)
-      archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec='-L$libdir'
-      hardcode_minus_L=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs=no
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
       ;;
 
     bsdi[45]*)
       export_dynamic_flag_spec=-rdynamic
       ;;
 
-    cygwin* | mingw* | pw32*)
+    cygwin* | mingw* | pw32* | cegcc*)
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -9422,9 +10822,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       # Tell ltmain to make .dll files, not .so files.
       shrext_cmds=".dll"
       # FIXME: Setting linknames here is a bad hack.
-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
       # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds='true'
+      old_archive_from_new_cmds='true'
       # FIXME: Should let the user specify the lib program.
       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
       fix_srcfile_path='`cygpath -w "$srcfile"`'
@@ -9432,52 +10832,30 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ;;
 
     darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc=no
-      hardcode_direct=no
-      hardcode_automatic=yes
-      hardcode_shlibpath_var=unsupported
-      whole_archive_flag_spec=''
-      link_all_deplibs=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs=no
-          ;;
-      esac
-    fi
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  whole_archive_flag_spec=''
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
       ;;
 
     dgux*)
@@ -9519,9 +10897,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     hpux9*)
       if test "$GCC" = yes; then
-	archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
       fi
       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
       hardcode_libdir_separator=:
@@ -9541,11 +10919,11 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       fi
       if test "$with_gnu_ld" = no; then
 	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld='+b $libdir'
 	hardcode_libdir_separator=:
-
 	hardcode_direct=yes
+	hardcode_direct_absolute=yes
 	export_dynamic_flag_spec='${wl}-E'
-
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -9559,7 +10937,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
@@ -9584,12 +10962,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
 	case $host_cpu in
 	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld='+b $libdir'
 	  hardcode_direct=no
 	  hardcode_shlibpath_var=no
 	  ;;
 	*)
 	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
 	  export_dynamic_flag_spec='${wl}-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
@@ -9602,18 +10980,62 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat >conftest.$ac_ext <<_ACEOF
+int foo(void) {}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
       else
-	archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
+      inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
     netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
       else
 	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
@@ -9631,11 +11053,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_shlibpath_var=no
       ;;
 
+    *nto* | *qnx*)
+      ;;
+
     openbsd*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -9651,7 +11077,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
 	     ;;
 	  esac
-        fi
+	fi
       else
 	ld_shlibs=no
       fi
@@ -9661,18 +11087,19 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
       ;;
 
     osf3*)
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       hardcode_libdir_separator=:
       ;;
@@ -9680,32 +11107,43 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
       if test "$GCC" = yes; then
 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
       fi
+      archive_cmds_need_lc='no'
       hardcode_libdir_separator=:
       ;;
 
     solaris*)
-      no_undefined_flag=' -z text'
+      no_undefined_flag=' -z defs'
       if test "$GCC" = yes; then
 	wlarc='${wl}'
-	archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
-	wlarc=''
-	archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
       fi
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_shlibpath_var=no
@@ -9715,7 +11153,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 	# The compiler driver will combine and reorder linker options,
 	# but understands `-z linker_flag'.  GCC discards it without `$wl',
 	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
 	if test "$GCC" = yes; then
 	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
 	else
@@ -9804,18 +11242,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       allow_undefined_flag='${wl}-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
       export_dynamic_flag_spec='${wl}-Bexport'
       runpath_var='LD_RUN_PATH'
 
       if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -9829,12 +11267,36 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
       ld_shlibs=no
       ;;
     esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
   fi
 
-{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5
-echo "${ECHO_T}$ld_shlibs" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
 test "$ld_shlibs" = no && can_build_shared=no
 
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 #
 # Do we need to explicitly link libc?
 #
@@ -9852,15 +11314,15 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $RM conftest*
       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } 2>conftest.err; then
         soname=conftest
         lib=conftest
@@ -9875,10 +11337,10 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libname=conftest
         lt_save_allow_undefined_flag=$allow_undefined_flag
         allow_undefined_flag=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
         then
 	  archive_cmds_need_lc=no
@@ -9889,30 +11351,173 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
       else
         cat conftest.err 1>&5
       fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
-echo "${ECHO_T}$archive_cmds_need_lc" >&6; }
+      $RM conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+$as_echo "$archive_cmds_need_lc" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
 
 if test "$GCC" = yes; then
   case $host_os in
@@ -9920,14 +11525,14 @@ if test "$GCC" = yes; then
     *) lt_awk_arg="/^libraries:/" ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
     # otherwise default to the standard path separator (i.e. ":") - it is
     # assumed that no part of a normal pathname contains ";" but that should
     # okay in the real world where ";" in dirpaths is itself problematic.
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
   else
-    lt_search_path_spec=`echo "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
   fi
   # Ok, now we have the path, separated by spaces, we can step through it
   # and add multilib dir if necessary.
@@ -9941,7 +11546,7 @@ if test "$GCC" = yes; then
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
-  lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
 BEGIN {RS=" "; FS="/|\n";} {
   lt_foo="";
   lt_count=0;
@@ -9961,10 +11566,23 @@ BEGIN {RS=" "; FS="/|\n";} {
   if (lt_foo != "") { lt_freq[lt_foo]++; }
   if (lt_freq[lt_foo] == 1) { print lt_foo; }
 }'`
-  sys_lib_search_path_spec=`echo $lt_search_path_spec`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -10001,7 +11619,7 @@ aix[4-9]*)
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
@@ -10027,9 +11645,18 @@ aix[4-9]*)
   ;;
 
 amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
   ;;
 
 beos*)
@@ -10052,25 +11679,28 @@ bsdi[45]*)
   # libtool to hard-code these into programs
   ;;
 
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
   shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
   case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
-       $rm \$dlpath'
+       $RM \$dlpath'
     shlibpath_overrides_runpath=yes
 
     case $host_os in
@@ -10079,20 +11709,20 @@ cygwin* | mingw* | pw32*)
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    mingw*)
+    mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH printed by
         # mingw gcc, but we are running on Cygwin. Gcc prints its search
         # path with ; separators, and with drive letters. We can handle the
         # drive letters (cygwin fileutils understands them), so leave them,
         # especially as we might pass files found there to a mingw objdump,
         # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
       else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
       fi
       ;;
     pw32*)
@@ -10116,7 +11746,7 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
@@ -10215,18 +11845,18 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
     shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
@@ -10303,6 +11933,64 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  shlibpath_overrides_runpath=yes
+fi
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
@@ -10310,7 +11998,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -10327,7 +12015,7 @@ netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
@@ -10348,14 +12036,16 @@ newsos6)
   shlibpath_overrides_runpath=yes
   ;;
 
-nto-qnx*)
-  version_type=linux
+*nto* | *qnx*)
+  version_type=qnx
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
   ;;
 
 openbsd*)
@@ -10364,13 +12054,13 @@ openbsd*)
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
       openbsd2.[89] | openbsd2.[89].*)
 	shlibpath_overrides_runpath=no
@@ -10442,7 +12132,6 @@ sysv4 | sysv4.3*)
     sni)
       shlibpath_overrides_runpath=no
       need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
       runpath_var=LD_RUN_PATH
       ;;
     siemens)
@@ -10473,13 +12162,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
   if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
     case $host_os in
       sco3.2v5*)
         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -10489,6 +12177,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   sys_lib_dlsearch_path_spec='/usr/lib'
   ;;
 
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10500,43 +12199,121 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
 if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
 
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
 
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
-   test -n "$runpath_var" || \
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
    test "X$hardcode_automatic" = "Xyes" ; then
 
-  # We can hardcode non-existant directories.
+  # We can hardcode non-existent directories.
   if test "$hardcode_direct" != no &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
      test "$hardcode_minus_L" != no; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
@@ -10549,10 +12326,11 @@ else
   # directories.
   hardcode_action=unsupported
 fi
-{ echo "$as_me:$LINENO: result: $hardcode_action" >&5
-echo "${ECHO_T}$hardcode_action" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink; then
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
   # Fast installation is not supported
   enable_fast_install=no
 elif test "$shlibpath_overrides_runpath" = yes ||
@@ -10561,37 +12339,12 @@ elif test "$shlibpath_overrides_runpath" = yes ||
   enable_fast_install=needless
 fi
 
-striplib=
-old_striplib=
-{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         old_striplib="$STRIP -S"
-         { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
-       else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-fi
-       ;;
-   *)
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
-    ;;
-  esac
-fi
 
-if test "x$enable_dlopen" != xyes; then
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -10606,22 +12359,22 @@ else
     lt_cv_dlopen_self=yes
     ;;
 
-  mingw* | pw32*)
+  mingw* | pw32* | cegcc*)
     lt_cv_dlopen="LoadLibrary"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   cygwin*)
     lt_cv_dlopen="dlopen"
     lt_cv_dlopen_libs=
-   ;;
+    ;;
 
   darwin*)
   # if libdl is installed we need to link against it
-    { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -10653,33 +12406,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
 
@@ -10689,13 +12446,13 @@ else
 
 fi
 
-   ;;
+    ;;
 
   *)
-    { echo "$as_me:$LINENO: checking for shl_load" >&5
-echo $ECHO_N "checking for shl_load... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
 if test "${ac_cv_func_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10748,38 +12505,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_shl_load=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_shl_load=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-echo "${ECHO_T}$ac_cv_func_shl_load" >&6; }
-if test $ac_cv_func_shl_load = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
   lt_cv_dlopen="shl_load"
 else
-  { echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
 if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
@@ -10811,39 +12572,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dld_shl_load=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dld_shl_load=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; }
-if test $ac_cv_lib_dld_shl_load = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
   lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
 else
-  { echo "$as_me:$LINENO: checking for dlopen" >&5
-echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
 if test "${ac_cv_func_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -10896,38 +12661,42 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_func_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_func_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-echo "${ECHO_T}$ac_cv_func_dlopen" >&6; }
-if test $ac_cv_func_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen"
 else
-  { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
 if test "${ac_cv_lib_dl_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
@@ -10959,39 +12728,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dl_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; }
-if test $ac_cv_lib_dl_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
-  { echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
 if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsvld  $LIBS"
@@ -11023,39 +12796,43 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_svld_dlopen=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_svld_dlopen=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6; }
-if test $ac_cv_lib_svld_dlopen = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
   lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
 else
-  { echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
 if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldld  $LIBS"
@@ -11087,33 +12864,37 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dld_dld_link=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_dld_dld_link=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; }
-if test $ac_cv_lib_dld_dld_link = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
   lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
 fi
 
@@ -11152,18 +12933,18 @@ fi
     save_LIBS="$LIBS"
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
-    { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; }
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if test "${lt_cv_dlopen_self+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 11166 "configure"
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 12947 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11204,10 +12985,6 @@ else
 #  endif
 #endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
 void fnord() { int i=42;}
 int main ()
 {
@@ -11223,13 +13000,13 @@ int main ()
   else
     puts (dlerror ());
 
-    exit (status);
+  return status;
 }
-EOF
+_LT_EOF
   if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
@@ -11247,23 +13024,23 @@ rm -fr conftest*
 
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
 
     if test "x$lt_cv_dlopen_self" = xyes; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; }
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if test "${lt_cv_dlopen_self_static+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   	  if test "$cross_compiling" = yes; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-#line 11266 "configure"
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 13043 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11304,10 +13081,6 @@ else
 #  endif
 #endif
 
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
 void fnord() { int i=42;}
 int main ()
 {
@@ -11323,13 +13096,13 @@ int main ()
   else
     puts (dlerror ());
 
-    exit (status);
+  return status;
 }
-EOF
+_LT_EOF
   if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
@@ -11347,8 +13120,8 @@ rm -fr conftest*
 
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
     CPPFLAGS="$save_CPPFLAGS"
@@ -11369,530 +13142,103 @@ echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; }
 fi
 
 
-# Report which library types will actually be built
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
 
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
 
-aix[4-9]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-    ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
-
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler \
-    CC \
-    LD \
-    lt_prog_compiler_wl \
-    lt_prog_compiler_pic \
-    lt_prog_compiler_static \
-    lt_prog_compiler_no_builtin_flag \
-    export_dynamic_flag_spec \
-    thread_safe_flag_spec \
-    whole_archive_flag_spec \
-    enable_shared_with_static_runtimes \
-    old_archive_cmds \
-    old_archive_from_new_cmds \
-    predep_objects \
-    postdep_objects \
-    predeps \
-    postdeps \
-    compiler_lib_search_path \
-    compiler_lib_search_dirs \
-    archive_cmds \
-    archive_expsym_cmds \
-    postinstall_cmds \
-    postuninstall_cmds \
-    old_archive_from_expsyms_cmds \
-    allow_undefined_flag \
-    no_undefined_flag \
-    export_symbols_cmds \
-    hardcode_libdir_flag_spec \
-    hardcode_libdir_flag_spec_ld \
-    hardcode_libdir_separator \
-    hardcode_automatic \
-    module_cmds \
-    module_expsym_cmds \
-    lt_cv_prog_compiler_c_o \
-    fix_srcfile_path \
-    exclude_expsyms \
-    include_expsyms; do
-
-    case $var in
-    old_archive_cmds | \
-    old_archive_from_new_cmds | \
-    archive_cmds | \
-    archive_expsym_cmds | \
-    module_cmds | \
-    module_expsym_cmds | \
-    old_archive_from_expsyms_cmds | \
-    export_symbols_cmds | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
 
-cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  { echo "$as_me:$LINENO: creating $ofile" >&5
-echo "$as_me: creating $ofile" >&6;}
 
-  cat <<__EOF__ >> "$cfgfile"
-#! $SHELL
 
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
 
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
 
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
 
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
 
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
 
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
 
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
 
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
 
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
 
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
 
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
 
-# ### END LIBTOOL CONFIG
 
-__EOF__
+  # Report which library types will actually be built
+  { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
 
+  { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
 
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
   case $host_os in
   aix3*)
-    cat <<\EOF >> "$cfgfile"
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
 
-# AIX sometimes has problems with the GCC collect2 program.  For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
-  COLLECT_NAMES=
-  export COLLECT_NAMES
-fi
-EOF
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
     ;;
   esac
+  { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
 
-  # We use sed instead of cat because bash on DJGPP gets confused if
-  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
-  # text mode, it properly converts lines to CR/LF.  This bash problem
-  # is reportedly fixed, but why not run on old versions too?
-  sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+  { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
 
-  mv -f "$cfgfile" "$ofile" || \
-    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
-  chmod +x "$ofile"
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
 
 
+fi
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -11902,85 +13248,27 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 CC="$lt_save_CC"
 
 
-# Check whether --with-tags was given.
-if test "${with_tags+set}" = set; then
-  withval=$with_tags; tagnames="$withval"
-fi
-
-
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
-  fi
-
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
-echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
-    else
-      { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
-echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
-    fi
-  fi
-  if test -z "$LTCFLAGS"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
-  fi
-
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
-    "") ;;
-    *)  { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
-echo "$as_me: error: invalid tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-    esac
-
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
-echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
-
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
-
-      case $tagname in
-      CXX)
-	if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-	    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-	    (test "X$CXX" != "Xg++"))) ; then
-	  ac_ext=cpp
+ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-
-
-
 archive_cmds_need_lc_CXX=no
 allow_undefined_flag_CXX=
 always_export_symbols_CXX=no
 archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
 export_dynamic_flag_spec_CXX=
 hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
 hardcode_libdir_flag_spec_CXX=
 hardcode_libdir_flag_spec_ld_CXX=
 hardcode_libdir_separator_CXX=
 hardcode_minus_L_CXX=no
 hardcode_shlibpath_var_CXX=unsupported
 hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
 module_cmds_CXX=
 module_expsym_cmds_CXX=
 link_all_deplibs_CXX=unknown
@@ -11989,14 +13277,6 @@ no_undefined_flag_CXX=
 whole_archive_flag_spec_CXX=
 enable_shared_with_static_runtimes_CXX=no
 
-# Dependencies to place before and after the object being linked:
-predep_objects_CXX=
-postdep_objects_CXX=
-predeps_CXX=
-postdeps_CXX=
-compiler_lib_search_path_CXX=
-compiler_lib_search_dirs_CXX=
-
 # Source file extension for C++ test sources.
 ac_ext=cpp
 
@@ -12004,13 +13284,23 @@ ac_ext=cpp
 objext=o
 objext_CXX=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
 # If no C compiler was specified, use CC.
 LTCC=${LTCC-"$CC"}
@@ -12022,42 +13312,42 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
 eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
+$RM conftest*
 
-ac_outfile=conftest.$ac_objext
+  ac_outfile=conftest.$ac_objext
 echo "$lt_simple_link_test_code" >conftest.$ac_ext
 eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  $as_unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  $as_unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-compiler_CXX=$CC
-for cc_temp in $compiler""; do
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
   case $cc_temp in
     compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
     distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
@@ -12065,19 +13355,21 @@ for cc_temp in $compiler""; do
     *) break;;
   esac
 done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
-else
-  lt_prog_compiler_no_builtin_flag_CXX=
-fi
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
 
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
 
 
 # Check whether --with-gnu-ld was given.
@@ -12090,8 +13382,8 @@ fi
 ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
-  { echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -12104,9 +13396,9 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     [\\/]* | ?:[\\/]*)
       re_direlt='/[^/][^/]*/\.\./'
       # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-	ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
       test -z "$LD" && LD="$ac_prog"
       ;;
@@ -12120,14 +13412,14 @@ echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; }
     ;;
   esac
 elif test "$with_gnu_ld" = yes; then
-  { echo "$as_me:$LINENO: checking for GNU ld" >&5
-echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  { echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
 if test "${lt_cv_path_LD+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
@@ -12157,19 +13449,19 @@ fi
 
 LD="$lt_cv_path_LD"
 if test -n "$LD"; then
-  { echo "$as_me:$LINENO: result: $LD" >&5
-echo "${ECHO_T}$LD" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
 if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   # I'd rather use --version here, but apparently some GNU lds only accept -v.
 case `$LD -v 2>&1 </dev/null` in
@@ -12181,155 +13473,163 @@ case `$LD -v 2>&1 </dev/null` in
   ;;
 esac
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
 with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
 
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-	grep 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      whole_archive_flag_spec_CXX=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
-
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
 
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-ld_shlibs_CXX=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  aix[4-9]*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
-
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	for ld_flag in $LDFLAGS; do
-	  case $ld_flag in
-	  *-brtl*)
-	    aix_use_runtimelinking=yes
-	    break
-	    ;;
-	  esac
-	done
-	;;
-      esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
 
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
 
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
 
-    archive_cmds_CXX=''
-    hardcode_direct_CXX=yes
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
 
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[012]|aix4.[012].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-	collect2name=`${CC} -print-prog-name=collect2`
-	if test -f "$collect2name" && \
-	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	then
-	  # We have reworked collect2
-	  :
-	else
-	  # We have old collect2
-	  hardcode_direct_CXX=unsupported
-	  # It fails to find uninstalled libraries when the uninstalled
-	  # path is not listed in the libpath.  Setting hardcode_minus_L
-	  # to unsupported forces relinking
-	  hardcode_minus_L_CXX=yes
-	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  hardcode_libdir_separator_CXX=
-	fi
-	;;
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-	shared_flag="$shared_flag "'${wl}-G'
-      fi
     else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-	# chokes on -Wl,-G. The following line is correct:
-	shared_flag='-G'
-      else
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag='${wl}-G'
-	else
-	  shared_flag='${wl}-bM:SRE'
-	fi
-      fi
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
     fi
 
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    always_export_symbols_CXX=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      allow_undefined_flag_CXX='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      cat >conftest.$ac_ext <<_ACEOF
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12350,18 +13650,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -12376,27 +13679,29 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-      hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
 
-      archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-	hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
-	allow_undefined_flag_CXX="-z nodefs"
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-      else
-	# Determine the default libpath from the value encoded in an empty executable.
-	cat >conftest.$ac_ext <<_ACEOF
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -12417,18 +13722,21 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 lt_aix_libpath_sed='
     /Import File Strings/,/^$/ {
@@ -12443,749 +13751,777 @@ if test -z "$aix_libpath"; then
   aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
 fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 
-	hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
-	# Warning - without using the other run time loading flags,
-	# -berok will link without error, but may produce a broken library.
-	no_undefined_flag_CXX=' ${wl}-bernotok'
-	allow_undefined_flag_CXX=' ${wl}-berok'
-	# Exported symbols can be pulled into shared objects from archives
-	whole_archive_flag_spec_CXX='$convenience'
-	archive_cmds_need_lc_CXX=yes
-	# This is similar to how AIX traditionally builds its shared libraries.
-	archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
+	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' ${wl}-bernotok'
+	    allow_undefined_flag_CXX=' ${wl}-berok'
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec_CXX='$convenience'
+	    archive_cmds_need_lc_CXX=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
 
-  beos*)
-    if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-      allow_undefined_flag_CXX=unsupported
-      # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-      # support --undefined.  This deserves some investigation.  FIXME
-      archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    else
-      ld_shlibs_CXX=no
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+        # as there is no search path for DLLs.
+        hardcode_libdir_flag_spec_CXX='-L$libdir'
+        allow_undefined_flag_CXX=unsupported
+        always_export_symbols_CXX=no
+        enable_shared_with_static_runtimes_CXX=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          ld_shlibs_CXX=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  whole_archive_flag_spec_CXX=''
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
     fi
-    ;;
 
-  chorus*)
-    case $cc_basename in
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
+  else
+  ld_shlibs_CXX=no
+  fi
+
 	;;
-    esac
-    ;;
 
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
-    # as there is no search path for DLLs.
-    hardcode_libdir_flag_spec_CXX='-L$libdir'
-    allow_undefined_flag_CXX=unsupported
-    always_export_symbols_CXX=no
-    enable_shared_with_static_runtimes_CXX=yes
-
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	cp $export_symbols $output_objdir/$soname.def;
-      else
-	echo EXPORTS > $output_objdir/$soname.def;
-	cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-    else
-      ld_shlibs_CXX=no
-    fi
-  ;;
-      darwin* | rhapsody*)
-      archive_cmds_need_lc_CXX=no
-      hardcode_direct_CXX=no
-      hardcode_automatic_CXX=yes
-      hardcode_shlibpath_var_CXX=unsupported
-      whole_archive_flag_spec_CXX=''
-      link_all_deplibs_CXX=yes
-      allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
-      if test "$GXX" = yes ; then
-      output_verbose_link_cmd='echo'
-      archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-      module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-      module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-      if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-        archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-        archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
-      fi
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-          module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_CXX=no
-          ;;
-      esac
-      fi
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
         ;;
 
-  dgux*)
-    case $cc_basename in
-      ec++*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      ghcx*)
-	# Green Hills C++ Compiler
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  freebsd[12]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    ld_shlibs_CXX=no
-    ;;
-  freebsd-elf*)
-    archive_cmds_need_lc_CXX=no
-    ;;
-  freebsd* | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    ld_shlibs_CXX=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    hardcode_direct_CXX=yes
-    hardcode_minus_L_CXX=yes # Not in the search PATH,
-				# but as the default
-				# location of the library.
-
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      ld_shlibs_CXX=no
-      ;;
-    aCC*)
-      archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
+      freebsd[12]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
         ld_shlibs_CXX=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_CXX=:
+        ;;
 
-      case $host_cpu in
-      hppa*64*|ia64*) ;;
-      *)
-	export_dynamic_flag_spec_CXX='${wl}-E'
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
         ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*|ia64*)
-      hardcode_direct_CXX=no
-      hardcode_shlibpath_var_CXX=no
-      ;;
-    *)
-      hardcode_direct_CXX=yes
-      hardcode_minus_L_CXX=yes # Not in the search PATH,
-					      # but as the default
-					      # location of the library.
-      ;;
-    esac
 
-    case $cc_basename in
-      CC*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      aCC*)
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  ;;
-	esac
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test $with_gnu_ld = no; then
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
 	    case $host_cpu in
-	    hppa*64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5]* | *pgcpp\ [1-5]*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    ia64*)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    *) # Version 6 will use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 	      ;;
-	    *)
-	      archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    esac
+
+	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  xl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='echo'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
 	      ;;
 	    esac
-	  fi
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  interix[3-9]*)
-    hardcode_direct_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-    export_dynamic_flag_spec_CXX='${wl}-E'
-    # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-    # Instead, shared libraries are loaded at an image base (0x10000000 by
-    # default) and relocated if they conflict, which is a slow very memory
-    # consuming and fragmenting process.  To avoid this, we pick a random,
-    # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-    # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-    archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-	# SGI C++
-	archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	# Archives containing C++ object files must be created using
-	# "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+	esac
 	;;
-      *)
-	if test "$GXX" = yes; then
-	  if test "$with_gnu_ld" = no; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	  else
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-	  fi
-	fi
-	link_all_deplibs_CXX=yes
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
 	;;
-    esac
-    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-    hardcode_libdir_separator_CXX=:
-    ;;
-  linux* | k*bsd*-gnu)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
-
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
 	;;
-      icpc*)
-	# Intel C++
-	with_gnu_ld=yes
-	# version 8.0 and above of icpc choke on multiply defined symbols
-	# if we add $predep_objects and $postdep_objects, however 7.1 and
-	# earlier do not add the objects themselves.
-	case `$CC -V 2>&1` in
-	*"Version 7."*)
-  	  archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-  	  archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
-	*)  # Version 8.0 or newer
-	  tmp_idyn=
-	  case $host_cpu in
-	    ia64*) tmp_idyn=' -i_dynamic';;
-	  esac
-  	  archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	  archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-	  ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
 	esac
-	archive_cmds_need_lc_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
 	;;
-      pgCC* | pgcpp*)
-        # Portland Group C++ compiler
-	archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-  	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-	# Compaq C++
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
-	runpath_var=LD_RUN_PATH
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C++ 5.9
-	  no_undefined_flag_CXX=' -zdefs'
-	  archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
 	  hardcode_libdir_flag_spec_CXX='-R$libdir'
-	  whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-
-	  # Not sure whether something based on
-	  # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
-	  # would be better.
-	  output_verbose_link_cmd='echo'
-
-	  # Archives containing C++ object files must be created using
-	  # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	  # necessary to make sure instantiated templates are included
-	  # in the archive.
-	  old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	  ;;
-	esac
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
 	;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
 	;;
-      *)
-	# FIXME: insert proper C++ library support
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
 	ld_shlibs_CXX=no
 	;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      hardcode_libdir_flag_spec_CXX='-R$libdir'
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    ld_shlibs_CXX=no
-    ;;
-  openbsd*)
-    if test -f /usr/libexec/ld.so; then
-      hardcode_direct_CXX=yes
-      hardcode_shlibpath_var_CXX=no
-      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-      hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	export_dynamic_flag_spec_CXX='${wl}-E'
-	whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      fi
-      output_verbose_link_cmd='echo'
-    else
-      ld_shlibs_CXX=no
-    fi
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
 
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='${wl}-E'
+	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=echo
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
 
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
 
-	# Archives containing C++ object files must be created using
-	# "CC -Bstatic", where "CC" is the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    hardcode_libdir_separator_CXX=:
 
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	  archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
 
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
 
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-	# Kuck and Associates, Inc. (KAI) C++ Compiler
+      solaris*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
 
-	# KCC will only create a shared library if the output file
-	# ends with ".so" (or ".sl" for HP-UX), so rename the library
-	# to its proper name (with version) after linking.
-	archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    output_verbose_link_cmd='echo'
 
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	hardcode_libdir_separator_CXX=:
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
-	# Archives containing C++ object files must be created using
-	# the KAI C++ compiler.
-	old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
-	;;
-      RCC*)
-	# Rational C++ 2.4.1
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      cxx*)
-	allow_undefined_flag_CXX=' -expect_unresolved \*'
-	archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	  echo "-hidden">> $lib.exp~
-	  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version	$verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-	  $rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-rpath $libdir'
-	hardcode_libdir_separator_CXX=:
-
-	# Commands to make compiler produce verbose output that lists
-	# what "hidden" libraries, object files and flags are used when
-	# linking a shared library.
-	#
-	# There doesn't appear to be a way to prevent this compiler from
-	# explicitly linking system object files so we need to strip them
-	# from the output so that they don't get included in the library
-	# dependencies.
-	output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-	;;
-      *)
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	 archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	  hardcode_libdir_separator_CXX=:
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='${wl}-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
 
-	  # Commands to make compiler produce verbose output that lists
-	  # what "hidden" libraries, object files and flags are used when
-	  # linking a shared library.
-	  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
 
-	else
-	  # FIXME: insert proper C++ library support
-	  ld_shlibs_CXX=no
-	fi
-	;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.x
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      lcc*)
-	# Lucid
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-	# Sun C++ 4.2, 5.x and Centerline C++
-        archive_cmds_need_lc_CXX=yes
-	no_undefined_flag_CXX=' -zdefs'
-	archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	$CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
-	hardcode_libdir_flag_spec_CXX='-R$libdir'
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='${wl}-z,text'
+	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	archive_cmds_need_lc_CXX=no
 	hardcode_shlibpath_var_CXX=no
-	case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
+	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
 	  *)
-	    # The compiler driver will combine and reorder linker options,
-	    # but understands `-z linker_flag'.
-	    # Supported since Solaris 2.6 (maybe 2.5.1?)
-	    whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
-	link_all_deplibs_CXX=yes
+      ;;
 
-	output_verbose_link_cmd='echo'
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
 
-	# Archives containing C++ object files must be created using
-	# "CC -xar", where "CC" is the Sun C++ compiler.  This is
-	# necessary to make sure instantiated templates are included
-	# in the archive.
-	old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
-	;;
-      gcx*)
-	# Green Hills C++ Compiler
-	archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
 
-	# The C++ compiler must be used to create the archive.
-	old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-	;;
       *)
-	# GNU C++ compiler with Solaris linker
-	if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	  no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
-	  if $CC --version | grep -v '^2\.7' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
 
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  else
-	    # g++ 2.7 appears to require `-G' NOT `-shared' on this
-	    # platform.
-	    archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-		$CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+    { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test "$ld_shlibs_CXX" = no && can_build_shared=no
 
-	    # Commands to make compiler produce verbose output that lists
-	    # what "hidden" libraries, object files and flags are used when
-	    # linking a shared library.
-	    output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-	  fi
+    GCC_CXX="$GXX"
+    LD_CXX="$LD"
 
-	  hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
-	  case $host_os in
-	  solaris2.[0-5] | solaris2.[0-5].*) ;;
-	  *)
-	    whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	    ;;
-	  esac
-	fi
-	;;
-    esac
-    ;;
-  sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-    no_undefined_flag_CXX='${wl}-z,text'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  sysv5* | sco3.2v5* | sco5v6*)
-    # Note: We can NOT use -z defs as we might desire, because we do not
-    # link with -lc, and that would cause any symbols used from libc to
-    # always be unresolved, which means just about no library would
-    # ever link correctly.  If we're not using GNU ld we use -z text
-    # though, which does catch some bad symbols but isn't as heavy-handed
-    # as -z defs.
-    # For security reasons, it is highly recommended that you always
-    # use absolute paths for naming shared libraries, and exclude the
-    # DT_RUNPATH tag from executables and libraries.  But doing so
-    # requires that you compile everything twice, which is a pain.
-    # So that behaviour is only enabled if SCOABSPATH is set to a
-    # non-empty value in the environment.  Most likely only useful for
-    # creating official distributions of packages.
-    # This is a hack until libtool officially supports absolute path
-    # names for shared libraries.
-    no_undefined_flag_CXX='${wl}-z,text'
-    allow_undefined_flag_CXX='${wl}-z,nodefs'
-    archive_cmds_need_lc_CXX=no
-    hardcode_shlibpath_var_CXX=no
-    hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-    hardcode_libdir_separator_CXX=':'
-    link_all_deplibs_CXX=yes
-    export_dynamic_flag_spec_CXX='${wl}-Bexport'
-    runpath_var='LD_RUN_PATH'
-
-    case $cc_basename in
-      CC*)
-	archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-      *)
-	archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	;;
-    esac
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-	# NonStop-UX NCC 3.20
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-      *)
-	# FIXME: insert proper C++ library support
-	ld_shlibs_CXX=no
-	;;
-    esac
-    ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    ld_shlibs_CXX=no
-    ;;
-esac
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
-
-GCC_CXX="$GXX"
-LD_CXX="$LD"
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
 
-cat > conftest.$ac_ext <<EOF
+cat > conftest.$ac_ext <<_LT_EOF
 class Foo
 {
 public:
@@ -13193,12 +14529,12 @@ public:
 private:
   int a;
 };
-EOF
+_LT_EOF
 
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
   # Parse the compiler output and extract the necessary
   # objects, libraries and library flags.
@@ -13207,19 +14543,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   # the conftest object file.
   pre_test_object_deps_done=no
 
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
-
-  for p in `eval $output_verbose_link_cmd`; do
+  for p in `eval "$output_verbose_link_cmd"`; do
     case $p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" \
-	  || test $p = "-R"; then
+       if test $p = "-L" ||
+          test $p = "-R"; then
 	 prev=$p
 	 continue
        else
@@ -13284,12 +14615,7 @@ else
   echo "libtool.m4: error: problem compiling CXX test program"
 fi
 
-$rm -f confest.$objext
-
-compiler_lib_search_dirs_CXX=
-if test -n "$compiler_lib_search_path_CXX"; then
-  compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
+$RM -f confest.$objext
 
 # PORTME: override above test on systems where it is broken
 case $host_os in
@@ -13305,7 +14631,7 @@ linux*)
   case `$CC -V 2>&1 | sed 5q` in
   *Sun\ C*)
     # Sun C++ 5.9
-    #
+
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -13315,6 +14641,7 @@ linux*)
       solaris_use_stlport4=yes
       ;;
     esac
+
     if test "$solaris_use_stlport4" != yes; then
       postdeps_CXX='-library=Cstd -library=Crun'
     fi
@@ -13346,16 +14673,51 @@ solaris*)
   ;;
 esac
 
+
 case " $postdeps_CXX " in
 *" -lc "*) archive_cmds_need_lc_CXX=no ;;
 esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
 
-lt_prog_compiler_wl_CXX=
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
 lt_prog_compiler_pic_CXX=
 lt_prog_compiler_static_CXX=
 
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
 
   # C++ specific cases for pic, static, wl, etc.
   if test "$GXX" = yes; then
@@ -13370,16 +14732,26 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	lt_prog_compiler_static_CXX='-Bstatic'
       fi
       ;;
+
     amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
       ;;
+
     beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
       # PIC is the default for these OSes.
       ;;
-    mingw* | cygwin* | os2* | pw32*)
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
@@ -13405,16 +14777,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
       fi
       ;;
     hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
       case $host_cpu in
-      hppa*64*|ia64*)
+      hppa*64*)
 	;;
       *)
 	lt_prog_compiler_pic_CXX='-fPIC'
 	;;
       esac
       ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
     *)
       lt_prog_compiler_pic_CXX='-fPIC'
       ;;
@@ -13434,20 +14812,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	case $cc_basename in
 	cxch68*)
 	  # Green Hills C++ Compiler
-	  # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
 	  ;;
 	esac
 	;;
-       darwin*)
-         # PIC is the default on this platform
-         # Common symbols not allowed in MH_DYLIB files
-         case $cc_basename in
-           xlc*)
-           lt_prog_compiler_pic_CXX='-qnocommon'
-           lt_prog_compiler_wl_CXX='-Wl,'
-           ;;
-         esac
-       ;;
       dgux*)
 	case $cc_basename in
 	  ec++*)
@@ -13511,14 +14879,21 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	    lt_prog_compiler_wl_CXX='--backend -Wl,'
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
-	  icpc* | ecpc*)
-	    # Intel C++
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
 	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
 	  pgCC* | pgcpp*)
-	    # Portland Group C++ compiler.
+	    # Portland Group C++ compiler
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-fpic'
 	    lt_prog_compiler_static_CXX='-Bstatic'
@@ -13530,6 +14905,12 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	    lt_prog_compiler_pic_CXX=
 	    lt_prog_compiler_static_CXX='-non_shared'
 	    ;;
+	  xlc* | xlC*)
+	    # IBM XL 8.0 on PPC
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
 	  *)
 	    case `$CC -V 2>&1 | sed 5q` in
 	    *Sun\ C*)
@@ -13557,6 +14938,11 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	;;
       netbsd*)
 	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
       osf3* | osf4* | osf5*)
 	case $cc_basename in
 	  KCC*)
@@ -13611,22 +14997,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 	    ;;
 	esac
 	;;
-      tandem*)
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
 	case $cc_basename in
-	  NCC*)
-	    # NonStop-UX NCC 3.20
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
-	    ;;
-	  *)
+	    lt_prog_compiler_static_CXX='-Bstatic'
 	    ;;
 	esac
 	;;
-      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      tandem*)
 	case $cc_basename in
-	  CC*)
-	    lt_prog_compiler_wl_CXX='-Wl,'
+	  NCC*)
+	    # NonStop-UX NCC 3.20
 	    lt_prog_compiler_pic_CXX='-KPIC'
-	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  *)
 	    ;;
 	esac
 	;;
@@ -13638,21 +15024,31 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
     esac
   fi
 
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; }
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+
+
 
 #
 # Check to make sure the PIC flag actually works.
 #
 if test -n "$lt_prog_compiler_pic_CXX"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
 if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_pic_works_CXX=no
-  ac_outfile=conftest.$ac_objext
+   ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
    lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
    # Insert the option either (1) after the last *FLAGS variable, or
@@ -13664,25 +15060,25 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13667: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15063: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13671: \$? = $ac_status" >&5
+   echo "$as_me:15067: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
      $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
      if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_pic_works_CXX=yes
      fi
    fi
-   $rm conftest*
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
 
 if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
     case $lt_prog_compiler_pic_CXX in
@@ -13695,24 +15091,17 @@ else
 fi
 
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_CXX=
-    ;;
-  *)
-    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
-    ;;
-esac
+
+
 
 #
 # Check to make sure the static flag actually works.
 #
 wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
 if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works_CXX=no
    save_LDFLAGS="$LDFLAGS"
@@ -13724,7 +15113,7 @@ else
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
        $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
        if diff conftest.exp conftest.er2 >/dev/null; then
          lt_cv_prog_compiler_static_works_CXX=yes
@@ -13733,12 +15122,12 @@ else
        lt_cv_prog_compiler_static_works_CXX=yes
      fi
    fi
-   $rm -r conftest*
+   $RM -r conftest*
    LDFLAGS="$save_LDFLAGS"
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
 
 if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
     :
@@ -13747,13 +15136,15 @@ else
 fi
 
 
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
+
+
+    { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
 if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_c_o_CXX=no
-   $rm -r conftest 2>/dev/null
+   $RM -r conftest 2>/dev/null
    mkdir conftest
    cd conftest
    mkdir out
@@ -13768,77 +15159,133 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13771: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15162: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13775: \$? = $ac_status" >&5
+   echo "$as_me:15166: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
      $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
      if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
        lt_cv_prog_compiler_c_o_CXX=yes
      fi
    fi
    chmod u+w . 2>&5
-   $rm conftest*
+   $RM conftest*
    # SGI C++ compiler will create directory out/ii_files/ for
    # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
    cd ..
-   rmdir conftest
-   $rm conftest*
+   $RM -r conftest
+   $RM conftest*
 
 fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:15214: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:15218: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
 
 
 hard_links="nottested"
 if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
   # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
   hard_links=yes
-  $rm conftest*
+  $RM conftest*
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   touch conftest.a
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
+  { $as_echo "$as_me:$LINENO: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
   if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
   need_locks=no
 fi
 
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
+
+
+    { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
 
   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
   case $host_os in
   aix[4-9]*)
     # If we're using GNU nm, then we don't want the "-C" option.
     # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
     export_symbols_cmds_CXX="$ltdll_cmds"
   ;;
-  cygwin* | mingw*)
-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+  cygwin* | mingw* | cegcc*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
   ;;
   *)
     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
@@ -13846,10 +15293,17 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
   esac
   exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
 
-{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
-echo "${ECHO_T}$ld_shlibs_CXX" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
 test "$ld_shlibs_CXX" = no && can_build_shared=no
 
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
 #
 # Do we need to explicitly link libc?
 #
@@ -13867,15 +15321,15 @@ x|xyes)
       # Test whether the compiler implicitly links with -lc since on some
       # systems, -lgcc has to come before -lc. If gcc already passes -lc
       # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
+      { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+      $RM conftest*
       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
       if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } 2>conftest.err; then
         soname=conftest
         lib=conftest
@@ -13890,10 +15344,10 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
         libname=conftest
         lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
         allow_undefined_flag_CXX=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
   ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
         then
 	  archive_cmds_need_lc_CXX=no
@@ -13904,2638 +15358,81 @@ echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&
       else
         cat conftest.err 1>&5
       fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; }
+      $RM conftest*
+      { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+$as_echo "$archive_cmds_need_lc_CXX" >&6; }
       ;;
     esac
   fi
   ;;
 esac
 
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
 
-need_lib_prefix=unknown
-hardcode_into_libs=no
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
 
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
 
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
 
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
 
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
 
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
 
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
 
-freebsd1*)
-  dynamic_linker=no
-  ;;
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
 
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
 
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
 
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
 
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
 
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
 
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
 
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
 
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
 
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
 
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
 
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
 
-rdos*)
-  dynamic_linker=no
-  ;;
 
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
 
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
 
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
 
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
 
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_CXX=
-if test -n "$hardcode_libdir_flag_spec_CXX" || \
-   test -n "$runpath_var_CXX" || \
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_CXX" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_CXX=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_CXX=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_CXX=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
-echo "${ECHO_T}$hardcode_action_CXX" >&6; }
-
-if test "$hardcode_action_CXX" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_CXX \
-    CC_CXX \
-    LD_CXX \
-    lt_prog_compiler_wl_CXX \
-    lt_prog_compiler_pic_CXX \
-    lt_prog_compiler_static_CXX \
-    lt_prog_compiler_no_builtin_flag_CXX \
-    export_dynamic_flag_spec_CXX \
-    thread_safe_flag_spec_CXX \
-    whole_archive_flag_spec_CXX \
-    enable_shared_with_static_runtimes_CXX \
-    old_archive_cmds_CXX \
-    old_archive_from_new_cmds_CXX \
-    predep_objects_CXX \
-    postdep_objects_CXX \
-    predeps_CXX \
-    postdeps_CXX \
-    compiler_lib_search_path_CXX \
-    compiler_lib_search_dirs_CXX \
-    archive_cmds_CXX \
-    archive_expsym_cmds_CXX \
-    postinstall_cmds_CXX \
-    postuninstall_cmds_CXX \
-    old_archive_from_expsyms_cmds_CXX \
-    allow_undefined_flag_CXX \
-    no_undefined_flag_CXX \
-    export_symbols_cmds_CXX \
-    hardcode_libdir_flag_spec_CXX \
-    hardcode_libdir_flag_spec_ld_CXX \
-    hardcode_libdir_separator_CXX \
-    hardcode_automatic_CXX \
-    module_cmds_CXX \
-    module_expsym_cmds_CXX \
-    lt_cv_prog_compiler_c_o_CXX \
-    fix_srcfile_path_CXX \
-    exclude_expsyms_CXX \
-    include_expsyms_CXX; do
-
-    case $var in
-    old_archive_cmds_CXX | \
-    old_archive_from_new_cmds_CXX | \
-    archive_cmds_CXX | \
-    archive_expsym_cmds_CXX | \
-    module_cmds_CXX | \
-    module_expsym_cmds_CXX | \
-    old_archive_from_expsyms_cmds_CXX | \
-    export_symbols_cmds_CXX | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_CXX
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_CXX
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_CXX
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_CXX
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_CXX
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_CXX
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_CXX
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_CXX
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_CXX
-archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_CXX
-module_expsym_cmds=$lt_module_expsym_cmds_CXX
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_CXX
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_CXX
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_CXX
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_CXX
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_CXX
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_CXX
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_CXX
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_CXX
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_CXX
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_CXX
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_CXX
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_CXX
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_CXX
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_CXX
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
 
-	else
-	  tagname=""
-	fi
-	;;
 
-      F77)
-	if test -n "$F77" && test "X$F77" != "Xno"; then
-
-ac_ext=f
-ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
-ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_f77_compiler_gnu
-
-
-archive_cmds_need_lc_F77=no
-allow_undefined_flag_F77=
-always_export_symbols_F77=no
-archive_expsym_cmds_F77=
-export_dynamic_flag_spec_F77=
-hardcode_direct_F77=no
-hardcode_libdir_flag_spec_F77=
-hardcode_libdir_flag_spec_ld_F77=
-hardcode_libdir_separator_F77=
-hardcode_minus_L_F77=no
-hardcode_automatic_F77=no
-module_cmds_F77=
-module_expsym_cmds_F77=
-link_all_deplibs_F77=unknown
-old_archive_cmds_F77=$old_archive_cmds
-no_undefined_flag_F77=
-whole_archive_flag_spec_F77=
-enable_shared_with_static_runtimes_F77=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-objext_F77=$objext
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="\
-      subroutine t
-      return
-      end
-"
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="\
-      program t
-      end
-"
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
 
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
 
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-# Allow CC to be a program name with arguments.
-compiler=$CC
 
 
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
 
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
 
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-compiler_F77=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 
 
-{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $can_build_shared" >&5
-echo "${ECHO_T}$can_build_shared" >&6; }
 
-{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; }
-test "$can_build_shared" = "no" && enable_shared=no
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix[4-9]*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $enable_shared" >&5
-echo "${ECHO_T}$enable_shared" >&6; }
 
-{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; }
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-{ echo "$as_me:$LINENO: result: $enable_static" >&5
-echo "${ECHO_T}$enable_static" >&6; }
 
-GCC_F77="$G77"
-LD_F77="$LD"
 
-lt_prog_compiler_wl_F77=
-lt_prog_compiler_pic_F77=
-lt_prog_compiler_static_F77=
 
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
 
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_F77='-Wl,'
-    lt_prog_compiler_static_F77='-static'
 
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
 
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_F77='-fno-common'
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_F77=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_F77=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_F77='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_F77='-Bstatic'
-      else
-	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_F77='-qnocommon'
-         lt_prog_compiler_wl_F77='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_F77='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
-      ;;
+    { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-KPIC'
-	lt_prog_compiler_static_F77='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_F77='-Wl,'
-	lt_prog_compiler_pic_F77='-fpic'
-	lt_prog_compiler_static_F77='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_F77='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_F77='-non_shared'
-        ;;
-      *)
-        case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic_F77='-KPIC'
-	  lt_prog_compiler_static_F77='-Bstatic'
-	  lt_prog_compiler_wl_F77='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic_F77='-KPIC'
-	  lt_prog_compiler_static_F77='-Bstatic'
-	  lt_prog_compiler_wl_F77=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static_F77='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_F77='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_F77='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl_F77='-Qoption ld '
-      lt_prog_compiler_pic_F77='-PIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_F77='-Kconform_pic'
-	lt_prog_compiler_static_F77='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_pic_F77='-KPIC'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl_F77='-Wl,'
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic_F77='-pic'
-      lt_prog_compiler_static_F77='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared_F77=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_F77"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_pic_works_F77=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_F77"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15354: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:15358: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_F77=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
-    case $lt_prog_compiler_pic_F77 in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
-     esac
-else
-    lt_prog_compiler_pic_F77=
-     lt_prog_compiler_can_build_shared_F77=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_F77=
-    ;;
-  *)
-    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_static_works_F77=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_F77=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_F77=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
-    :
-else
-    lt_prog_compiler_static_F77=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_F77=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15458: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:15462: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_F77=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
-  runpath_var=
-  allow_undefined_flag_F77=
-  enable_shared_with_static_runtimes_F77=no
-  archive_cmds_F77=
-  archive_expsym_cmds_F77=
-  old_archive_From_new_cmds_F77=
-  old_archive_from_expsyms_cmds_F77=
-  export_dynamic_flag_spec_F77=
-  whole_archive_flag_spec_F77=
-  thread_safe_flag_spec_F77=
-  hardcode_libdir_flag_spec_F77=
-  hardcode_libdir_flag_spec_ld_F77=
-  hardcode_libdir_separator_F77=
-  hardcode_direct_F77=no
-  hardcode_minus_L_F77=no
-  hardcode_shlibpath_var_F77=unsupported
-  link_all_deplibs_F77=unknown
-  hardcode_automatic_F77=no
-  module_cmds_F77=
-  module_expsym_cmds_F77=
-  always_export_symbols_F77=no
-  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_F77=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_F77=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_F77=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_F77=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_F77=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=no
-      enable_shared_with_static_runtimes_F77=yes
-      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_F77='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
-	esac
-	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_F77=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_F77=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_F77=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs_F77" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_F77=
-      export_dynamic_flag_spec_F77=
-      whole_archive_flag_spec_F77=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_F77=unsupported
-      always_export_symbols_F77=yes
-      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_F77=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_F77=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds_F77=''
-      hardcode_direct_F77=yes
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  :
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_F77=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_F77=yes
-  	  hardcode_libdir_flag_spec_F77='-L$libdir'
-  	  hardcode_libdir_separator_F77=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_F77=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_F77='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_F77="-z nodefs"
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-      program main
-
-      end
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_f77_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_F77=' ${wl}-bernotok'
-	  allow_undefined_flag_F77=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_F77='$convenience'
-	  archive_cmds_need_lc_F77=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_F77=no
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec_F77=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_F77=' '
-      allow_undefined_flag_F77=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_F77='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_F77=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_F77=no
-      hardcode_direct_F77=no
-      hardcode_automatic_F77=yes
-      hardcode_shlibpath_var_F77=unsupported
-      whole_archive_flag_spec_F77=''
-      link_all_deplibs_F77=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_F77=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_F77=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_direct_F77=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	hardcode_direct_F77=yes
-	export_dynamic_flag_spec_F77='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_F77=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_F77=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_F77='+b $libdir'
-	  hardcode_direct_F77=no
-	  hardcode_shlibpath_var_F77=no
-	  ;;
-	*)
-	  hardcode_direct_F77=yes
-	  export_dynamic_flag_spec_F77='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_F77=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      link_all_deplibs_F77=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_direct_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    newsos6)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_F77=yes
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct_F77=yes
-	hardcode_shlibpath_var_F77=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec_F77='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec_F77='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-        fi
-      else
-	ld_shlibs_F77=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_minus_L_F77=yes
-      allow_undefined_flag_F77=unsupported
-      archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_F77=' -expect_unresolved \*'
-	archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_F77='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_F77=:
-      ;;
-
-    solaris*)
-      no_undefined_flag_F77=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_F77='-R$libdir'
-      hardcode_shlibpath_var_F77=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs_F77=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_direct_F77=yes
-      hardcode_minus_L_F77=yes
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_F77='$CC -r -o $output$reload_objs'
-	  hardcode_direct_F77=no
-        ;;
-	motorola)
-	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_F77=no
-      export_dynamic_flag_spec_F77='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_F77=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_F77=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_F77='${wl}-z,text'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_F77='${wl}-z,text'
-      allow_undefined_flag_F77='${wl}-z,nodefs'
-      archive_cmds_need_lc_F77=no
-      hardcode_shlibpath_var_F77=no
-      hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_F77=':'
-      link_all_deplibs_F77=yes
-      export_dynamic_flag_spec_F77='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_F77='-L$libdir'
-      hardcode_shlibpath_var_F77=no
-      ;;
-
-    *)
-      ld_shlibs_F77=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
-echo "${ECHO_T}$ld_shlibs_F77" >&6; }
-test "$ld_shlibs_F77" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_F77" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_F77=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_F77 in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_F77
-	pic_flag=$lt_prog_compiler_pic_F77
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_F77
-        allow_undefined_flag_F77=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_F77=no
-        else
-	  archive_cmds_need_lc_F77=yes
-        fi
-        allow_undefined_flag_F77=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -16549,7 +15446,6 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -16586,7 +15482,7 @@ aix[4-9]*)
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
@@ -16612,9 +15508,18 @@ aix[4-9]*)
   ;;
 
 amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
   ;;
 
 beos*)
@@ -16637,25 +15542,28 @@ bsdi[45]*)
   # libtool to hard-code these into programs
   ;;
 
-cygwin* | mingw* | pw32*)
+cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
   shrext_cmds=".dll"
   need_version=no
   need_lib_prefix=no
 
   case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
     postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
     postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
       dlpath=$dir/\$dldll~
-       $rm \$dlpath'
+       $RM \$dlpath'
     shlibpath_overrides_runpath=yes
 
     case $host_os in
@@ -16664,20 +15572,20 @@ cygwin* | mingw* | pw32*)
       soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
       sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    mingw*)
+    mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
       soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH printed by
         # mingw gcc, but we are running on Cygwin. Gcc prints its search
         # path with ; separators, and with drive letters. We can handle the
         # drive letters (cygwin fileutils understands them), so leave them,
         # especially as we might pass files found there to a mingw objdump,
         # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
       else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
       fi
       ;;
     pw32*)
@@ -16701,7 +15609,7 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
   soname_spec='${libname}${release}${major}$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
@@ -16799,18 +15707,18 @@ hpux9* | hpux10* | hpux11*)
     fi
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
     shrext_cmds='.sl'
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
@@ -16887,1638 +15795,12 @@ linux* | k*bsd*-gnu)
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
-
-  # We used to test for /lib/ld.so.1 and disable shared libraries on
-  # powerpc, because MkLinux only supported shared libraries with the
-  # GNU dynamic linker.  Since this was broken with cross compilers,
-  # most powerpc-linux boxes support dynamic linking these days and
-  # people can always --disable-shared, the test was removed, and we
-  # assume the GNU/Linux dynamic linker is in use.
-  dynamic_linker='GNU/Linux ld.so'
-  ;;
-
-netbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-    dynamic_linker='NetBSD (a.out) ld.so'
-  else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    dynamic_linker='NetBSD ld.elf_so'
-  fi
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  ;;
-
-newsos6)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
-    shlibpath_var=LD_LIBRARY_PATH
-  fi
-  ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
-  else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-	;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-uts4*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-*)
-  dynamic_linker=no
-  ;;
-esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_F77=
-if test -n "$hardcode_libdir_flag_spec_F77" || \
-   test -n "$runpath_var_F77" || \
-   test "X$hardcode_automatic_F77" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_F77" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
-     test "$hardcode_minus_L_F77" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_F77=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_F77=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_F77=unsupported
-fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
-echo "${ECHO_T}$hardcode_action_F77" >&6; }
-
-if test "$hardcode_action_F77" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_F77 \
-    CC_F77 \
-    LD_F77 \
-    lt_prog_compiler_wl_F77 \
-    lt_prog_compiler_pic_F77 \
-    lt_prog_compiler_static_F77 \
-    lt_prog_compiler_no_builtin_flag_F77 \
-    export_dynamic_flag_spec_F77 \
-    thread_safe_flag_spec_F77 \
-    whole_archive_flag_spec_F77 \
-    enable_shared_with_static_runtimes_F77 \
-    old_archive_cmds_F77 \
-    old_archive_from_new_cmds_F77 \
-    predep_objects_F77 \
-    postdep_objects_F77 \
-    predeps_F77 \
-    postdeps_F77 \
-    compiler_lib_search_path_F77 \
-    compiler_lib_search_dirs_F77 \
-    archive_cmds_F77 \
-    archive_expsym_cmds_F77 \
-    postinstall_cmds_F77 \
-    postuninstall_cmds_F77 \
-    old_archive_from_expsyms_cmds_F77 \
-    allow_undefined_flag_F77 \
-    no_undefined_flag_F77 \
-    export_symbols_cmds_F77 \
-    hardcode_libdir_flag_spec_F77 \
-    hardcode_libdir_flag_spec_ld_F77 \
-    hardcode_libdir_separator_F77 \
-    hardcode_automatic_F77 \
-    module_cmds_F77 \
-    module_expsym_cmds_F77 \
-    lt_cv_prog_compiler_c_o_F77 \
-    fix_srcfile_path_F77 \
-    exclude_expsyms_F77 \
-    include_expsyms_F77; do
-
-    case $var in
-    old_archive_cmds_F77 | \
-    old_archive_from_new_cmds_F77 | \
-    archive_cmds_F77 | \
-    archive_expsym_cmds_F77 | \
-    module_cmds_F77 | \
-    module_expsym_cmds_F77 | \
-    old_archive_from_expsyms_cmds_F77 | \
-    export_symbols_cmds_F77 | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_F77
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_F77
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_F77
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_F77
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_F77
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_F77
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_F77
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_F77
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_F77
-archive_expsym_cmds=$lt_archive_expsym_cmds_F77
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_F77
-module_expsym_cmds=$lt_module_expsym_cmds_F77
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_F77
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_F77
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_F77
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_F77
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_F77
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_F77
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_F77
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_F77
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_F77
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_F77
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_F77
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_F77
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_F77
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_F77
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_F77
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
-
-
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      GCJ)
-	if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-objext_GCJ=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-compiler_GCJ=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-archive_cmds_need_lc_GCJ=no
-
-old_archive_cmds_GCJ=$old_archive_cmds
-
-
-lt_prog_compiler_no_builtin_flag_GCJ=
-
-if test "$GCC" = yes; then
-  lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_rtti_exceptions=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17665: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:17669: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_rtti_exceptions=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
-    lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
-else
-    :
-fi
-
-fi
-
-lt_prog_compiler_wl_GCJ=
-lt_prog_compiler_pic_GCJ=
-lt_prog_compiler_static_GCJ=
-
-{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
-echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; }
-
-  if test "$GCC" = yes; then
-    lt_prog_compiler_wl_GCJ='-Wl,'
-    lt_prog_compiler_static_GCJ='-static'
-
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
-
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
-      ;;
-
-    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      # Although the cygwin gcc ignores -fPIC, still need this for old-style
-      # (--disable-auto-import) libraries
-
-      ;;
-
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_GCJ='-fno-common'
-      ;;
-
-    interix[3-9]*)
-      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
-      # Instead, we relocate shared libraries at runtime.
-      ;;
-
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      lt_prog_compiler_can_build_shared_GCJ=no
-      enable_shared=no
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	lt_prog_compiler_pic_GCJ=-Kconform_pic
-      fi
-      ;;
-
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_GCJ='-fPIC'
-	;;
-      esac
-      ;;
-
-    *)
-      lt_prog_compiler_pic_GCJ='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      if test "$host_cpu" = ia64; then
-	# AIX 5 now supports IA64 processor
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      else
-	lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         lt_prog_compiler_pic_GCJ='-qnocommon'
-         lt_prog_compiler_wl_GCJ='-Wl,'
-         ;;
-       esac
-       ;;
-
-    mingw* | cygwin* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-
-      ;;
-
-    hpux9* | hpux10* | hpux11*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-	# +Z the default
-	;;
-      *)
-	lt_prog_compiler_pic_GCJ='+Z'
-	;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # PIC (with -KPIC) is the default.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    newsos6)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    linux* | k*bsd*-gnu)
-      case $cc_basename in
-      icc* | ecc*)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-KPIC'
-	lt_prog_compiler_static_GCJ='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-	# which looks to be a dead project)
-	lt_prog_compiler_wl_GCJ='-Wl,'
-	lt_prog_compiler_pic_GCJ='-fpic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-        ;;
-      ccc*)
-        lt_prog_compiler_wl_GCJ='-Wl,'
-        # All Alpha code is PIC.
-        lt_prog_compiler_static_GCJ='-non_shared'
-        ;;
-      *)
-        case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)
-	  # Sun C 5.9
-	  lt_prog_compiler_pic_GCJ='-KPIC'
-	  lt_prog_compiler_static_GCJ='-Bstatic'
-	  lt_prog_compiler_wl_GCJ='-Wl,'
-	  ;;
-	*Sun\ F*)
-	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
-	  lt_prog_compiler_pic_GCJ='-KPIC'
-	  lt_prog_compiler_static_GCJ='-Bstatic'
-	  lt_prog_compiler_wl_GCJ=''
-	  ;;
-	esac
-	;;
-      esac
-      ;;
-
-    osf3* | osf4* | osf5*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      # All OSF/1 code is PIC.
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    rdos*)
-      lt_prog_compiler_static_GCJ='-non_shared'
-      ;;
-
-    solaris*)
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-	lt_prog_compiler_wl_GCJ='-Qoption ld ';;
-      *)
-	lt_prog_compiler_wl_GCJ='-Wl,';;
-      esac
-      ;;
-
-    sunos4*)
-      lt_prog_compiler_wl_GCJ='-Qoption ld '
-      lt_prog_compiler_pic_GCJ='-PIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    sysv4 | sysv4.2uw2* | sysv4.3*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-	lt_prog_compiler_pic_GCJ='-Kconform_pic'
-	lt_prog_compiler_static_GCJ='-Bstatic'
-      fi
-      ;;
-
-    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_pic_GCJ='-KPIC'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    unicos*)
-      lt_prog_compiler_wl_GCJ='-Wl,'
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-
-    uts4*)
-      lt_prog_compiler_pic_GCJ='-pic'
-      lt_prog_compiler_static_GCJ='-Bstatic'
-      ;;
-
-    *)
-      lt_prog_compiler_can_build_shared_GCJ=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; }
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic_GCJ"; then
-
-{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
-echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_pic_works_GCJ=no
-  ac_outfile=conftest.$ac_objext
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17955: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&5
-   echo "$as_me:17959: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
-     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_pic_works_GCJ=yes
-     fi
-   fi
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
-    case $lt_prog_compiler_pic_GCJ in
-     "" | " "*) ;;
-     *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
-     esac
-else
-    lt_prog_compiler_pic_GCJ=
-     lt_prog_compiler_can_build_shared_GCJ=no
-fi
-
-fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    lt_prog_compiler_pic_GCJ=
-    ;;
-  *)
-    lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
-    ;;
-esac
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
-{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_static_works_GCJ=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
-   echo "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&5
-       $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
-       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         lt_cv_prog_compiler_static_works_GCJ=yes
-       fi
-     else
-       lt_cv_prog_compiler_static_works_GCJ=yes
-     fi
-   fi
-   $rm -r conftest*
-   LDFLAGS="$save_LDFLAGS"
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; }
-
-if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
-    :
-else
-    lt_prog_compiler_static_GCJ=
-fi
-
-
-{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
-echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; }
-if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_prog_compiler_c_o_GCJ=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18059: $lt_compile\"" >&5)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&5
-   echo "$as_me:18063: \$? = $ac_status" >&5
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
-     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       lt_cv_prog_compiler_c_o_GCJ=yes
-     fi
-   fi
-   chmod u+w . 2>&5
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-
-fi
-{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
-echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; }
-
-
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
-echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; }
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  { echo "$as_me:$LINENO: result: $hard_links" >&5
-echo "${ECHO_T}$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
-    need_locks=warn
-  fi
-else
-  need_locks=no
-fi
-
-{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; }
-
-  runpath_var=
-  allow_undefined_flag_GCJ=
-  enable_shared_with_static_runtimes_GCJ=no
-  archive_cmds_GCJ=
-  archive_expsym_cmds_GCJ=
-  old_archive_From_new_cmds_GCJ=
-  old_archive_from_expsyms_cmds_GCJ=
-  export_dynamic_flag_spec_GCJ=
-  whole_archive_flag_spec_GCJ=
-  thread_safe_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_GCJ=
-  hardcode_libdir_flag_spec_ld_GCJ=
-  hardcode_libdir_separator_GCJ=
-  hardcode_direct_GCJ=no
-  hardcode_minus_L_GCJ=no
-  hardcode_shlibpath_var_GCJ=unsupported
-  link_all_deplibs_GCJ=unknown
-  hardcode_automatic_GCJ=no
-  module_cmds_GCJ=
-  module_expsym_cmds_GCJ=
-  always_export_symbols_GCJ=no
-  export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  include_expsyms_GCJ=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  # Exclude shared library initialization/finalization symbols.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  interix*)
-    # we just hope/assume this is gcc and not c89 (= MSVC++)
-    with_gnu_ld=yes
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
-
-  ld_shlibs_GCJ=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
-
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
-    export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-	whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-  	whole_archive_flag_spec_GCJ=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
-
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix[3-9]*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-
-      # Samuel A. Falvo II <kc5tja at dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      ld_shlibs_GCJ=no
-      ;;
-
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	allow_undefined_flag_GCJ=unsupported
-	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
-	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
-      # as there is no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=no
-      enable_shared_with_static_runtimes_GCJ=yes
-      export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
-
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    interix[3-9]*)
-      hardcode_direct_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
-      # Instead, shared libraries are loaded at an image base (0x10000000 by
-      # default) and relocated if they conflict, which is a slow very memory
-      # consuming and fragmenting process.  To avoid this, we pick a random,
-      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
-      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      ;;
-
-    gnu* | linux* | k*bsd*-gnu)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	tmp_addflag=
-	case $cc_basename,$host_cpu in
-	pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag'
-	  ;;
-	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_addflag=' $pic_flag -Mnomain' ;;
-	ecc*,ia64* | icc*,ia64*)		# Intel C compiler on ia64
-	  tmp_addflag=' -i_dynamic' ;;
-	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
-	  tmp_addflag=' -i_dynamic -nofor_main' ;;
-	ifc* | ifort*)			# Intel Fortran compiler
-	  tmp_addflag=' -nofor_main' ;;
-	esac
-	case `$CC -V 2>&1 | sed 5q` in
-	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-	  tmp_sharedflag='-G' ;;
-	*Sun\ F*)			# Sun Fortran 8.3
-	  tmp_sharedflag='-G' ;;
-	*)
-	  tmp_sharedflag='-shared' ;;
-	esac
-	archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
-	if test $supports_anon_versioning = yes; then
-	  archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-	  $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-	fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-	wlarc=
-      else
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
-
-    solaris*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-	ld_shlibs_GCJ=no
-	cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
-      case `$LD -v 2>&1` in
-        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
-	ld_shlibs_GCJ=no
-	cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
-	;;
-	*)
-	  if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
-	    archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
-	    archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
-	  else
-	    ld_shlibs_GCJ=no
-	  fi
-	;;
-      esac
-      ;;
-
-    sunos4*)
-      archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-    esac
-
-    if test "$ld_shlibs_GCJ" = no; then
-      runpath_var=
-      hardcode_libdir_flag_spec_GCJ=
-      export_dynamic_flag_spec_GCJ=
-      whole_archive_flag_spec_GCJ=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      allow_undefined_flag_GCJ=unsupported
-      always_export_symbols_GCJ=yes
-      archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      hardcode_minus_L_GCJ=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
-	# Neither direct hardcoding nor static linking is supported with a
-	# broken collect2.
-	hardcode_direct_GCJ=unsupported
-      fi
-      ;;
-
-    aix[4-9]*)
-      if test "$host_cpu" = ia64; then
-	# On IA64, the linker does run time linking by default, so we don't
-	# have to do anything special.
-	aix_use_runtimelinking=no
-	exp_sym_flag='-Bexport'
-	no_entry_flag=""
-      else
-	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-	  export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	else
-	  export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
-	fi
-	aix_use_runtimelinking=no
-
-	# Test if we are trying to use run time linking or normal
-	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
-	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
-	  for ld_flag in $LDFLAGS; do
-  	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-  	    aix_use_runtimelinking=yes
-  	    break
-  	  fi
-	  done
-	  ;;
-	esac
-
-	exp_sym_flag='-bexport'
-	no_entry_flag='-bnoentry'
-      fi
-
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
-      archive_cmds_GCJ=''
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
-
-      if test "$GCC" = yes; then
-	case $host_os in aix4.[012]|aix4.[012].*)
-	# We only want to do this on AIX 4.2 and lower, the check
-	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
-	  if test -f "$collect2name" && \
-  	   strings "$collect2name" | grep resolve_lib_name >/dev/null
-	  then
-  	  # We have reworked collect2
-  	  :
-	  else
-  	  # We have old collect2
-  	  hardcode_direct_GCJ=unsupported
-  	  # It fails to find uninstalled libraries when the uninstalled
-  	  # path is not listed in the libpath.  Setting hardcode_minus_L
-  	  # to unsupported forces relinking
-  	  hardcode_minus_L_GCJ=yes
-  	  hardcode_libdir_flag_spec_GCJ='-L$libdir'
-  	  hardcode_libdir_separator_GCJ=
-	  fi
-	  ;;
-	esac
-	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
-	fi
-      else
-	# not using gcc
-	if test "$host_cpu" = ia64; then
-  	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-  	# chokes on -Wl,-G. The following line is correct:
-	  shared_flag='-G'
-	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
-	  else
-	    shared_flag='${wl}-bM:SRE'
-	  fi
-	fi
-      fi
-
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      always_export_symbols_GCJ=yes
-      if test "$aix_use_runtimelinking" = yes; then
-	# Warning - without using the other runtime loading flags (-brtl),
-	# -berok will link without error, but may produce a broken library.
-	allow_undefined_flag_GCJ='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       cat >conftest.$ac_ext <<_ACEOF
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+       LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -18539,975 +15821,38 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
+	 test -z "$ac_cxx_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  shlibpath_overrides_runpath=yes
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-       hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
-	  allow_undefined_flag_GCJ="-z nodefs"
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
-	else
-	 # Determine the default libpath from the value encoded in an empty executable.
-	 cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
-
-lt_aix_libpath_sed='
-    /Import File Strings/,/^$/ {
-	/^0/ {
-	    s/^0  *\(.*\)$/\1/
-	    p
-	}
-    }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-
-	 hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
-	  # Warning - without using the other run time loading flags,
-	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag_GCJ=' ${wl}-bernotok'
-	  allow_undefined_flag_GCJ=' ${wl}-berok'
-	  # Exported symbols can be pulled into shared objects from archives
-	  whole_archive_flag_spec_GCJ='$convenience'
-	  archive_cmds_need_lc_GCJ=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-	fi
-      fi
-      ;;
-
-    amigaos*)
-      archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      # see comment about different semantics on the GNU ld section
-      ld_shlibs_GCJ=no
-      ;;
-
-    bsdi[45]*)
-      export_dynamic_flag_spec_GCJ=-rdynamic
-      ;;
-
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      hardcode_libdir_flag_spec_GCJ=' '
-      allow_undefined_flag_GCJ=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      old_archive_From_new_cmds_GCJ='true'
-      # FIXME: Should let the user specify the lib program.
-      old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
-      fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
-      enable_shared_with_static_runtimes_GCJ=yes
-      ;;
-
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[012])
-         allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[012])
-               allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      archive_cmds_need_lc_GCJ=no
-      hardcode_direct_GCJ=no
-      hardcode_automatic_GCJ=yes
-      hardcode_shlibpath_var_GCJ=unsupported
-      whole_archive_flag_spec_GCJ=''
-      link_all_deplibs_GCJ=yes
-    if test "$GCC" = yes ; then
-    	output_verbose_link_cmd='echo'
-        archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-        module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-        archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-        module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
-         module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         ld_shlibs_GCJ=no
-          ;;
-      esac
-    fi
-      ;;
-
-    dgux*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    freebsd1*)
-      ld_shlibs_GCJ=no
-      ;;
-
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | dragonfly*)
-      archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-	archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_direct_GCJ=yes
-
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      hardcode_minus_L_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-E'
-      ;;
-
-    hpux10*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
-
-	hardcode_direct_GCJ=yes
-	export_dynamic_flag_spec_GCJ='${wl}-E'
-
-	# hardcode_minus_L: Not really in the search PATH,
-	# but as the default location of the library.
-	hardcode_minus_L_GCJ=yes
-      fi
-      ;;
-
-    hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      else
-	case $host_cpu in
-	hppa*64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	ia64*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	*)
-	  archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-	  ;;
-	esac
-      fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
-	hardcode_libdir_separator_GCJ=:
-
-	case $host_cpu in
-	hppa*64*|ia64*)
-	  hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
-	  hardcode_direct_GCJ=no
-	  hardcode_shlibpath_var_GCJ=no
-	  ;;
-	*)
-	  hardcode_direct_GCJ=yes
-	  export_dynamic_flag_spec_GCJ='${wl}-E'
-
-	  # hardcode_minus_L: Not really in the search PATH,
-	  # but as the default location of the library.
-	  hardcode_minus_L_GCJ=yes
-	  ;;
-	esac
-      fi
-      ;;
-
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      link_all_deplibs_GCJ=yes
-      ;;
-
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-	archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-	archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    newsos6)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_direct_GCJ=yes
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    openbsd*)
-      if test -f /usr/libexec/ld.so; then
-	hardcode_direct_GCJ=yes
-	hardcode_shlibpath_var_GCJ=no
-	if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	  archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec_GCJ='${wl}-E'
-	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec_GCJ='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
-	     ;;
-	  esac
-        fi
-      else
-	ld_shlibs_GCJ=no
-      fi
-      ;;
-
-    os2*)
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_minus_L_GCJ=yes
-      allow_undefined_flag_GCJ=unsupported
-      archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
-
-    osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      hardcode_libdir_separator_GCJ=:
-      ;;
-
-    osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
-      else
-	allow_undefined_flag_GCJ=' -expect_unresolved \*'
-	archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-	$LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
-	# Both c and cxx compiler support -rpath directly
-	hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
-      fi
-      hardcode_libdir_separator_GCJ=:
-      ;;
-
-    solaris*)
-      no_undefined_flag_GCJ=' -z text'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-	  $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-	wlarc=''
-	archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-  	$LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-R$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      case $host_os in
-      solaris2.[0-5] | solaris2.[0-5].*) ;;
-      *)
-	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
-	# but is careful enough not to reorder.
- 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
-	else
-	  whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
-	fi
-	;;
-      esac
-      link_all_deplibs_GCJ=yes
-      ;;
-
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-	# Use $CC to link under sequent, because it throws in some extra .o
-	# files that make .init and .fini sections work.
-	archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_direct_GCJ=yes
-      hardcode_minus_L_GCJ=yes
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    sysv4)
-      case $host_vendor in
-	sni)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=yes # is this really true???
-	;;
-	siemens)
-	  ## LD is ld it makes a PLAMLIB
-	  ## CC just makes a GrossModule.
-	  archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-	  reload_cmds_GCJ='$CC -r -o $output$reload_objs'
-	  hardcode_direct_GCJ=no
-        ;;
-	motorola)
-	  archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	  hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
-	;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    sysv4.3*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_shlibpath_var_GCJ=no
-      export_dynamic_flag_spec_GCJ='-Bexport'
-      ;;
-
-    sysv4*MP*)
-      if test -d /usr/nec; then
-	archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-	hardcode_shlibpath_var_GCJ=no
-	runpath_var=LD_RUN_PATH
-	hardcode_runpath_var=yes
-	ld_shlibs_GCJ=yes
-      fi
-      ;;
-
-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_GCJ='${wl}-z,text'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
-      # link with -lc, and that would cause any symbols used from libc to
-      # always be unresolved, which means just about no library would
-      # ever link correctly.  If we're not using GNU ld we use -z text
-      # though, which does catch some bad symbols but isn't as heavy-handed
-      # as -z defs.
-      no_undefined_flag_GCJ='${wl}-z,text'
-      allow_undefined_flag_GCJ='${wl}-z,nodefs'
-      archive_cmds_need_lc_GCJ=no
-      hardcode_shlibpath_var_GCJ=no
-      hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
-      hardcode_libdir_separator_GCJ=':'
-      link_all_deplibs_GCJ=yes
-      export_dynamic_flag_spec_GCJ='${wl}-Bexport'
-      runpath_var='LD_RUN_PATH'
-
-      if test "$GCC" = yes; then
-	archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-	archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      ;;
-
-    uts4*)
-      archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      hardcode_libdir_flag_spec_GCJ='-L$libdir'
-      hardcode_shlibpath_var_GCJ=no
-      ;;
-
-    *)
-      ld_shlibs_GCJ=no
-      ;;
-    esac
-  fi
-
-{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
-echo "${ECHO_T}$ld_shlibs_GCJ" >&6; }
-test "$ld_shlibs_GCJ" = no && can_build_shared=no
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc_GCJ" in
-x|xyes)
-  # Assume -lc should be added
-  archive_cmds_need_lc_GCJ=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $archive_cmds_GCJ in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
-echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; }
-      $rm conftest*
-      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
-      if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$lt_prog_compiler_wl_GCJ
-	pic_flag=$lt_prog_compiler_pic_GCJ
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
-        allow_undefined_flag_GCJ=
-        if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
-  (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-        then
-	  archive_cmds_need_lc_GCJ=no
-        else
-	  archive_cmds_need_lc_GCJ=yes
-        fi
-        allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
-echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; }
-      ;;
-    esac
-  fi
-  ;;
-esac
-
-{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
-echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; }
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
-
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
-
-aix[4-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[01] | aix4.[01].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-	:
-      else
-	can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
-
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
-
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
-
-bsdi[45]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
-
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
-
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
-
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
-      ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-      ;;
-    esac
-    ;;
-
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
-
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
-
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
-
-freebsd1*)
-  dynamic_linker=no
-  ;;
-
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
-  else
-    case $host_os in
-    freebsd[123]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
-  fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[01]* | freebsdelf3.[01]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
-  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  *) # from 4.6 on, and DragonFly
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
-
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
-
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-interix[3-9]*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
-  esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
-    ;;
-  *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
-    ;;
-  esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
   # This implies no fast_install, which is unacceptable.
   # Some rework will be needed to allow for fast_install
   # before this can be enabled.
@@ -19515,7 +15860,7 @@ linux* | k*bsd*-gnu)
 
   # Append ld.so.conf contents to the search path
   if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ 	]*hwcap[ 	]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
@@ -19532,7 +15877,7 @@ netbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
@@ -19553,14 +15898,16 @@ newsos6)
   shlibpath_overrides_runpath=yes
   ;;
 
-nto-qnx*)
-  version_type=linux
+*nto* | *qnx*)
+  version_type=qnx
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
   ;;
 
 openbsd*)
@@ -19569,13 +15916,13 @@ openbsd*)
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
   esac
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
     case $host_os in
       openbsd2.[89] | openbsd2.[89].*)
 	shlibpath_overrides_runpath=no
@@ -19647,7 +15994,6 @@ sysv4 | sysv4.3*)
     sni)
       shlibpath_overrides_runpath=no
       need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
       runpath_var=LD_RUN_PATH
       ;;
     siemens)
@@ -19678,13 +16024,12 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
   if test "$with_gnu_ld" = yes; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
-    shlibpath_overrides_runpath=no
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    shlibpath_overrides_runpath=yes
     case $host_os in
       sco3.2v5*)
         sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
@@ -19694,6 +16039,17 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
   sys_lib_dlsearch_path_spec='/usr/lib'
   ;;
 
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
 uts4*)
   version_type=linux
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -19705,967 +16061,113 @@ uts4*)
   dynamic_linker=no
   ;;
 esac
-{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-echo "${ECHO_T}$dynamic_linker" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
 test "$dynamic_linker" = no && can_build_shared=no
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
-fi
-
-sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
-fi
-
-sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
 if test "$GCC" = yes; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; }
-hardcode_action_GCJ=
-if test -n "$hardcode_libdir_flag_spec_GCJ" || \
-   test -n "$runpath_var_GCJ" || \
-   test "X$hardcode_automatic_GCJ" = "Xyes" ; then
-
-  # We can hardcode non-existant directories.
-  if test "$hardcode_direct_GCJ" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
-     test "$hardcode_minus_L_GCJ" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action_GCJ=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action_GCJ=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action_GCJ=unsupported
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
 fi
-{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
-echo "${ECHO_T}$hardcode_action_GCJ" >&6; }
-
-if test "$hardcode_action_GCJ" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
 fi
 
 
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_GCJ \
-    CC_GCJ \
-    LD_GCJ \
-    lt_prog_compiler_wl_GCJ \
-    lt_prog_compiler_pic_GCJ \
-    lt_prog_compiler_static_GCJ \
-    lt_prog_compiler_no_builtin_flag_GCJ \
-    export_dynamic_flag_spec_GCJ \
-    thread_safe_flag_spec_GCJ \
-    whole_archive_flag_spec_GCJ \
-    enable_shared_with_static_runtimes_GCJ \
-    old_archive_cmds_GCJ \
-    old_archive_from_new_cmds_GCJ \
-    predep_objects_GCJ \
-    postdep_objects_GCJ \
-    predeps_GCJ \
-    postdeps_GCJ \
-    compiler_lib_search_path_GCJ \
-    compiler_lib_search_dirs_GCJ \
-    archive_cmds_GCJ \
-    archive_expsym_cmds_GCJ \
-    postinstall_cmds_GCJ \
-    postuninstall_cmds_GCJ \
-    old_archive_from_expsyms_cmds_GCJ \
-    allow_undefined_flag_GCJ \
-    no_undefined_flag_GCJ \
-    export_symbols_cmds_GCJ \
-    hardcode_libdir_flag_spec_GCJ \
-    hardcode_libdir_flag_spec_ld_GCJ \
-    hardcode_libdir_separator_GCJ \
-    hardcode_automatic_GCJ \
-    module_cmds_GCJ \
-    module_expsym_cmds_GCJ \
-    lt_cv_prog_compiler_c_o_GCJ \
-    fix_srcfile_path_GCJ \
-    exclude_expsyms_GCJ \
-    include_expsyms_GCJ; do
-
-    case $var in
-    old_archive_cmds_GCJ | \
-    old_archive_from_new_cmds_GCJ | \
-    archive_cmds_GCJ | \
-    archive_expsym_cmds_GCJ | \
-    module_cmds_GCJ | \
-    module_expsym_cmds_GCJ | \
-    old_archive_from_expsyms_cmds_GCJ | \
-    export_symbols_cmds_GCJ | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
 
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
 
-cfgfile="$ofile"
 
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
 
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
 
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
 
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
 
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_GCJ
 
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
 
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
 
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
 
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
 
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
 
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
 
-# A C compiler.
-LTCC=$lt_LTCC
 
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
 
-# A language-specific compiler.
-CC=$lt_compiler_GCJ
 
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_GCJ
 
-# An ERE matcher.
-EGREP=$lt_EGREP
 
-# The linker used to build libraries.
-LD=$lt_LD_GCJ
 
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
 
-# A BSD-compatible nm program.
-NM=$lt_NM
 
-# A symbol stripping program
-STRIP=$lt_STRIP
 
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
 
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
 
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
 
-# Used on cygwin: assembler.
-AS="$AS"
 
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
 
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
 
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_GCJ
 
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_GCJ
-pic_mode=$pic_mode
 
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
 
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_GCJ
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_GCJ
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_GCJ
-archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_GCJ
-module_expsym_cmds=$lt_module_expsym_cmds_GCJ
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_GCJ
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_GCJ
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_GCJ
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_GCJ
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_GCJ
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_GCJ
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_GCJ
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_GCJ
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_GCJ
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_GCJ
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_GCJ
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_GCJ
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_GCJ
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_GCJ
-
-# ### END LIBTOOL TAG CONFIG: $tagname
-
-__EOF__
 
+    { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
   fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
 fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
 
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-	else
-	  tagname=""
-	fi
-	;;
-
-      RC)
-
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-objext_RC=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm -r conftest*
-
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-compiler_RC=$CC
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-
-lt_cv_prog_compiler_c_o_RC=yes
-
-# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    compiler_RC \
-    CC_RC \
-    LD_RC \
-    lt_prog_compiler_wl_RC \
-    lt_prog_compiler_pic_RC \
-    lt_prog_compiler_static_RC \
-    lt_prog_compiler_no_builtin_flag_RC \
-    export_dynamic_flag_spec_RC \
-    thread_safe_flag_spec_RC \
-    whole_archive_flag_spec_RC \
-    enable_shared_with_static_runtimes_RC \
-    old_archive_cmds_RC \
-    old_archive_from_new_cmds_RC \
-    predep_objects_RC \
-    postdep_objects_RC \
-    predeps_RC \
-    postdeps_RC \
-    compiler_lib_search_path_RC \
-    compiler_lib_search_dirs_RC \
-    archive_cmds_RC \
-    archive_expsym_cmds_RC \
-    postinstall_cmds_RC \
-    postuninstall_cmds_RC \
-    old_archive_from_expsyms_cmds_RC \
-    allow_undefined_flag_RC \
-    no_undefined_flag_RC \
-    export_symbols_cmds_RC \
-    hardcode_libdir_flag_spec_RC \
-    hardcode_libdir_flag_spec_ld_RC \
-    hardcode_libdir_separator_RC \
-    hardcode_automatic_RC \
-    module_cmds_RC \
-    module_expsym_cmds_RC \
-    lt_cv_prog_compiler_c_o_RC \
-    fix_srcfile_path_RC \
-    exclude_expsyms_RC \
-    include_expsyms_RC; do
-
-    case $var in
-    old_archive_cmds_RC | \
-    old_archive_from_new_cmds_RC | \
-    archive_cmds_RC | \
-    archive_expsym_cmds_RC | \
-    module_cmds_RC | \
-    module_expsym_cmds_RC | \
-    old_archive_from_expsyms_cmds_RC | \
-    export_symbols_cmds_RC | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
-
-  case $lt_echo in
-  *'\$0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
-    ;;
-  esac
-
-cfgfile="$ofile"
-
-  cat <<__EOF__ >> "$cfgfile"
-# ### BEGIN LIBTOOL TAG CONFIG: $tagname
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc_RC
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_LTCFLAGS
-
-# A language-specific compiler.
-CC=$lt_compiler_RC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC_RC
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_LD_RC
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl_RC
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic_RC
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static_RC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds_RC
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds_RC
-archive_expsym_cmds=$lt_archive_expsym_cmds_RC
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_module_cmds_RC
-module_expsym_cmds=$lt_module_expsym_cmds_RC
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_predep_objects_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_postdep_objects_RC
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_predeps_RC
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_postdeps_RC
-
-# The directories searched by this compiler when creating a shared
-# library
-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_compiler_lib_search_path_RC
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag_RC
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag_RC
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action_RC
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct_RC
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L_RC
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$hardcode_automatic_RC
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs_RC
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols_RC
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds_RC
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
 
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms_RC
 
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms_RC
 
-# ### END LIBTOOL TAG CONFIG: $tagname
 
-__EOF__
 
 
-else
-  # If there is no Makefile yet, we rely on a make rule to execute
-  # `config.status --recheck' to rerun these tests and create the
-  # libtool script then.
-  ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
-  if test -f "$ltmain_in"; then
-    test -f Makefile && make "$ltmain"
-  fi
-fi
+  fi # test -n "$compiler"
 
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -20673,48 +16175,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
-
-	;;
-
-      *)
-	{ { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
-echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
-   { (exit 1); exit 1; }; }
-	;;
-      esac
-
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
-
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
-echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-fi
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-# Prevent multiple expansion
-
-
 
 
 
@@ -20727,10 +16187,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
+        ac_config_commands="$ac_config_commands libtool"
 
 
 
 
+# Only expand once:
 
 
 
@@ -20739,17 +16201,17 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 #
 ac_is_dgux=no
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  { echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6; }
+  { $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
+$as_echo_n "checking for sys/dg_sys_info.h... " >&6; }
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
+$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; }
 else
   # Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5
-echo $ECHO_N "checking sys/dg_sys_info.h usability... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5
+$as_echo_n "checking sys/dg_sys_info.h usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20765,32 +16227,33 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
 # Is the header present?
-{ echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5
-echo $ECHO_N "checking sys/dg_sys_info.h presence... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5
+$as_echo_n "checking sys/dg_sys_info.h presence... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20804,51 +16267,52 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } >/dev/null && {
 	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
 	 test ! -s conftest.err
        }; then
   ac_header_preproc=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
 
 rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&2;}
     ( cat <<\_ASBOX
 ## -------------------------------- ##
 ## Report this to Hans_Boehm at hp.com ##
@@ -20857,18 +16321,18 @@ _ASBOX
      ) | sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-{ echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
+$as_echo_n "checking for sys/dg_sys_info.h... " >&6; }
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_cv_header_sys_dg_sys_info_h=$ac_header_preproc
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
+$as_echo "$ac_cv_header_sys_dg_sys_info_h" >&6; }
 
 fi
-if test $ac_cv_header_sys_dg_sys_info_h = yes; then
+if test "x$ac_cv_header_sys_dg_sys_info_h" = x""yes; then
   ac_is_dgux=yes;
 fi
 
@@ -20911,18 +16375,18 @@ if false; then
 
 fi
 
-{ echo "$as_me:$LINENO: checking for threads package to use" >&5
-echo $ECHO_N "checking for threads package to use... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $THREADS" >&5
-echo "${ECHO_T}$THREADS" >&6; }
+{ $as_echo "$as_me:$LINENO: checking for threads package to use" >&5
+$as_echo_n "checking for threads package to use... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $THREADS" >&5
+$as_echo "$THREADS" >&6; }
 
-{ echo "$as_me:$LINENO: checking whether Solaris gcc optimization fix is necessary" >&5
-echo $ECHO_N "checking whether Solaris gcc optimization fix is necessary... $ECHO_C" >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether Solaris gcc optimization fix is necessary" >&5
+$as_echo_n "checking whether Solaris gcc optimization fix is necessary... " >&6; }
 case "$host" in
  *aix*)
     if test "$GCC" = yes; then
-       { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+       { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
        new_CFLAGS=
        for i in $CFLAGS; do
 	  case "$i" in
@@ -20935,12 +16399,12 @@ echo "${ECHO_T}yes" >&6; }
        done
        CFLAGS="$new_CFLAGS"
     else
-       { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+       { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
     fi
     ;;
- *) { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; } ;;
+ *) { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; } ;;
 esac
 
 MY_CFLAGS="$CFLAGS"
@@ -20995,8 +16459,8 @@ UNWINDLIBS=
 # Check whether --enable-full-debug was given.
 if test "${enable_full_debug+set}" = set; then
   enableval=$enable_full_debug;  if test "$enable_full_debug" = "yes"; then
-    { echo "$as_me:$LINENO: WARNING: \"Should define GC_DEBUG and use debug alloc. in clients.\"" >&5
-echo "$as_me: WARNING: \"Should define GC_DEBUG and use debug alloc. in clients.\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: \"Should define GC_DEBUG and use debug alloc. in clients.\"" >&5
+$as_echo "$as_me: WARNING: \"Should define GC_DEBUG and use debug alloc. in clients.\"" >&2;}
     cat >>confdefs.h <<\_ACEOF
 #define KEEP_BACK_PTRS 1
 _ACEOF
@@ -21015,10 +16479,10 @@ _ACEOF
 #define SAVE_CALL_COUNT 8
 _ACEOF
 
-        { echo "$as_me:$LINENO: checking for backtrace in -lunwind" >&5
-echo $ECHO_N "checking for backtrace in -lunwind... $ECHO_C" >&6; }
+        { $as_echo "$as_me:$LINENO: checking for backtrace in -lunwind" >&5
+$as_echo_n "checking for backtrace in -lunwind... " >&6; }
 if test "${ac_cv_lib_unwind_backtrace+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lunwind  $LIBS"
@@ -21050,41 +16514,45 @@ case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && {
 	 test -z "$ac_c_werror_flag" ||
 	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext &&
-       $as_test_x conftest$ac_exeext; then
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_unwind_backtrace=yes
 else
-  echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 	ac_cv_lib_unwind_backtrace=no
 fi
 
+rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_unwind_backtrace" >&5
-echo "${ECHO_T}$ac_cv_lib_unwind_backtrace" >&6; }
-if test $ac_cv_lib_unwind_backtrace = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_unwind_backtrace" >&5
+$as_echo "$ac_cv_lib_unwind_backtrace" >&6; }
+if test "x$ac_cv_lib_unwind_backtrace" = x""yes; then
 
 	  cat >>confdefs.h <<\_ACEOF
 #define GC_HAVE_BUILTIN_BACKTRACE 1
 _ACEOF
 
 	  UNWINDLIBS=-lunwind
-	  { echo "$as_me:$LINENO: WARNING: \"Client code may need to link against libunwind.\"" >&5
-echo "$as_me: WARNING: \"Client code may need to link against libunwind.\"" >&2;}
+	  { $as_echo "$as_me:$LINENO: WARNING: \"Client code may need to link against libunwind.\"" >&5
+$as_echo "$as_me: WARNING: \"Client code may need to link against libunwind.\"" >&2;}
 
 fi
 
@@ -21094,8 +16562,8 @@ fi
 #define MAKE_BACK_GRAPH 1
 _ACEOF
 
-	{ echo "$as_me:$LINENO: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&5
-echo "$as_me: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&2;}
+	{ $as_echo "$as_me:$LINENO: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&5
+$as_echo "$as_me: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&2;}
 	cat >>confdefs.h <<\_ACEOF
 #define SAVE_CALL_COUNT 8
 _ACEOF
@@ -21205,11 +16673,12 @@ _ACEOF
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
       *) $as_unset $ac_var ;;
       esac ;;
     esac
@@ -21242,12 +16711,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -21264,6 +16733,12 @@ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 # take arguments), then branch to the quote section.  Otherwise,
 # look for a macro that doesn't take arguments.
 ac_script='
+:mline
+/\\$/{
+ N
+ s,\\\n,,
+ b mline
+}
 t clear
 :clear
 s/^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*([^)]*)\)[	 ]*\(.*\)/-D\1=\2/g
@@ -21293,7 +16768,7 @@ ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
   ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -21305,75 +16780,83 @@ LTLIBOBJS=$ac_ltlibobjs
 
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"AMDEP\" was never defined.
+$as_echo "$as_me: error: conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
+$as_echo "$as_me: error: conditional \"am__fastdepCCAS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+$as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${POWERPC_DARWIN_TRUE}" && test -z "${POWERPC_DARWIN_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"POWERPC_DARWIN\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"POWERPC_DARWIN\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"POWERPC_DARWIN\" was never defined.
+$as_echo "$as_me: error: conditional \"POWERPC_DARWIN\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${COMPILER_XLC_TRUE}" && test -z "${COMPILER_XLC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"COMPILER_XLC\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"COMPILER_XLC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"COMPILER_XLC\" was never defined.
+$as_echo "$as_me: error: conditional \"COMPILER_XLC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${CPLUSPLUS_TRUE}" && test -z "${CPLUSPLUS_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"CPLUSPLUS\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"CPLUSPLUS\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"CPLUSPLUS\" was never defined.
+$as_echo "$as_me: error: conditional \"CPLUSPLUS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test -z "${USE_LIBDIR_TRUE}" && test -z "${USE_LIBDIR_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"USE_LIBDIR\" was never defined.
+  { { $as_echo "$as_me:$LINENO: error: conditional \"USE_LIBDIR\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"USE_LIBDIR\" was never defined.
+$as_echo "$as_me: error: conditional \"USE_LIBDIR\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
 
 : ${CONFIG_STATUS=./config.status}
+ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
-echo "$as_me: creating $CONFIG_STATUS" >&6;}
-cat >$CONFIG_STATUS <<_ACEOF
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -21386,7 +16869,7 @@ ac_cs_silent=false
 SHELL=\${CONFIG_SHELL-$SHELL}
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
@@ -21396,7 +16879,7 @@ DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
@@ -21418,17 +16901,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
   else
-    PATH_SEPARATOR=:
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
   fi
-  rm -f conf$$.sh
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
 fi
 
 # Support unset when possible.
@@ -21444,8 +16955,6 @@ fi
 # there to prevent editors from complaining about space-tab.
 # (If _AS_PATH_WALK were called with IFS unset, it would disable word
 # splitting by setting IFS to empty value.)
-as_nl='
-'
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
@@ -21468,7 +16977,7 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   { (exit 1); exit 1; }
 fi
 
@@ -21481,17 +16990,10 @@ PS2='> '
 PS4='+ '
 
 # NLS nuisances.
-for as_var in \
-  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
-  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
-  LC_TELEPHONE LC_TIME
-do
-  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
-    eval $as_var=C; export $as_var
-  else
-    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-  fi
-done
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
 
 # Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
@@ -21513,7 +17015,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
 	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-echo X/"$0" |
+$as_echo X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
 	    s//\1/
 	    q
@@ -21564,7 +17066,7 @@ $as_unset CDPATH
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
@@ -21592,7 +17094,6 @@ case `echo -n x` in
 *)
   ECHO_N='-n';;
 esac
-
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -21605,19 +17106,22 @@ if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
 else
   rm -f conf$$.dir
-  mkdir conf$$.dir
-fi
-echo >conf$$.file
-if ln -s conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s='ln -s'
-  # ... but there are two gotchas:
-  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-  # In both cases, we have to default to `cp -p'.
-  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
     as_ln_s='cp -p'
-elif ln conf$$.file conf$$ 2>/dev/null; then
-  as_ln_s=ln
+  fi
 else
   as_ln_s='cp -p'
 fi
@@ -21642,10 +17146,10 @@ else
   as_test_x='
     eval sh -c '\''
       if test -d "$1"; then
-        test -d "$1/.";
+	test -d "$1/.";
       else
 	case $1 in
-        -*)set "./$1";;
+	-*)set "./$1";;
 	esac;
 	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
@@ -21668,7 +17172,7 @@ exec 6>&1
 # values after options handling.
 ac_log="
 This file was extended by libgc-mono $as_me 6.6, which was
-generated by GNU Autoconf 2.61.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -21681,27 +17185,34 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q`
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<_ACEOF
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
 config_commands="$ac_config_commands"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
 
-Usage: $0 [OPTIONS] [FILE]...
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-  -q, --quiet      do not print progress messages
+  -q, --quiet, --silent
+                   do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
-  --file=FILE[:TEMPLATE]
-		   instantiate the configuration file FILE
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
 
 Configuration files:
 $config_files
@@ -21712,13 +17223,13 @@ $config_commands
 Report bugs to <bug-autoconf at gnu.org>."
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
 libgc-mono config.status 6.6
-configured by $0, generated by GNU Autoconf 2.61,
-  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright (C) 2008 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -21726,11 +17237,12 @@ ac_pwd='$ac_pwd'
 srcdir='$srcdir'
 INSTALL='$INSTALL'
 MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If no file are specified by the user, then we need to provide default
-# value.  By we need to know if files were specified by the user.
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
 ac_need_defaults=:
 while test $# != 0
 do
@@ -21752,21 +17264,24 @@ do
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    echo "$ac_cs_version"; exit ;;
+    $as_echo "$ac_cs_version"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
-    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h |  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit ;;
+    $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { echo "$as_me: error: unrecognized option: $1
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
 Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
@@ -21785,31 +17300,384 @@ if $ac_cs_silent; then
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  CONFIG_SHELL=$SHELL
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
-  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  exec "\$@"
 fi
 
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 exec 5>>config.log
 {
   echo
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  echo "$ac_log"
+  $as_echo "$ac_log"
 } >&5
 
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`'
+macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`'
+enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`'
+host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`'
+host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`'
+host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`'
+build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`'
+build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`'
+build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`'
+SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`'
+Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`'
+GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`'
+EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`'
+FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`'
+LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`'
+NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`'
+LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`'
+exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`'
+AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`'
+compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`'
+GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`'
+SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`'
+ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`'
+need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`'
+LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`'
+libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`'
+need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`'
+version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`'
+striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`'
+predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`'
+postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+SHELL \
+ECHO \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+fix_srcfile_path_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX; do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\$0 --fallback-echo"')  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\`
+  ;;
+esac
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
 srcdir=${srcdir}
 host=${host}
 CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
@@ -21819,21 +17687,22 @@ DEFS="$DEFS"
 
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 
 # Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
   case $ac_config_target in
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
     "include/private/Makefile") CONFIG_FILES="$CONFIG_FILES include/private/Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
 
-  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
-echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
@@ -21873,241 +17742,144 @@ $debug ||
   (umask 077 && mkdir "$tmp")
 } ||
 {
-   echo "$me: cannot create a temporary directory in ." >&2
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-#
-# Set up the sed scripts for CONFIG_FILES section.
-#
-
-# No need to generate the scripts if there are no CONFIG_FILES.
-# This happens for instance when ./config.status config.h
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
 if test -n "$CONFIG_FILES"; then
 
-_ACEOF
-
 
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-am__isrc!$am__isrc$ac_delim
-CYGPATH_W!$CYGPATH_W$ac_delim
-PACKAGE!$PACKAGE$ac_delim
-VERSION!$VERSION$ac_delim
-ACLOCAL!$ACLOCAL$ac_delim
-AUTOCONF!$AUTOCONF$ac_delim
-AUTOMAKE!$AUTOMAKE$ac_delim
-AUTOHEADER!$AUTOHEADER$ac_delim
-MAKEINFO!$MAKEINFO$ac_delim
-install_sh!$install_sh$ac_delim
-STRIP!$STRIP$ac_delim
-INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
-mkdir_p!$mkdir_p$ac_delim
-AWK!$AWK$ac_delim
-SET_MAKE!$SET_MAKE$ac_delim
-am__leading_dot!$am__leading_dot$ac_delim
-AMTAR!$AMTAR$ac_delim
-am__tar!$am__tar$ac_delim
-am__untar!$am__untar$ac_delim
-build!$build$ac_delim
-build_cpu!$build_cpu$ac_delim
-build_vendor!$build_vendor$ac_delim
-build_os!$build_os$ac_delim
-host!$host$ac_delim
-host_cpu!$host_cpu$ac_delim
-host_vendor!$host_vendor$ac_delim
-host_os!$host_os$ac_delim
-GC_VERSION!$GC_VERSION$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-DEPDIR!$DEPDIR$ac_delim
-am__include!$am__include$ac_delim
-am__quote!$am__quote$ac_delim
-AMDEP_TRUE!$AMDEP_TRUE$ac_delim
-AMDEP_FALSE!$AMDEP_FALSE$ac_delim
-AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
-CCDEPMODE!$CCDEPMODE$ac_delim
-am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
-am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
-CXX!$CXX$ac_delim
-CXXFLAGS!$CXXFLAGS$ac_delim
-ac_ct_CXX!$ac_ct_CXX$ac_delim
-CXXDEPMODE!$CXXDEPMODE$ac_delim
-am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
-am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
-CCAS!$CCAS$ac_delim
-CCASFLAGS!$CCASFLAGS$ac_delim
-CCASDEPMODE!$CCASDEPMODE$ac_delim
-am__fastdepCCAS_TRUE!$am__fastdepCCAS_TRUE$ac_delim
-am__fastdepCCAS_FALSE!$am__fastdepCCAS_FALSE$ac_delim
-AR!$AR$ac_delim
-RANLIB!$RANLIB$ac_delim
-_ACEOF
-
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
-    break
-  elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
-   { (exit 1); exit 1; }; }
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
+ac_cr='
'
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
 fi
 
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-CEOF$ac_eof
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
-  cat >conf$$subs.sed <<_ACEOF
-MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
-MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
-MAINT!$MAINT$ac_delim
-GC_CFLAGS!$GC_CFLAGS$ac_delim
-THREADDLLIBS!$THREADDLLIBS$ac_delim
-POWERPC_DARWIN_TRUE!$POWERPC_DARWIN_TRUE$ac_delim
-POWERPC_DARWIN_FALSE!$POWERPC_DARWIN_FALSE$ac_delim
-COMPILER_XLC_TRUE!$COMPILER_XLC_TRUE$ac_delim
-COMPILER_XLC_FALSE!$COMPILER_XLC_FALSE$ac_delim
-EXTRA_TEST_LIBS!$EXTRA_TEST_LIBS$ac_delim
-target_all!$target_all$ac_delim
-CPLUSPLUS_TRUE!$CPLUSPLUS_TRUE$ac_delim
-CPLUSPLUS_FALSE!$CPLUSPLUS_FALSE$ac_delim
-INCLUDES!$INCLUDES$ac_delim
-CXXINCLUDES!$CXXINCLUDES$ac_delim
-addobjs!$addobjs$ac_delim
-addincludes!$addincludes$ac_delim
-addlibs!$addlibs$ac_delim
-addtests!$addtests$ac_delim
-SED!$SED$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-LN_S!$LN_S$ac_delim
-ECHO!$ECHO$ac_delim
-DSYMUTIL!$DSYMUTIL$ac_delim
-NMEDIT!$NMEDIT$ac_delim
-CPP!$CPP$ac_delim
-CXXCPP!$CXXCPP$ac_delim
-F77!$F77$ac_delim
-FFLAGS!$FFLAGS$ac_delim
-ac_ct_F77!$ac_ct_F77$ac_delim
-LIBTOOL!$LIBTOOL$ac_delim
-MY_CFLAGS!$MY_CFLAGS$ac_delim
-UNWINDLIBS!$UNWINDLIBS$ac_delim
-USE_LIBDIR_TRUE!$USE_LIBDIR_TRUE$ac_delim
-USE_LIBDIR_FALSE!$USE_LIBDIR_FALSE$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
+  . ./conf$$subs.sh ||
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 38; then
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
    { (exit 1); exit 1; }; }
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
 done
+rm -f conf$$subs.sh
 
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
-  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
-  ac_eof=`expr $ac_eof + 1`
-fi
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\).*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\).*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
 
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACAWK
 _ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
 _ACEOF
 
-
 # VPATH may cause trouble with some makes, so we remove $(srcdir),
 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
@@ -22123,19 +17895,21 @@ s/^[^=]*=[	 ]*$//
 }'
 fi
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_FILES"
 
 
-for ac_tag in  :F $CONFIG_FILES      :C $CONFIG_COMMANDS
+eval set X "  :F $CONFIG_FILES      :C $CONFIG_COMMANDS"
+shift
+for ac_tag
 do
   case $ac_tag in
   :[FHLC]) ac_mode=$ac_tag; continue;;
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
    { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
@@ -22164,26 +17938,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;}
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
    { (exit 1); exit 1; }; };;
       esac
-      ac_file_inputs="$ac_file_inputs $ac_f"
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
-    configure_input="Generated from "`IFS=:
-	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
     fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin";;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
     esac
     ;;
   esac
@@ -22193,7 +17979,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$ac_file" : 'X\(//\)[^/]' \| \
 	 X"$ac_file" : 'X\(//\)$' \| \
 	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$ac_file" |
+$as_echo X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -22219,7 +18005,7 @@ echo X"$ac_file" |
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -22228,7 +18014,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -22249,17 +18035,17 @@ echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
   ac_builddir=.
 
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -22304,12 +18090,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
   esac
 _ACEOF
 
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
 
-case `sed -n '/datarootdir/ {
+ac_sed_dataroot='
+/datarootdir/ {
   p
   q
 }
@@ -22318,13 +18105,14 @@ case `sed -n '/datarootdir/ {
 /@infodir@/p
 /@localedir@/p
 /@mandir@/p
-' $ac_file_inputs` in
+'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_datarootdir_hack='
   s&@datadir@&$datadir&g
   s&@docdir@&$docdir&g
@@ -22338,15 +18126,16 @@ _ACEOF
 # Neutralize VPATH when `$srcdir' = `.'.
 # Shell code in configure.ac might set extrasub.
 # FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF
-  sed "$ac_vpsub
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
 $extrasub
 _ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
+s|@configure_input@|$ac_sed_conf_input|;t t
 s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
 s&@srcdir@&$ac_srcdir&;t t
 s&@abs_srcdir@&$ac_abs_srcdir&;t t
 s&@top_srcdir@&$ac_top_srcdir&;t t
@@ -22357,26 +18146,33 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 s&@MKDIR_P@&$ac_MKDIR_P&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined." >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out"; rm -f "$tmp/out";;
-  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
-  esac
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  esac \
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
  ;;
 
 
-  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
-echo "$as_me: executing $ac_file commands" >&6;}
+  :C)  { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
  ;;
   esac
 
@@ -22398,7 +18194,7 @@ $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
 	 X"$mf" : 'X\(//\)$' \| \
 	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$mf" |
+$as_echo X"$mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -22442,7 +18238,7 @@ $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
 	 X"$file" : 'X\(//\)$' \| \
 	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$file" |
+$as_echo X"$file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -22468,7 +18264,7 @@ echo X"$file" |
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -22477,7 +18273,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$as_dir" : 'X\(//\)[^/]' \| \
 	 X"$as_dir" : 'X\(//\)$' \| \
 	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-echo X"$as_dir" |
+$as_echo X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
 	    s//\1/
 	    q
@@ -22498,14 +18294,816 @@ echo X"$as_dir" |
       test -d "$as_dir" && break
     done
     test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
     # echo "creating $dirpart/$file"
     echo '# dummy' > "$dirpart/$file"
   done
 done
  ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that does not interpret backslashes.
+ECHO=$lt_ECHO
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
 
   esac
 done # for ac_tag
@@ -22516,6 +19114,11 @@ _ACEOF
 chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
+test $ac_write_fail = 0 ||
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+
 
 # configure is writing to config.log, and then calls config.status.
 # config.status does its own redirection, appending to config.log.
@@ -22537,4 +19140,8 @@ if test "$no_create" != yes; then
   # would make configure fail if this is the last instruction.
   $ac_cs_success || { (exit 1); exit 1; }
 fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
 
diff --git a/libgc/doc/Makefile.in b/libgc/doc/Makefile.in
index b2f06f0..b102ae0 100644
--- a/libgc/doc/Makefile.in
+++ b/libgc/doc/Makefile.in
@@ -91,15 +91,14 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GC_CFLAGS = @GC_CFLAGS@
 GC_VERSION = @GC_VERSION@
 GREP = @GREP@
@@ -109,18 +108,24 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 MY_CFLAGS = @MY_CFLAGS@
+NM = @NM@
 NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -142,7 +147,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 addincludes = @addincludes@
 addlibs = @addlibs@
 addobjs = @addobjs@
@@ -177,6 +182,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -190,6 +196,7 @@ srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 target_all = @target_all@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
diff --git a/libgc/include/Makefile.in b/libgc/include/Makefile.in
index 927c692..81b319d 100644
--- a/libgc/include/Makefile.in
+++ b/libgc/include/Makefile.in
@@ -82,15 +82,14 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GC_CFLAGS = @GC_CFLAGS@
 GC_VERSION = @GC_VERSION@
 GREP = @GREP@
@@ -100,18 +99,24 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 MY_CFLAGS = @MY_CFLAGS@
+NM = @NM@
 NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -133,7 +138,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 addincludes = @addincludes@
 addlibs = @addlibs@
 addobjs = @addobjs@
@@ -168,6 +173,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -181,6 +187,7 @@ srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 target_all = @target_all@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 noinst_HEADERS = libgc-mono-debugger.h
diff --git a/libgc/include/private/Makefile.in b/libgc/include/private/Makefile.in
index 9e540cc..68eb807 100644
--- a/libgc/include/private/Makefile.in
+++ b/libgc/include/private/Makefile.in
@@ -67,15 +67,14 @@ CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 EXTRA_TEST_LIBS = @EXTRA_TEST_LIBS@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GC_CFLAGS = @GC_CFLAGS@
 GC_VERSION = @GC_VERSION@
 GREP = @GREP@
@@ -85,18 +84,24 @@ INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
 MY_CFLAGS = @MY_CFLAGS@
+NM = @NM@
 NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -118,7 +123,7 @@ abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 addincludes = @addincludes@
 addlibs = @addlibs@
 addobjs = @addobjs@
@@ -153,6 +158,7 @@ libdir = @libdir@
 libexecdir = @libexecdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mkdir_p = @mkdir_p@
 oldincludedir = @oldincludedir@
@@ -166,6 +172,7 @@ srcdir = @srcdir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 target_all = @target_all@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = $(srcdir)/*.h
diff --git a/libgc/ltmain.sh b/libgc/ltmain.sh
old mode 100644
new mode 100755
index 27d498a..b36c4ad
--- a/libgc/ltmain.sh
+++ b/libgc/ltmain.sh
@@ -1,52 +1,83 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008  Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, but
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#     --config             show all configuration variables
+#     --debug              enable verbose shell tracing
+# -n, --dry-run            display commands without modifying any files
+#     --features           display basic configuration information and exit
+#     --mode=MODE          use operation mode MODE
+#     --preserve-dup-deps  don't remove duplicate dependency libraries
+#     --quiet, --silent    don't print informational messages
+#     --tag=TAG            use configuration variables from tag TAG
+# -v, --verbose            print informational messages (default)
+#     --version            print version information
+# -h, --help               print short or long help message
+#
+# MODE must be one of the following:
+#
+#       clean              remove files from the build directory
+#       compile            compile a source file into a libtool object
+#       execute            automatically set library path, then run a program
+#       finish             complete the installation of libtool libraries
+#       install            install libraries or executables
+#       link               create a library or an executable
+#       uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#       host-triplet:	$host
+#       shell:		$SHELL
+#       compiler:		$LTCC
+#       compiler flags:		$LTCFLAGS
+#       linker:		$LD (gnu? $with_gnu_ld)
+#       $progname:		(GNU libtool) 2.2.6
+#       automake:		$automake_version
+#       autoconf:		$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.26
-TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
 
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
@@ -60,104 +91,261 @@ fi
 BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  SP2NL='tr \040 \012'
-  NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  SP2NL='tr \100 \n'
-  NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-# NLS nuisances.
+# NLS nuisances: We save the old values to restore during execute mode.
 # Only set LANG and LC_ALL to C if already set.
 # These must not be set unconditionally because not all systems understand
 # e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-lt_env=
+lt_user_locale=
+lt_safe_locale=
 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
   eval "if test \"\${$lt_var+set}\" = set; then
-	  save_$lt_var=\$$lt_var
-	  lt_env=\"$lt_var=\$$lt_var \$lt_env\"
-	  $lt_var=C
+          save_$lt_var=\$$lt_var
+          $lt_var=C
 	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 	fi"
 done
 
-if test -n "$lt_env"; then
-  lt_env="env $lt_env"
-fi
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/opt/local/bin/gsed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
 
 # Make sure IFS has a sensible default
 lt_nl='
 '
 IFS=" 	$lt_nl"
 
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  $echo "$modename: not configured to build any kind of library" 1>&2
-  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit $EXIT_FAILURE
-fi
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
 
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+  -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
 
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
 
 # func_mktempdir [string]
 # Make a temporary directory that won't clash with other running
@@ -167,7 +355,7 @@ func_mktempdir ()
 {
     my_template="${TMPDIR-/tmp}/${1-$progname}"
 
-    if test "$run" = ":"; then
+    if test "$opt_dry_run" = ":"; then
       # Return a directory name, but don't create it in dry-run mode
       my_tmpdir="${my_template}-$$"
     else
@@ -176,486 +364,743 @@ func_mktempdir ()
       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
       if test ! -d "$my_tmpdir"; then
-	# Failing that, at least try and use $RANDOM to avoid a race
-	my_tmpdir="${my_template}-${RANDOM-0}$$"
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
-	save_mktempdir_umask=`umask`
-	umask 0077
-	$mkdir "$my_tmpdir"
-	umask $save_mktempdir_umask
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || {
-        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
-	exit $EXIT_FAILURE
-      }
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     fi
 
-    $echo "X$my_tmpdir" | $Xsed
+    $ECHO "X$my_tmpdir" | $Xsed
 }
 
 
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
 {
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 | \
-	$SED -n -e '1,100{
-		/ I /{
-			s,.*,import,
-			p
-			q
-			}
-		}'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     esac
-    ;;
-  esac
-  $echo $win32_libid_type
 }
 
 
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
 {
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	case $arg in
-	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	CC_quoted="$CC_quoted $arg"
-      done
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "X$1" | $Xsed \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	    # Double-quote args containing other shell metacharacters.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    CC_quoted="$CC_quoted $arg"
-	  done
-	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit $EXIT_FAILURE
-#        else
-#          $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
 }
 
 
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
 {
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
-    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
-      exit $EXIT_FAILURE
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
     fi
 }
 
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
 {
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-    my_status=""
-
-    $show "${rm}r $my_gentop"
-    $run ${rm}r "$my_gentop"
-    $show "$mkdir $my_gentop"
-    $run $mkdir "$my_gentop"
-    my_status=$?
-    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
-      exit $my_status
-    fi
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  extracted_serial=`expr $extracted_serial + 1`
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
 
-      $show "${rm}r $my_xdir"
-      $run ${rm}r "$my_xdir"
-      $show "$mkdir $my_xdir"
-      $run $mkdir "$my_xdir"
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $exit_status
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
       fi
-      case $host in
-      *-darwin*)
-	$show "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	if test -z "$run"; then
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
-	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
-	  if test -n "$darwin_arches"; then 
-	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	      lipo -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    ${rm}r unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd "$darwin_orig_dir"
- 	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	fi # $run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-        ;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-    done
-    func_extract_archives_result="$my_oldobjs"
+    fi
 }
-# End of Shell function definitions
-#####################################
 
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
 
-disable_libs=no
 
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
-  arg="$1"
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/# -h/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    $ECHO
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	p
+     }' < "$progpath"
+    exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1"
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
   shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell, and then maybe $ECHO will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
 
-  case $arg in
-  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
 
-  # If the previous option needs an argument, assign it.
-  if test -n "$prev"; then
-    case $prev in
-    execute_dlfiles)
-      execute_dlfiles="$execute_dlfiles $arg"
-      ;;
-    tag)
-      tagname="$arg"
-      preserve_args="${preserve_args}=$arg"
-
-      # Check whether tagname contains only valid characters
-      case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-	$echo "$progname: invalid tag name: $tagname" 1>&2
-	exit $EXIT_FAILURE
-	;;
-      esac
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
 
-      case $tagname in
-      CC)
-	# Don't test for the "default" C tag, as we know, it's there, but
-	# not specially marked.
-	;;
-      *)
-	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
-	  taglist="$taglist $tagname"
-	  # Evaluate the configuration.
-	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
-	else
-	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
-	fi
-	;;
-      esac
-      ;;
-    *)
-      eval "$prev=\$arg"
-      ;;
-    esac
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
 
-    prev=
-    prevopt=
-    continue
-  fi
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
 
-  # Have we seen a non-optional argument yet?
-  case $arg in
-  --help)
-    show_help=yes
-    ;;
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
 
-  --version)
-    echo "\
-$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
 
-Copyright (C) 2008  Free Software Foundation, Inc.
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $?
-    ;;
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
 
-  --config)
-    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
     # Now print the configurations for the tags.
     for tagname in $taglist; do
-      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
     done
-    exit $?
-    ;;
-
-  --debug)
-    $echo "$progname: enabling shell trace mode"
-    set -x
-    preserve_args="$preserve_args $arg"
-    ;;
 
-  --dry-run | -n)
-    run=:
-    ;;
+    exit $?
+}
 
-  --features)
-    $echo "host: $host"
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    $ECHO "host: $host"
     if test "$build_libtool_libs" = yes; then
-      $echo "enable shared libraries"
+      $ECHO "enable shared libraries"
     else
-      $echo "disable shared libraries"
+      $ECHO "disable shared libraries"
     fi
     if test "$build_old_libs" = yes; then
-      $echo "enable static libraries"
+      $ECHO "enable static libraries"
     else
-      $echo "disable static libraries"
+      $ECHO "disable static libraries"
     fi
+
     exit $?
-    ;;
+}
 
-  --finish) mode="finish" ;;
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
 
-  --mode) prevopt="--mode" prev=mode ;;
-  --mode=*) mode="$optarg" ;;
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
 
-  --preserve-dup-deps) duplicate_deps="yes" ;;
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
 
-  --quiet | --silent)
-    show=:
-    preserve_args="$preserve_args $arg"
-    ;;
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
 
-  --tag)
-    prevopt="--tag"
-    prev=tag
-    preserve_args="$preserve_args --tag"
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
     ;;
-  --tag=*)
-    set tag "$optarg" ${1+"$@"}
-    shift
-    prev=tag
-    preserve_args="$preserve_args --tag"
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
     ;;
-
-  -dlopen)
-    prevopt="-dlopen"
-    prev=execute_dlfiles
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
     ;;
-
-  -*)
-    $echo "$modename: unrecognized option \`$arg'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
     ;;
-
-  *)
-    nonopt="$arg"
-    break
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
     ;;
   esac
-done
 
-if test -n "$prevopt"; then
-  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-fi
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
 
-case $disable_libs in
-no) 
-  ;;
-shared)
-  build_libtool_libs=no
-  build_old_libs=yes
-  ;;
-static)
-  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-  ;;
-esac
+    case $opt in
+      --config)		func_config					;;
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
+      --debug)		preserve_args="$preserve_args $opt"
+			func_echo "enabling shell trace mode"
+			opt_debug='set -x'
+			$opt_debug
+			;;
 
-if test -z "$show_help"; then
+      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			execute_dlfiles="$execute_dlfiles $1"
+			shift
+			;;
 
-  # Infer the operation mode.
-  if test -z "$mode"; then
-    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
-    case $nonopt in
-    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
-      mode=link
-      for arg
-      do
-	case $arg in
-	-c)
-	   mode=compile
-	   break
-	   ;;
-	esac
-      done
-      ;;
-    *db | *dbx | *strace | *truss)
-      mode=execute
-      ;;
-    *install*|cp|mv)
-      mode=install
-      ;;
-    *rm)
-      mode=uninstall
+      --dry-run | -n)	opt_dry_run=:					;;
+      --features)       func_features					;;
+      --finish)		mode="finish"					;;
+
+      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			case $1 in
+			  # Valid mode arguments:
+			  clean)	;;
+			  compile)	;;
+			  execute)	;;
+			  finish)	;;
+			  install)	;;
+			  link)		;;
+			  relink)	;;
+			  uninstall)	;;
+
+			  # Catch anything else as an error
+			  *) func_error "invalid argument for $opt"
+			     exit_cmd=exit
+			     break
+			     ;;
+		        esac
+
+			mode="$1"
+			shift
+			;;
+
+      --preserve-dup-deps)
+			opt_duplicate_deps=:				;;
+
+      --quiet|--silent)	preserve_args="$preserve_args $opt"
+			opt_silent=:
+			;;
+
+      --verbose| -v)	preserve_args="$preserve_args $opt"
+			opt_silent=false
+			;;
+
+      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			preserve_args="$preserve_args $opt $1"
+			func_enable_tag "$1"	# tagname is set here
+			shift
+			;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+			func_opt_split "$opt"
+			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+			shift
+			;;
+
+      -\?|-h)		func_usage					;;
+      --help)		opt_help=:					;;
+      --version)	func_version					;;
+
+      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+
+      *)		nonopt="$opt"
+			break
+			;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
       ;;
     *)
-      # If we have no mode, but dlfiles were specified, then do execute mode.
-      test -n "$execute_dlfiles" && mode=execute
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
 
-      # Just use the default operation mode.
-      if test -z "$mode"; then
-	if test -n "$nonopt"; then
-	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-	else
-	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-	fi
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
       fi
-      ;;
-    esac
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
   fi
 
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
   # Only execute mode is allowed to have -dlopen flags.
   if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
-    $echo "$help" 1>&2
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
     exit $EXIT_FAILURE
   fi
 
   # Change the help message to a mode-specific one.
   generic_help="$help"
-  help="Try \`$modename --help --mode=$mode' for more information."
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+	func_dirname_and_basename "$1" "" "."
+	func_stripname '' '.exe' "$func_basename_result"
+	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
 
-  # These modes are in order of execution frequency so that they run quickly.
-  case $mode in
-  # libtool compile mode
-  compile)
-    modename="$modename: compile"
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_quote_for_eval "$arg"
+	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	    done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
     # Get the compilation command and the source file.
     base_compile=
     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
@@ -664,6 +1109,7 @@ if test -z "$show_help"; then
     arg_mode=normal
     libobj=
     later=
+    pie_flag=
 
     for arg
     do
@@ -684,15 +1130,18 @@ if test -z "$show_help"; then
 	# Accept any command-line options.
 	case $arg in
 	-o)
-	  if test -n "$libobj" ; then
-	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
 
-	-static | -prefer-pic | -prefer-non-pic)
+	-pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
 	  later="$later $arg"
 	  continue
 	  ;;
@@ -708,31 +1157,25 @@ if test -z "$show_help"; then
 	  ;;            #  replaced later.  I would guess that would be a bug.
 
 	-Wc,*)
-	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
 	  lastarg=
 	  save_ifs="$IFS"; IFS=','
- 	  for arg in $args; do
+	  for arg in $args; do
 	    IFS="$save_ifs"
-
-	    # Double-quote args containing other shell metacharacters.
-	    # Many Bourne shells cannot handle close brackets correctly
-	    # in scan sets, so we specify it separately.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    lastarg="$lastarg $arg"
+	    func_quote_for_eval "$arg"
+	    lastarg="$lastarg $func_quote_for_eval_result"
 	  done
 	  IFS="$save_ifs"
-	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
 
 	  # Add the arguments to base_compile.
 	  base_compile="$base_compile $lastarg"
 	  continue
 	  ;;
 
-	* )
+	*)
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
@@ -744,66 +1187,42 @@ if test -z "$show_help"; then
       esac    #  case $arg_mode
 
       # Aesthetically quote the previous argument.
-      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
-      case $lastarg in
-      # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, and some SunOS ksh mistreat backslash-escaping
-      # in scan sets (worked around with variable expansion),
-      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
-      # at all, so we specify them separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	lastarg="\"$lastarg\""
-	;;
-      esac
-
-      base_compile="$base_compile $lastarg"
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
     done # for arg
 
     case $arg_mode in
     arg)
-      $echo "$modename: you must specify an argument for -Xcompile"
-      exit $EXIT_FAILURE
+      func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_error "you must specify a target with \`-o'"
       ;;
     *)
       # Get the name of the library object.
-      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
       ;;
     esac
 
     # Recognize several different file suffixes.
     # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSifmso]'
     case $libobj in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.ii) xform=ii ;;
-    *.class) xform=class ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.[fF][09]?) xform=[fF][09]. ;;
-    *.for) xform=for ;;
-    *.java) xform=java ;;
-    *.obj) xform=obj ;;
-    *.sx) xform=sx ;;
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
     esac
 
-    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
     case $libobj in
-    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
       ;;
     esac
 
@@ -811,7 +1230,15 @@ if test -z "$show_help"; then
 
     for arg in $later; do
       case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
       -static)
+	build_libtool_libs=no
 	build_old_libs=yes
 	continue
 	;;
@@ -828,28 +1255,17 @@ if test -z "$show_help"; then
       esac
     done
 
-    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
-    case $qlibobj in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qlibobj="\"$qlibobj\"" ;;
-    esac
-    test "X$libobj" != "X$qlibobj" \
-	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
-	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
-    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$xdir" = "X$obj"; then
-      xdir=
-    else
-      xdir=$xdir/
-    fi
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
     lobj=${xdir}$objdir/$objname
 
-    if test -z "$base_compile"; then
-      $echo "$modename: you must specify a compilation command" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
     if test "$build_old_libs" = yes; then
@@ -858,12 +1274,9 @@ if test -z "$show_help"; then
       removelist="$lobj $libobj ${libobj}T"
     fi
 
-    $run $rm $removelist
-    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
     # On Cygwin there's no "real" PIC flag so we must build both object types
     case $host_os in
-    cygwin* | mingw* | pw32* | os2*)
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
       pic_mode=default
       ;;
     esac
@@ -875,10 +1288,8 @@ if test -z "$show_help"; then
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
     if test "$compiler_c_o" = no; then
-      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
-      removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     else
       output_obj=
       need_locks=no
@@ -888,13 +1299,13 @@ if test -z "$show_help"; then
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
     if test "$need_locks" = yes; then
-      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
-	$show "Waiting for $lockfile to be removed"
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
     elif test "$need_locks" = warn; then
       if test -f "$lockfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile exists and contains:
 `cat $lockfile 2>/dev/null`
 
@@ -905,34 +1316,22 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
-      $echo "$srcfile" > "$lockfile"
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
     fi
 
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
-    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
-    case $qsrcfile in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      qsrcfile="\"$qsrcfile\"" ;;
-    esac
-
-    $run $rm "$libobj" "${libobj}T"
-
-    # Create a libtool object file (analogous to a ".la" file),
-    # but don't create it if we're doing a dry run.
-    test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
     if test "$build_libtool_libs" = yes; then
@@ -946,32 +1345,19 @@ EOF
 	command="$base_compile $qsrcfile"
       fi
 
-      if test ! -d "${xdir}$objdir"; then
-	$show "$mkdir ${xdir}$objdir"
-	$run $mkdir ${xdir}$objdir
-	exit_status=$?
-	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $exit_status
-	fi
-      fi
+      func_mkdir_p "$xdir$objdir"
 
       if test -z "$output_obj"; then
 	# Place PIC objects in $objdir
 	command="$command -o $lobj"
       fi
 
-      $run $rm "$lobj" "$output_obj"
-
-      $show "$command"
-      if $run eval $lt_env "$command"; then :
-      else
-	test -n "$output_obj" && $run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
       if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -985,45 +1371,27 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed, then go on to compile the next one
       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	$show "$mv $output_obj $lobj"
-	if $run $mv $output_obj $lobj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
       fi
 
-      # Append the name of the PIC object to the libtool object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
       # Allow error messages only from the first compilation.
       if test "$suppress_opt" = yes; then
-        suppress_output=' >/dev/null 2>&1'
+	suppress_output=' >/dev/null 2>&1'
       fi
-    else
-      # No PIC object so indicate it doesn't exist in the libtool
-      # object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
     fi
 
     # Only build a position-dependent object if we build old libraries.
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
 	# Don't build PIC code
-	command="$base_compile $qsrcfile"
+	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
@@ -1033,17 +1401,12 @@ EOF
 
       # Suppress compiler output if we already did a PIC compilation.
       command="$command$suppress_output"
-      $run $rm "$obj" "$output_obj"
-      $show "$command"
-      if $run eval $lt_env "$command"; then :
-      else
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
       if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -1057,53 +1420,2620 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed
       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	$show "$mv $output_obj $obj"
-	if $run $mv $output_obj $obj; then :
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    $ECHO
+    $ECHO "Try \`$progname --help' for more information about other modes."
+
+    exit $?
+}
+
+  # Now that we've collected a possible --mode arg, show help if necessary
+  $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
 	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
 	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
       fi
+    done
 
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
 
-EOF
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
     else
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	$ECHO "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
 
-EOF
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
     fi
 
-    $run $mv "${libobj}T" "${libobj}"
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    $ECHO "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    $ECHO
+    $ECHO "If you ever happen to want to link against installed libraries"
+    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $ECHO "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $ECHO "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $ECHO "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
 
-    # Unlock the critical section if it was locked
-    if test "$need_locks" != no; then
-      $run $rm "$lockfile"
+      $ECHO "   - use the \`$flag' linker flag"
     fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $ECHO
 
+    $ECHO "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	$ECHO "pages."
+	;;
+      *)
+        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_verbose "extracting global C symbols from \`$progfile'"
+	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+	  $opt_dry_run || {
+	    eval '$ECHO ": $name " >> "$nlist"'
+	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	  }
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* )
+	    $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+	    lt_dlsym_const= ;;
+	  *osf5*)
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+	    lt_dlsym_const= ;;
+	  *)
+	    lt_dlsym_const=const ;;
+	  esac
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
     ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
 
-  # libtool link mode
-  link | relink)
-    modename="$modename: link"
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+	func_emit_wrapper_part1_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part1_arg1=$1
+	fi
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    ECHO=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$ECHO works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$ECHO will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$ECHO "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+	func_emit_wrapper_part2_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part2_arg1=$1
+	fi
+
+	$ECHO "\
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2* | *-cegcc*)
+	  $ECHO "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $ECHO "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_arg1=$1
+	fi
+
+	# split this up so that func_emit_cwrapperexe_src
+	# can call each part independently.
+	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_tmp1=`cygpath -w "$1"`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=""
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1" ; then
     case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+        func_to_host_pathlist_tmp2="$1"
+        # Once set for this call, this variable should not be
+        # reassigned. It is used in tha fallback case.
+        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+          $SED -e 's|^:*||' -e 's|:*$||'`
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+                  fi
+                fi
+              fi
+              IFS=:
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result" ; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "$SHELL $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+#  define HAVE_SETENV
+#  ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+#  endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+    va_list args;
+    va_start (args, fmt);
+    (void) vfprintf (stderr, fmt, args);
+    va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+	    func_emit_wrapper_part1 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+	    cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+	    func_emit_wrapper_part2 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+
+	    cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+
+static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
+  /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
+  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
+  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+  /* very simple arg parsing; don't want to rely on getopt */
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  printf ("%s", script_text_part1);
+	  printf ("%s", script_text_part2);
+	  return 0;
+	}
+    }
+
+  newargz = XMALLOC (char *, argc + 1);
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal ("Couldn't find %s", argv[0]);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+			  tmp_pathspec));
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+			  actual_cwrapper_path));
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+			  target_name));
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+        {
+          if (argv[i][env_set_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_set_opt_len + 1;
+              lt_opt_process_env_set (p);
+            }
+          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_set (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_set_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+        {
+          if (argv[i][env_prepend_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_prepend_opt_len + 1;
+              lt_opt_process_env_prepend (p);
+            }
+          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_prepend_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+        {
+          if (argv[i][env_append_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_append_opt_len + 1;
+              lt_opt_process_env_append (p);
+            }
+          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_append (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_append_opt);
+          continue;
+        }
+      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  for (i = 0; i < newargc; i++)
+    {
+      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal ("getcwd failed");
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+			      tmp_pathspec));
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  char *errstr = strerror (errno);
+	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal ("Could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+  const char *p;
+  int len;
+  if (!arg || !*arg)
+    return 1;
+
+  p = strchr (arg, (int)'=');
+
+  if (!p)
+    return 1;
+
+  *value = xstrdup (++p);
+
+  len = strlen (arg) - strlen (*value);
+  *name = XMALLOC (char, len);
+  strncpy (*name, arg, len-1);
+  (*name)[len - 1] = '\0';
+
+  return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+    }
+
+  lt_setenv (name, value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 0);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 1);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
       # which system we are compiling for in order to pass an extra
@@ -1121,10 +4051,10 @@ EOF
       allow_undefined=yes
       ;;
     esac
-    libtool_args="$nonopt"
+    libtool_args=$nonopt
     base_compile="$nonopt $@"
-    compile_command="$nonopt"
-    finalize_command="$nonopt"
+    compile_command=$nonopt
+    finalize_command=$nonopt
 
     compile_rpath=
     finalize_rpath=
@@ -1139,6 +4069,7 @@ EOF
     dllsearchpath=
     lib_search_path=`pwd`
     inst_prefix_dir=
+    new_inherited_linker_flags=
 
     avoid_version=no
     dlfiles=
@@ -1154,7 +4085,6 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
-    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -1168,19 +4098,25 @@ EOF
     thread_safe=no
     vinfo=
     vinfo_number=no
+    weak_libs=
     single_module="${wl}-single_module"
-
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
     for arg
     do
       case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
 	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
@@ -1214,20 +4150,16 @@ EOF
     while test "$#" -gt 0; do
       arg="$1"
       shift
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
-	;;
-      *) qarg=$arg ;;
-      esac
-      libtool_args="$libtool_args $qarg"
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
 	case $prev in
 	output)
-	  compile_command="$compile_command @OUTPUT@"
-	  finalize_command="$finalize_command @OUTPUT@"
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
 	  ;;
 	esac
 
@@ -1235,8 +4167,8 @@ EOF
 	dlfiles|dlprefiles)
 	  if test "$preload" = no; then
 	    # Add the symbol object into the linking commands.
-	    compile_command="$compile_command @SYMFILE@"
-	    finalize_command="$finalize_command @SYMFILE@"
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
 	    preload=yes
 	  fi
 	  case $arg in
@@ -1274,10 +4206,8 @@ EOF
 	  ;;
 	expsyms)
 	  export_symbols="$arg"
-	  if test ! -f "$arg"; then
-	    $echo "$modename: symbol file \`$arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
@@ -1286,18 +4216,21 @@ EOF
 	  prev=
 	  continue
 	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
 	  prev=
 	  continue
 	  ;;
-	release)
-	  release="-$arg"
+	inst_prefix)
+	  inst_prefix_dir="$arg"
 	  prev=
 	  continue
 	  ;;
@@ -1305,39 +4238,30 @@ EOF
 	  if test -f "$arg"; then
 	    save_arg=$arg
 	    moreargs=
-	    for fil in `cat $save_arg`
+	    for fil in `cat "$save_arg"`
 	    do
 #	      moreargs="$moreargs $fil"
 	      arg=$fil
 	      # A libtool-controlled object.
 
 	      # Check to see that this really is a libtool object.
-	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	      if func_lalib_unsafe_p "$arg"; then
 		pic_object=
 		non_pic_object=
 
 		# Read the .lo file
-		# If there is no directory component, then add one.
-		case $arg in
-		*/* | *\\*) . $arg ;;
-		*) . ./$arg ;;
-		esac
+		func_source "$arg"
 
-		if test -z "$pic_object" || \
+		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none && \
+		   test "$pic_object" = none &&
 		   test "$non_pic_object" = none; then
-		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-		  exit $EXIT_FAILURE
+		  func_fatal_error "cannot find name of object for \`$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
-		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		if test "X$xdir" = "X$arg"; then
-		  xdir=
-		else
-		  xdir="$xdir/"
-		fi
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
 
 		if test "$pic_object" != none; then
 		  # Prepend the subdirectory the object is found in.
@@ -1362,7 +4286,7 @@ EOF
 		  fi
 
 		  # A PIC object.
-		  libobjs="$libobjs $pic_object"
+		  func_append libobjs " $pic_object"
 		  arg="$pic_object"
 		fi
 
@@ -1372,7 +4296,7 @@ EOF
 		  non_pic_object="$xdir$non_pic_object"
 
 		  # A standard non-PIC object
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_append non_pic_objects " $non_pic_object"
 		  if test -z "$pic_object" || test "$pic_object" = none ; then
 		    arg="$non_pic_object"
 		  fi
@@ -1380,46 +4304,48 @@ EOF
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
 		  non_pic_object="$pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
-		if test -z "$run"; then
-		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-		  exit $EXIT_FAILURE
-		else
-		  # Dry-run case.
-
+		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
-		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		  if test "X$xdir" = "X$arg"; then
-		    xdir=
-		  else
-		    xdir="$xdir/"
-		  fi
-
-		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-		  libobjs="$libobjs $pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    $echo "$modename: link input file \`$save_arg' does not exist"
-	    exit $EXIT_FAILURE
+	    func_fatal_error "link input file \`$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
 	rpath | xrpath)
 	  # We need an absolute path.
 	  case $arg in
 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
 	  *)
-	    $echo "$modename: only absolute run-paths are allowed" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
 	  if test "$prev" = rpath; then
@@ -1436,39 +4362,37 @@ EOF
 	  prev=
 	  continue
 	  ;;
-	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
+	shrext)
+	  shrext_cmds="$arg"
 	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
 	  continue
 	  ;;
-	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
+	weak)
+	  weak_libs="$weak_libs $arg"
 	  prev=
-	  compile_command="$compile_command $wl$qarg"
-	  finalize_command="$finalize_command $wl$qarg"
 	  continue
 	  ;;
 	xcclinker)
 	  linker_flags="$linker_flags $qarg"
 	  compiler_flags="$compiler_flags $qarg"
 	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
-	shrext)
-  	  shrext_cmds="$arg"
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
 	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
-	darwin_framework|darwin_framework_skip)
-	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
 	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
 	  continue
 	  ;;
 	*)
@@ -1484,16 +4408,16 @@ EOF
       case $arg in
       -all-static)
 	if test -n "$link_static_flag"; then
-	  compile_command="$compile_command $link_static_flag"
-	  finalize_command="$finalize_command $link_static_flag"
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
 	fi
 	continue
 	;;
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
-	continue
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -1518,8 +4442,7 @@ EOF
 
       -export-symbols | -export-symbols-regex)
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  $echo "$modename: more than one -exported-symbols argument is not allowed"
-	  exit $EXIT_FAILURE
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
 	if test "X$arg" = "X-export-symbols"; then
 	  prev=expsyms
@@ -1529,15 +4452,8 @@ EOF
 	continue
 	;;
 
-      -framework|-arch|-isysroot)
-	case " $CC " in
-	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
-		prev=darwin_framework_skip ;;
-	  *) compiler_flags="$compiler_flags $arg"
-	     prev=darwin_framework ;;
-	esac
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+      -framework)
+	prev=framework
 	continue
 	;;
 
@@ -1551,25 +4467,30 @@ EOF
       -L[A-Z][A-Z]*:*)
 	case $with_gcc/$host in
 	no/*-*-irix* | /*-*-irix*)
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
 	  ;;
 	esac
 	continue
 	;;
 
       -L*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	func_stripname '-L' '' "$arg"
+	dir=$func_stripname_result
+	if test -z "$dir"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
 	*)
 	  absdir=`cd "$dir" && pwd`
-	  if test -z "$absdir"; then
-	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    absdir="$dir"
-	    notinst_path="$notinst_path $dir"
-	  fi
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
 	  dir="$absdir"
 	  ;;
 	esac
@@ -1581,14 +4502,16 @@ EOF
 	  ;;
 	esac
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
 	  *) dllsearchpath="$dllsearchpath:$dir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
 	  *) dllsearchpath="$dllsearchpath:$testbindir";;
 	  esac
 	  ;;
@@ -1599,7 +4522,7 @@ EOF
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
@@ -1613,7 +4536,7 @@ EOF
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
@@ -1637,20 +4560,30 @@ EOF
 	continue
 	;;
 
+      -module)
+	module=yes
+	continue
+	;;
+
       # Tru64 UNIX uses -model [arg] to determine the layout of C++
       # classes, name mangling, and exception handling.
-      -model)
-	compile_command="$compile_command $arg"
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
 	compiler_flags="$compiler_flags $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
 	prev=xcompiler
 	continue
 	;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 	compiler_flags="$compiler_flags $arg"
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	esac
 	continue
 	;;
 
@@ -1659,44 +4592,6 @@ EOF
 	continue
 	;;
 
-      -module)
-	module=yes
-	continue
-	;;
-
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m* pass through architecture-specific compiler args for GCC
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-      # -F/path gives path to uninstalled frameworks, gcc on darwin
-      # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
-
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-        compile_command="$compile_command $arg"
-        finalize_command="$finalize_command $arg"
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
       -no-fast-install)
 	fast_install=no
 	continue
@@ -1704,11 +4599,11 @@ EOF
 
       -no-install)
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
-	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -1749,13 +4644,13 @@ EOF
 	;;
 
       -R*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
 	*)
-	  $echo "$modename: only absolute run-paths are allowed" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "only absolute run-paths are allowed"
 	  ;;
 	esac
 	case "$xrpath " in
@@ -1765,6 +4660,16 @@ EOF
 	continue
 	;;
 
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
       -static | -static-libtool-libs)
 	# The effects of -static are defined in a previous loop.
 	# We used to do the same as -all-static on platforms that
@@ -1783,47 +4688,49 @@ EOF
 	prev=vinfo
 	continue
 	;;
+
       -version-number)
 	prev=vinfo
 	vinfo_number=yes
 	continue
 	;;
 
+      -weak)
+        prev=weak
+	continue
+	;;
+
       -Wc,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
 	arg=
 	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
 	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $flag"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
 	;;
 
       -Wl,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
 	arg=
 	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
 	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $wl$flag"
-	  linker_flags="$linker_flags $flag"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+	  linker_flags="$linker_flags $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
 	;;
 
       -Xcompiler)
@@ -1841,16 +4748,36 @@ EOF
 	continue
 	;;
 
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
       # Some other compiler flag.
       -* | +*)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
 	;;
 
       *.$objext)
@@ -1862,32 +4789,23 @@ EOF
 	# A libtool-controlled object.
 
 	# Check to see that this really is a libtool object.
-	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	if func_lalib_unsafe_p "$arg"; then
 	  pic_object=
 	  non_pic_object=
 
 	  # Read the .lo file
-	  # If there is no directory component, then add one.
-	  case $arg in
-	  */* | *\\*) . $arg ;;
-	  *) . ./$arg ;;
-	  esac
+	  func_source "$arg"
 
-	  if test -z "$pic_object" || \
+	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none && \
+	     test "$pic_object" = none &&
 	     test "$non_pic_object" = none; then
-	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "cannot find name of object for \`$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
-	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	  if test "X$xdir" = "X$arg"; then
-	    xdir=
- 	  else
-	    xdir="$xdir/"
-	  fi
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
 
 	  if test "$pic_object" != none; then
 	    # Prepend the subdirectory the object is found in.
@@ -1912,7 +4830,7 @@ EOF
 	    fi
 
 	    # A PIC object.
-	    libobjs="$libobjs $pic_object"
+	    func_append libobjs " $pic_object"
 	    arg="$pic_object"
 	  fi
 
@@ -1922,7 +4840,7 @@ EOF
 	    non_pic_object="$xdir$non_pic_object"
 
 	    # A standard non-PIC object
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_append non_pic_objects " $non_pic_object"
 	    if test -z "$pic_object" || test "$pic_object" = none ; then
 	      arg="$non_pic_object"
 	    fi
@@ -1930,28 +4848,22 @@ EOF
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
 	    non_pic_object="$pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
-	  if test -z "$run"; then
-	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-	    exit $EXIT_FAILURE
-	  else
-	    # Dry-run case.
-
+	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
-	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	    if test "X$xdir" = "X$arg"; then
-	      xdir=
-	    else
-	      xdir="$xdir/"
-	    fi
-
-	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-	    libobjs="$libobjs $pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -1984,70 +4896,51 @@ EOF
       *)
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
 	;;
       esac # arg
 
       # Now actually substitute the argument into the commands.
       if test -n "$arg"; then
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
       fi
     done # argument parsing loop
 
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
 
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
-      compile_command="$compile_command $arg"
-      finalize_command="$finalize_command $arg"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
     fi
 
     oldlibs=
     # calculate the name of the file, without its directory
-    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    func_basename "$output"
+    outputname="$func_basename_result"
     libobjs_save="$libobjs"
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
-    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$output_objdir" = "X$output"; then
-      output_objdir="$objdir"
-    else
-      output_objdir="$output_objdir/$objdir"
-    fi
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
     # Create the object directory.
-    if test ! -d "$output_objdir"; then
-      $show "$mkdir $output_objdir"
-      $run $mkdir $output_objdir
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $exit_status
-      fi
-    fi
+    func_mkdir_p "$output_objdir"
 
     # Determine the type of output
     case $output in
     "")
-      $echo "$modename: you must specify an output file" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_help "you must specify an output file"
       ;;
     *.$libext) linkmode=oldlib ;;
     *.lo | *.$objext) linkmode=obj ;;
@@ -2055,22 +4948,13 @@ EOF
     *) linkmode=prog ;; # Anything else should be a program.
     esac
 
-    case $host in
-    *cygwin* | *mingw* | *pw32*)
-      # don't eliminate duplications in $postdeps and $predeps
-      duplicate_compiler_generated_deps=yes
-      ;;
-    *)
-      duplicate_compiler_generated_deps=$duplicate_deps
-      ;;
-    esac
     specialdeplibs=
 
     libs=
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if test "X$duplicate_deps" = "Xyes" ; then
+      if $opt_duplicate_deps ; then
 	case "$libs " in
 	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	esac
@@ -2085,7 +4969,7 @@ EOF
       # $postdeps and mark them as special (i.e., whose duplicates are
       # not to be eliminated).
       pre_post_deps=
-      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+      if $opt_duplicate_compiler_generated_deps; then
 	for pre_post_dep in $predeps $postdeps; do
 	  case "$pre_post_deps " in
 	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
@@ -2101,15 +4985,16 @@ EOF
     newlib_search_path=
     need_relink=no # whether we're linking any uninstalled libtool libraries
     notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
     case $linkmode in
     lib)
-	passes="conv link"
+	passes="conv dlpreopen link"
 	for file in $dlfiles $dlprefiles; do
 	  case $file in
 	  *.la) ;;
 	  *)
-	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -2125,7 +5010,20 @@ EOF
     *)  passes="conv"
 	;;
     esac
+
     for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
       if test "$linkmode,$pass" = "lib,link" ||
 	 test "$linkmode,$pass" = "prog,scan"; then
 	libs="$deplibs"
@@ -2138,11 +5036,33 @@ EOF
 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  case $lib in
+	  *.la)	func_source "$lib" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) deplibs="$deplibs $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
       if test "$pass" = dlopen; then
 	# Collect dlpreopened libraries
 	save_deplibs="$deplibs"
 	deplibs=
       fi
+
       for deplib in $libs; do
 	lib=
 	found=no
@@ -2153,15 +5073,22 @@ EOF
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    compiler_flags="$compiler_flags $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
 	  fi
 	  continue
 	  ;;
 	-l*)
 	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    func_warning "\`-l' is ignored for archives/objects"
 	    continue
 	  fi
-	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
 	  if test "$linkmode" = lib; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
@@ -2197,21 +5124,17 @@ EOF
 	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
-		if (${SED} -e '2q' $lib |
-                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		if func_lalib_p "$lib"; then
 		  library_names=
 		  old_library=
-		  case $lib in
-		  */* | *\\*) . $lib ;;
-		  *) . ./$lib ;;
-		  esac
+		  func_source "$lib"
 		  for l in $old_library $library_names; do
 		    ll="$l"
 		  done
 		  if test "X$ll" = "X$old_library" ; then # only static version available
 		    found=no
-		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-		    test "X$ladir" = "X$lib" && ladir="."
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
 		    lib=$ladir/$old_library
 		    if test "$linkmode,$pass" = "prog,link"; then
 		      compile_deplibs="$deplib $compile_deplibs"
@@ -2223,19 +5146,35 @@ EOF
 		    continue
 		  fi
 		fi
-	        ;;
+		;;
 	      *) ;;
 	      esac
 	    fi
 	  fi
 	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
 	-L*)
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
 	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
 	    ;;
 	  prog)
 	    if test "$pass" = conv; then
@@ -2248,17 +5187,19 @@ EOF
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
 	    ;;
 	  *)
-	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    func_warning "\`-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
 	  if test "$pass" = link; then
-	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    func_stripname '-R' '' "$deplib"
+	    dir=$func_stripname_result
 	    # Make sure the xrpath contains only unique directories.
 	    case "$xrpath " in
 	    *" $dir "*) ;;
@@ -2276,35 +5217,41 @@ EOF
 	  fi
 	  case $linkmode in
 	  lib)
-	    valid_a_lib=no
-	    case $deplibs_check_method in
-	      match_pattern*)
-		set dummy $deplibs_check_method
-	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-		if eval $echo \"$deplib\" 2>/dev/null \
-		    | $SED 10q \
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		  valid_a_lib=yes
-		fi
+		    valid_a_lib=yes
+		  fi
 		;;
-	      pass_all)
-		valid_a_lib=yes
+		pass_all)
+		  valid_a_lib=yes
 		;;
-            esac
-	    if test "$valid_a_lib" != yes; then
-	      $echo
-	      $echo "*** Warning: Trying to link with static lib archive $deplib."
-	      $echo "*** I have the capability to make that library automatically link in when"
-	      $echo "*** you link to this library.  But I can only do this if you have a"
-	      $echo "*** shared version of the library, which you do not appear to have"
-	      $echo "*** because the file extensions .$libext of this argument makes me believe"
-	      $echo "*** that it is just a static archive that I should not used here."
-	    else
-	      $echo
-	      $echo "*** Warning: Linking the shared library $output against the"
-	      $echo "*** static library $deplib is not portable!"
-	      deplibs="$deplib $deplibs"
-	    fi
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		$ECHO
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
+		$ECHO "*** that it is just a static archive that I should not use here."
+	      else
+		$ECHO
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
 	    continue
 	    ;;
 	  prog)
@@ -2339,21 +5286,18 @@ EOF
 	  continue
 	  ;;
 	esac # case $deplib
+
 	if test "$found" = yes || test -f "$lib"; then :
 	else
-	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
 	fi
 
 	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
 
-	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$ladir" = "X$lib" && ladir="."
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
 
 	dlname=
 	dlopen=
@@ -2361,6 +5305,7 @@ EOF
 	libdir=
 	library_names=
 	old_library=
+	inherited_linker_flags=
 	# If the library was installed with an old release of libtool,
 	# it will not redefine variables installed, or shouldnotlink
 	installed=yes
@@ -2369,11 +5314,19 @@ EOF
 
 
 	# Read the .la file
-	case $lib in
-	*/* | *\\*) . $lib ;;
-	*) . ./$lib ;;
-	esac
-
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 	if test "$linkmode,$pass" = "lib,link" ||
 	   test "$linkmode,$pass" = "prog,scan" ||
 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -2386,26 +5339,24 @@ EOF
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	      exit $EXIT_FAILURE
+	      func_fatal_error "cannot find name of link library for \`$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    convenience="$convenience $ladir/$objdir/$old_library"
 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-              if test "X$duplicate_deps" = "Xyes" ; then
-	        case "$tmp_libs " in
-	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	        esac
-              fi
-	      tmp_libs="$tmp_libs $deplib"
-	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
 	  continue
 	fi # $pass = conv
 
@@ -2416,15 +5367,13 @@ EOF
 	  linklib="$l"
 	done
 	if test -z "$linklib"; then
-	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot find name of link library for \`$lib'"
 	fi
 
 	# This library was specified with -dlopen.
 	if test "$pass" = dlopen; then
 	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
 	  fi
 	  if test -z "$dlname" ||
 	     test "$dlopen_support" != yes ||
@@ -2446,18 +5395,19 @@ EOF
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
-	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
 	    abs_ladir="$ladir"
 	  fi
 	  ;;
 	esac
-	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	func_basename "$lib"
+	laname="$func_basename_result"
 
 	# Find the relevant object directory and library name.
 	if test "X$installed" = Xyes; then
 	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    func_warning "library \`$lib' was moved."
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    libdir="$abs_ladir"
@@ -2479,18 +5429,22 @@ EOF
 	    notinst_path="$notinst_path $abs_ladir"
 	  fi
 	fi # $installed = yes
-	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
 	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 	  fi
 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
 	  # are required to link).
 	  if test -n "$old_library"; then
 	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	    # Keep a list of preopened convenience libraries to check
+	    # that they are being used correctly in the link pass.
+	    test -z "$libdir" && \
+		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
 	  # Otherwise, use the dlname, so that lt_dlopen finds it.
 	  elif test -n "$dlname"; then
 	    newdlprefiles="$newdlprefiles $dir/$dlname"
@@ -2526,7 +5480,9 @@ EOF
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    case $deplib in
-	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    -L*) func_stripname '-L' '' "$deplib"
+	         newlib_search_path="$newlib_search_path $func_stripname_result"
+		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
 	    if test "$linkalldeplibs" = yes; then
@@ -2536,7 +5492,7 @@ EOF
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if test "X$duplicate_deps" = "Xyes" ; then
+	    if $opt_duplicate_deps ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	      esac
@@ -2549,15 +5505,14 @@ EOF
 	if test "$linkmode,$pass" = "prog,link"; then
 	  if test -n "$library_names" &&
 	     { { test "$prefer_static_libs" = no ||
-		 test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
 	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath " in
-	      *" $dir "*) ;;
-	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $absdir" ;;
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) temp_rpath="$temp_rpath$absdir:" ;;
 	      esac
 	    fi
 
@@ -2595,27 +5550,43 @@ EOF
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	if test "$use_static_libs" = built && test "$installed" = yes; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
 	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  if test "$installed" = no; then
-	    notinst_deplibs="$notinst_deplibs $lib"
-	    need_relink=yes
-	  fi
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
 	  # This is a shared library
 
-	  # Warn about portability, can't link against -module's on
-	  # some systems (darwin)
-	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
-	    $echo
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    $ECHO
 	    if test "$linkmode" = prog; then
-	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
-	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
-	    $echo "*** $linklib is not portable!"
+	    $ECHO "*** $linklib is not portable!"
 	  fi
 	  if test "$linkmode" = lib &&
 	     test "$hardcode_into_libs" = yes; then
@@ -2645,17 +5616,19 @@ EOF
 	  if test -n "$old_archive_from_expsyms_cmds"; then
 	    # figure out the soname
 	    set dummy $library_names
-	    realname="$2"
-	    shift; shift
-	    libname=`eval \\$echo \"$libname_spec\"`
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
 	      soname="$dlname"
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw*)
-		major=`expr $current - $age`
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
 		versuffix="-$major"
 		;;
 	      esac
@@ -2666,36 +5639,22 @@ EOF
 
 	    # Make a new name for the extract_expsyms_cmds to use
 	    soroot="$soname"
-	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
-	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      $show "extracting exported symbol list from \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$extract_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      $show "generating import library for \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$old_archive_from_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
 	    dir=$output_objdir
@@ -2717,17 +5676,21 @@ EOF
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
 		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
-		    # if the lib is a module then we can not link against
-		    # it, someone is ignoring the new warnings I added
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-                      $EGREP ": [^:]* bundle" >/dev/null ; then
-		      $echo "** Warning, lib $linklib is a module, not a shared library"
-		      if test -z "$old_library" ; then
-		        $echo
-		        $echo "** And there doesn't seem to be a static archive available"
-		        $echo "** The link will probably fail, sorry"
-		      else
-		        add="$dir/$old_library"
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  $ECHO
+			  $ECHO "*** And there doesn't seem to be a static archive available"
+			  $ECHO "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
 		      fi
 		    fi
 		esac
@@ -2745,7 +5708,8 @@ EOF
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes; then
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
 		add_dir="-L$dir"
@@ -2769,8 +5733,7 @@ EOF
 	    esac
 
 	    if test "$lib_linked" != yes; then
-	      $echo "$modename: configuration error: unsupported hardcode properties"
-	      exit $EXIT_FAILURE
+	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
 	    if test -n "$add_shlibpath"; then
@@ -2785,8 +5748,8 @@ EOF
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes && \
-		 test "$hardcode_minus_L" != yes && \
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
 		 test "$hardcode_shlibpath_var" = yes; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
@@ -2801,7 +5764,8 @@ EOF
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes; then
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
 	      add="$libdir/$linklib"
 	    elif test "$hardcode_minus_L" = yes; then
 	      add_dir="-L$libdir"
@@ -2815,9 +5779,9 @@ EOF
 	    elif test "$hardcode_automatic" = yes; then
 	      if test -n "$inst_prefix_dir" &&
 		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-	        add="$inst_prefix_dir$libdir/$linklib"
+		add="$inst_prefix_dir$libdir/$linklib"
 	      else
-	        add="$libdir/$linklib"
+		add="$libdir/$linklib"
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
@@ -2861,21 +5825,21 @@ EOF
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
-	    $echo
-	    $echo "*** Warning: This system can not link to static lib archive $lib."
-	    $echo "*** I have the capability to make that library automatically link in when"
-	    $echo "*** you link to this library.  But I can only do this if you have a"
-	    $echo "*** shared version of the library, which you do not appear to have."
+	    $ECHO
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** I have the capability to make that library automatically link in when"
+	    $ECHO "*** you link to this library.  But I can only do this if you have a"
+	    $ECHO "*** shared version of the library, which you do not appear to have."
 	    if test "$module" = yes; then
-	      $echo "*** But as you try to build a module library, libtool will still create "
-	      $echo "*** a static module, that should work as long as the dlopening application"
-	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      $ECHO "*** But as you try to build a module library, libtool will still create "
+	      $ECHO "*** a static module, that should work as long as the dlopening application"
+	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
-		$echo
-		$echo "*** However, this would only work if libtool was able to extract symbol"
-		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$echo "*** not find such a program.  So, this module is probably useless."
-		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		$ECHO
+		$ECHO "*** However, this would only work if libtool was able to extract symbol"
+		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$ECHO "*** not find such a program.  So, this module is probably useless."
+		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 	      fi
 	      if test "$build_old_libs" = no; then
 		build_libtool_libs=module
@@ -2899,7 +5863,8 @@ EOF
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
 	      case $libdir in
-	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
 		   case " $xrpath " in
 		   *" $temp_xrpath "*) ;;
 		   *) xrpath="$xrpath $temp_xrpath";;
@@ -2917,7 +5882,7 @@ EOF
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    newdependency_libs="$deplib $newdependency_libs"
-	    if test "X$duplicate_deps" = "Xyes" ; then
+	    if $opt_duplicate_deps ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	      esac
@@ -2931,94 +5896,71 @@ EOF
 	      case $deplib in
 	      -L*) path="$deplib" ;;
 	      *.la)
-		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
-		test "X$dir" = "X$deplib" && dir="."
+	        func_dirname "$deplib" "" "."
+		dir="$func_dirname_result"
 		# We need an absolute path.
 		case $dir in
 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    func_warning "cannot determine absolute directory name of \`$dir'"
 		    absdir="$dir"
 		  fi
 		  ;;
 		esac
-		if grep "^installed=no" $deplib > /dev/null; then
-		  path="$absdir/$objdir"
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  if test -z "$libdir"; then
-		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		    exit $EXIT_FAILURE
-		  fi
-		  if test "$absdir" != "$libdir"; then
-		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
-		  fi
-		  path="$absdir"
-		fi
-		depdepl=
+		if $GREP "^installed=no" $deplib > /dev/null; then
 		case $host in
 		*-*-darwin*)
-		  # we do not want to link against static libs,
-		  # but need to link against shared
+		  depdepl=
 		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  if test -n "$deplibrary_names" ; then
 		    for tmp in $deplibrary_names ; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$deplibdir/$depdepl" ; then
-		      depdepl="$deplibdir/$depdepl"
-	      	    elif test -f "$path/$depdepl" ; then
-		      depdepl="$path/$depdepl"
-		    else
-		      # Can't find it, oh well...
-		      depdepl=
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
 		    fi
-		    # do not add paths which are already there
-		    case " $newlib_search_path " in
-		    *" $path "*) ;;
-		    *) newlib_search_path="$newlib_search_path $path";;
-		    esac
 		  fi
-		  path=""
 		  ;;
 		*)
-		  path="-L$path"
-		  ;;
-		esac
-		;;
-	      -l*)
-		case $host in
-		*-*-darwin*)
-		  # Again, we only want to link against shared libraries
-		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-		  for tmp in $newlib_search_path ; do
-		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
-		      eval depdepl="$tmp/lib$tmp_libs.dylib"
-		      break
-		    fi
-		  done
-		  path=""
+		  path="-L$absdir/$objdir"
 		  ;;
-		*) continue ;;
 		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
 		;;
-	      *) continue ;;
 	      esac
 	      case " $deplibs " in
 	      *" $path "*) ;;
 	      *) deplibs="$path $deplibs" ;;
 	      esac
-	      case " $deplibs " in
-	      *" $depdepl "*) ;;
-	      *) deplibs="$depdepl $deplibs" ;;
-	      esac
 	    done
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
       dependency_libs="$newdependency_libs"
       if test "$pass" = dlpreopen; then
 	# Link the dlpreopened libraries before other libraries
@@ -3117,39 +6059,36 @@ EOF
     done # for pass
     if test "$linkmode" = prog; then
       dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
       dlprefiles="$newdlprefiles"
     fi
 
     case $linkmode in
     oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
       esac
 
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
-      fi
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
 
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
-      fi
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
 
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
 
-      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
-      fi
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
@@ -3161,48 +6100,48 @@ EOF
       # Make sure we only generate libraries of the form `libNAME.la'.
       case $outputname in
       lib*)
-	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
 	eval shared_ext=\"$shrext_cmds\"
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	if test "$module" = no; then
-	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
 	if test "$need_lib_prefix" != no; then
 	  # Add the "lib" prefix for modules if required
-	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
 	  eval shared_ext=\"$shrext_cmds\"
 	  eval libname=\"$libname_spec\"
 	else
-	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
 	fi
 	;;
       esac
 
       if test -n "$objs"; then
 	if test "$deplibs_check_method" != pass_all; then
-	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 	else
-	  $echo
-	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
-	  $echo "*** objects $objs is not portable!"
+	  $ECHO
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
 	  libobjs="$libobjs $objs"
 	fi
       fi
 
-      if test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
-      fi
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
-      if test "$#" -gt 2; then
-	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
-      fi
-      install_libdir="$2"
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
 
       oldlibs=
       if test -z "$rpath"; then
@@ -3216,25 +6155,21 @@ EOF
 	  build_old_libs=yes
 	fi
 
-	if test -n "$vinfo"; then
-	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
-	fi
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
 
-	if test -n "$release"; then
-	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
-	fi
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
 	save_ifs="$IFS"; IFS=':'
 	set dummy $vinfo 0 0 0
+	shift
 	IFS="$save_ifs"
 
-	if test -n "$8"; then
-	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -3242,9 +6177,9 @@ EOF
 
 	case $vinfo_number in
 	yes)
-	  number_major="$2"
-	  number_minor="$3"
-	  number_revision="$4"
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
@@ -3254,7 +6189,8 @@ EOF
 	  #
 	  case $version_type in
 	  darwin|linux|osf|windows|none)
-	    current=`expr $number_major + $number_minor`
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_revision"
 	    ;;
@@ -3264,7 +6200,8 @@ EOF
 	    age="0"
 	    ;;
 	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor`
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_minor"
 	    lt_irix_increment=no
@@ -3272,9 +6209,9 @@ EOF
 	  esac
 	  ;;
 	no)
-	  current="$2"
-	  revision="$3"
-	  age="$4"
+	  current="$1"
+	  revision="$2"
+	  age="$3"
 	  ;;
 	esac
 
@@ -3282,34 +6219,30 @@ EOF
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -3322,10 +6255,12 @@ EOF
 	darwin)
 	  # Like Linux, but with the current version available in
 	  # verstring for coding it into the library header
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
 	  # Darwin ld doesn't like 0 for these options...
-	  minor_current=`expr $current + 1`
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
 	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 	  ;;
@@ -3337,15 +6272,17 @@ EOF
 
 	freebsd-elf)
 	  major=".$current"
-	  versuffix=".$current";
+	  versuffix=".$current"
 	  ;;
 
 	irix | nonstopux)
 	  if test "X$lt_irix_increment" = "Xno"; then
-	    major=`expr $current - $age`
+	    func_arith $current - $age
 	  else
-	    major=`expr $current - $age + 1`
+	    func_arith $current - $age + 1
 	  fi
+	  major=$func_arith_result
+
 	  case $version_type in
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
@@ -3355,8 +6292,10 @@ EOF
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
 	  while test "$loop" -ne 0; do
-	    iface=`expr $revision - $loop`
-	    loop=`expr $loop - 1`
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
 	    verstring="$verstring_prefix$major.$iface:$verstring"
 	  done
 
@@ -3366,20 +6305,24 @@ EOF
 	  ;;
 
 	linux)
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
 	  ;;
 
 	osf)
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix=".$current.$age.$revision"
 	  verstring="$current.$age.$revision"
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
 	  while test "$loop" -ne 0; do
-	    iface=`expr $current - $loop`
-	    loop=`expr $loop - 1`
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
 	    verstring="$verstring:${iface}.0"
 	  done
 
@@ -3387,6 +6330,11 @@ EOF
 	  verstring="$verstring:${current}.0"
 	  ;;
 
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
 	sunos)
 	  major=".$current"
 	  versuffix=".$current.$revision"
@@ -3395,14 +6343,13 @@ EOF
 	windows)
 	  # Use '-' rather than '.', since we only want one
 	  # extension on DOS 8.3 filesystems.
-	  major=`expr $current - $age`
+	  func_arith $current - $age
+	  major=$func_arith_result
 	  versuffix="-$major"
 	  ;;
 
 	*)
-	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
-	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_configuration "unknown library version type \`$version_type'"
 	  ;;
 	esac
 
@@ -3436,7 +6383,7 @@ EOF
 	# Check to see if the archive will have undefined symbols.
 	if test "$allow_undefined" = yes; then
 	  if test "$allow_undefined_flag" = unsupported; then
-	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    func_warning "undefined symbols not allowed in $host shared libraries"
 	    build_libtool_libs=no
 	    build_old_libs=yes
 	  fi
@@ -3444,21 +6391,26 @@ EOF
 	  # Don't allow undefined symbols.
 	  allow_undefined_flag="$no_undefined_flag"
 	fi
+
       fi
 
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
       if test "$mode" != relink; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
-	tempremovelist=`$echo "$output_objdir/*"`
+	tempremovelist=`$ECHO "$output_objdir/*"`
 	for p in $tempremovelist; do
 	  case $p in
-	    *.$objext)
+	    *.$objext | *.gcno)
 	       ;;
 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
 	       if test "X$precious_files_regex" != "X"; then
-	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-	         then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
 		   continue
 		 fi
 	       fi
@@ -3467,10 +6419,8 @@ EOF
 	    *) ;;
 	  esac
 	done
-	if test -n "$removelist"; then
-	  $show "${rm}r $removelist"
-	  $run ${rm}r $removelist
-	fi
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
       fi
 
       # Now set the variables for building old libraries.
@@ -3478,14 +6428,14 @@ EOF
 	oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
       #for path in $notinst_path; do
-      #	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-      #	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-      #	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
       #done
 
       if test -n "$xrpath"; then
@@ -3526,12 +6476,12 @@ EOF
       if test "$build_libtool_libs" = yes; then
 	if test -n "$rpath"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
 	    # these systems don't actually have a c library (as such)!
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -3545,7 +6495,7 @@ EOF
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
 	    ;;
- 	  *)
+	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test "$build_libtool_need_lc" = "yes"; then
 	      deplibs="$deplibs -lc"
@@ -3582,17 +6532,18 @@ EOF
 	  # limits. Maybe even breaks it.  We compile a program, linking it
 	  # against the deplibs as a proxy for the library.  Then we can check
 	  # whether they linked in statically or dynamically with ldd.
-	  $rm conftest.c
+	  $opt_dry_run || $RM conftest.c
 	  cat > conftest.c <<EOF
 	  int main() { return 0; }
 EOF
-	  $rm conftest
+	  $opt_dry_run || $RM conftest
 	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
@@ -3600,37 +6551,40 @@ EOF
 		    i=""
 		    ;;
 		  esac
-	        fi
+		fi
 		if test -n "$i" ; then
-		  libname=`eval \\$echo \"$libname_spec\"`
-		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		  set dummy $deplib_matches
-		  deplib_match=$2
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		    newdeplibs="$newdeplibs $i"
 		  else
 		    droppeddeps=yes
-		    $echo
-		    $echo "*** Warning: dynamic linker does not accept needed library $i."
-		    $echo "*** I have the capability to make that library automatically link in when"
-		    $echo "*** you link to this library.  But I can only do this if you have a"
-		    $echo "*** shared version of the library, which I believe you do not have"
-		    $echo "*** because a test_compile did reveal that the linker did not use it for"
-		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		    $ECHO
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    $ECHO "*** I have the capability to make that library automatically link in when"
+		    $ECHO "*** you link to this library.  But I can only do this if you have a"
+		    $ECHO "*** shared version of the library, which I believe you do not have"
+		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
 		  fi
 		fi
-	      else
+		;;
+	      *)
 		newdeplibs="$newdeplibs $i"
-	      fi
+		;;
+	      esac
 	    done
 	  else
 	    # Error occurred in the first compile.  Let's try to salvage
 	    # the situation: Compile a separate program for each library.
 	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
-		$rm conftest
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3642,44 +6596,47 @@ EOF
 		    esac
 		  fi
 		  if test -n "$i" ; then
-		    libname=`eval \\$echo \"$libname_spec\"`
-		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		    set dummy $deplib_matches
-		    deplib_match=$2
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		      newdeplibs="$newdeplibs $i"
 		    else
 		      droppeddeps=yes
-		      $echo
-		      $echo "*** Warning: dynamic linker does not accept needed library $i."
-		      $echo "*** I have the capability to make that library automatically link in when"
-		      $echo "*** you link to this library.  But I can only do this if you have a"
-		      $echo "*** shared version of the library, which you do not appear to have"
-		      $echo "*** because a test_compile did reveal that the linker did not use this one"
-		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		      $ECHO
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      $ECHO "*** I have the capability to make that library automatically link in when"
+		      $ECHO "*** you link to this library.  But I can only do this if you have a"
+		      $ECHO "*** shared version of the library, which you do not appear to have"
+		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
 		    fi
 		  fi
 		else
 		  droppeddeps=yes
-		  $echo
-		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $echo "*** make it link in!  You will probably need to install it or some"
-		  $echo "*** library that it depends on before this library will be fully"
-		  $echo "*** functional.  Installing it before continuing would be even better."
+		  $ECHO
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $ECHO "*** make it link in!  You will probably need to install it or some"
+		  $ECHO "*** library that it depends on before this library will be fully"
+		  $ECHO "*** functional.  Installing it before continuing would be even better."
 		fi
-	      else
+		;;
+	      *)
 		newdeplibs="$newdeplibs $i"
-	      fi
+		;;
+	      esac
 	    done
 	  fi
 	  ;;
 	file_magic*)
-	  set dummy $deplibs_check_method
-	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-            if test "$name" != "" && test  "$name" != "0"; then
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
@@ -3689,13 +6646,13 @@ EOF
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
+		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null \
-			 | grep " -> " >/dev/null; then
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
 			continue
 		      fi
 		      # The statement above tries to avoid entering an
@@ -3708,12 +6665,12 @@ EOF
 			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 			case $potliblink in
 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
-			 | ${SED} 10q \
-			 | $EGREP "$file_magic_regex" > /dev/null; then
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
 			newdeplibs="$newdeplibs $a_deplib"
 			a_deplib=""
 			break 2
@@ -3723,32 +6680,35 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a file magic. Last file checked: $potlib"
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
 		fi
 	      fi
-	    else
+	      ;;
+	    *)
 	      # Add a -L argument.
 	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
+	      ;;
+	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	match_pattern*)
-	  set dummy $deplibs_check_method
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-	    if test -n "$name" && test "$name" != "0"; then
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
@@ -3758,14 +6718,13 @@ EOF
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
+		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval $echo \"$potent_lib\" 2>/dev/null \
-		        | ${SED} 10q \
-		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      newdeplibs="$newdeplibs $a_deplib"
 		      a_deplib=""
 		      break 2
@@ -3775,44 +6734,46 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
 		fi
 	      fi
-	    else
+	      ;;
+	    *)
 	      # Add a -L argument.
 	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
+	      ;;
+	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
 	  newdeplibs=""
-	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-	    -e 's/ -[LR][^ ]*//g'`
+	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
 	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	    for i in $predeps $postdeps ; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
 	    done
 	  fi
-	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
-	    | grep . >/dev/null; then
-	    $echo
+	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
+	     $GREP . >/dev/null; then
+	    $ECHO
 	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
-	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
 	    fi
-	    $echo "*** All declared inter-library dependencies are being dropped."
+	    $ECHO "*** All declared inter-library dependencies are being dropped."
 	    droppeddeps=yes
 	  fi
 	  ;;
@@ -3825,24 +6786,24 @@ EOF
 
 	case $host in
 	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library is the System framework
-	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	  ;;
 	esac
 
 	if test "$droppeddeps" = yes; then
 	  if test "$module" = yes; then
-	    $echo
-	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $echo "*** a static module, that should work as long as the dlopening"
-	    $echo "*** application is linked with the -dlopen flag."
+	    $ECHO
+	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $ECHO "*** a static module, that should work as long as the dlopening"
+	    $ECHO "*** application is linked with the -dlopen flag."
 	    if test -z "$global_symbol_pipe"; then
-	      $echo
-	      $echo "*** However, this would only work if libtool was able to extract symbol"
-	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $echo "*** not find such a program.  So, this module is probably useless."
-	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      $ECHO
+	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
+	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $ECHO "*** not find such a program.  So, this module is probably useless."
+	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 	    fi
 	    if test "$build_old_libs" = no; then
 	      oldlibs="$output_objdir/$libname.$libext"
@@ -3852,16 +6813,16 @@ EOF
 	      build_libtool_libs=no
 	    fi
 	  else
-	    $echo "*** The inter-library dependencies that have been dropped here will be"
-	    $echo "*** automatically added whenever a program is linked with this library"
-	    $echo "*** or is declared to -dlopen it."
+	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
+	    $ECHO "*** automatically added whenever a program is linked with this library"
+	    $ECHO "*** or is declared to -dlopen it."
 
 	    if test "$allow_undefined" = no; then
-	      $echo
-	      $echo "*** Since this library must not contain undefined symbols,"
-	      $echo "*** because either the platform does not support them or"
-	      $echo "*** it was explicitly requested with -no-undefined,"
-	      $echo "*** libtool will only create a static version of it."
+	      $ECHO
+	      $ECHO "*** Since this library must not contain undefined symbols,"
+	      $ECHO "*** because either the platform does not support them or"
+	      $ECHO "*** it was explicitly requested with -no-undefined,"
+	      $ECHO "*** libtool will only create a static version of it."
 	      if test "$build_old_libs" = no; then
 		oldlibs="$output_objdir/$libname.$libext"
 		build_libtool_libs=module
@@ -3875,7 +6836,14 @@ EOF
 	# Done checking deplibs!
 	deplibs=$newdeplibs
       fi
-
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
 
       # move library search paths that coincide with paths to not yet
       # installed libraries to the beginning of the library search list
@@ -3904,7 +6872,6 @@ EOF
       done
       deplibs="$new_libs"
 
-
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3949,10 +6916,7 @@ EOF
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      case $archive_cmds in
-	      *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
-	      *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
-	      esac
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
 	    else
 	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
 	    fi
@@ -3978,8 +6942,9 @@ EOF
 	eval shared_ext=\"$shrext_cmds\"
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
-	realname="$2"
-	shift; shift
+	shift
+	realname="$1"
+	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
@@ -3998,71 +6963,122 @@ EOF
 	done
 
 	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  delfiles="$delfiles $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
 	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    $show "generating symbol list for \`$libname.la'"
+	    func_verbose "generating symbol list for \`$libname.la'"
 	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
+	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
 	    save_ifs="$IFS"; IFS='~'
 	    for cmd in $cmds; do
 	      IFS="$save_ifs"
 	      eval cmd=\"$cmd\"
-	      if len=`expr "X$cmd" : ".*"` &&
-	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	        $show "$cmd"
-	        $run eval "$cmd" || exit $?
-	        skipped_export=false
+	      func_len " $cmd"
+	      len=$func_len_result
+	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
 	      else
-	        # The command line is too long to execute in one step.
-	        $show "using reloadable object file for export list..."
-	        skipped_export=:
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
 		# Break out early, otherwise skipped_export may be
 		# set to false by a later but shorter cmd.
 		break
 	      fi
 	    done
 	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex"; then
-	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
-	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
 	  fi
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	fi
 
 	tmp_deplibs=
 	for test_deplib in $deplibs; do
-		case " $convenience " in
-		*" $test_deplib "*) ;;
-		*)
-			tmp_deplibs="$tmp_deplibs $test_deplib"
-			;;
-		esac
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    ;;
+	  esac
 	done
 	deplibs="$tmp_deplibs"
 
 	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
 	  if test -n "$whole_archive_flag_spec"; then
 	    save_libobjs=$libobjs
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
 	  else
 	    gentop="$output_objdir/${outputname}x"
 	    generated="$generated $gentop"
 
 	    func_extract_archives $gentop $convenience
 	    libobjs="$libobjs $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
-	
+
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  linker_flags="$linker_flags $flag"
@@ -4070,7 +7086,7 @@ EOF
 
 	# Make a backup of the uninstalled library when relinking
 	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
@@ -4083,22 +7099,24 @@ EOF
 	    cmds=$module_cmds
 	  fi
 	else
-	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	  eval test_cmds=\"$archive_expsym_cmds\"
-	  cmds=$archive_expsym_cmds
-	else
-	  eval test_cmds=\"$archive_cmds\"
-	  cmds=$archive_cmds
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
 	  fi
 	fi
 
 	if test "X$skipped_export" != "X:" &&
-	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  :
 	else
-	  # The command line is too long to link in one step, link piecewise.
-	  $echo "creating reloadable object files..."
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
 
 	  # Save the value of $output and $libobjs because we want to
 	  # use them later.  If we have whole_archive_flag_spec, we
@@ -4112,77 +7130,162 @@ EOF
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
-	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
+	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
 	  test_cmds=
 	  concat_cmds=
 	  objlist=
-	  delfiles=
 	  last_robj=
 	  k=1
-	  output=$output_objdir/$output_la-${k}.$objext
-	  # Loop over the list of objects to be linked.
-	  for obj in $save_libobjs
-	  do
-	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
-	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-		 test "$len" -le "$max_cmd_len"; }; then
-	      objlist="$objlist $obj"
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    $ECHO 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    $ECHO ')' >> $output
+	    delfiles="$delfiles $output"
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    delfiles="$delfiles $output"
+	    output=$firstobj\"$file_list_spec$output\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=$obj
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      delfiles="$delfiles $output"
+
 	    else
-	      # The command $test_cmds is almost too long, add a
-	      # command to the queue.
-	      if test "$k" -eq 1 ; then
-		# The first file doesn't have a previous command to add.
-		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-	      else
-		# All subsequent reloadable object files will link in
-		# the last one created.
-		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	      last_robj=$output_objdir/$output_la-${k}.$objext
-	      k=`expr $k + 1`
-	      output=$output_objdir/$output_la-${k}.$objext
-	      objlist=$obj
-	      len=1
 	    fi
-	  done
-	  # Handle the remaining objects by creating one last
-	  # reloadable object file.  All subsequent reloadable object
-	  # files will link in the last one created.
-	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
-	  if ${skipped_export-false}; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    libobjs=$output
-	    # Append the command to create the export file.
-	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
-          fi
-
-	  # Set up a command to remove the reloadable object files
-	  # after they are used.
-	  i=0
-	  while test "$i" -lt "$k"
-	  do
-	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
-	  done
 
-	  $echo "creating a temporary reloadable object file: $output"
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
 
-	  # Loop through the commands generated above and execute them.
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $concat_cmds; do
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
 	    IFS="$save_ifs"
-	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
-	  done
-	  IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -4190,6 +7293,7 @@ EOF
 
 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	  # Expand the library linking commands again to reset the
 	  # value of $libobjs for piecewise linking.
@@ -4202,28 +7306,45 @@ EOF
 	      cmds=$module_cmds
 	    fi
 	  else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    cmds=$archive_expsym_cmds
-	  else
-	    cmds=$archive_cmds
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
 	    fi
 	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
 
-	  # Append the command to remove the reloadable object files
-	  # to the just-reset $cmds.
-	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	  func_extract_archives $gentop $dlprefiles
+	  libobjs="$libobjs $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
 	fi
+
 	save_ifs="$IFS"; IFS='~'
 	for cmd in $cmds; do
 	  IFS="$save_ifs"
 	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || {
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
 	    if test "$mode" = relink; then
-	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
 	    fi
 
 	    exit $lt_exit
@@ -4233,12 +7354,11 @@ EOF
 
 	# Restore the uninstalled library and exit
 	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
 	    if test -z "$whole_archive_flag_spec"; then
-	      $show "${rm}r $gentop"
-	      $run ${rm}r "$gentop"
+	      func_show_eval '${RM}r "$gentop"'
 	    fi
 	  fi
 
@@ -4248,8 +7368,7 @@ EOF
 	# Create links to the real library.
 	for linkname in $linknames; do
 	  if test "$realname" != "$linkname"; then
-	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
-	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
 	  fi
 	done
 
@@ -4262,39 +7381,35 @@ EOF
       ;;
 
     obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
       esac
 
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
-      fi
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
 
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
-      fi
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
 
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
 
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
 
       case $output in
       *.lo)
-	if test -n "$objs$old_deplibs"; then
-	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	libobj="$output"
-	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
 	;;
       *)
 	libobj=
@@ -4303,7 +7418,7 @@ EOF
       esac
 
       # Delete the old objects.
-      $run $rm $obj $libobj
+      $opt_dry_run || $RM $obj $libobj
 
       # Objects from convenience libraries.  This assumes
       # single-version convenience libraries.  Whenever we create
@@ -4319,7 +7434,7 @@ EOF
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 	else
 	  gentop="$output_objdir/${obj}x"
 	  generated="$generated $gentop"
@@ -4330,24 +7445,15 @@ EOF
       fi
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
       output="$obj"
-      cmds=$reload_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
+      func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
       if test -z "$libobj"; then
 	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
+	  func_show_eval '${RM}r "$gentop"'
 	fi
 
 	exit $EXIT_SUCCESS
@@ -4355,14 +7461,13 @@ EOF
 
       if test "$build_libtool_libs" != yes; then
 	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
+	  func_show_eval '${RM}r "$gentop"'
 	fi
 
 	# Create an invalid libtool object if no PIC, so that we don't
 	# accidentally link it into a program.
 	# $show "echo timestamp > $libobj"
-	# $run eval "echo timestamp > $libobj" || exit $?
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
       fi
 
@@ -4370,20 +7475,11 @@ EOF
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
 	output="$libobj"
-	cmds=$reload_cmds
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
-	done
-	IFS="$save_ifs"
+	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
       if test -n "$gentop"; then
-	$show "${rm}r $gentop"
-	$run ${rm}r $gentop
+	func_show_eval '${RM}r "$gentop"'
       fi
 
       exit $EXIT_SUCCESS
@@ -4391,39 +7487,45 @@ EOF
 
     prog)
       case $host in
-	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
       esac
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
 
-      if test "$preload" = yes; then
-	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
-	   test "$dlopen_self_static" = unknown; then
-	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
-	fi
-      fi
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
 	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	;;
       esac
 
       case $host in
-      *darwin*)
-        # Don't allow lazy linking, it breaks C++ global constructors
-        if test "$tagname" = CXX ; then
-        compile_command="$compile_command ${wl}-bind_at_load"
-        finalize_command="$finalize_command ${wl}-bind_at_load"
-        fi
-        ;;
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      compile_command="$compile_command ${wl}-bind_at_load"
+	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
       esac
 
 
@@ -4498,14 +7600,16 @@ EOF
 	  esac
 	fi
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
 	  *) dllsearchpath="$dllsearchpath:$libdir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
 	  *) dllsearchpath="$dllsearchpath:$testbindir";;
 	  esac
 	  ;;
@@ -4557,281 +7661,51 @@ EOF
 
       if test -n "$libobjs" && test "$build_old_libs" = yes; then
 	# Transform all the library objects into standard objects.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-      fi
-
-      dlsyms=
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	  dlsyms="${outputname}S.c"
-	else
-	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
-	fi
+	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       fi
 
-      if test -n "$dlsyms"; then
-	case $dlsyms in
-	"") ;;
-	*.c)
-	  # Discover the nlist of each of the dlfiles.
-	  nlist="$output_objdir/${outputname}.nm"
-
-	  $show "$rm $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Parse the name list into a source file.
-	  $show "creating $output_objdir/$dlsyms"
-
-	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
-	  if test "$dlself" = yes; then
-	    $show "generating symbol list for \`$output'"
-
-	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
-	    # Add our own program objects to the symbol list.
-	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	    for arg in $progfiles; do
-	      $show "extracting global C symbols from \`$arg'"
-	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	    done
-
-	    if test -n "$exclude_expsyms"; then
-	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    if test -n "$export_symbols_regex"; then
-	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    # Prepare the list of exported symbols
-	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$outputname.exp"
-	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    else
-	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      $run eval 'mv "$nlist"T "$nlist"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    fi
-	  fi
-
-	  for arg in $dlprefiles; do
-	    $show "extracting global C symbols from \`$arg'"
-	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
-	    $run eval '$echo ": $name " >> "$nlist"'
-	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -z "$run"; then
-	    # Make sure we have at least an empty file.
-	    test -f "$nlist" || : > "$nlist"
-
-	    if test -n "$exclude_expsyms"; then
-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	      $mv "$nlist"T "$nlist"
-	    fi
-
-	    # Try sorting and uniquifying the output.
-	    if grep -v "^: " < "$nlist" |
-		if sort -k 3 </dev/null >/dev/null 2>&1; then
-		  sort -k 3
-		else
-		  sort +2
-		fi |
-		uniq > "$nlist"S; then
-	      :
-	    else
-	      grep -v "^: " < "$nlist" > "$nlist"S
-	    fi
-
-	    if test -f "$nlist"S; then
-	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
-	    else
-	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
-	    fi
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
 
-	    case $host in
-	    *cygwin* | *mingw* )
-	  $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs */
-struct {
-"
-	      ;;
-	    * )
-	  $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
-	      ;;
-	    esac
-
-
-	  $echo >> "$output_objdir/$dlsyms" "\
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-  {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	  fi
-
-	  pic_flag_for_symtable=
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
-	    esac;;
-	  *-*-hpux*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag";;
-	    esac
-	  esac
-
-	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
-	  # Clean up the generated files.
-	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Transform the symbol file into the correct name.
-          case $host in
-          *cygwin* | *mingw* )
-            if test -f "$output_objdir/${outputname}.def" ; then
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            else
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-             fi
-            ;;
-          * )
-            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            ;;
-          esac
-	  ;;
-	*)
-	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      else
-	# We keep going just in case the user didn't refer to
-	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-	# really was required.
-
-	# Nullify the symbol file.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+      wrappers_required=yes
+      case $host in
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *cegcc)
+        # Disable wrappers for cegcc, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
 	# Replace the output file specification.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
-	$show "$link_command"
-	$run eval "$link_command"
-	exit_status=$?
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
 
 	# Delete the generated files.
-	if test -n "$dlsyms"; then
-	  $show "$rm $output_objdir/${outputname}S.${objext}"
-	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
 	fi
 
 	exit $exit_status
       fi
 
-      if test -n "$shlibpath_var"; then
-	# We should set the shlibpath_var
-	rpath=
-	for dir in $temp_rpath; do
-	  case $dir in
-	  [\\/]* | [A-Za-z]:[\\/]*)
-	    # Absolute path.
-	    rpath="$rpath$dir:"
-	    ;;
-	  *)
-	    # Relative path: add a thisdir entry.
-	    rpath="$rpath\$thisdir/$dir:"
-	    ;;
-	  esac
-	done
-	temp_rpath="$rpath"
-      fi
-
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
       fi
@@ -4864,12 +7738,11 @@ static const void *lt_preloaded_setup() {
 	# We don't need to create a wrapper script.
 	link_command="$compile_var$compile_command$compile_rpath"
 	# Replace the output file specification.
-	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
-	$run $rm $output
+	$opt_dry_run || $RM $output
 	# Link the executable and exit
-	$show "$link_command"
-	$run eval "$link_command" || exit $?
+	func_show_eval "$link_command" 'exit $?'
 	exit $EXIT_SUCCESS
       fi
 
@@ -4878,13 +7751,13 @@ static const void *lt_preloaded_setup() {
 	link_command="$compile_var$compile_command$compile_rpath"
 	relink_command="$finalize_var$finalize_command$finalize_rpath"
 
-	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
-	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
       else
 	if test "$fast_install" != no; then
 	  link_command="$finalize_var$compile_command$finalize_rpath"
 	  if test "$fast_install" = yes; then
-	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 	  else
 	    # fast_install is set to needless
 	    relink_command=
@@ -4896,608 +7769,103 @@ static const void *lt_preloaded_setup() {
       fi
 
       # Replace the output file specification.
-      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
       # Delete the old output files.
-      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
-      $show "$link_command"
-      $run eval "$link_command" || exit $?
+      func_show_eval "$link_command" 'exit $?'
 
       # Now create the wrapper script.
-      $show "creating $output"
+      func_verbose "creating $output"
 
       # Quote the relink command for shipping.
       if test -n "$relink_command"; then
 	# Preserve any variables that may affect compiler behavior
 	for var in $variables_saved_for_relink; do
 	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 	  elif eval var_value=\$$var; test -z "$var_value"; then
 	    relink_command="$var=; export $var; $relink_command"
 	  else
-	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 	  fi
 	done
 	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       fi
 
-      # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+      # Quote $ECHO for shipping.
+      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
 	case $progpath in
 	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
 	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
 	esac
-	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
       else
-	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
       fi
 
-      # Only actually do things if our run command is non-null.
-      if test -z "$run"; then
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
 	# win32 will think the script is a binary if it has
 	# a .exe suffix, so we strip it off here.
 	case $output in
-	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
 	esac
 	# test for cygwin because mv fails w/o .exe extensions
 	case $host in
 	  *cygwin*)
 	    exeext=.exe
-	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
 	  *) exeext= ;;
 	esac
 	case $host in
 	  *cygwin* | *mingw* )
-            output_name=`basename $output`
-            output_path=`dirname $output`
-            cwrappersource="$output_path/$objdir/lt-$output_name.c"
-            cwrapper="$output_path/$output_name.exe"
-            $rm $cwrappersource $cwrapper
-            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "/bin/sh $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
-*/
-EOF
-	    cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS.  */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int    check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  DEBUG("(main) argv[0]      : %s\n",argv[0]);
-  DEBUG("(main) program_name : %s\n",program_name);
-  newargz = XMALLOC(char *, argc+2);
-EOF
-
-            cat >> $cwrappersource <<EOF
-  newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
-            cat >> $cwrappersource <<"EOF"
-  newargz[1] = find_executable(argv[0]);
-  if (newargz[1] == NULL)
-    lt_fatal("Couldn't find %s", argv[0]);
-  DEBUG("(main) found exe at : %s\n",newargz[1]);
-  /* we know the script has the same name, without the .exe */
-  /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe");
-  for (i = 1; i < argc; i++)
-    newargz[i+1] = xstrdup(argv[i]);
-  newargz[argc+1] = NULL;
-
-  for (i=0; i<argc+1; i++)
-  {
-    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
-    ;
-  }
-
-EOF
-
-            case $host_os in
-              mingw*)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",(char const **)newargz);
-EOF
-              ;;
-              *)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",newargz);
-EOF
-              ;;
-            esac
-
-            cat >> $cwrappersource <<"EOF"
-  return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
-  void * p = (void *) malloc (num);
-  if (!p)
-    lt_fatal ("Memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable(const char * path)
-{
-  struct stat st;
-
-  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0) &&
-      (
-        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
-       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
-       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
-       ((st.st_mode & S_IXUSR) == S_IXUSR))
-      )
-    return 1;
-  else
-    return 0;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
-  int has_slash = 0;
-  const char* p;
-  const char* p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char* concat_name;
-
-  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
-  {
-    concat_name = xstrdup (wrapper);
-    if (check_executable(concat_name))
-      return concat_name;
-    XFREE(concat_name);
-  }
-  else
-  {
-#endif
-    if (IS_DIR_SEPARATOR (wrapper[0]))
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable(concat_name))
-        return concat_name;
-      XFREE(concat_name);
-    }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-    {
-      has_slash = 1;
-      break;
-    }
-  if (!has_slash)
-  {
-    /* no slashes; search PATH */
-    const char* path = getenv ("PATH");
-    if (path != NULL)
-    {
-      for (p = path; *p; p = p_next)
-      {
-        const char* q;
-        size_t p_len;
-        for (q = p; *q; q++)
-          if (IS_PATH_SEPARATOR(*q))
-            break;
-        p_len = q - p;
-        p_next = (*q == '\0' ? q : q + 1);
-        if (p_len == 0)
-        {
-          /* empty path: current directory */
-          if (getcwd (tmp, LT_PATHMAX) == NULL)
-            lt_fatal ("getcwd failed");
-          tmp_len = strlen(tmp);
-          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, tmp, tmp_len);
-          concat_name[tmp_len] = '/';
-          strcpy (concat_name + tmp_len + 1, wrapper);
-        }
-        else
-        {
-          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, p, p_len);
-          concat_name[p_len] = '/';
-          strcpy (concat_name + p_len + 1, wrapper);
-        }
-        if (check_executable(concat_name))
-          return concat_name;
-        XFREE(concat_name);
-      }
-    }
-    /* not found in PATH; assume curdir */
-  }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
-  tmp_len = strlen(tmp);
-  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable(concat_name))
-    return concat_name;
-  XFREE(concat_name);
-  return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert(str != NULL);
-  assert(pat != NULL);
-
-  len = strlen(str);
-  patlen = strlen(pat);
-
-  if (patlen <= len)
-  {
-    str += len - patlen;
-    if (strcmp(str, pat) == 0)
-      *str = '\0';
-  }
-  return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
-          const char * message, va_list ap)
-{
-  fprintf (stderr, "%s: %s: ", program_name, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-  va_end (ap);
-}
-EOF
-          # we should really use a build-platform specific compiler
-          # here, but OTOH, the wrappers (shell script and this C one)
-          # are only useful if you want to execute the "real" binary.
-          # Since the "real" binary is built for $host, then this
-          # wrapper might as well be built for $host, too.
-          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
-          ;;
-        esac
-        $rm $output
-        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
-	$echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variable:
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$echo are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    echo=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$echo works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$echo will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
-"
-	$echo >> $output "\
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
-  done
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $echo >> $output "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" || \\
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $mkdir \"\$progdir\"
-    else
-      $rm \"\$progdir/\$file\"
-    fi"
-
-	  $echo >> $output "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$echo \"\$relink_command_output\" >&2
-	$rm \"\$progdir/\$file\"
-	exit $EXIT_FAILURE
-      fi
-    fi
-
-    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $rm \"\$progdir/\$program\";
-      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $rm \"\$progdir/\$file\"
-  fi"
-	else
-	  $echo >> $output "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$echo >> $output "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $echo >> $output "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $echo >> $output "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
 
-	$echo >> $output "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2*)
-	  $echo >> $output "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
 	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
 
-	*)
-	  $echo >> $output "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
+	    func_emit_wrapper no > $output
+	    chmod +x $output
 	  ;;
 	esac
-	$echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \$*\"
-      exit $EXIT_FAILURE
-    fi
-  else
-    # The program doesn't exist.
-    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi\
-"
-	chmod +x $output
-      fi
+      }
       exit $EXIT_SUCCESS
       ;;
     esac
@@ -5506,7 +7874,7 @@ fi\
     for oldlib in $oldlibs; do
 
       if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save"
+	oldobjs="$libobjs_save $symfileobj"
 	addlibs="$convenience"
 	build_libtool_libs=no
       else
@@ -5515,6 +7883,9 @@ fi\
 	  build_libtool_libs=no
 	else
 	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    oldobjs="$oldobjs $symfileobj"
+	  fi
 	fi
 	addlibs="$old_convenience"
       fi
@@ -5529,8 +7900,18 @@ fi\
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       cmds=$old_archive_from_new_cmds
+	cmds=$old_archive_from_new_cmds
       else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  oldobjs="$oldobjs $func_extract_archives_result"
+	fi
+
 	# POSIX demands no paths to be encoded in archives.  We have
 	# to avoid creating archives with duplicate basenames if we
 	# might have to extract them afterwards, e.g., when creating a
@@ -5539,32 +7920,22 @@ fi\
 	# not supported by libtool).
 	if (for obj in $oldobjs
 	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
 	    done | sort | sort -uc >/dev/null 2>&1); then
 	  :
 	else
-	  $echo "copying selected object files to avoid basename conflicts..."
-
-	  if test -z "$gentop"; then
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    $show "${rm}r $gentop"
-	    $run ${rm}r "$gentop"
-	    $show "$mkdir $gentop"
-	    $run $mkdir "$gentop"
-	    exit_status=$?
-	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
-	      exit $exit_status
-	    fi
-	  fi
-
+	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
 	  oldobjs=
 	  counter=1
 	  for obj in $save_oldobjs
 	  do
-	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -5572,58 +7943,62 @@ fi\
 		# Make sure we don't pick an alternate name that also
 		# overlaps.
 		newobj=lt$counter-$objbase
-		counter=`expr $counter + 1`
+		func_arith $counter + 1
+		counter=$func_arith_result
 		case " $oldobjs " in
 		*[\ /]"$newobj "*) ;;
 		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
 		esac
 	      done
-	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      $run ln "$obj" "$gentop/$newobj" ||
-	      $run cp "$obj" "$gentop/$newobj"
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 	      oldobjs="$oldobjs $gentop/$newobj"
 	      ;;
 	    *) oldobjs="$oldobjs $obj" ;;
 	    esac
 	  done
 	fi
-
 	eval cmds=\"$old_archive_cmds\"
 
-	if len=`expr "X$cmds" : ".*"` &&
-	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  cmds=$old_archive_cmds
 	else
 	  # the command line is too long to link in one step, link in parts
-	  $echo "using piecewise archive linking..."
+	  func_verbose "using piecewise archive linking..."
 	  save_RANLIB=$RANLIB
 	  RANLIB=:
 	  objlist=
 	  concat_cmds=
 	  save_oldobjs=$oldobjs
-
+	  oldobjs=
 	  # Is there a better way of finding the last object in the list?
 	  for obj in $save_oldobjs
 	  do
 	    last_oldobj=$obj
 	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
 	  for obj in $save_oldobjs
 	  do
-	    oldobjs="$objlist $obj"
-	    objlist="$objlist $obj"
-	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	       test "$len" -le "$max_cmd_len"; then
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
 	      :
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
 	      if test "$obj" = "$last_oldobj" ; then
-	        RANLIB=$save_RANLIB
+		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 	      objlist=
+	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
@@ -5635,49 +8010,39 @@ fi\
 	  fi
 	fi
       fi
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-        eval cmd=\"$cmd\"
-	IFS="$save_ifs"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
+      func_execute_cmds "$cmds" 'exit $?'
     done
 
-    if test -n "$generated"; then
-      $show "${rm}r$generated"
-      $run ${rm}r$generated
-    fi
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
 
     # Now create the libtool archive.
     case $output in
     *.la)
       old_library=
       test "$build_old_libs" = yes && old_library="$libname.$libext"
-      $show "creating $output"
+      func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
       for var in $variables_saved_for_relink; do
 	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 	elif eval var_value=\$$var; test -z "$var_value"; then
 	  relink_command="$var=; export $var; $relink_command"
 	else
-	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 	fi
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
 
-
       # Only create the output if not a dry run.
-      if test -z "$run"; then
+      $opt_dry_run || {
 	for installed in no yes; do
 	  if test "$installed" = yes; then
 	    if test -z "$install_libdir"; then
@@ -5689,12 +8054,11 @@ fi\
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
-		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		func_basename "$deplib"
+		name="$func_basename_result"
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		if test -z "$libdir"; then
-		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		  exit $EXIT_FAILURE
-		fi
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
 		newdependency_libs="$newdependency_libs $libdir/$name"
 		;;
 	      *) newdependency_libs="$newdependency_libs $deplib" ;;
@@ -5702,25 +8066,37 @@ fi\
 	    done
 	    dependency_libs="$newdependency_libs"
 	    newdlfiles=
+
 	    for lib in $dlfiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlfiles="$newdlfiles $libdir/$name"
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlfiles="$newdlfiles $libdir/$name"
+		;;
+	      *) newdlfiles="$newdlfiles $lib" ;;
+	      esac
 	    done
 	    dlfiles="$newdlfiles"
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlprefiles="$newdlprefiles $libdir/$name"
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlprefiles="$newdlprefiles $libdir/$name"
+		;;
+	      esac
 	    done
 	    dlprefiles="$newdlprefiles"
 	  else
@@ -5743,15 +8119,15 @@ fi\
 	    done
 	    dlprefiles="$newdlprefiles"
 	  fi
-	  $rm $output
+	  $RM $output
 	  # place dlname in correct position for cygwin
 	  tdlname=$dlname
 	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 	  esac
-	  $echo > $output "\
+	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -5765,9 +8141,15 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
 # Libraries that this one depends upon.
 dependency_libs='$dependency_libs'
 
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
 # Version information for $libname.
 current=$current
 age=$age
@@ -5786,748 +8168,29 @@ dlpreopen='$dlprefiles'
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
 	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $echo >> $output "\
+	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
 	done
-      fi
+      }
 
       # Do a symbolic link so that the libtool archive can be found in
       # LD_LIBRARY_PATH before the program is installed.
-      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
       ;;
     esac
     exit $EXIT_SUCCESS
-    ;;
-
-  # libtool install mode
-  install)
-    modename="$modename: install"
-
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | grep shtool > /dev/null; then
-      # Aesthetically quote it.
-      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$arg "
-      arg="$1"
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-    case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      arg="\"$arg\""
-      ;;
-    esac
-    install_prog="$install_prog$arg"
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-	files="$files $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f) 
-      	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
-	;;
-      -g | -m | -o) prev=$arg ;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$install_prog $arg"
-    done
-
-    if test -z "$install_prog"; then
-      $echo "$modename: you must specify an install program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prev' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	$echo "$modename: no file or destination specified" 1>&2
-      else
-	$echo "$modename: you must specify a destination" 1>&2
-      fi
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Strip any trailing slash from the destination.
-    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$destdir" = "X$dest" && destdir=.
-      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      if test "$#" -gt 2; then
-	$echo "$modename: \`$dest' is not a directory" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
-	;;
-
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	library_names=
-	old_library=
-	relink_command=
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
-	  esac
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
-	test "X$dir" = "X$file/" && dir=
-	dir="$dir$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  if test "$inst_prefix_dir" = "$destdir"; then
-	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
-	  else
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
-	  fi
-
-	  $echo "$modename: warning: relinking \`$file'" 1>&2
-	  $show "$relink_command"
-	  if $run eval "$relink_command"; then :
-	  else
-	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names
-	if test -n "$2"; then
-	  realname="$2"
-	  shift
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  $show "$install_prog $dir/$srcname $destdir/$realname"
-	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
-	  if test -n "$stripme" && test -n "$striplib"; then
-	    $show "$striplib $destdir/$realname"
-	    $run eval "$striplib $destdir/$realname" || exit $?
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      if test "$linkname" != "$realname"; then
-                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-	      fi
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  cmds=$postinstall_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || {
-	      lt_exit=$?
-
-	      # Restore the uninstalled library and exit
-	      if test "$mode" = relink; then
-		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
-	      fi
-
-	      exit $lt_exit
-	    }
-	  done
-	  IFS="$save_ifs"
-	fi
-
-	# Install the pseudo-library for information purposes.
-	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	instname="$dir/$name"i
-	$show "$install_prog $instname $destdir/$name"
-	$run eval "$install_prog $instname $destdir/$name" || exit $?
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	if test -n "$destfile"; then
-	  $show "$install_prog $file $destfile"
-	  $run eval "$install_prog $file $destfile" || exit $?
-	fi
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
-	  $show "$install_prog $staticobj $staticdest"
-	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      file=`$echo $file|${SED} 's,.exe$,,'`
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin*|*mingw*)
-	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  # Check the variables that should have been set.
-	  if test -z "$notinst_deplibs"; then
-	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      # If there is no directory component, then add one.
-	      case $lib in
-	      */* | *\\*) . $lib ;;
-	      *) . ./$lib ;;
-	      esac
-	    fi
-	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir=`func_mktempdir`
-	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
-	      outputname="$tmpdir/$file"
-	      # Replace the output file specification.
-	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
-
-	      $show "$relink_command"
-	      if $run eval "$relink_command"; then :
-	      else
-		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-		${rm}r "$tmpdir"
-		continue
-	      fi
-	      file="$outputname"
-	    else
-	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
-	    fi
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway 
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
-	    ;;
-	  esac
-	  ;;
-	esac
-	$show "$install_prog$stripme $file $destfile"
-	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
-	test -n "$outputname" && ${rm}r "$tmpdir"
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-
-      $show "$install_prog $file $oldlib"
-      $run eval "$install_prog \$file \$oldlib" || exit $?
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	$show "$old_striplib $oldlib"
-	$run eval "$old_striplib $oldlib" || exit $?
-      fi
-
-      # Do each command in the postinstall commands.
-      cmds=$old_postinstall_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
-
-    if test -n "$future_libdirs"; then
-      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
-    fi
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool finish mode
-  finish)
-    modename="$modename: finish"
-    libdirs="$nonopt"
-    admincmds=
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
-
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  cmds=$finish_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || admincmds="$admincmds
-       $cmd"
-	  done
-	  IFS="$save_ifs"
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $run eval "$cmds" || admincmds="$admincmds
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    test "$show" = : && exit $EXIT_SUCCESS
-
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    $echo "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $echo "   $libdir"
-    done
-    $echo
-    $echo "If you ever happen to want to link against installed libraries"
-    $echo "in a given directory, LIBDIR, you must either use libtool, and"
-    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $echo "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $echo "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $echo "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      $echo "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $echo "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $echo
-    $echo "See any operating system documentation about shared libraries for"
-    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    exit $EXIT_SUCCESS
-    ;;
-
-  # libtool execute mode
-  execute)
-    modename="$modename: execute"
-
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit $EXIT_FAILURE
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test ! -f "$file"; then
-	$echo "$modename: \`$file' is not a file" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-
-      dir=
-      case $file in
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-	;;
-
-      *)
-	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
-	  esac
-
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
+}
 
-    if test -z "$run"; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
 
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-		$lt_var=\$save_$lt_var; export $lt_var
-	      fi"
-      done
 
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-	$echo "export $shlibpath_var"
-      fi
-      $echo "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool clean and uninstall mode
-  clean | uninstall)
-    modename="$modename: $mode"
-    rm="$nonopt"
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
     files=
     rmforce=
     exit_status=0
@@ -6539,30 +8202,28 @@ relink_command=\"$relink_command\""
     for arg
     do
       case $arg in
-      -f) rm="$rm $arg"; rmforce=yes ;;
-      -*) rm="$rm $arg" ;;
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
       *) files="$files $arg" ;;
       esac
     done
 
-    if test -z "$rm"; then
-      $echo "$modename: you must specify an RM program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
 
     rmdirs=
 
     origobjdir="$objdir"
     for file in $files; do
-      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-      if test "X$dir" = "X$file"; then
-	dir=.
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
 	objdir="$origobjdir"
       else
 	objdir="$dir/$origobjdir"
       fi
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      func_basename "$file"
+      name="$func_basename_result"
       test "$mode" = uninstall && objdir="$dir"
 
       # Remember objdir for removal later, being careful to avoid duplicates
@@ -6574,9 +8235,9 @@ relink_command=\"$relink_command\""
       fi
 
       # Don't error if the file doesn't exist and rm -f was used.
-      if (test -L "$file") >/dev/null 2>&1 \
-	|| (test -h "$file") >/dev/null 2>&1 \
-	|| test -f "$file"; then
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
 	:
       elif test -d "$file"; then
 	exit_status=1
@@ -6590,8 +8251,8 @@ relink_command=\"$relink_command\""
       case $name in
       *.la)
 	# Possibly a libtool archive, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  . $dir/$name
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
@@ -6606,39 +8267,17 @@ relink_command=\"$relink_command\""
 	    *" $dlname "*) ;;
 	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
 	    esac
-	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      cmds=$postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      cmds=$old_postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -6648,20 +8287,20 @@ relink_command=\"$relink_command\""
 
       *.lo)
 	# Possibly a libtool object, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	if func_lalib_p "$file"; then
 
 	  # Read the .lo file
-	  . $dir/$name
+	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" \
-	     && test "$pic_object" != none; then
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
 	    rmfiles="$rmfiles $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" \
-	     && test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
 	    rmfiles="$rmfiles $dir/$non_pic_object"
 	  fi
 	fi
@@ -6672,17 +8311,26 @@ relink_command=\"$relink_command\""
 	  noexename=$name
 	  case $file in
 	  *.exe)
-	    file=`$echo $file|${SED} 's,.exe$,,'`
-	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
 	    rmfiles="$rmfiles $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
-	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	    relink_command=
-	    . $dir/$noexename
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
@@ -6697,239 +8345,38 @@ relink_command=\"$relink_command\""
 	fi
 	;;
       esac
-      $show "$rm $rmfiles"
-      $run $rm $rmfiles || exit_status=1
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
     objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
-	$show "rmdir $dir"
-	$run rmdir $dir >/dev/null 2>&1
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
       fi
     done
 
     exit $exit_status
-    ;;
+}
 
-  "")
-    $echo "$modename: you must specify a MODE" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
-  esac
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
 
-  if test -z "$exec_cmd"; then
-    $echo "$modename: invalid operation mode \`$mode'" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi # test -z "$show_help"
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
 
 if test -n "$exec_cmd"; then
-  eval exec $exec_cmd
+  eval exec "$exec_cmd"
   exit $EXIT_FAILURE
 fi
 
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
-    --config          show all configuration variables
-    --debug           enable verbose shell tracing
--n, --dry-run         display commands without modifying any files
-    --features        display basic configuration information and exit
-    --finish          same as \`--mode=finish'
-    --help            display this help message and exit
-    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
-    --quiet           same as \`--silent'
-    --silent          don't print informational messages
-    --tag=TAG         use configuration variables from tag TAG
-    --version         print version information
-
-MODE must be one of the following:
-
-      clean           remove files from the build directory
-      compile         compile a source file into a libtool object
-      execute         automatically set library path, then run a program
-      finish          complete the installation of libtool libraries
-      install         install libraries or executables
-      link            create a library or an executable
-      uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool at gnu.org>."
-  exit $EXIT_SUCCESS
-  ;;
-
-clean)
-  $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-  ;;
+exit $exit_status
 
-compile)
-  $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
-  -static           always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-  ;;
-
-execute)
-  $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-  ;;
-
-finish)
-  $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-  ;;
-
-install)
-  $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-  ;;
-
-link)
-  $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-  ;;
-
-uninstall)
-  $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-*)
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-  ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
@@ -6943,14 +8390,17 @@ exit $?
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
+build_libtool_libs=no
+build_old_libs=yes
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
 # mode:shell-script
 # sh-indentation:2
 # End:
+# vi:sw=2
+
diff --git a/libgc/solaris_threads.c b/libgc/solaris_threads.c
index e6e0ea2..a0321b1 100644
--- a/libgc/solaris_threads.c
+++ b/libgc/solaris_threads.c
@@ -670,7 +670,7 @@ word GC_get_orig_stack_size() {
     result = (word)rl.rlim_cur & ~(HBLKSIZE-1);
     if (result > MAX_ORIG_STACK_SIZE) {
 	if (!warned) {
-	    WARN("Large stack limit(%ld): only scanning 8 MB\n", result);
+	    /* WARN("Large stack limit(%ld): only scanning 8 MB\n", result); */
 	    warned = 1;
 	}
 	result = MAX_ORIG_STACK_SIZE;
@@ -787,18 +787,20 @@ void * GC_thr_daemon(void * dummy)
             UNLOCK();
     	} else {
     	    t = GC_lookup_thread(departed);
-	    GC_multithreaded--;
-    	    if (!(t -> flags & CLIENT_OWNS_STACK)) {
-    	    	GC_stack_free(t -> stack, t -> stack_size);
-    	    }
-    	    if (t -> flags & DETACHED) {
-    	    	GC_delete_thread(departed);
-    	    } else {
-    	        t -> status = status;
-    	    	t -> flags |= FINISHED;
-    	    	cond_signal(&(t -> join_cv));
-    	    	cond_broadcast(&GC_prom_join_cv);
-    	    }
+			GC_multithreaded--;
+			if (t) {
+				if (!(t -> flags & CLIENT_OWNS_STACK)) {
+					GC_stack_free(t -> stack, t -> stack_size);
+				}
+				if (t -> flags & DETACHED) {
+					GC_delete_thread(departed);
+				} else {
+					t -> status = status;
+					t -> flags |= FINISHED;
+					cond_signal(&(t -> join_cv));
+					cond_broadcast(&GC_prom_join_cv);
+				}
+			}
     	    UNLOCK();
     	}
     }
diff --git a/libtool.m4 b/libtool.m4
new file mode 100644
index 0000000..39ba996
--- /dev/null
+++ b/libtool.m4
@@ -0,0 +1,7357 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 56 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Fix-up fallback echo if it was mangled by the above quoting rules.
+case \$lt_ECHO in
+*'\\\[$]0 --fallback-echo"')dnl "
+  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
+  ;;
+esac
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
+
+lt_cl_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AS_SHELL_SANITIZE
+_AS_PREPARE
+
+exec AS_MESSAGE_FD>&1
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+if test "$no_create" != yes; then
+  lt_cl_success=:
+  test "$silent" = yes &&
+    lt_config_lt_args="$lt_config_lt_args --quiet"
+  exec AS_MESSAGE_LOG_FD>/dev/null
+  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+  exec AS_MESSAGE_LOG_FD>>config.log
+  $lt_cl_success || AS_EXIT(1)
+fi
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=echo
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+	 [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_SHELL_INIT
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$lt_ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+ECHO=${lt_ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+[$]*
+_LT_EOF
+  exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$lt_ECHO"; then
+  if test "X${echo_test_string+set}" != Xset; then
+    # find a string as large as possible, as long as the shell can cope with it
+    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
+	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
+      then
+        break
+      fi
+    done
+  fi
+
+  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+     test "X$echo_testing_string" = "X$echo_test_string"; then
+    :
+  else
+    # The Solaris, AIX, and Digital Unix default echo programs unquote
+    # backslashes.  This makes it impossible to quote backslashes using
+    #   echo "$something" | sed 's/\\/\\\\/g'
+    #
+    # So, first we look for a working echo in the user's PATH.
+
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for dir in $PATH /usr/ucb; do
+      IFS="$lt_save_ifs"
+      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        ECHO="$dir/echo"
+        break
+      fi
+    done
+    IFS="$lt_save_ifs"
+
+    if test "X$ECHO" = Xecho; then
+      # We didn't find a better echo, so look for alternatives.
+      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
+         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
+         test "X$echo_testing_string" = "X$echo_test_string"; then
+        # This shell has a builtin print -r that does the trick.
+        ECHO='print -r'
+      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
+	   test "X$CONFIG_SHELL" != X/bin/ksh; then
+        # If we have ksh, try running configure again with it.
+        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+        export ORIGINAL_CONFIG_SHELL
+        CONFIG_SHELL=/bin/ksh
+        export CONFIG_SHELL
+        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+      else
+        # Try using printf.
+        ECHO='printf %s\n'
+        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
+	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
+	   test "X$echo_testing_string" = "X$echo_test_string"; then
+	  # Cool, printf works
+	  :
+        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+	  export CONFIG_SHELL
+	  SHELL="$CONFIG_SHELL"
+	  export SHELL
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+	     test "X$echo_testing_string" = 'X\t' &&
+	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+	     test "X$echo_testing_string" = "X$echo_test_string"; then
+	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
+        else
+	  # maybe with a smaller string...
+	  prev=:
+
+	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
+	    then
+	      break
+	    fi
+	    prev="$cmd"
+	  done
+
+	  if test "$prev" != 'sed 50q "[$]0"'; then
+	    echo_test_string=`eval $prev`
+	    export echo_test_string
+	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+	  else
+	    # Oops.  We lost completely, so just stick with echo.
+	    ECHO=echo
+	  fi
+        fi
+      fi
+    fi
+  fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+lt_ECHO=$ECHO
+if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(lt_ECHO)
+])
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1],
+    [An echo program that does not interpret backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # Some binutils ld are patched to set DT_RUNPATH
+  save_LDFLAGS=$LDFLAGS
+  save_libdir=$libdir
+  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+       [shlibpath_overrides_runpath=yes])])
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC*)
+	    # IBM XL 8.0 on PPC
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl*)
+	# IBM XL C 8.0/Fortran 10.1 on PPC
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	*Sun\ F*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  # Exported symbols can be pulled into shared objects from archives
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $RM conftest*
+      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+        _LT_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+        then
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $RM conftest*
+      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_PROG_CXX
+# ------------
+# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
+# compiler, we have our own version here.
+m4_defun([_LT_PROG_CXX],
+[
+pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
+AC_PROG_CXX
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_CXX
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_CXX], [])
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[AC_REQUIRE([_LT_PROG_CXX])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 will use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  xl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='echo'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=echo
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='echo'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_PROG_F77
+# ------------
+# Since AC_PROG_F77 is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_F77],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
+AC_PROG_F77
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_F77
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_F77], [])
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_REQUIRE([_LT_PROG_F77])dnl
+AC_LANG_PUSH(Fortran 77)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_PROG_FC
+# -----------
+# Since AC_PROG_FC is broken, in that it returns the empty string
+# if there is no fortran compiler, we have our own version here.
+m4_defun([_LT_PROG_FC],
+[
+pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
+AC_PROG_FC
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+popdef([AC_MSG_ERROR])
+])# _LT_PROG_FC
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([_LT_PROG_FC], [])
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "X${3}" \
+           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
diff --git a/ltmain.sh b/ltmain.sh
old mode 100644
new mode 100755
index 27d498a..b36c4ad
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,52 +1,83 @@
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008  Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
+# Generated from ltmain.m4sh.
+
+# ltmain.sh (GNU libtool) 2.2.6
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
 # (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful, but
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#     --config             show all configuration variables
+#     --debug              enable verbose shell tracing
+# -n, --dry-run            display commands without modifying any files
+#     --features           display basic configuration information and exit
+#     --mode=MODE          use operation mode MODE
+#     --preserve-dup-deps  don't remove duplicate dependency libraries
+#     --quiet, --silent    don't print informational messages
+#     --tag=TAG            use configuration variables from tag TAG
+# -v, --verbose            print informational messages (default)
+#     --version            print version information
+# -h, --help               print short or long help message
+#
+# MODE must be one of the following:
+#
+#       clean              remove files from the build directory
+#       compile            compile a source file into a libtool object
+#       execute            automatically set library path, then run a program
+#       finish             complete the installation of libtool libraries
+#       install            install libraries or executables
+#       link               create a library or an executable
+#       uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#       host-triplet:	$host
+#       shell:		$SHELL
+#       compiler:		$LTCC
+#       compiler flags:		$LTCFLAGS
+#       linker:		$LD (gnu? $with_gnu_ld)
+#       $progname:		(GNU libtool) 2.2.6
+#       automake:		$automake_version
+#       autoconf:		$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION=1.5.26
-TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
+VERSION=2.2.6
+TIMESTAMP=""
+package_revision=1.3012
 
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+# Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
@@ -60,104 +91,261 @@ fi
 BIN_SH=xpg4; export BIN_SH # for Tru64
 DUALCASE=1; export DUALCASE # for MKS sh
 
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X$1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
-  # Yippee, $echo works!
-  :
-else
-  # Restart under the correct shell, and then maybe $echo will work.
-  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-$*
-EOF
-  exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  SP2NL='tr \040 \012'
-  NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  SP2NL='tr \100 \n'
-  NL2SP='tr \r\n \100\100'
-  ;;
-esac
-
-# NLS nuisances.
+# NLS nuisances: We save the old values to restore during execute mode.
 # Only set LANG and LC_ALL to C if already set.
 # These must not be set unconditionally because not all systems understand
 # e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-lt_env=
+lt_user_locale=
+lt_safe_locale=
 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
   eval "if test \"\${$lt_var+set}\" = set; then
-	  save_$lt_var=\$$lt_var
-	  lt_env=\"$lt_var=\$$lt_var \$lt_env\"
-	  $lt_var=C
+          save_$lt_var=\$$lt_var
+          $lt_var=C
 	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
 	fi"
 done
 
-if test -n "$lt_env"; then
-  lt_env="env $lt_env"
-fi
+$lt_unset CDPATH
+
+
+
+
+
+: ${CP="cp -f"}
+: ${ECHO="echo"}
+: ${EGREP="/usr/bin/grep -E"}
+: ${FGREP="/usr/bin/grep -F"}
+: ${GREP="/usr/bin/grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="/opt/local/bin/gsed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
 
 # Make sure IFS has a sensible default
 lt_nl='
 '
 IFS=" 	$lt_nl"
 
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-  $echo "$modename: not configured to build any kind of library" 1>&2
-  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-  exit $EXIT_FAILURE
-fi
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
 
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Generated shell functions inserted here.
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+# In the unlikely event $progname began with a '-', it would play havoc with
+# func_echo (imagine progname=-n), so we prepend ./ in that case:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+case $progname in
+  -*) progname=./$progname ;;
+esac
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
 
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
 
 # func_mktempdir [string]
 # Make a temporary directory that won't clash with other running
@@ -167,7 +355,7 @@ func_mktempdir ()
 {
     my_template="${TMPDIR-/tmp}/${1-$progname}"
 
-    if test "$run" = ":"; then
+    if test "$opt_dry_run" = ":"; then
       # Return a directory name, but don't create it in dry-run mode
       my_tmpdir="${my_template}-$$"
     else
@@ -176,486 +364,743 @@ func_mktempdir ()
       my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
       if test ! -d "$my_tmpdir"; then
-	# Failing that, at least try and use $RANDOM to avoid a race
-	my_tmpdir="${my_template}-${RANDOM-0}$$"
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
-	save_mktempdir_umask=`umask`
-	umask 0077
-	$mkdir "$my_tmpdir"
-	umask $save_mktempdir_umask
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || {
-        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
-	exit $EXIT_FAILURE
-      }
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
     fi
 
-    $echo "X$my_tmpdir" | $Xsed
+    $ECHO "X$my_tmpdir" | $Xsed
 }
 
 
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
 {
-  win32_libid_type="unknown"
-  win32_fileres=`file -L $1 2>/dev/null`
-  case $win32_fileres in
-  *ar\ archive\ import\ library*) # definitely import
-    win32_libid_type="x86 archive import"
-    ;;
-  *ar\ archive*) # could be an import, or static
-    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
-      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
-      win32_nmres=`eval $NM -f posix -A $1 | \
-	$SED -n -e '1,100{
-		/ I /{
-			s,.*,import,
-			p
-			q
-			}
-		}'`
-      case $win32_nmres in
-      import*)  win32_libid_type="x86 archive import";;
-      *)        win32_libid_type="x86 archive static";;
-      esac
-    fi
-    ;;
-  *DLL*)
-    win32_libid_type="x86 DLL"
-    ;;
-  *executable*) # but shell scripts are "executable" too...
-    case $win32_fileres in
-    *MS\ Windows\ PE\ Intel*)
-      win32_libid_type="x86 DLL"
-      ;;
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
     esac
-    ;;
-  esac
-  $echo $win32_libid_type
 }
 
 
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
 {
-    if test -n "$available_tags" && test -z "$tagname"; then
-      CC_quoted=
-      for arg in $CC; do
-	case $arg in
-	  *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-	CC_quoted="$CC_quoted $arg"
-      done
-      case $@ in
-      # Blanks in the command may have been stripped by the calling shell,
-      # but not from the CC environment variable when configure was run.
-      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
-      # Blanks at the start of $base_compile will cause this to fail
-      # if we don't check for them as well.
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "X$1" | $Xsed \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
       *)
-	for z in $available_tags; do
-	  if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
-	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
-	    CC_quoted=
-	    for arg in $CC; do
-	    # Double-quote args containing other shell metacharacters.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    CC_quoted="$CC_quoted $arg"
-	  done
-	    case "$@ " in
-	      " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
-	      # The compiler in the base compile command matches
-	      # the one in the tagged configuration.
-	      # Assume this is the tagged configuration we want.
-	      tagname=$z
-	      break
-	      ;;
-	    esac
-	  fi
-	done
-	# If $tagname still isn't set, then no tagged configuration
-	# was found and let the user know that the "--tag" command
-	# line option must be used.
-	if test -z "$tagname"; then
-	  $echo "$modename: unable to infer tagged configuration"
-	  $echo "$modename: specify a tag with \`--tag'" 1>&2
-	  exit $EXIT_FAILURE
-#        else
-#          $echo "$modename: using $tagname tagged configuration"
-	fi
-	;;
-      esac
-    fi
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
 }
 
 
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
 {
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
-    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
-    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
-     :
-    else
-      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
-      exit $EXIT_FAILURE
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
     fi
 }
 
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
 {
-    my_gentop="$1"; shift
-    my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
-    my_status=""
-
-    $show "${rm}r $my_gentop"
-    $run ${rm}r "$my_gentop"
-    $show "$mkdir $my_gentop"
-    $run $mkdir "$my_gentop"
-    my_status=$?
-    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
-      exit $my_status
-    fi
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
 
-    for my_xlib in $my_oldlibs; do
-      # Extract the objects.
-      case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
-	*) my_xabs=`pwd`"/$my_xlib" ;;
-      esac
-      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
-      my_xlib_u=$my_xlib
-      while :; do
-        case " $extracted_archives " in
-	*" $my_xlib_u "*)
-	  extracted_serial=`expr $extracted_serial + 1`
-	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
-	*) break ;;
-	esac
-      done
-      extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
 
-      $show "${rm}r $my_xdir"
-      $run ${rm}r "$my_xdir"
-      $show "$mkdir $my_xdir"
-      $run $mkdir "$my_xdir"
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
-	exit $exit_status
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
       fi
-      case $host in
-      *-darwin*)
-	$show "Extracting $my_xabs"
-	# Do not bother doing anything if just a dry run
-	if test -z "$run"; then
-	  darwin_orig_dir=`pwd`
-	  cd $my_xdir || exit $?
-	  darwin_archive=$my_xabs
-	  darwin_curdir=`pwd`
-	  darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
-	  darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
-	  if test -n "$darwin_arches"; then 
-	    darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
-	    darwin_arch=
-	    $show "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
-	      cd "$darwin_curdir"
-	      $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
-	    done # $darwin_arches
-      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
-	    darwin_file=
-	    darwin_files=
-	    for darwin_file in $darwin_filelist; do
-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
-	      lipo -create -output "$darwin_file" $darwin_files
-	    done # $darwin_filelist
-	    ${rm}r unfat-$$
-	    cd "$darwin_orig_dir"
-	  else
-	    cd "$darwin_orig_dir"
- 	    func_extract_an_archive "$my_xdir" "$my_xabs"
-	  fi # $darwin_arches
-	fi # $run
-	;;
-      *)
-        func_extract_an_archive "$my_xdir" "$my_xabs"
-        ;;
-      esac
-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
-    done
-    func_extract_archives_result="$my_oldobjs"
+    fi
 }
-# End of Shell function definitions
-#####################################
 
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
 
-disable_libs=no
 
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
-  arg="$1"
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/# -h/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    $ECHO
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help
+# Echo long help message to standard output and exit.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	p
+     }' < "$progpath"
+    exit $?
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1"
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+# Check that we have a working $ECHO.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
   shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
+  # Yippee, $ECHO works!
+  :
+else
+  # Restart under the correct shell, and then maybe $ECHO will work.
+  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
 
-  case $arg in
-  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
-  *) optarg= ;;
-  esac
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit $EXIT_SUCCESS
+fi
 
-  # If the previous option needs an argument, assign it.
-  if test -n "$prev"; then
-    case $prev in
-    execute_dlfiles)
-      execute_dlfiles="$execute_dlfiles $arg"
-      ;;
-    tag)
-      tagname="$arg"
-      preserve_args="${preserve_args}=$arg"
-
-      # Check whether tagname contains only valid characters
-      case $tagname in
-      *[!-_A-Za-z0-9,/]*)
-	$echo "$progname: invalid tag name: $tagname" 1>&2
-	exit $EXIT_FAILURE
-	;;
-      esac
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
 
-      case $tagname in
-      CC)
-	# Don't test for the "default" C tag, as we know, it's there, but
-	# not specially marked.
-	;;
-      *)
-	if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
-	  taglist="$taglist $tagname"
-	  # Evaluate the configuration.
-	  eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
-	else
-	  $echo "$progname: ignoring unknown tag $tagname" 1>&2
-	fi
-	;;
-      esac
-      ;;
-    *)
-      eval "$prev=\$arg"
-      ;;
-    esac
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
 
-    prev=
-    prevopt=
-    continue
-  fi
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
 
-  # Have we seen a non-optional argument yet?
-  case $arg in
-  --help)
-    show_help=yes
-    ;;
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
 
-  --version)
-    echo "\
-$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
 
-Copyright (C) 2008  Free Software Foundation, Inc.
-This is free software; see the source for copying conditions.  There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-    exit $?
-    ;;
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
 
-  --config)
-    ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
     # Now print the configurations for the tags.
     for tagname in $taglist; do
-      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
     done
-    exit $?
-    ;;
-
-  --debug)
-    $echo "$progname: enabling shell trace mode"
-    set -x
-    preserve_args="$preserve_args $arg"
-    ;;
 
-  --dry-run | -n)
-    run=:
-    ;;
+    exit $?
+}
 
-  --features)
-    $echo "host: $host"
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    $ECHO "host: $host"
     if test "$build_libtool_libs" = yes; then
-      $echo "enable shared libraries"
+      $ECHO "enable shared libraries"
     else
-      $echo "disable shared libraries"
+      $ECHO "disable shared libraries"
     fi
     if test "$build_old_libs" = yes; then
-      $echo "enable static libraries"
+      $ECHO "enable static libraries"
     else
-      $echo "disable static libraries"
+      $ECHO "disable static libraries"
     fi
+
     exit $?
-    ;;
+}
 
-  --finish) mode="finish" ;;
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
 
-  --mode) prevopt="--mode" prev=mode ;;
-  --mode=*) mode="$optarg" ;;
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
 
-  --preserve-dup-deps) duplicate_deps="yes" ;;
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
 
-  --quiet | --silent)
-    show=:
-    preserve_args="$preserve_args $arg"
-    ;;
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
 
-  --tag)
-    prevopt="--tag"
-    prev=tag
-    preserve_args="$preserve_args --tag"
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
     ;;
-  --tag=*)
-    set tag "$optarg" ${1+"$@"}
-    shift
-    prev=tag
-    preserve_args="$preserve_args --tag"
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
     ;;
-
-  -dlopen)
-    prevopt="-dlopen"
-    prev=execute_dlfiles
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
     ;;
-
-  -*)
-    $echo "$modename: unrecognized option \`$arg'" 1>&2
-    $echo "$help" 1>&2
-    exit $EXIT_FAILURE
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
     ;;
-
-  *)
-    nonopt="$arg"
-    break
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
     ;;
   esac
-done
 
-if test -n "$prevopt"; then
-  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-fi
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
 
-case $disable_libs in
-no) 
-  ;;
-shared)
-  build_libtool_libs=no
-  build_old_libs=yes
-  ;;
-static)
-  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-  ;;
-esac
+    case $opt in
+      --config)		func_config					;;
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
+      --debug)		preserve_args="$preserve_args $opt"
+			func_echo "enabling shell trace mode"
+			opt_debug='set -x'
+			$opt_debug
+			;;
 
-if test -z "$show_help"; then
+      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			execute_dlfiles="$execute_dlfiles $1"
+			shift
+			;;
 
-  # Infer the operation mode.
-  if test -z "$mode"; then
-    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
-    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
-    case $nonopt in
-    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
-      mode=link
-      for arg
-      do
-	case $arg in
-	-c)
-	   mode=compile
-	   break
-	   ;;
-	esac
-      done
-      ;;
-    *db | *dbx | *strace | *truss)
-      mode=execute
-      ;;
-    *install*|cp|mv)
-      mode=install
-      ;;
-    *rm)
-      mode=uninstall
+      --dry-run | -n)	opt_dry_run=:					;;
+      --features)       func_features					;;
+      --finish)		mode="finish"					;;
+
+      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			case $1 in
+			  # Valid mode arguments:
+			  clean)	;;
+			  compile)	;;
+			  execute)	;;
+			  finish)	;;
+			  install)	;;
+			  link)		;;
+			  relink)	;;
+			  uninstall)	;;
+
+			  # Catch anything else as an error
+			  *) func_error "invalid argument for $opt"
+			     exit_cmd=exit
+			     break
+			     ;;
+		        esac
+
+			mode="$1"
+			shift
+			;;
+
+      --preserve-dup-deps)
+			opt_duplicate_deps=:				;;
+
+      --quiet|--silent)	preserve_args="$preserve_args $opt"
+			opt_silent=:
+			;;
+
+      --verbose| -v)	preserve_args="$preserve_args $opt"
+			opt_silent=false
+			;;
+
+      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			preserve_args="$preserve_args $opt $1"
+			func_enable_tag "$1"	# tagname is set here
+			shift
+			;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+			func_opt_split "$opt"
+			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+			shift
+			;;
+
+      -\?|-h)		func_usage					;;
+      --help)		opt_help=:					;;
+      --version)	func_version					;;
+
+      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+
+      *)		nonopt="$opt"
+			break
+			;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
       ;;
     *)
-      # If we have no mode, but dlfiles were specified, then do execute mode.
-      test -n "$execute_dlfiles" && mode=execute
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
 
-      # Just use the default operation mode.
-      if test -z "$mode"; then
-	if test -n "$nonopt"; then
-	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
-	else
-	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
-	fi
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
       fi
-      ;;
-    esac
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
   fi
 
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
   # Only execute mode is allowed to have -dlopen flags.
   if test -n "$execute_dlfiles" && test "$mode" != execute; then
-    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
-    $echo "$help" 1>&2
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
     exit $EXIT_FAILURE
   fi
 
   # Change the help message to a mode-specific one.
   generic_help="$help"
-  help="Try \`$modename --help --mode=$mode' for more information."
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+	func_dirname_and_basename "$1" "" "."
+	func_stripname '' '.exe' "$func_basename_result"
+	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
 
-  # These modes are in order of execution frequency so that they run quickly.
-  case $mode in
-  # libtool compile mode
-  compile)
-    modename="$modename: compile"
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_quote_for_eval "$arg"
+	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	    done
+	    case "$@ " in
+	      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
     # Get the compilation command and the source file.
     base_compile=
     srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
@@ -664,6 +1109,7 @@ if test -z "$show_help"; then
     arg_mode=normal
     libobj=
     later=
+    pie_flag=
 
     for arg
     do
@@ -684,15 +1130,18 @@ if test -z "$show_help"; then
 	# Accept any command-line options.
 	case $arg in
 	-o)
-	  if test -n "$libobj" ; then
-	    $echo "$modename: you cannot specify \`-o' more than once" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
 
-	-static | -prefer-pic | -prefer-non-pic)
+	-pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
 	  later="$later $arg"
 	  continue
 	  ;;
@@ -708,31 +1157,25 @@ if test -z "$show_help"; then
 	  ;;            #  replaced later.  I would guess that would be a bug.
 
 	-Wc,*)
-	  args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
 	  lastarg=
 	  save_ifs="$IFS"; IFS=','
- 	  for arg in $args; do
+	  for arg in $args; do
 	    IFS="$save_ifs"
-
-	    # Double-quote args containing other shell metacharacters.
-	    # Many Bourne shells cannot handle close brackets correctly
-	    # in scan sets, so we specify it separately.
-	    case $arg in
-	      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	      arg="\"$arg\""
-	      ;;
-	    esac
-	    lastarg="$lastarg $arg"
+	    func_quote_for_eval "$arg"
+	    lastarg="$lastarg $func_quote_for_eval_result"
 	  done
 	  IFS="$save_ifs"
-	  lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
 
 	  # Add the arguments to base_compile.
 	  base_compile="$base_compile $lastarg"
 	  continue
 	  ;;
 
-	* )
+	*)
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
@@ -744,66 +1187,42 @@ if test -z "$show_help"; then
       esac    #  case $arg_mode
 
       # Aesthetically quote the previous argument.
-      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
-      case $lastarg in
-      # Double-quote args containing other shell metacharacters.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, and some SunOS ksh mistreat backslash-escaping
-      # in scan sets (worked around with variable expansion),
-      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
-      # at all, so we specify them separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	lastarg="\"$lastarg\""
-	;;
-      esac
-
-      base_compile="$base_compile $lastarg"
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
     done # for arg
 
     case $arg_mode in
     arg)
-      $echo "$modename: you must specify an argument for -Xcompile"
-      exit $EXIT_FAILURE
+      func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      $echo "$modename: you must specify a target with \`-o'" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_error "you must specify a target with \`-o'"
       ;;
     *)
       # Get the name of the library object.
-      [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
       ;;
     esac
 
     # Recognize several different file suffixes.
     # If the user specifies -o file.o, it is replaced with file.lo
-    xform='[cCFSifmso]'
     case $libobj in
-    *.ada) xform=ada ;;
-    *.adb) xform=adb ;;
-    *.ads) xform=ads ;;
-    *.asm) xform=asm ;;
-    *.c++) xform=c++ ;;
-    *.cc) xform=cc ;;
-    *.ii) xform=ii ;;
-    *.class) xform=class ;;
-    *.cpp) xform=cpp ;;
-    *.cxx) xform=cxx ;;
-    *.[fF][09]?) xform=[fF][09]. ;;
-    *.for) xform=for ;;
-    *.java) xform=java ;;
-    *.obj) xform=obj ;;
-    *.sx) xform=sx ;;
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
     esac
 
-    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
     case $libobj in
-    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
       ;;
     esac
 
@@ -811,7 +1230,15 @@ if test -z "$show_help"; then
 
     for arg in $later; do
       case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
       -static)
+	build_libtool_libs=no
 	build_old_libs=yes
 	continue
 	;;
@@ -828,28 +1255,17 @@ if test -z "$show_help"; then
       esac
     done
 
-    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
-    case $qlibobj in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qlibobj="\"$qlibobj\"" ;;
-    esac
-    test "X$libobj" != "X$qlibobj" \
-	&& $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' 	&()|`$[]' \
-	&& $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
-    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
-    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$xdir" = "X$obj"; then
-      xdir=
-    else
-      xdir=$xdir/
-    fi
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
     lobj=${xdir}$objdir/$objname
 
-    if test -z "$base_compile"; then
-      $echo "$modename: you must specify a compilation command" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
     if test "$build_old_libs" = yes; then
@@ -858,12 +1274,9 @@ if test -z "$show_help"; then
       removelist="$lobj $libobj ${libobj}T"
     fi
 
-    $run $rm $removelist
-    trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
     # On Cygwin there's no "real" PIC flag so we must build both object types
     case $host_os in
-    cygwin* | mingw* | pw32* | os2*)
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
       pic_mode=default
       ;;
     esac
@@ -875,10 +1288,8 @@ if test -z "$show_help"; then
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
     if test "$compiler_c_o" = no; then
-      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
       lockfile="$output_obj.lock"
-      removelist="$removelist $output_obj $lockfile"
-      trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
     else
       output_obj=
       need_locks=no
@@ -888,13 +1299,13 @@ if test -z "$show_help"; then
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
     if test "$need_locks" = yes; then
-      until $run ln "$progpath" "$lockfile" 2>/dev/null; do
-	$show "Waiting for $lockfile to be removed"
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
     elif test "$need_locks" = warn; then
       if test -f "$lockfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile exists and contains:
 `cat $lockfile 2>/dev/null`
 
@@ -905,34 +1316,22 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
-      $echo "$srcfile" > "$lockfile"
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
     fi
 
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
     if test -n "$fix_srcfile_path"; then
       eval srcfile=\"$fix_srcfile_path\"
     fi
-    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
-    case $qsrcfile in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      qsrcfile="\"$qsrcfile\"" ;;
-    esac
-
-    $run $rm "$libobj" "${libobj}T"
-
-    # Create a libtool object file (analogous to a ".la" file),
-    # but don't create it if we're doing a dry run.
-    test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
     if test "$build_libtool_libs" = yes; then
@@ -946,32 +1345,19 @@ EOF
 	command="$base_compile $qsrcfile"
       fi
 
-      if test ! -d "${xdir}$objdir"; then
-	$show "$mkdir ${xdir}$objdir"
-	$run $mkdir ${xdir}$objdir
-	exit_status=$?
-	if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
-	  exit $exit_status
-	fi
-      fi
+      func_mkdir_p "$xdir$objdir"
 
       if test -z "$output_obj"; then
 	# Place PIC objects in $objdir
 	command="$command -o $lobj"
       fi
 
-      $run $rm "$lobj" "$output_obj"
-
-      $show "$command"
-      if $run eval $lt_env "$command"; then :
-      else
-	test -n "$output_obj" && $run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
       if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -985,45 +1371,27 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed, then go on to compile the next one
       if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
-	$show "$mv $output_obj $lobj"
-	if $run $mv $output_obj $lobj; then :
-	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
-	fi
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
       fi
 
-      # Append the name of the PIC object to the libtool object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
       # Allow error messages only from the first compilation.
       if test "$suppress_opt" = yes; then
-        suppress_output=' >/dev/null 2>&1'
+	suppress_output=' >/dev/null 2>&1'
       fi
-    else
-      # No PIC object so indicate it doesn't exist in the libtool
-      # object file.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
     fi
 
     # Only build a position-dependent object if we build old libraries.
     if test "$build_old_libs" = yes; then
       if test "$pic_mode" != yes; then
 	# Don't build PIC code
-	command="$base_compile $qsrcfile"
+	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
@@ -1033,17 +1401,12 @@ EOF
 
       # Suppress compiler output if we already did a PIC compilation.
       command="$command$suppress_output"
-      $run $rm "$obj" "$output_obj"
-      $show "$command"
-      if $run eval $lt_env "$command"; then :
-      else
-	$run $rm $removelist
-	exit $EXIT_FAILURE
-      fi
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
       if test "$need_locks" = warn &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
-	$echo "\
+	$ECHO "\
 *** ERROR, $lockfile contains:
 `cat $lockfile 2>/dev/null`
 
@@ -1057,53 +1420,2620 @@ repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
 
-	$run $rm $removelist
+	$opt_dry_run || $RM $removelist
 	exit $EXIT_FAILURE
       fi
 
       # Just move the object if needed
       if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
-	$show "$mv $output_obj $obj"
-	if $run $mv $output_obj $obj; then :
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to building PIC objects only
+  -prefer-non-pic   try to building non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    $ECHO
+    $ECHO "Try \`$progname --help' for more information about other modes."
+
+    exit $?
+}
+
+  # Now that we've collected a possible --mode arg, show help if necessary
+  $opt_help && func_mode_help
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
 	else
-	  error=$?
-	  $run $rm $removelist
-	  exit $error
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
 	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
       fi
+    done
 
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
 
-EOF
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
     else
-      # Append the name of the non-PIC object the libtool object file.
-      # Only append if the libtool object file exists.
-      test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	$ECHO "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
 
-EOF
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
     fi
 
-    $run $mv "${libobj}T" "${libobj}"
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
+    $ECHO "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    $ECHO
+    $ECHO "If you ever happen to want to link against installed libraries"
+    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
+    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    $ECHO "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      $ECHO "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
+      $ECHO "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
 
-    # Unlock the critical section if it was locked
-    if test "$need_locks" != no; then
-      $run $rm "$lockfile"
+      $ECHO "   - use the \`$flag' linker flag"
     fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    $ECHO
 
+    $ECHO "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	$ECHO "pages."
+	;;
+      *)
+        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    $ECHO "X----------------------------------------------------------------------" | $Xsed
     exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	case " $install_prog " in
+	*[\\\ /]cp\ *) ;;
+	*) prev=$arg ;;
+	esac
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_verbose "extracting global C symbols from \`$progfile'"
+	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+	  $opt_dry_run || {
+	    eval '$ECHO ": $name " >> "$nlist"'
+	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	  }
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* )
+	    $ECHO >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+	    lt_dlsym_const= ;;
+	  *osf5*)
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+	    lt_dlsym_const= ;;
+	  *)
+	    lt_dlsym_const=const ;;
+	  esac
+
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  $ECHO >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
     ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
 
-  # libtool link mode
-  link | relink)
-    modename="$modename: link"
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+
+# func_emit_wrapper_part1 [arg=no]
+#
+# Emit the first part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part1 ()
+{
+	func_emit_wrapper_part1_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part1_arg1=$1
+	fi
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    ECHO=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$ECHO works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$ECHO will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$ECHO "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+  done
+"
+}
+# end: func_emit_wrapper_part1
+
+# func_emit_wrapper_part2 [arg=no]
+#
+# Emit the second part of a libtool wrapper script on stdout.
+# For more information, see the description associated with
+# func_emit_wrapper(), below.
+func_emit_wrapper_part2 ()
+{
+	func_emit_wrapper_part2_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_part2_arg1=$1
+	fi
+
+	$ECHO "\
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2* | *-cegcc*)
+	  $ECHO "\
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $ECHO "\
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+# end: func_emit_wrapper_part2
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=no
+	if test -n "$1" ; then
+	  func_emit_wrapper_arg1=$1
+	fi
+
+	# split this up so that func_emit_cwrapperexe_src
+	# can call each part independently.
+	func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
+	func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1" ; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_tmp1=`cygpath -w "$1"`
+            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=""
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1" ; then
     case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+        func_to_host_pathlist_tmp2="$1"
+        # Once set for this call, this variable should not be
+        # reassigned. It is used in tha fallback case.
+        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
+          $SED -e 's|^:*||' -e 's|:*$||'`
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
+            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
+              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
+            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
+                  fi
+                fi
+              fi
+              IFS=:
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result" ; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  '$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+
+   Currently, it simply execs the wrapper *script* "$SHELL $output",
+   but could eventually absorb all of the scripts functionality and
+   exec $objdir/$outputname directly.
+*/
+EOF
+	    cat <<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+# define setmode _setmode
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+#  define HAVE_SETENV
+#  ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+#  endif
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+#ifdef _MSC_VER
+# define S_IXUSR _S_IEXEC
+# define stat _stat
+# ifndef _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifdef __CYGWIN__
+# define FOPEN_WB "wb"
+#endif
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#undef LTWRAPPER_DEBUGPRINTF
+#if defined DEBUGWRAPPER
+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+static void
+ltwrapper_debugprintf (const char *fmt, ...)
+{
+    va_list args;
+    va_start (args, fmt);
+    (void) vfprintf (stderr, fmt, args);
+    va_end (args);
+}
+#else
+# define LTWRAPPER_DEBUGPRINTF(args)
+#endif
+
+const char *program_name = NULL;
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_opt_process_env_set (const char *arg);
+void lt_opt_process_env_prepend (const char *arg);
+void lt_opt_process_env_append (const char *arg);
+int lt_split_name_value (const char *arg, char** name, char** value);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+
+static const char *script_text_part1 =
+EOF
+
+	    func_emit_wrapper_part1 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+	    cat <<EOF
+
+static const char *script_text_part2 =
+EOF
+	    func_emit_wrapper_part2 yes |
+	        $SED -e 's/\([\\"]\)/\\\1/g' \
+	             -e 's/^/  "/' -e 's/$/\\n"/'
+	    echo ";"
+
+	    cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+
+static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+
+static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
+static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
+  /* argument is putenv-style "foo=bar", value of foo is set to bar */
+
+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
+static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
+  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
+
+static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
+static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
+  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+
+  /* very simple arg parsing; don't want to rely on getopt */
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  printf ("%s", script_text_part1);
+	  printf ("%s", script_text_part2);
+	  return 0;
+	}
+    }
+
+  newargz = XMALLOC (char *, argc + 1);
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal ("Couldn't find %s", argv[0]);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+			  tmp_pathspec));
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+			  actual_cwrapper_path));
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+			  target_name));
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
+        {
+          if (argv[i][env_set_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_set_opt_len + 1;
+              lt_opt_process_env_set (p);
+            }
+          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_set (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_set_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
+        {
+          if (argv[i][env_prepend_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_prepend_opt_len + 1;
+              lt_opt_process_env_prepend (p);
+            }
+          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_prepend_opt);
+          continue;
+        }
+      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
+        {
+          if (argv[i][env_append_opt_len] == '=')
+            {
+              const char *p = argv[i] + env_append_opt_len + 1;
+              lt_opt_process_env_append (p);
+            }
+          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
+            {
+              lt_opt_process_env_append (argv[++i]); /* don't copy */
+            }
+          else
+            lt_fatal ("%s missing required argument", env_append_opt);
+          continue;
+        }
+      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  for (i = 0; i < newargc; i++)
+    {
+      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal ("Memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal ("getcwd failed");
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal ("getcwd failed");
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+			      tmp_pathspec));
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  char *errstr = strerror (errno);
+	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal ("Could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+static void
+lt_error_core (int exit_status, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s: %s: ", program_name, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  va_end (ap);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+int
+lt_split_name_value (const char *arg, char** name, char** value)
+{
+  const char *p;
+  int len;
+  if (!arg || !*arg)
+    return 1;
+
+  p = strchr (arg, (int)'=');
+
+  if (!p)
+    return 1;
+
+  *value = xstrdup (++p);
+
+  len = strlen (arg) - strlen (*value);
+  *name = XMALLOC (char, len);
+  strncpy (*name, arg, len-1);
+  (*name)[len - 1] = '\0';
+
+  return 0;
+}
+
+void
+lt_opt_process_env_set (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
+    }
+
+  lt_setenv (name, value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_prepend (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 0);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_opt_process_env_append (const char *arg)
+{
+  char *name = NULL;
+  char *value = NULL;
+  char *new_value = NULL;
+
+  if (lt_split_name_value (arg, &name, &value) != 0)
+    {
+      XFREE (name);
+      XFREE (value);
+      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
+    }
+
+  new_value = lt_extend_str (getenv (name), value, 1);
+  lt_setenv (name, new_value);
+  XFREE (new_value);
+  XFREE (name);
+  XFREE (value);
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                          (name ? name : "<NULL>"),
+                          (value ? value : "<NULL>")));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
       # which system we are compiling for in order to pass an extra
@@ -1121,10 +4051,10 @@ EOF
       allow_undefined=yes
       ;;
     esac
-    libtool_args="$nonopt"
+    libtool_args=$nonopt
     base_compile="$nonopt $@"
-    compile_command="$nonopt"
-    finalize_command="$nonopt"
+    compile_command=$nonopt
+    finalize_command=$nonopt
 
     compile_rpath=
     finalize_rpath=
@@ -1139,6 +4069,7 @@ EOF
     dllsearchpath=
     lib_search_path=`pwd`
     inst_prefix_dir=
+    new_inherited_linker_flags=
 
     avoid_version=no
     dlfiles=
@@ -1154,7 +4085,6 @@ EOF
     no_install=no
     objs=
     non_pic_objects=
-    notinst_path= # paths that contain not-installed libtool libraries
     precious_files_regex=
     prefer_static_libs=no
     preload=no
@@ -1168,19 +4098,25 @@ EOF
     thread_safe=no
     vinfo=
     vinfo_number=no
+    weak_libs=
     single_module="${wl}-single_module"
-
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
     for arg
     do
       case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
 	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
-	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
 	    dlopen_self=$dlopen_self_static
@@ -1214,20 +4150,16 @@ EOF
     while test "$#" -gt 0; do
       arg="$1"
       shift
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
-	;;
-      *) qarg=$arg ;;
-      esac
-      libtool_args="$libtool_args $qarg"
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
 
       # If the previous option needs an argument, assign it.
       if test -n "$prev"; then
 	case $prev in
 	output)
-	  compile_command="$compile_command @OUTPUT@"
-	  finalize_command="$finalize_command @OUTPUT@"
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
 	  ;;
 	esac
 
@@ -1235,8 +4167,8 @@ EOF
 	dlfiles|dlprefiles)
 	  if test "$preload" = no; then
 	    # Add the symbol object into the linking commands.
-	    compile_command="$compile_command @SYMFILE@"
-	    finalize_command="$finalize_command @SYMFILE@"
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
 	    preload=yes
 	  fi
 	  case $arg in
@@ -1274,10 +4206,8 @@ EOF
 	  ;;
 	expsyms)
 	  export_symbols="$arg"
-	  if test ! -f "$arg"; then
-	    $echo "$modename: symbol file \`$arg' does not exist"
-	    exit $EXIT_FAILURE
-	  fi
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
@@ -1286,18 +4216,21 @@ EOF
 	  prev=
 	  continue
 	  ;;
-	inst_prefix)
-	  inst_prefix_dir="$arg"
-	  prev=
-	  continue
-	  ;;
-	precious_regex)
-	  precious_files_regex="$arg"
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
 	  prev=
 	  continue
 	  ;;
-	release)
-	  release="-$arg"
+	inst_prefix)
+	  inst_prefix_dir="$arg"
 	  prev=
 	  continue
 	  ;;
@@ -1305,39 +4238,30 @@ EOF
 	  if test -f "$arg"; then
 	    save_arg=$arg
 	    moreargs=
-	    for fil in `cat $save_arg`
+	    for fil in `cat "$save_arg"`
 	    do
 #	      moreargs="$moreargs $fil"
 	      arg=$fil
 	      # A libtool-controlled object.
 
 	      # Check to see that this really is a libtool object.
-	      if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	      if func_lalib_unsafe_p "$arg"; then
 		pic_object=
 		non_pic_object=
 
 		# Read the .lo file
-		# If there is no directory component, then add one.
-		case $arg in
-		*/* | *\\*) . $arg ;;
-		*) . ./$arg ;;
-		esac
+		func_source "$arg"
 
-		if test -z "$pic_object" || \
+		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none && \
+		   test "$pic_object" = none &&
 		   test "$non_pic_object" = none; then
-		  $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-		  exit $EXIT_FAILURE
+		  func_fatal_error "cannot find name of object for \`$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
-		xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		if test "X$xdir" = "X$arg"; then
-		  xdir=
-		else
-		  xdir="$xdir/"
-		fi
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
 
 		if test "$pic_object" != none; then
 		  # Prepend the subdirectory the object is found in.
@@ -1362,7 +4286,7 @@ EOF
 		  fi
 
 		  # A PIC object.
-		  libobjs="$libobjs $pic_object"
+		  func_append libobjs " $pic_object"
 		  arg="$pic_object"
 		fi
 
@@ -1372,7 +4296,7 @@ EOF
 		  non_pic_object="$xdir$non_pic_object"
 
 		  # A standard non-PIC object
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_append non_pic_objects " $non_pic_object"
 		  if test -z "$pic_object" || test "$pic_object" = none ; then
 		    arg="$non_pic_object"
 		  fi
@@ -1380,46 +4304,48 @@ EOF
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
 		  non_pic_object="$pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
 		# Only an error if not doing a dry-run.
-		if test -z "$run"; then
-		  $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-		  exit $EXIT_FAILURE
-		else
-		  # Dry-run case.
-
+		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
-		  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-		  if test "X$xdir" = "X$arg"; then
-		    xdir=
-		  else
-		    xdir="$xdir/"
-		  fi
-
-		  pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-		  non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-		  libobjs="$libobjs $pic_object"
-		  non_pic_objects="$non_pic_objects $non_pic_object"
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    $echo "$modename: link input file \`$save_arg' does not exist"
-	    exit $EXIT_FAILURE
+	    func_fatal_error "link input file \`$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
 	rpath | xrpath)
 	  # We need an absolute path.
 	  case $arg in
 	  [\\/]* | [A-Za-z]:[\\/]*) ;;
 	  *)
-	    $echo "$modename: only absolute run-paths are allowed" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
 	  if test "$prev" = rpath; then
@@ -1436,39 +4362,37 @@ EOF
 	  prev=
 	  continue
 	  ;;
-	xcompiler)
-	  compiler_flags="$compiler_flags $qarg"
+	shrext)
+	  shrext_cmds="$arg"
 	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
 	  continue
 	  ;;
-	xlinker)
-	  linker_flags="$linker_flags $qarg"
-	  compiler_flags="$compiler_flags $wl$qarg"
+	weak)
+	  weak_libs="$weak_libs $arg"
 	  prev=
-	  compile_command="$compile_command $wl$qarg"
-	  finalize_command="$finalize_command $wl$qarg"
 	  continue
 	  ;;
 	xcclinker)
 	  linker_flags="$linker_flags $qarg"
 	  compiler_flags="$compiler_flags $qarg"
 	  prev=
-	  compile_command="$compile_command $qarg"
-	  finalize_command="$finalize_command $qarg"
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
-	shrext)
-  	  shrext_cmds="$arg"
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
 	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
 	  continue
 	  ;;
-	darwin_framework|darwin_framework_skip)
-	  test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
 	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
 	  continue
 	  ;;
 	*)
@@ -1484,16 +4408,16 @@ EOF
       case $arg in
       -all-static)
 	if test -n "$link_static_flag"; then
-	  compile_command="$compile_command $link_static_flag"
-	  finalize_command="$finalize_command $link_static_flag"
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
 	fi
 	continue
 	;;
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
-	continue
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -1518,8 +4442,7 @@ EOF
 
       -export-symbols | -export-symbols-regex)
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	  $echo "$modename: more than one -exported-symbols argument is not allowed"
-	  exit $EXIT_FAILURE
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
 	if test "X$arg" = "X-export-symbols"; then
 	  prev=expsyms
@@ -1529,15 +4452,8 @@ EOF
 	continue
 	;;
 
-      -framework|-arch|-isysroot)
-	case " $CC " in
-	  *" ${arg} ${1} "* | *" ${arg}	${1} "*) 
-		prev=darwin_framework_skip ;;
-	  *) compiler_flags="$compiler_flags $arg"
-	     prev=darwin_framework ;;
-	esac
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+      -framework)
+	prev=framework
 	continue
 	;;
 
@@ -1551,25 +4467,30 @@ EOF
       -L[A-Z][A-Z]*:*)
 	case $with_gcc/$host in
 	no/*-*-irix* | /*-*-irix*)
-	  compile_command="$compile_command $arg"
-	  finalize_command="$finalize_command $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
 	  ;;
 	esac
 	continue
 	;;
 
       -L*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	func_stripname '-L' '' "$arg"
+	dir=$func_stripname_result
+	if test -z "$dir"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
 	*)
 	  absdir=`cd "$dir" && pwd`
-	  if test -z "$absdir"; then
-	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
-	    absdir="$dir"
-	    notinst_path="$notinst_path $dir"
-	  fi
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
 	  dir="$absdir"
 	  ;;
 	esac
@@ -1581,14 +4502,16 @@ EOF
 	  ;;
 	esac
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
 	  *) dllsearchpath="$dllsearchpath:$dir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
 	  *) dllsearchpath="$dllsearchpath:$testbindir";;
 	  esac
 	  ;;
@@ -1599,7 +4522,7 @@ EOF
       -l*)
 	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
 	    # These systems don't actually have a C or math library (as such)
 	    continue
 	    ;;
@@ -1613,7 +4536,7 @@ EOF
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    continue
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
@@ -1637,20 +4560,30 @@ EOF
 	continue
 	;;
 
+      -module)
+	module=yes
+	continue
+	;;
+
       # Tru64 UNIX uses -model [arg] to determine the layout of C++
       # classes, name mangling, and exception handling.
-      -model)
-	compile_command="$compile_command $arg"
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
 	compiler_flags="$compiler_flags $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
 	prev=xcompiler
 	continue
 	;;
 
-     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 	compiler_flags="$compiler_flags $arg"
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	esac
 	continue
 	;;
 
@@ -1659,44 +4592,6 @@ EOF
 	continue
 	;;
 
-      -module)
-	module=yes
-	continue
-	;;
-
-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
-      # +DA*, +DD* enable 64-bit mode on the HP compiler
-      # -q* pass through compiler args for the IBM compiler
-      # -m* pass through architecture-specific compiler args for GCC
-      # -m*, -t[45]*, -txscale* pass through architecture-specific
-      # compiler args for GCC
-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
-      # -F/path gives path to uninstalled frameworks, gcc on darwin
-      # @file GCC response files
-      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
-
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
-        compile_command="$compile_command $arg"
-        finalize_command="$finalize_command $arg"
-        compiler_flags="$compiler_flags $arg"
-        continue
-        ;;
-
-      -shrext)
-	prev=shrext
-	continue
-	;;
-
       -no-fast-install)
 	fast_install=no
 	continue
@@ -1704,11 +4599,11 @@ EOF
 
       -no-install)
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
-	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -1749,13 +4644,13 @@ EOF
 	;;
 
       -R*)
-	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
 	# We need an absolute path.
 	case $dir in
 	[\\/]* | [A-Za-z]:[\\/]*) ;;
 	*)
-	  $echo "$modename: only absolute run-paths are allowed" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "only absolute run-paths are allowed"
 	  ;;
 	esac
 	case "$xrpath " in
@@ -1765,6 +4660,16 @@ EOF
 	continue
 	;;
 
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
       -static | -static-libtool-libs)
 	# The effects of -static are defined in a previous loop.
 	# We used to do the same as -all-static on platforms that
@@ -1783,47 +4688,49 @@ EOF
 	prev=vinfo
 	continue
 	;;
+
       -version-number)
 	prev=vinfo
 	vinfo_number=yes
 	continue
 	;;
 
+      -weak)
+        prev=weak
+	continue
+	;;
+
       -Wc,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
 	arg=
 	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
 	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $flag"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
 	;;
 
       -Wl,*)
-	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
 	arg=
 	save_ifs="$IFS"; IFS=','
 	for flag in $args; do
 	  IFS="$save_ifs"
-	  case $flag in
-	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	    flag="\"$flag\""
-	    ;;
-	  esac
-	  arg="$arg $wl$flag"
-	  compiler_flags="$compiler_flags $wl$flag"
-	  linker_flags="$linker_flags $flag"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+	  linker_flags="$linker_flags $func_quote_for_eval_result"
 	done
 	IFS="$save_ifs"
-	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
 	;;
 
       -Xcompiler)
@@ -1841,16 +4748,36 @@ EOF
 	continue
 	;;
 
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+      # +DA*, +DD* enable 64-bit mode on the HP compiler
+      # -q* pass through compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* pass through architecture-specific
+      # compiler args for GCC
+      # -F/path gives path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+      # @file GCC response files
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
       # Some other compiler flag.
       -* | +*)
-	# Unknown arguments in both finalize_command and compile_command need
-	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
 	;;
 
       *.$objext)
@@ -1862,32 +4789,23 @@ EOF
 	# A libtool-controlled object.
 
 	# Check to see that this really is a libtool object.
-	if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	if func_lalib_unsafe_p "$arg"; then
 	  pic_object=
 	  non_pic_object=
 
 	  # Read the .lo file
-	  # If there is no directory component, then add one.
-	  case $arg in
-	  */* | *\\*) . $arg ;;
-	  *) . ./$arg ;;
-	  esac
+	  func_source "$arg"
 
-	  if test -z "$pic_object" || \
+	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none && \
+	     test "$pic_object" = none &&
 	     test "$non_pic_object" = none; then
-	    $echo "$modename: cannot find name of object for \`$arg'" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "cannot find name of object for \`$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
-	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	  if test "X$xdir" = "X$arg"; then
-	    xdir=
- 	  else
-	    xdir="$xdir/"
-	  fi
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
 
 	  if test "$pic_object" != none; then
 	    # Prepend the subdirectory the object is found in.
@@ -1912,7 +4830,7 @@ EOF
 	    fi
 
 	    # A PIC object.
-	    libobjs="$libobjs $pic_object"
+	    func_append libobjs " $pic_object"
 	    arg="$pic_object"
 	  fi
 
@@ -1922,7 +4840,7 @@ EOF
 	    non_pic_object="$xdir$non_pic_object"
 
 	    # A standard non-PIC object
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_append non_pic_objects " $non_pic_object"
 	    if test -z "$pic_object" || test "$pic_object" = none ; then
 	      arg="$non_pic_object"
 	    fi
@@ -1930,28 +4848,22 @@ EOF
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
 	    non_pic_object="$pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
 	  # Only an error if not doing a dry-run.
-	  if test -z "$run"; then
-	    $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
-	    exit $EXIT_FAILURE
-	  else
-	    # Dry-run case.
-
+	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
-	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
-	    if test "X$xdir" = "X$arg"; then
-	      xdir=
-	    else
-	      xdir="$xdir/"
-	    fi
-
-	    pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
-	    non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
-	    libobjs="$libobjs $pic_object"
-	    non_pic_objects="$non_pic_objects $non_pic_object"
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -1984,70 +4896,51 @@ EOF
       *)
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
-	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-	case $arg in
-	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	  arg="\"$arg\""
-	  ;;
-	esac
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
 	;;
       esac # arg
 
       # Now actually substitute the argument into the commands.
       if test -n "$arg"; then
-	compile_command="$compile_command $arg"
-	finalize_command="$finalize_command $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
       fi
     done # argument parsing loop
 
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
 
     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
-      compile_command="$compile_command $arg"
-      finalize_command="$finalize_command $arg"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
     fi
 
     oldlibs=
     # calculate the name of the file, without its directory
-    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    func_basename "$output"
+    outputname="$func_basename_result"
     libobjs_save="$libobjs"
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
-    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
-    if test "X$output_objdir" = "X$output"; then
-      output_objdir="$objdir"
-    else
-      output_objdir="$output_objdir/$objdir"
-    fi
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
     # Create the object directory.
-    if test ! -d "$output_objdir"; then
-      $show "$mkdir $output_objdir"
-      $run $mkdir $output_objdir
-      exit_status=$?
-      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
-	exit $exit_status
-      fi
-    fi
+    func_mkdir_p "$output_objdir"
 
     # Determine the type of output
     case $output in
     "")
-      $echo "$modename: you must specify an output file" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
+      func_fatal_help "you must specify an output file"
       ;;
     *.$libext) linkmode=oldlib ;;
     *.lo | *.$objext) linkmode=obj ;;
@@ -2055,22 +4948,13 @@ EOF
     *) linkmode=prog ;; # Anything else should be a program.
     esac
 
-    case $host in
-    *cygwin* | *mingw* | *pw32*)
-      # don't eliminate duplications in $postdeps and $predeps
-      duplicate_compiler_generated_deps=yes
-      ;;
-    *)
-      duplicate_compiler_generated_deps=$duplicate_deps
-      ;;
-    esac
     specialdeplibs=
 
     libs=
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if test "X$duplicate_deps" = "Xyes" ; then
+      if $opt_duplicate_deps ; then
 	case "$libs " in
 	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	esac
@@ -2085,7 +4969,7 @@ EOF
       # $postdeps and mark them as special (i.e., whose duplicates are
       # not to be eliminated).
       pre_post_deps=
-      if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+      if $opt_duplicate_compiler_generated_deps; then
 	for pre_post_dep in $predeps $postdeps; do
 	  case "$pre_post_deps " in
 	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
@@ -2101,15 +4985,16 @@ EOF
     newlib_search_path=
     need_relink=no # whether we're linking any uninstalled libtool libraries
     notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
     case $linkmode in
     lib)
-	passes="conv link"
+	passes="conv dlpreopen link"
 	for file in $dlfiles $dlprefiles; do
 	  case $file in
 	  *.la) ;;
 	  *)
-	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -2125,7 +5010,20 @@ EOF
     *)  passes="conv"
 	;;
     esac
+
     for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
       if test "$linkmode,$pass" = "lib,link" ||
 	 test "$linkmode,$pass" = "prog,scan"; then
 	libs="$deplibs"
@@ -2138,11 +5036,33 @@ EOF
 	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 	esac
       fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  case $lib in
+	  *.la)	func_source "$lib" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) deplibs="$deplibs $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
       if test "$pass" = dlopen; then
 	# Collect dlpreopened libraries
 	save_deplibs="$deplibs"
 	deplibs=
       fi
+
       for deplib in $libs; do
 	lib=
 	found=no
@@ -2153,15 +5073,22 @@ EOF
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    compiler_flags="$compiler_flags $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
 	  fi
 	  continue
 	  ;;
 	-l*)
 	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    func_warning "\`-l' is ignored for archives/objects"
 	    continue
 	  fi
-	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
 	  if test "$linkmode" = lib; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
@@ -2197,21 +5124,17 @@ EOF
 	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
-		if (${SED} -e '2q' $lib |
-                    grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+		if func_lalib_p "$lib"; then
 		  library_names=
 		  old_library=
-		  case $lib in
-		  */* | *\\*) . $lib ;;
-		  *) . ./$lib ;;
-		  esac
+		  func_source "$lib"
 		  for l in $old_library $library_names; do
 		    ll="$l"
 		  done
 		  if test "X$ll" = "X$old_library" ; then # only static version available
 		    found=no
-		    ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-		    test "X$ladir" = "X$lib" && ladir="."
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
 		    lib=$ladir/$old_library
 		    if test "$linkmode,$pass" = "prog,link"; then
 		      compile_deplibs="$deplib $compile_deplibs"
@@ -2223,19 +5146,35 @@ EOF
 		    continue
 		  fi
 		fi
-	        ;;
+		;;
 	      *) ;;
 	      esac
 	    fi
 	  fi
 	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
 	-L*)
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
 	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
 	    ;;
 	  prog)
 	    if test "$pass" = conv; then
@@ -2248,17 +5187,19 @@ EOF
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
 	    ;;
 	  *)
-	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    func_warning "\`-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
 	  if test "$pass" = link; then
-	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    func_stripname '-R' '' "$deplib"
+	    dir=$func_stripname_result
 	    # Make sure the xrpath contains only unique directories.
 	    case "$xrpath " in
 	    *" $dir "*) ;;
@@ -2276,35 +5217,41 @@ EOF
 	  fi
 	  case $linkmode in
 	  lib)
-	    valid_a_lib=no
-	    case $deplibs_check_method in
-	      match_pattern*)
-		set dummy $deplibs_check_method
-	        match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
-		if eval $echo \"$deplib\" 2>/dev/null \
-		    | $SED 10q \
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		  valid_a_lib=yes
-		fi
+		    valid_a_lib=yes
+		  fi
 		;;
-	      pass_all)
-		valid_a_lib=yes
+		pass_all)
+		  valid_a_lib=yes
 		;;
-            esac
-	    if test "$valid_a_lib" != yes; then
-	      $echo
-	      $echo "*** Warning: Trying to link with static lib archive $deplib."
-	      $echo "*** I have the capability to make that library automatically link in when"
-	      $echo "*** you link to this library.  But I can only do this if you have a"
-	      $echo "*** shared version of the library, which you do not appear to have"
-	      $echo "*** because the file extensions .$libext of this argument makes me believe"
-	      $echo "*** that it is just a static archive that I should not used here."
-	    else
-	      $echo
-	      $echo "*** Warning: Linking the shared library $output against the"
-	      $echo "*** static library $deplib is not portable!"
-	      deplibs="$deplib $deplibs"
-	    fi
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		$ECHO
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because the file extensions .$libext of this argument makes me believe"
+		$ECHO "*** that it is just a static archive that I should not use here."
+	      else
+		$ECHO
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
 	    continue
 	    ;;
 	  prog)
@@ -2339,21 +5286,18 @@ EOF
 	  continue
 	  ;;
 	esac # case $deplib
+
 	if test "$found" = yes || test -f "$lib"; then :
 	else
-	  $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
 	fi
 
 	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
 
-	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$ladir" = "X$lib" && ladir="."
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
 
 	dlname=
 	dlopen=
@@ -2361,6 +5305,7 @@ EOF
 	libdir=
 	library_names=
 	old_library=
+	inherited_linker_flags=
 	# If the library was installed with an old release of libtool,
 	# it will not redefine variables installed, or shouldnotlink
 	installed=yes
@@ -2369,11 +5314,19 @@ EOF
 
 
 	# Read the .la file
-	case $lib in
-	*/* | *\\*) . $lib ;;
-	*) . ./$lib ;;
-	esac
-
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 	if test "$linkmode,$pass" = "lib,link" ||
 	   test "$linkmode,$pass" = "prog,scan" ||
 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
@@ -2386,26 +5339,24 @@ EOF
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	      exit $EXIT_FAILURE
+	      func_fatal_error "cannot find name of link library for \`$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    convenience="$convenience $ladir/$objdir/$old_library"
 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
-	    tmp_libs=
-	    for deplib in $dependency_libs; do
-	      deplibs="$deplib $deplibs"
-              if test "X$duplicate_deps" = "Xyes" ; then
-	        case "$tmp_libs " in
-	        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
-	        esac
-              fi
-	      tmp_libs="$tmp_libs $deplib"
-	    done
 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "\`$lib' is not a convenience library"
 	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
 	  continue
 	fi # $pass = conv
 
@@ -2416,15 +5367,13 @@ EOF
 	  linklib="$l"
 	done
 	if test -z "$linklib"; then
-	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot find name of link library for \`$lib'"
 	fi
 
 	# This library was specified with -dlopen.
 	if test "$pass" = dlopen; then
 	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
 	  fi
 	  if test -z "$dlname" ||
 	     test "$dlopen_support" != yes ||
@@ -2446,18 +5395,19 @@ EOF
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
-	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
 	    abs_ladir="$ladir"
 	  fi
 	  ;;
 	esac
-	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	func_basename "$lib"
+	laname="$func_basename_result"
 
 	# Find the relevant object directory and library name.
 	if test "X$installed" = Xyes; then
 	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    func_warning "library \`$lib' was moved."
 	    dir="$ladir"
 	    absdir="$abs_ladir"
 	    libdir="$abs_ladir"
@@ -2479,18 +5429,22 @@ EOF
 	    notinst_path="$notinst_path $abs_ladir"
 	  fi
 	fi # $installed = yes
-	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
 	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir"; then
-	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
-	    exit $EXIT_FAILURE
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
 	  fi
 	  # Prefer using a static library (so that no silly _DYNAMIC symbols
 	  # are required to link).
 	  if test -n "$old_library"; then
 	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	    # Keep a list of preopened convenience libraries to check
+	    # that they are being used correctly in the link pass.
+	    test -z "$libdir" && \
+		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
 	  # Otherwise, use the dlname, so that lt_dlopen finds it.
 	  elif test -n "$dlname"; then
 	    newdlprefiles="$newdlprefiles $dir/$dlname"
@@ -2526,7 +5480,9 @@ EOF
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    case $deplib in
-	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    -L*) func_stripname '-L' '' "$deplib"
+	         newlib_search_path="$newlib_search_path $func_stripname_result"
+		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
 	    if test "$linkalldeplibs" = yes; then
@@ -2536,7 +5492,7 @@ EOF
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if test "X$duplicate_deps" = "Xyes" ; then
+	    if $opt_duplicate_deps ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	      esac
@@ -2549,15 +5505,14 @@ EOF
 	if test "$linkmode,$pass" = "prog,link"; then
 	  if test -n "$library_names" &&
 	     { { test "$prefer_static_libs" = no ||
-		 test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
 	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath " in
-	      *" $dir "*) ;;
-	      *" $absdir "*) ;;
-	      *) temp_rpath="$temp_rpath $absdir" ;;
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) temp_rpath="$temp_rpath$absdir:" ;;
 	      esac
 	    fi
 
@@ -2595,27 +5550,43 @@ EOF
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes ; then
+	if test "$use_static_libs" = built && test "$installed" = yes; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
 	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
-	  if test "$installed" = no; then
-	    notinst_deplibs="$notinst_deplibs $lib"
-	    need_relink=yes
-	  fi
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
 	  # This is a shared library
 
-	  # Warn about portability, can't link against -module's on
-	  # some systems (darwin)
-	  if test "$shouldnotlink" = yes && test "$pass" = link ; then
-	    $echo
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    $ECHO
 	    if test "$linkmode" = prog; then
-	      $echo "*** Warning: Linking the executable $output against the loadable module"
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
-	      $echo "*** Warning: Linking the shared library $output against the loadable module"
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
-	    $echo "*** $linklib is not portable!"
+	    $ECHO "*** $linklib is not portable!"
 	  fi
 	  if test "$linkmode" = lib &&
 	     test "$hardcode_into_libs" = yes; then
@@ -2645,17 +5616,19 @@ EOF
 	  if test -n "$old_archive_from_expsyms_cmds"; then
 	    # figure out the soname
 	    set dummy $library_names
-	    realname="$2"
-	    shift; shift
-	    libname=`eval \\$echo \"$libname_spec\"`
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
 	      soname="$dlname"
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw*)
-		major=`expr $current - $age`
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
 		versuffix="-$major"
 		;;
 	      esac
@@ -2666,36 +5639,22 @@ EOF
 
 	    # Make a new name for the extract_expsyms_cmds to use
 	    soroot="$soname"
-	    soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
-	    newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      $show "extracting exported symbol list from \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$extract_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      $show "generating import library for \`$soname'"
-	      save_ifs="$IFS"; IFS='~'
-	      cmds=$old_archive_from_expsyms_cmds
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd" || exit $?
-	      done
-	      IFS="$save_ifs"
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
 	    dir=$output_objdir
@@ -2717,17 +5676,21 @@ EOF
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
 		    *-*-unixware7*) add_dir="-L$dir" ;;
 		  *-*-darwin* )
-		    # if the lib is a module then we can not link against
-		    # it, someone is ignoring the new warnings I added
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-                      $EGREP ": [^:]* bundle" >/dev/null ; then
-		      $echo "** Warning, lib $linklib is a module, not a shared library"
-		      if test -z "$old_library" ; then
-		        $echo
-		        $echo "** And there doesn't seem to be a static archive available"
-		        $echo "** The link will probably fail, sorry"
-		      else
-		        add="$dir/$old_library"
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  $ECHO
+			  $ECHO "*** And there doesn't seem to be a static archive available"
+			  $ECHO "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
 		      fi
 		    fi
 		esac
@@ -2745,7 +5708,8 @@ EOF
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes; then
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
 		add_dir="-L$dir"
@@ -2769,8 +5733,7 @@ EOF
 	    esac
 
 	    if test "$lib_linked" != yes; then
-	      $echo "$modename: configuration error: unsupported hardcode properties"
-	      exit $EXIT_FAILURE
+	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
 	    if test -n "$add_shlibpath"; then
@@ -2785,8 +5748,8 @@ EOF
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes && \
-		 test "$hardcode_minus_L" != yes && \
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
 		 test "$hardcode_shlibpath_var" = yes; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
@@ -2801,7 +5764,8 @@ EOF
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes; then
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
 	      add="$libdir/$linklib"
 	    elif test "$hardcode_minus_L" = yes; then
 	      add_dir="-L$libdir"
@@ -2815,9 +5779,9 @@ EOF
 	    elif test "$hardcode_automatic" = yes; then
 	      if test -n "$inst_prefix_dir" &&
 		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-	        add="$inst_prefix_dir$libdir/$linklib"
+		add="$inst_prefix_dir$libdir/$linklib"
 	      else
-	        add="$libdir/$linklib"
+		add="$libdir/$linklib"
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
@@ -2861,21 +5825,21 @@ EOF
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
-	    $echo
-	    $echo "*** Warning: This system can not link to static lib archive $lib."
-	    $echo "*** I have the capability to make that library automatically link in when"
-	    $echo "*** you link to this library.  But I can only do this if you have a"
-	    $echo "*** shared version of the library, which you do not appear to have."
+	    $ECHO
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** I have the capability to make that library automatically link in when"
+	    $ECHO "*** you link to this library.  But I can only do this if you have a"
+	    $ECHO "*** shared version of the library, which you do not appear to have."
 	    if test "$module" = yes; then
-	      $echo "*** But as you try to build a module library, libtool will still create "
-	      $echo "*** a static module, that should work as long as the dlopening application"
-	      $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      $ECHO "*** But as you try to build a module library, libtool will still create "
+	      $ECHO "*** a static module, that should work as long as the dlopening application"
+	      $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
-		$echo
-		$echo "*** However, this would only work if libtool was able to extract symbol"
-		$echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-		$echo "*** not find such a program.  So, this module is probably useless."
-		$echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		$ECHO
+		$ECHO "*** However, this would only work if libtool was able to extract symbol"
+		$ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		$ECHO "*** not find such a program.  So, this module is probably useless."
+		$ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 	      fi
 	      if test "$build_old_libs" = no; then
 		build_libtool_libs=module
@@ -2899,7 +5863,8 @@ EOF
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
 	      case $libdir in
-	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
 		   case " $xrpath " in
 		   *" $temp_xrpath "*) ;;
 		   *) xrpath="$xrpath $temp_xrpath";;
@@ -2917,7 +5882,7 @@ EOF
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
 	    newdependency_libs="$deplib $newdependency_libs"
-	    if test "X$duplicate_deps" = "Xyes" ; then
+	    if $opt_duplicate_deps ; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 	      esac
@@ -2931,94 +5896,71 @@ EOF
 	      case $deplib in
 	      -L*) path="$deplib" ;;
 	      *.la)
-		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
-		test "X$dir" = "X$deplib" && dir="."
+	        func_dirname "$deplib" "" "."
+		dir="$func_dirname_result"
 		# We need an absolute path.
 		case $dir in
 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    func_warning "cannot determine absolute directory name of \`$dir'"
 		    absdir="$dir"
 		  fi
 		  ;;
 		esac
-		if grep "^installed=no" $deplib > /dev/null; then
-		  path="$absdir/$objdir"
-		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		  if test -z "$libdir"; then
-		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		    exit $EXIT_FAILURE
-		  fi
-		  if test "$absdir" != "$libdir"; then
-		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
-		  fi
-		  path="$absdir"
-		fi
-		depdepl=
+		if $GREP "^installed=no" $deplib > /dev/null; then
 		case $host in
 		*-*-darwin*)
-		  # we do not want to link against static libs,
-		  # but need to link against shared
+		  depdepl=
 		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  if test -n "$deplibrary_names" ; then
 		    for tmp in $deplibrary_names ; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$deplibdir/$depdepl" ; then
-		      depdepl="$deplibdir/$depdepl"
-	      	    elif test -f "$path/$depdepl" ; then
-		      depdepl="$path/$depdepl"
-		    else
-		      # Can't find it, oh well...
-		      depdepl=
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
 		    fi
-		    # do not add paths which are already there
-		    case " $newlib_search_path " in
-		    *" $path "*) ;;
-		    *) newlib_search_path="$newlib_search_path $path";;
-		    esac
 		  fi
-		  path=""
 		  ;;
 		*)
-		  path="-L$path"
-		  ;;
-		esac
-		;;
-	      -l*)
-		case $host in
-		*-*-darwin*)
-		  # Again, we only want to link against shared libraries
-		  eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
-		  for tmp in $newlib_search_path ; do
-		    if test -f "$tmp/lib$tmp_libs.dylib" ; then
-		      eval depdepl="$tmp/lib$tmp_libs.dylib"
-		      break
-		    fi
-		  done
-		  path=""
+		  path="-L$absdir/$objdir"
 		  ;;
-		*) continue ;;
 		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
 		;;
-	      *) continue ;;
 	      esac
 	      case " $deplibs " in
 	      *" $path "*) ;;
 	      *) deplibs="$path $deplibs" ;;
 	      esac
-	      case " $deplibs " in
-	      *" $depdepl "*) ;;
-	      *) deplibs="$depdepl $deplibs" ;;
-	      esac
 	    done
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
       dependency_libs="$newdependency_libs"
       if test "$pass" = dlpreopen; then
 	# Link the dlpreopened libraries before other libraries
@@ -3117,39 +6059,36 @@ EOF
     done # for pass
     if test "$linkmode" = prog; then
       dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
       dlprefiles="$newdlprefiles"
     fi
 
     case $linkmode in
     oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
       esac
 
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
-      fi
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
 
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
-      fi
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
 
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
-      fi
-
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
 
-      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
-	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
-      fi
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
@@ -3161,48 +6100,48 @@ EOF
       # Make sure we only generate libraries of the form `libNAME.la'.
       case $outputname in
       lib*)
-	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
 	eval shared_ext=\"$shrext_cmds\"
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	if test "$module" = no; then
-	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
 	if test "$need_lib_prefix" != no; then
 	  # Add the "lib" prefix for modules if required
-	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
 	  eval shared_ext=\"$shrext_cmds\"
 	  eval libname=\"$libname_spec\"
 	else
-	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
 	fi
 	;;
       esac
 
       if test -n "$objs"; then
 	if test "$deplibs_check_method" != pass_all; then
-	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
-	  exit $EXIT_FAILURE
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
 	else
-	  $echo
-	  $echo "*** Warning: Linking the shared library $output against the non-libtool"
-	  $echo "*** objects $objs is not portable!"
+	  $ECHO
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
 	  libobjs="$libobjs $objs"
 	fi
       fi
 
-      if test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
-      fi
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
-      if test "$#" -gt 2; then
-	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
-      fi
-      install_libdir="$2"
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
 
       oldlibs=
       if test -z "$rpath"; then
@@ -3216,25 +6155,21 @@ EOF
 	  build_old_libs=yes
 	fi
 
-	if test -n "$vinfo"; then
-	  $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
-	fi
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
 
-	if test -n "$release"; then
-	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
-	fi
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
 	save_ifs="$IFS"; IFS=':'
 	set dummy $vinfo 0 0 0
+	shift
 	IFS="$save_ifs"
 
-	if test -n "$8"; then
-	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -3242,9 +6177,9 @@ EOF
 
 	case $vinfo_number in
 	yes)
-	  number_major="$2"
-	  number_minor="$3"
-	  number_revision="$4"
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
@@ -3254,7 +6189,8 @@ EOF
 	  #
 	  case $version_type in
 	  darwin|linux|osf|windows|none)
-	    current=`expr $number_major + $number_minor`
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_revision"
 	    ;;
@@ -3264,7 +6200,8 @@ EOF
 	    age="0"
 	    ;;
 	  irix|nonstopux)
-	    current=`expr $number_major + $number_minor`
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
 	    age="$number_minor"
 	    revision="$number_minor"
 	    lt_irix_increment=no
@@ -3272,9 +6209,9 @@ EOF
 	  esac
 	  ;;
 	no)
-	  current="$2"
-	  revision="$3"
-	  age="$4"
+	  current="$1"
+	  revision="$2"
+	  age="$3"
 	  ;;
 	esac
 
@@ -3282,34 +6219,30 @@ EOF
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
-	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
-	  exit $EXIT_FAILURE
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -3322,10 +6255,12 @@ EOF
 	darwin)
 	  # Like Linux, but with the current version available in
 	  # verstring for coding it into the library header
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
 	  # Darwin ld doesn't like 0 for these options...
-	  minor_current=`expr $current + 1`
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
 	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 	  ;;
@@ -3337,15 +6272,17 @@ EOF
 
 	freebsd-elf)
 	  major=".$current"
-	  versuffix=".$current";
+	  versuffix=".$current"
 	  ;;
 
 	irix | nonstopux)
 	  if test "X$lt_irix_increment" = "Xno"; then
-	    major=`expr $current - $age`
+	    func_arith $current - $age
 	  else
-	    major=`expr $current - $age + 1`
+	    func_arith $current - $age + 1
 	  fi
+	  major=$func_arith_result
+
 	  case $version_type in
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
@@ -3355,8 +6292,10 @@ EOF
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
 	  while test "$loop" -ne 0; do
-	    iface=`expr $revision - $loop`
-	    loop=`expr $loop - 1`
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
 	    verstring="$verstring_prefix$major.$iface:$verstring"
 	  done
 
@@ -3366,20 +6305,24 @@ EOF
 	  ;;
 
 	linux)
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix="$major.$age.$revision"
 	  ;;
 
 	osf)
-	  major=.`expr $current - $age`
+	  func_arith $current - $age
+	  major=.$func_arith_result
 	  versuffix=".$current.$age.$revision"
 	  verstring="$current.$age.$revision"
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
 	  while test "$loop" -ne 0; do
-	    iface=`expr $current - $loop`
-	    loop=`expr $loop - 1`
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
 	    verstring="$verstring:${iface}.0"
 	  done
 
@@ -3387,6 +6330,11 @@ EOF
 	  verstring="$verstring:${current}.0"
 	  ;;
 
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
 	sunos)
 	  major=".$current"
 	  versuffix=".$current.$revision"
@@ -3395,14 +6343,13 @@ EOF
 	windows)
 	  # Use '-' rather than '.', since we only want one
 	  # extension on DOS 8.3 filesystems.
-	  major=`expr $current - $age`
+	  func_arith $current - $age
+	  major=$func_arith_result
 	  versuffix="-$major"
 	  ;;
 
 	*)
-	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
-	  $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
-	  exit $EXIT_FAILURE
+	  func_fatal_configuration "unknown library version type \`$version_type'"
 	  ;;
 	esac
 
@@ -3436,7 +6383,7 @@ EOF
 	# Check to see if the archive will have undefined symbols.
 	if test "$allow_undefined" = yes; then
 	  if test "$allow_undefined_flag" = unsupported; then
-	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    func_warning "undefined symbols not allowed in $host shared libraries"
 	    build_libtool_libs=no
 	    build_old_libs=yes
 	  fi
@@ -3444,21 +6391,26 @@ EOF
 	  # Don't allow undefined symbols.
 	  allow_undefined_flag="$no_undefined_flag"
 	fi
+
       fi
 
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
       if test "$mode" != relink; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
-	tempremovelist=`$echo "$output_objdir/*"`
+	tempremovelist=`$ECHO "$output_objdir/*"`
 	for p in $tempremovelist; do
 	  case $p in
-	    *.$objext)
+	    *.$objext | *.gcno)
 	       ;;
 	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
 	       if test "X$precious_files_regex" != "X"; then
-	         if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
-	         then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
 		   continue
 		 fi
 	       fi
@@ -3467,10 +6419,8 @@ EOF
 	    *) ;;
 	  esac
 	done
-	if test -n "$removelist"; then
-	  $show "${rm}r $removelist"
-	  $run ${rm}r $removelist
-	fi
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
       fi
 
       # Now set the variables for building old libraries.
@@ -3478,14 +6428,14 @@ EOF
 	oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
       #for path in $notinst_path; do
-      #	lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-      #	deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-      #	dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+      #	lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
+      #	deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
       #done
 
       if test -n "$xrpath"; then
@@ -3526,12 +6476,12 @@ EOF
       if test "$build_libtool_libs" = yes; then
 	if test -n "$rpath"; then
 	  case $host in
-	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
 	    # these systems don't actually have a c library (as such)!
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C library is in the System framework
-	    deplibs="$deplibs -framework System"
+	    deplibs="$deplibs System.ltframework"
 	    ;;
 	  *-*-netbsd*)
 	    # Don't link with libc until the a.out ld.so is fixed.
@@ -3545,7 +6495,7 @@ EOF
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
 	    ;;
- 	  *)
+	  *)
 	    # Add libc to deplibs on all other systems if necessary.
 	    if test "$build_libtool_need_lc" = "yes"; then
 	      deplibs="$deplibs -lc"
@@ -3582,17 +6532,18 @@ EOF
 	  # limits. Maybe even breaks it.  We compile a program, linking it
 	  # against the deplibs as a proxy for the library.  Then we can check
 	  # whether they linked in statically or dynamically with ldd.
-	  $rm conftest.c
+	  $opt_dry_run || $RM conftest.c
 	  cat > conftest.c <<EOF
 	  int main() { return 0; }
 EOF
-	  $rm conftest
+	  $opt_dry_run || $RM conftest
 	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
 	    ldd_output=`ldd conftest`
 	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
@@ -3600,37 +6551,40 @@ EOF
 		    i=""
 		    ;;
 		  esac
-	        fi
+		fi
 		if test -n "$i" ; then
-		  libname=`eval \\$echo \"$libname_spec\"`
-		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		  set dummy $deplib_matches
-		  deplib_match=$2
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		    newdeplibs="$newdeplibs $i"
 		  else
 		    droppeddeps=yes
-		    $echo
-		    $echo "*** Warning: dynamic linker does not accept needed library $i."
-		    $echo "*** I have the capability to make that library automatically link in when"
-		    $echo "*** you link to this library.  But I can only do this if you have a"
-		    $echo "*** shared version of the library, which I believe you do not have"
-		    $echo "*** because a test_compile did reveal that the linker did not use it for"
-		    $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		    $ECHO
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    $ECHO "*** I have the capability to make that library automatically link in when"
+		    $ECHO "*** you link to this library.  But I can only do this if you have a"
+		    $ECHO "*** shared version of the library, which I believe you do not have"
+		    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
+		    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
 		  fi
 		fi
-	      else
+		;;
+	      *)
 		newdeplibs="$newdeplibs $i"
-	      fi
+		;;
+	      esac
 	    done
 	  else
 	    # Error occurred in the first compile.  Let's try to salvage
 	    # the situation: Compile a separate program for each library.
 	    for i in $deplibs; do
-	      name=`expr $i : '-l\(.*\)'`
-	      # If $name is empty we are operating on a -L argument.
-              if test "$name" != "" && test "$name" != "0"; then
-		$rm conftest
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
@@ -3642,44 +6596,47 @@ EOF
 		    esac
 		  fi
 		  if test -n "$i" ; then
-		    libname=`eval \\$echo \"$libname_spec\"`
-		    deplib_matches=`eval \\$echo \"$library_names_spec\"`
-		    set dummy $deplib_matches
-		    deplib_match=$2
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
 		      newdeplibs="$newdeplibs $i"
 		    else
 		      droppeddeps=yes
-		      $echo
-		      $echo "*** Warning: dynamic linker does not accept needed library $i."
-		      $echo "*** I have the capability to make that library automatically link in when"
-		      $echo "*** you link to this library.  But I can only do this if you have a"
-		      $echo "*** shared version of the library, which you do not appear to have"
-		      $echo "*** because a test_compile did reveal that the linker did not use this one"
-		      $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		      $ECHO
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      $ECHO "*** I have the capability to make that library automatically link in when"
+		      $ECHO "*** you link to this library.  But I can only do this if you have a"
+		      $ECHO "*** shared version of the library, which you do not appear to have"
+		      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
+		      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
 		    fi
 		  fi
 		else
 		  droppeddeps=yes
-		  $echo
-		  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
-		  $echo "*** make it link in!  You will probably need to install it or some"
-		  $echo "*** library that it depends on before this library will be fully"
-		  $echo "*** functional.  Installing it before continuing would be even better."
+		  $ECHO
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  $ECHO "*** make it link in!  You will probably need to install it or some"
+		  $ECHO "*** library that it depends on before this library will be fully"
+		  $ECHO "*** functional.  Installing it before continuing would be even better."
 		fi
-	      else
+		;;
+	      *)
 		newdeplibs="$newdeplibs $i"
-	      fi
+		;;
+	      esac
 	    done
 	  fi
 	  ;;
 	file_magic*)
-	  set dummy $deplibs_check_method
-	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-            if test "$name" != "" && test  "$name" != "0"; then
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
@@ -3689,13 +6646,13 @@ EOF
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
+		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		      # Follow soft links.
-		      if ls -lLd "$potent_lib" 2>/dev/null \
-			 | grep " -> " >/dev/null; then
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
 			continue
 		      fi
 		      # The statement above tries to avoid entering an
@@ -3708,12 +6665,12 @@ EOF
 			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
 			case $potliblink in
 			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			*) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 			esac
 		      done
-		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
-			 | ${SED} 10q \
-			 | $EGREP "$file_magic_regex" > /dev/null; then
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
 			newdeplibs="$newdeplibs $a_deplib"
 			a_deplib=""
 			break 2
@@ -3723,32 +6680,35 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for file magic test)"
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a file magic. Last file checked: $potlib"
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
 		fi
 	      fi
-	    else
+	      ;;
+	    *)
 	      # Add a -L argument.
 	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
+	      ;;
+	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	match_pattern*)
-	  set dummy $deplibs_check_method
-	  match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 	  for a_deplib in $deplibs; do
-	    name=`expr $a_deplib : '-l\(.*\)'`
-	    # If $name is empty we are operating on a -L argument.
-	    if test -n "$name" && test "$name" != "0"; then
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
@@ -3758,14 +6718,13 @@ EOF
 		esac
 	      fi
 	      if test -n "$a_deplib" ; then
-		libname=`eval \\$echo \"$libname_spec\"`
+		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
 		    potlib="$potent_lib" # see symlink-check above in file_magic test
-		    if eval $echo \"$potent_lib\" 2>/dev/null \
-		        | ${SED} 10q \
-		        | $EGREP "$match_pattern_regex" > /dev/null; then
+		    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      newdeplibs="$newdeplibs $a_deplib"
 		      a_deplib=""
 		      break 2
@@ -3775,44 +6734,46 @@ EOF
 	      fi
 	      if test -n "$a_deplib" ; then
 		droppeddeps=yes
-		$echo
-		$echo "*** Warning: linker path does not have real file for library $a_deplib."
-		$echo "*** I have the capability to make that library automatically link in when"
-		$echo "*** you link to this library.  But I can only do this if you have a"
-		$echo "*** shared version of the library, which you do not appear to have"
-		$echo "*** because I did check the linker path looking for a file starting"
+		$ECHO
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		$ECHO "*** I have the capability to make that library automatically link in when"
+		$ECHO "*** you link to this library.  But I can only do this if you have a"
+		$ECHO "*** shared version of the library, which you do not appear to have"
+		$ECHO "*** because I did check the linker path looking for a file starting"
 		if test -z "$potlib" ; then
-		  $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
-		  $echo "*** with $libname and none of the candidates passed a file format test"
-		  $echo "*** using a regex pattern. Last file checked: $potlib"
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
 		fi
 	      fi
-	    else
+	      ;;
+	    *)
 	      # Add a -L argument.
 	      newdeplibs="$newdeplibs $a_deplib"
-	    fi
+	      ;;
+	    esac
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
 	  newdeplibs=""
-	  tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
-	    -e 's/ -[LR][^ ]*//g'`
+	  tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
+	      -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
 	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
 	    for i in $predeps $postdeps ; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+	      tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
 	    done
 	  fi
-	  if $echo "X $tmp_deplibs" | $Xsed -e 's/[ 	]//g' \
-	    | grep . >/dev/null; then
-	    $echo
+	  if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[	 ]//g' |
+	     $GREP . >/dev/null; then
+	    $ECHO
 	    if test "X$deplibs_check_method" = "Xnone"; then
-	      $echo "*** Warning: inter-library dependencies are not supported in this platform."
+	      $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
-	      $echo "*** Warning: inter-library dependencies are not known to be supported."
+	      $ECHO "*** Warning: inter-library dependencies are not known to be supported."
 	    fi
-	    $echo "*** All declared inter-library dependencies are being dropped."
+	    $ECHO "*** All declared inter-library dependencies are being dropped."
 	    droppeddeps=yes
 	  fi
 	  ;;
@@ -3825,24 +6786,24 @@ EOF
 
 	case $host in
 	*-*-rhapsody* | *-*-darwin1.[012])
-	  # On Rhapsody replace the C library is the System framework
-	  newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	  ;;
 	esac
 
 	if test "$droppeddeps" = yes; then
 	  if test "$module" = yes; then
-	    $echo
-	    $echo "*** Warning: libtool could not satisfy all declared inter-library"
-	    $echo "*** dependencies of module $libname.  Therefore, libtool will create"
-	    $echo "*** a static module, that should work as long as the dlopening"
-	    $echo "*** application is linked with the -dlopen flag."
+	    $ECHO
+	    $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    $ECHO "*** a static module, that should work as long as the dlopening"
+	    $ECHO "*** application is linked with the -dlopen flag."
 	    if test -z "$global_symbol_pipe"; then
-	      $echo
-	      $echo "*** However, this would only work if libtool was able to extract symbol"
-	      $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
-	      $echo "*** not find such a program.  So, this module is probably useless."
-	      $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      $ECHO
+	      $ECHO "*** However, this would only work if libtool was able to extract symbol"
+	      $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      $ECHO "*** not find such a program.  So, this module is probably useless."
+	      $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 	    fi
 	    if test "$build_old_libs" = no; then
 	      oldlibs="$output_objdir/$libname.$libext"
@@ -3852,16 +6813,16 @@ EOF
 	      build_libtool_libs=no
 	    fi
 	  else
-	    $echo "*** The inter-library dependencies that have been dropped here will be"
-	    $echo "*** automatically added whenever a program is linked with this library"
-	    $echo "*** or is declared to -dlopen it."
+	    $ECHO "*** The inter-library dependencies that have been dropped here will be"
+	    $ECHO "*** automatically added whenever a program is linked with this library"
+	    $ECHO "*** or is declared to -dlopen it."
 
 	    if test "$allow_undefined" = no; then
-	      $echo
-	      $echo "*** Since this library must not contain undefined symbols,"
-	      $echo "*** because either the platform does not support them or"
-	      $echo "*** it was explicitly requested with -no-undefined,"
-	      $echo "*** libtool will only create a static version of it."
+	      $ECHO
+	      $ECHO "*** Since this library must not contain undefined symbols,"
+	      $ECHO "*** because either the platform does not support them or"
+	      $ECHO "*** it was explicitly requested with -no-undefined,"
+	      $ECHO "*** libtool will only create a static version of it."
 	      if test "$build_old_libs" = no; then
 		oldlibs="$output_objdir/$libname.$libext"
 		build_libtool_libs=module
@@ -3875,7 +6836,14 @@ EOF
 	# Done checking deplibs!
 	deplibs=$newdeplibs
       fi
-
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
 
       # move library search paths that coincide with paths to not yet
       # installed libraries to the beginning of the library search list
@@ -3904,7 +6872,6 @@ EOF
       done
       deplibs="$new_libs"
 
-
       # All the library-specific variables (install_libdir is set above).
       library_names=
       old_library=
@@ -3949,10 +6916,7 @@ EOF
 	     test -n "$hardcode_libdirs"; then
 	    libdir="$hardcode_libdirs"
 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
-	      case $archive_cmds in
-	      *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
-	      *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
-	      esac
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
 	    else
 	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
 	    fi
@@ -3978,8 +6942,9 @@ EOF
 	eval shared_ext=\"$shrext_cmds\"
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
-	realname="$2"
-	shift; shift
+	shift
+	realname="$1"
+	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
@@ -3998,71 +6963,122 @@ EOF
 	done
 
 	# Use standard objects if they are pic
-	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  delfiles="$delfiles $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
 	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    $show "generating symbol list for \`$libname.la'"
+	    func_verbose "generating symbol list for \`$libname.la'"
 	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
+	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
 	    save_ifs="$IFS"; IFS='~'
 	    for cmd in $cmds; do
 	      IFS="$save_ifs"
 	      eval cmd=\"$cmd\"
-	      if len=`expr "X$cmd" : ".*"` &&
-	       test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
-	        $show "$cmd"
-	        $run eval "$cmd" || exit $?
-	        skipped_export=false
+	      func_len " $cmd"
+	      len=$func_len_result
+	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
 	      else
-	        # The command line is too long to execute in one step.
-	        $show "using reloadable object file for export list..."
-	        skipped_export=:
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
 		# Break out early, otherwise skipped_export may be
 		# set to false by a later but shorter cmd.
 		break
 	      fi
 	    done
 	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex"; then
-	      $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-	      $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
-	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
 	  fi
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	fi
 
 	tmp_deplibs=
 	for test_deplib in $deplibs; do
-		case " $convenience " in
-		*" $test_deplib "*) ;;
-		*)
-			tmp_deplibs="$tmp_deplibs $test_deplib"
-			;;
-		esac
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    ;;
+	  esac
 	done
 	deplibs="$tmp_deplibs"
 
 	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
 	  if test -n "$whole_archive_flag_spec"; then
 	    save_libobjs=$libobjs
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
 	  else
 	    gentop="$output_objdir/${outputname}x"
 	    generated="$generated $gentop"
 
 	    func_extract_archives $gentop $convenience
 	    libobjs="$libobjs $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	fi
-	
+
 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  linker_flags="$linker_flags $flag"
@@ -4070,7 +7086,7 @@ EOF
 
 	# Make a backup of the uninstalled library when relinking
 	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
@@ -4083,22 +7099,24 @@ EOF
 	    cmds=$module_cmds
 	  fi
 	else
-	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	  eval test_cmds=\"$archive_expsym_cmds\"
-	  cmds=$archive_expsym_cmds
-	else
-	  eval test_cmds=\"$archive_cmds\"
-	  cmds=$archive_cmds
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
 	  fi
 	fi
 
 	if test "X$skipped_export" != "X:" &&
-	   len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	   test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  :
 	else
-	  # The command line is too long to link in one step, link piecewise.
-	  $echo "creating reloadable object files..."
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
 
 	  # Save the value of $output and $libobjs because we want to
 	  # use them later.  If we have whole_archive_flag_spec, we
@@ -4112,77 +7130,162 @@ EOF
 	    save_libobjs=$libobjs
 	  fi
 	  save_output=$output
-	  output_la=`$echo "X$output" | $Xsed -e "$basename"`
+	  output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
 
 	  # Clear the reloadable object creation command queue and
 	  # initialize k to one.
 	  test_cmds=
 	  concat_cmds=
 	  objlist=
-	  delfiles=
 	  last_robj=
 	  k=1
-	  output=$output_objdir/$output_la-${k}.$objext
-	  # Loop over the list of objects to be linked.
-	  for obj in $save_libobjs
-	  do
-	    eval test_cmds=\"$reload_cmds $objlist $last_robj\"
-	    if test "X$objlist" = X ||
-	       { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-		 test "$len" -le "$max_cmd_len"; }; then
-	      objlist="$objlist $obj"
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    $ECHO 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    $ECHO ')' >> $output
+	    delfiles="$delfiles $output"
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    delfiles="$delfiles $output"
+	    output=$firstobj\"$file_list_spec$output\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=$obj
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      delfiles="$delfiles $output"
+
 	    else
-	      # The command $test_cmds is almost too long, add a
-	      # command to the queue.
-	      if test "$k" -eq 1 ; then
-		# The first file doesn't have a previous command to add.
-		eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
-	      else
-		# All subsequent reloadable object files will link in
-		# the last one created.
-		eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	      last_robj=$output_objdir/$output_la-${k}.$objext
-	      k=`expr $k + 1`
-	      output=$output_objdir/$output_la-${k}.$objext
-	      objlist=$obj
-	      len=1
 	    fi
-	  done
-	  # Handle the remaining objects by creating one last
-	  # reloadable object file.  All subsequent reloadable object
-	  # files will link in the last one created.
-	  test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	  eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
-	  if ${skipped_export-false}; then
-	    $show "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
-	    $run $rm $export_symbols
-	    libobjs=$output
-	    # Append the command to create the export file.
-	    eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
-          fi
-
-	  # Set up a command to remove the reloadable object files
-	  # after they are used.
-	  i=0
-	  while test "$i" -lt "$k"
-	  do
-	    i=`expr $i + 1`
-	    delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
-	  done
 
-	  $echo "creating a temporary reloadable object file: $output"
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
 
-	  # Loop through the commands generated above and execute them.
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $concat_cmds; do
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
 	    IFS="$save_ifs"
-	    $show "$cmd"
-	    $run eval "$cmd" || exit $?
-	  done
-	  IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -4190,6 +7293,7 @@ EOF
 
 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
 	  fi
 	  # Expand the library linking commands again to reset the
 	  # value of $libobjs for piecewise linking.
@@ -4202,28 +7306,45 @@ EOF
 	      cmds=$module_cmds
 	    fi
 	  else
-	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
-	    cmds=$archive_expsym_cmds
-	  else
-	    cmds=$archive_cmds
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
 	    fi
 	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
 
-	  # Append the command to remove the reloadable object files
-	  # to the just-reset $cmds.
-	  eval cmds=\"\$cmds~\$rm $delfiles\"
+	  func_extract_archives $gentop $dlprefiles
+	  libobjs="$libobjs $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
 	fi
+
 	save_ifs="$IFS"; IFS='~'
 	for cmd in $cmds; do
 	  IFS="$save_ifs"
 	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || {
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
 	    if test "$mode" = relink; then
-	      $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
 	    fi
 
 	    exit $lt_exit
@@ -4233,12 +7354,11 @@ EOF
 
 	# Restore the uninstalled library and exit
 	if test "$mode" = relink; then
-	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
 	    if test -z "$whole_archive_flag_spec"; then
-	      $show "${rm}r $gentop"
-	      $run ${rm}r "$gentop"
+	      func_show_eval '${RM}r "$gentop"'
 	    fi
 	  fi
 
@@ -4248,8 +7368,7 @@ EOF
 	# Create links to the real library.
 	for linkname in $linknames; do
 	  if test "$realname" != "$linkname"; then
-	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
-	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
 	  fi
 	done
 
@@ -4262,39 +7381,35 @@ EOF
       ;;
 
     obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
       esac
 
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
-      fi
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
 
-      if test -n "$rpath"; then
-	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
-      fi
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
 
-      if test -n "$xrpath"; then
-	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
 
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
-      fi
-
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
 
       case $output in
       *.lo)
-	if test -n "$objs$old_deplibs"; then
-	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-	libobj="$output"
-	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
 	;;
       *)
 	libobj=
@@ -4303,7 +7418,7 @@ EOF
       esac
 
       # Delete the old objects.
-      $run $rm $obj $libobj
+      $opt_dry_run || $RM $obj $libobj
 
       # Objects from convenience libraries.  This assumes
       # single-version convenience libraries.  Whenever we create
@@ -4319,7 +7434,7 @@ EOF
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 	else
 	  gentop="$output_objdir/${obj}x"
 	  generated="$generated $gentop"
@@ -4330,24 +7445,15 @@ EOF
       fi
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
       output="$obj"
-      cmds=$reload_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
+      func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
       if test -z "$libobj"; then
 	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
+	  func_show_eval '${RM}r "$gentop"'
 	fi
 
 	exit $EXIT_SUCCESS
@@ -4355,14 +7461,13 @@ EOF
 
       if test "$build_libtool_libs" != yes; then
 	if test -n "$gentop"; then
-	  $show "${rm}r $gentop"
-	  $run ${rm}r $gentop
+	  func_show_eval '${RM}r "$gentop"'
 	fi
 
 	# Create an invalid libtool object if no PIC, so that we don't
 	# accidentally link it into a program.
 	# $show "echo timestamp > $libobj"
-	# $run eval "echo timestamp > $libobj" || exit $?
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
       fi
 
@@ -4370,20 +7475,11 @@ EOF
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
 	output="$libobj"
-	cmds=$reload_cmds
-	save_ifs="$IFS"; IFS='~'
-	for cmd in $cmds; do
-	  IFS="$save_ifs"
-	  eval cmd=\"$cmd\"
-	  $show "$cmd"
-	  $run eval "$cmd" || exit $?
-	done
-	IFS="$save_ifs"
+	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
       if test -n "$gentop"; then
-	$show "${rm}r $gentop"
-	$run ${rm}r $gentop
+	func_show_eval '${RM}r "$gentop"'
       fi
 
       exit $EXIT_SUCCESS
@@ -4391,39 +7487,45 @@ EOF
 
     prog)
       case $host in
-	*cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
       esac
-      if test -n "$vinfo"; then
-	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
-      fi
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
 
-      if test -n "$release"; then
-	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
-      fi
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
 
-      if test "$preload" = yes; then
-	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
-	   test "$dlopen_self_static" = unknown; then
-	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
-	fi
-      fi
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
 	# On Rhapsody replace the C library is the System framework
-	compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
-	finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 	;;
       esac
 
       case $host in
-      *darwin*)
-        # Don't allow lazy linking, it breaks C++ global constructors
-        if test "$tagname" = CXX ; then
-        compile_command="$compile_command ${wl}-bind_at_load"
-        finalize_command="$finalize_command ${wl}-bind_at_load"
-        fi
-        ;;
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      compile_command="$compile_command ${wl}-bind_at_load"
+	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
       esac
 
 
@@ -4498,14 +7600,16 @@ EOF
 	  esac
 	fi
 	case $host in
-	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
-	  testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
 	  *) dllsearchpath="$dllsearchpath:$libdir";;
 	  esac
 	  case :$dllsearchpath: in
 	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
 	  *) dllsearchpath="$dllsearchpath:$testbindir";;
 	  esac
 	  ;;
@@ -4557,281 +7661,51 @@ EOF
 
       if test -n "$libobjs" && test "$build_old_libs" = yes; then
 	# Transform all the library objects into standard objects.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-      fi
-
-      dlsyms=
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	  dlsyms="${outputname}S.c"
-	else
-	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
-	fi
+	compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
       fi
 
-      if test -n "$dlsyms"; then
-	case $dlsyms in
-	"") ;;
-	*.c)
-	  # Discover the nlist of each of the dlfiles.
-	  nlist="$output_objdir/${outputname}.nm"
-
-	  $show "$rm $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Parse the name list into a source file.
-	  $show "creating $output_objdir/$dlsyms"
-
-	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
-	  if test "$dlself" = yes; then
-	    $show "generating symbol list for \`$output'"
-
-	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
-	    # Add our own program objects to the symbol list.
-	    progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-	    for arg in $progfiles; do
-	      $show "extracting global C symbols from \`$arg'"
-	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	    done
-
-	    if test -n "$exclude_expsyms"; then
-	      $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    if test -n "$export_symbols_regex"; then
-	      $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
-	      $run eval '$mv "$nlist"T "$nlist"'
-	    fi
-
-	    # Prepare the list of exported symbols
-	    if test -z "$export_symbols"; then
-	      export_symbols="$output_objdir/$outputname.exp"
-	      $run $rm $export_symbols
-	      $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    else
-	      $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
-	      $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
-	      $run eval 'mv "$nlist"T "$nlist"'
-              case $host in
-              *cygwin* | *mingw* )
-	        $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
-		$run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
-                ;;
-              esac
-	    fi
-	  fi
-
-	  for arg in $dlprefiles; do
-	    $show "extracting global C symbols from \`$arg'"
-	    name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
-	    $run eval '$echo ": $name " >> "$nlist"'
-	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
-	  done
-
-	  if test -z "$run"; then
-	    # Make sure we have at least an empty file.
-	    test -f "$nlist" || : > "$nlist"
-
-	    if test -n "$exclude_expsyms"; then
-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
-	      $mv "$nlist"T "$nlist"
-	    fi
-
-	    # Try sorting and uniquifying the output.
-	    if grep -v "^: " < "$nlist" |
-		if sort -k 3 </dev/null >/dev/null 2>&1; then
-		  sort -k 3
-		else
-		  sort +2
-		fi |
-		uniq > "$nlist"S; then
-	      :
-	    else
-	      grep -v "^: " < "$nlist" > "$nlist"S
-	    fi
-
-	    if test -f "$nlist"S; then
-	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
-	    else
-	      $echo '/* NONE */' >> "$output_objdir/$dlsyms"
-	    fi
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
 
-	    case $host in
-	    *cygwin* | *mingw* )
-	  $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
-   runtime relocations are performed -- see ld's documentation
-   on pseudo-relocs */
-struct {
-"
-	      ;;
-	    * )
-	  $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
-	      ;;
-	    esac
-
-
-	  $echo >> "$output_objdir/$dlsyms" "\
-  const char *name;
-  lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
-	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
-	    $echo >> "$output_objdir/$dlsyms" "\
-  {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
-  return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
-	  fi
-
-	  pic_flag_for_symtable=
-	  case $host in
-	  # compiling the symbol table file with pic_flag works around
-	  # a FreeBSD bug that causes programs to crash when -lm is
-	  # linked before any other PIC object.  But we must not use
-	  # pic_flag when linking with -static.  The problem exists in
-	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
-	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
-	    esac;;
-	  *-*-hpux*)
-	    case "$compile_command " in
-	    *" -static "*) ;;
-	    *) pic_flag_for_symtable=" $pic_flag";;
-	    esac
-	  esac
-
-	  # Now compile the dynamic symbol file.
-	  $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
-	  $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
-	  # Clean up the generated files.
-	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
-	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
-	  # Transform the symbol file into the correct name.
-          case $host in
-          *cygwin* | *mingw* )
-            if test -f "$output_objdir/${outputname}.def" ; then
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            else
-              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-             fi
-            ;;
-          * )
-            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
-            ;;
-          esac
-	  ;;
-	*)
-	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      else
-	# We keep going just in case the user didn't refer to
-	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
-	# really was required.
-
-	# Nullify the symbol file.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
-	finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+      wrappers_required=yes
+      case $host in
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *cegcc)
+        # Disable wrappers for cegcc, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
 	# Replace the output file specification.
-	compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+	compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 	link_command="$compile_command$compile_rpath"
 
 	# We have no uninstalled library dependencies, so finalize right now.
-	$show "$link_command"
-	$run eval "$link_command"
-	exit_status=$?
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
 
 	# Delete the generated files.
-	if test -n "$dlsyms"; then
-	  $show "$rm $output_objdir/${outputname}S.${objext}"
-	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
 	fi
 
 	exit $exit_status
       fi
 
-      if test -n "$shlibpath_var"; then
-	# We should set the shlibpath_var
-	rpath=
-	for dir in $temp_rpath; do
-	  case $dir in
-	  [\\/]* | [A-Za-z]:[\\/]*)
-	    # Absolute path.
-	    rpath="$rpath$dir:"
-	    ;;
-	  *)
-	    # Relative path: add a thisdir entry.
-	    rpath="$rpath\$thisdir/$dir:"
-	    ;;
-	  esac
-	done
-	temp_rpath="$rpath"
-      fi
-
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
       fi
@@ -4864,12 +7738,11 @@ static const void *lt_preloaded_setup() {
 	# We don't need to create a wrapper script.
 	link_command="$compile_var$compile_command$compile_rpath"
 	# Replace the output file specification.
-	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
-	$run $rm $output
+	$opt_dry_run || $RM $output
 	# Link the executable and exit
-	$show "$link_command"
-	$run eval "$link_command" || exit $?
+	func_show_eval "$link_command" 'exit $?'
 	exit $EXIT_SUCCESS
       fi
 
@@ -4878,13 +7751,13 @@ static const void *lt_preloaded_setup() {
 	link_command="$compile_var$compile_command$compile_rpath"
 	relink_command="$finalize_var$finalize_command$finalize_rpath"
 
-	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
-	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
       else
 	if test "$fast_install" != no; then
 	  link_command="$finalize_var$compile_command$finalize_rpath"
 	  if test "$fast_install" = yes; then
-	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+	    relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 	  else
 	    # fast_install is set to needless
 	    relink_command=
@@ -4896,608 +7769,103 @@ static const void *lt_preloaded_setup() {
       fi
 
       # Replace the output file specification.
-      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
       # Delete the old output files.
-      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
 
-      $show "$link_command"
-      $run eval "$link_command" || exit $?
+      func_show_eval "$link_command" 'exit $?'
 
       # Now create the wrapper script.
-      $show "creating $output"
+      func_verbose "creating $output"
 
       # Quote the relink command for shipping.
       if test -n "$relink_command"; then
 	# Preserve any variables that may affect compiler behavior
 	for var in $variables_saved_for_relink; do
 	  if eval test -z \"\${$var+set}\"; then
-	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 	  elif eval var_value=\$$var; test -z "$var_value"; then
 	    relink_command="$var=; export $var; $relink_command"
 	  else
-	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 	  fi
 	done
 	relink_command="(cd `pwd`; $relink_command)"
-	relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+	relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       fi
 
-      # Quote $echo for shipping.
-      if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+      # Quote $ECHO for shipping.
+      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
 	case $progpath in
 	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
 	*) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
 	esac
-	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+	qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
       else
-	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+	qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
       fi
 
-      # Only actually do things if our run command is non-null.
-      if test -z "$run"; then
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
 	# win32 will think the script is a binary if it has
 	# a .exe suffix, so we strip it off here.
 	case $output in
-	  *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
 	esac
 	# test for cygwin because mv fails w/o .exe extensions
 	case $host in
 	  *cygwin*)
 	    exeext=.exe
-	    outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
 	  *) exeext= ;;
 	esac
 	case $host in
 	  *cygwin* | *mingw* )
-            output_name=`basename $output`
-            output_path=`dirname $output`
-            cwrappersource="$output_path/$objdir/lt-$output_name.c"
-            cwrapper="$output_path/$output_name.exe"
-            $rm $cwrappersource $cwrapper
-            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
-	    cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
-   The $output program cannot be directly executed until all the libtool
-   libraries that it depends on are installed.
-
-   This wrapper executable should never be moved out of the build directory.
-   If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "/bin/sh $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
-*/
-EOF
-	    cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-#  define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-#  define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
-        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS.  */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int    check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
-  char **newargz;
-  int i;
-
-  program_name = (char *) xstrdup (base_name (argv[0]));
-  DEBUG("(main) argv[0]      : %s\n",argv[0]);
-  DEBUG("(main) program_name : %s\n",program_name);
-  newargz = XMALLOC(char *, argc+2);
-EOF
-
-            cat >> $cwrappersource <<EOF
-  newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
-            cat >> $cwrappersource <<"EOF"
-  newargz[1] = find_executable(argv[0]);
-  if (newargz[1] == NULL)
-    lt_fatal("Couldn't find %s", argv[0]);
-  DEBUG("(main) found exe at : %s\n",newargz[1]);
-  /* we know the script has the same name, without the .exe */
-  /* so make sure newargz[1] doesn't end in .exe */
-  strendzap(newargz[1],".exe");
-  for (i = 1; i < argc; i++)
-    newargz[i+1] = xstrdup(argv[i]);
-  newargz[argc+1] = NULL;
-
-  for (i=0; i<argc+1; i++)
-  {
-    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
-    ;
-  }
-
-EOF
-
-            case $host_os in
-              mingw*)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",(char const **)newargz);
-EOF
-              ;;
-              *)
-                cat >> $cwrappersource <<EOF
-  execv("$SHELL",newargz);
-EOF
-              ;;
-            esac
-
-            cat >> $cwrappersource <<"EOF"
-  return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
-  void * p = (void *) malloc (num);
-  if (!p)
-    lt_fatal ("Memory exhausted");
-
-  return p;
-}
-
-char *
-xstrdup (const char *string)
-{
-  return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
-  const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  /* Skip over the disk name in MSDOS pathnames. */
-  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
-    name += 2;
-#endif
-
-  for (base = name; *name; name++)
-    if (IS_DIR_SEPARATOR (*name))
-      base = name + 1;
-  return base;
-}
-
-int
-check_executable(const char * path)
-{
-  struct stat st;
-
-  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
-  if ((!path) || (!*path))
-    return 0;
-
-  if ((stat (path, &st) >= 0) &&
-      (
-        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
-       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
-       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
-       ((st.st_mode & S_IXUSR) == S_IXUSR))
-      )
-    return 1;
-  else
-    return 0;
-}
-
-/* Searches for the full path of the wrapper.  Returns
-   newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
-  int has_slash = 0;
-  const char* p;
-  const char* p_next;
-  /* static buffer for getcwd */
-  char tmp[LT_PATHMAX + 1];
-  int tmp_len;
-  char* concat_name;
-
-  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
-  if ((wrapper == NULL) || (*wrapper == '\0'))
-    return NULL;
-
-  /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
-  {
-    concat_name = xstrdup (wrapper);
-    if (check_executable(concat_name))
-      return concat_name;
-    XFREE(concat_name);
-  }
-  else
-  {
-#endif
-    if (IS_DIR_SEPARATOR (wrapper[0]))
-    {
-      concat_name = xstrdup (wrapper);
-      if (check_executable(concat_name))
-        return concat_name;
-      XFREE(concat_name);
-    }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
-  }
-#endif
-
-  for (p = wrapper; *p; p++)
-    if (*p == '/')
-    {
-      has_slash = 1;
-      break;
-    }
-  if (!has_slash)
-  {
-    /* no slashes; search PATH */
-    const char* path = getenv ("PATH");
-    if (path != NULL)
-    {
-      for (p = path; *p; p = p_next)
-      {
-        const char* q;
-        size_t p_len;
-        for (q = p; *q; q++)
-          if (IS_PATH_SEPARATOR(*q))
-            break;
-        p_len = q - p;
-        p_next = (*q == '\0' ? q : q + 1);
-        if (p_len == 0)
-        {
-          /* empty path: current directory */
-          if (getcwd (tmp, LT_PATHMAX) == NULL)
-            lt_fatal ("getcwd failed");
-          tmp_len = strlen(tmp);
-          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, tmp, tmp_len);
-          concat_name[tmp_len] = '/';
-          strcpy (concat_name + tmp_len + 1, wrapper);
-        }
-        else
-        {
-          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
-          memcpy (concat_name, p, p_len);
-          concat_name[p_len] = '/';
-          strcpy (concat_name + p_len + 1, wrapper);
-        }
-        if (check_executable(concat_name))
-          return concat_name;
-        XFREE(concat_name);
-      }
-    }
-    /* not found in PATH; assume curdir */
-  }
-  /* Relative path | not found in path: prepend cwd */
-  if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
-  tmp_len = strlen(tmp);
-  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
-  memcpy (concat_name, tmp, tmp_len);
-  concat_name[tmp_len] = '/';
-  strcpy (concat_name + tmp_len + 1, wrapper);
-
-  if (check_executable(concat_name))
-    return concat_name;
-  XFREE(concat_name);
-  return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
-  size_t len, patlen;
-
-  assert(str != NULL);
-  assert(pat != NULL);
-
-  len = strlen(str);
-  patlen = strlen(pat);
-
-  if (patlen <= len)
-  {
-    str += len - patlen;
-    if (strcmp(str, pat) == 0)
-      *str = '\0';
-  }
-  return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
-          const char * message, va_list ap)
-{
-  fprintf (stderr, "%s: %s: ", program_name, mode);
-  vfprintf (stderr, message, ap);
-  fprintf (stderr, ".\n");
-
-  if (exit_status >= 0)
-    exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
-  va_list ap;
-  va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
-  va_end (ap);
-}
-EOF
-          # we should really use a build-platform specific compiler
-          # here, but OTOH, the wrappers (shell script and this C one)
-          # are only useful if you want to execute the "real" binary.
-          # Since the "real" binary is built for $host, then this
-          # wrapper might as well be built for $host, too.
-          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
-          ;;
-        esac
-        $rm $output
-        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
-	$echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
-  emulate sh
-  NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
-  # install mode needs the following variable:
-  notinst_deplibs='$notinst_deplibs'
-else
-  # When we are sourced in execute mode, \$file and \$echo are already set.
-  if test \"\$libtool_execute_magic\" != \"$magic\"; then
-    echo=\"$qecho\"
-    file=\"\$0\"
-    # Make sure echo works.
-    if test \"X\$1\" = X--no-reexec; then
-      # Discard the --no-reexec flag, and continue.
-      shift
-    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
-      # Yippee, \$echo works!
-      :
-    else
-      # Restart under the correct shell, and then maybe \$echo will work.
-      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
-    fi
-  fi\
-"
-	$echo >> $output "\
-
-  # Find the directory that this script lives in.
-  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
-  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
-  # Follow symbolic links until we get to the real thisdir.
-  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
-  while test -n \"\$file\"; do
-    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
-    # If there was a directory component, then change thisdir.
-    if test \"x\$destdir\" != \"x\$file\"; then
-      case \"\$destdir\" in
-      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
-      *) thisdir=\"\$thisdir/\$destdir\" ;;
-      esac
-    fi
-
-    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
-    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
-  done
-
-  # Try to get the absolute directory name.
-  absdir=\`cd \"\$thisdir\" && pwd\`
-  test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
-	if test "$fast_install" = yes; then
-	  $echo >> $output "\
-  program=lt-'$outputname'$exeext
-  progdir=\"\$thisdir/$objdir\"
-
-  if test ! -f \"\$progdir/\$program\" || \\
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
-       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
-    file=\"\$\$-\$program\"
-
-    if test ! -d \"\$progdir\"; then
-      $mkdir \"\$progdir\"
-    else
-      $rm \"\$progdir/\$file\"
-    fi"
-
-	  $echo >> $output "\
-
-    # relink executable if necessary
-    if test -n \"\$relink_command\"; then
-      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
-      else
-	$echo \"\$relink_command_output\" >&2
-	$rm \"\$progdir/\$file\"
-	exit $EXIT_FAILURE
-      fi
-    fi
-
-    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
-    { $rm \"\$progdir/\$program\";
-      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
-    $rm \"\$progdir/\$file\"
-  fi"
-	else
-	  $echo >> $output "\
-  program='$outputname'
-  progdir=\"\$thisdir/$objdir\"
-"
-	fi
-
-	$echo >> $output "\
-
-  if test -f \"\$progdir/\$program\"; then"
-
-	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
-	  $echo >> $output "\
-    # Add our own library path to $shlibpath_var
-    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
-    # Some systems cannot cope with colon-terminated $shlibpath_var
-    # The second colon is a workaround for a bug in BeOS R4 sed
-    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
-    export $shlibpath_var
-"
-	fi
-
-	# fixup the dll searchpath if we need to.
-	if test -n "$dllsearchpath"; then
-	  $echo >> $output "\
-    # Add the dll search path components to the executable PATH
-    PATH=$dllsearchpath:\$PATH
-"
-	fi
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
 
-	$echo >> $output "\
-    if test \"\$libtool_execute_magic\" != \"$magic\"; then
-      # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2*)
-	  $echo >> $output "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
 	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
 
-	*)
-	  $echo >> $output "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
+	    func_emit_wrapper no > $output
+	    chmod +x $output
 	  ;;
 	esac
-	$echo >> $output "\
-      \$echo \"\$0: cannot exec \$program \$*\"
-      exit $EXIT_FAILURE
-    fi
-  else
-    # The program doesn't exist.
-    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
-    \$echo \"This script is just a wrapper for \$program.\" 1>&2
-    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi\
-"
-	chmod +x $output
-      fi
+      }
       exit $EXIT_SUCCESS
       ;;
     esac
@@ -5506,7 +7874,7 @@ fi\
     for oldlib in $oldlibs; do
 
       if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save"
+	oldobjs="$libobjs_save $symfileobj"
 	addlibs="$convenience"
 	build_libtool_libs=no
       else
@@ -5515,6 +7883,9 @@ fi\
 	  build_libtool_libs=no
 	else
 	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    oldobjs="$oldobjs $symfileobj"
+	  fi
 	fi
 	addlibs="$old_convenience"
       fi
@@ -5529,8 +7900,18 @@ fi\
 
       # Do each command in the archive commands.
       if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
-       cmds=$old_archive_from_new_cmds
+	cmds=$old_archive_from_new_cmds
       else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  oldobjs="$oldobjs $func_extract_archives_result"
+	fi
+
 	# POSIX demands no paths to be encoded in archives.  We have
 	# to avoid creating archives with duplicate basenames if we
 	# might have to extract them afterwards, e.g., when creating a
@@ -5539,32 +7920,22 @@ fi\
 	# not supported by libtool).
 	if (for obj in $oldobjs
 	    do
-	      $echo "X$obj" | $Xsed -e 's%^.*/%%'
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
 	    done | sort | sort -uc >/dev/null 2>&1); then
 	  :
 	else
-	  $echo "copying selected object files to avoid basename conflicts..."
-
-	  if test -z "$gentop"; then
-	    gentop="$output_objdir/${outputname}x"
-	    generated="$generated $gentop"
-
-	    $show "${rm}r $gentop"
-	    $run ${rm}r "$gentop"
-	    $show "$mkdir $gentop"
-	    $run $mkdir "$gentop"
-	    exit_status=$?
-	    if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
-	      exit $exit_status
-	    fi
-	  fi
-
+	  $ECHO "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
 	  oldobjs=
 	  counter=1
 	  for obj in $save_oldobjs
 	  do
-	    objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -5572,58 +7943,62 @@ fi\
 		# Make sure we don't pick an alternate name that also
 		# overlaps.
 		newobj=lt$counter-$objbase
-		counter=`expr $counter + 1`
+		func_arith $counter + 1
+		counter=$func_arith_result
 		case " $oldobjs " in
 		*[\ /]"$newobj "*) ;;
 		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
 		esac
 	      done
-	      $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
-	      $run ln "$obj" "$gentop/$newobj" ||
-	      $run cp "$obj" "$gentop/$newobj"
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 	      oldobjs="$oldobjs $gentop/$newobj"
 	      ;;
 	    *) oldobjs="$oldobjs $obj" ;;
 	    esac
 	  done
 	fi
-
 	eval cmds=\"$old_archive_cmds\"
 
-	if len=`expr "X$cmds" : ".*"` &&
-	     test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
 	  cmds=$old_archive_cmds
 	else
 	  # the command line is too long to link in one step, link in parts
-	  $echo "using piecewise archive linking..."
+	  func_verbose "using piecewise archive linking..."
 	  save_RANLIB=$RANLIB
 	  RANLIB=:
 	  objlist=
 	  concat_cmds=
 	  save_oldobjs=$oldobjs
-
+	  oldobjs=
 	  # Is there a better way of finding the last object in the list?
 	  for obj in $save_oldobjs
 	  do
 	    last_oldobj=$obj
 	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
 	  for obj in $save_oldobjs
 	  do
-	    oldobjs="$objlist $obj"
-	    objlist="$objlist $obj"
-	    eval test_cmds=\"$old_archive_cmds\"
-	    if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
-	       test "$len" -le "$max_cmd_len"; then
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
 	      :
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
 	      if test "$obj" = "$last_oldobj" ; then
-	        RANLIB=$save_RANLIB
+		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
 	      objlist=
+	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
@@ -5635,49 +8010,39 @@ fi\
 	  fi
 	fi
       fi
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-        eval cmd=\"$cmd\"
-	IFS="$save_ifs"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
+      func_execute_cmds "$cmds" 'exit $?'
     done
 
-    if test -n "$generated"; then
-      $show "${rm}r$generated"
-      $run ${rm}r$generated
-    fi
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
 
     # Now create the libtool archive.
     case $output in
     *.la)
       old_library=
       test "$build_old_libs" = yes && old_library="$libname.$libext"
-      $show "creating $output"
+      func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
       for var in $variables_saved_for_relink; do
 	if eval test -z \"\${$var+set}\"; then
-	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
 	elif eval var_value=\$$var; test -z "$var_value"; then
 	  relink_command="$var=; export $var; $relink_command"
 	else
-	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
-	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
 	fi
       done
       # Quote the link command for shipping.
       relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
-      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
       if test "$hardcode_automatic" = yes ; then
 	relink_command=
       fi
 
-
       # Only create the output if not a dry run.
-      if test -z "$run"; then
+      $opt_dry_run || {
 	for installed in no yes; do
 	  if test "$installed" = yes; then
 	    if test -z "$install_libdir"; then
@@ -5689,12 +8054,11 @@ fi\
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
-		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		func_basename "$deplib"
+		name="$func_basename_result"
 		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
-		if test -z "$libdir"; then
-		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
-		  exit $EXIT_FAILURE
-		fi
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
 		newdependency_libs="$newdependency_libs $libdir/$name"
 		;;
 	      *) newdependency_libs="$newdependency_libs $deplib" ;;
@@ -5702,25 +8066,37 @@ fi\
 	    done
 	    dependency_libs="$newdependency_libs"
 	    newdlfiles=
+
 	    for lib in $dlfiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlfiles="$newdlfiles $libdir/$name"
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlfiles="$newdlfiles $libdir/$name"
+		;;
+	      *) newdlfiles="$newdlfiles $lib" ;;
+	      esac
 	    done
 	    dlfiles="$newdlfiles"
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
-	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-	      eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
-	      if test -z "$libdir"; then
-		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-		exit $EXIT_FAILURE
-	      fi
-	      newdlprefiles="$newdlprefiles $libdir/$name"
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlprefiles="$newdlprefiles $libdir/$name"
+		;;
+	      esac
 	    done
 	    dlprefiles="$newdlprefiles"
 	  else
@@ -5743,15 +8119,15 @@ fi\
 	    done
 	    dlprefiles="$newdlprefiles"
 	  fi
-	  $rm $output
+	  $RM $output
 	  # place dlname in correct position for cygwin
 	  tdlname=$dlname
 	  case $host,$output,$installed,$module,$dlname in
-	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 	  esac
-	  $echo > $output "\
+	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -5765,9 +8141,15 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
 # Libraries that this one depends upon.
 dependency_libs='$dependency_libs'
 
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
 # Version information for $libname.
 current=$current
 age=$age
@@ -5786,748 +8168,29 @@ dlpreopen='$dlprefiles'
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
 	  if test "$installed" = no && test "$need_relink" = yes; then
-	    $echo >> $output "\
+	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
 	done
-      fi
+      }
 
       # Do a symbolic link so that the libtool archive can be found in
       # LD_LIBRARY_PATH before the program is installed.
-      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
-      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
       ;;
     esac
     exit $EXIT_SUCCESS
-    ;;
-
-  # libtool install mode
-  install)
-    modename="$modename: install"
-
-    # There may be an optional sh(1) argument at the beginning of
-    # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
-       # Allow the use of GNU shtool's install command.
-       $echo "X$nonopt" | grep shtool > /dev/null; then
-      # Aesthetically quote it.
-      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$arg "
-      arg="$1"
-      shift
-    else
-      install_prog=
-      arg=$nonopt
-    fi
-
-    # The real first argument should be the name of the installation program.
-    # Aesthetically quote it.
-    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-    case $arg in
-    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-      arg="\"$arg\""
-      ;;
-    esac
-    install_prog="$install_prog$arg"
-
-    # We need to accept at least all the BSD install flags.
-    dest=
-    files=
-    opts=
-    prev=
-    install_type=
-    isdir=no
-    stripme=
-    for arg
-    do
-      if test -n "$dest"; then
-	files="$files $dest"
-	dest=$arg
-	continue
-      fi
-
-      case $arg in
-      -d) isdir=yes ;;
-      -f) 
-      	case " $install_prog " in
-	*[\\\ /]cp\ *) ;;
-	*) prev=$arg ;;
-	esac
-	;;
-      -g | -m | -o) prev=$arg ;;
-      -s)
-	stripme=" -s"
-	continue
-	;;
-      -*)
-	;;
-      *)
-	# If the previous option needed an argument, then skip it.
-	if test -n "$prev"; then
-	  prev=
-	else
-	  dest=$arg
-	  continue
-	fi
-	;;
-      esac
-
-      # Aesthetically quote the argument.
-      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-      case $arg in
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-	arg="\"$arg\""
-	;;
-      esac
-      install_prog="$install_prog $arg"
-    done
-
-    if test -z "$install_prog"; then
-      $echo "$modename: you must specify an install program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -n "$prev"; then
-      $echo "$modename: the \`$prev' option requires an argument" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    if test -z "$files"; then
-      if test -z "$dest"; then
-	$echo "$modename: no file or destination specified" 1>&2
-      else
-	$echo "$modename: you must specify a destination" 1>&2
-      fi
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
-
-    # Strip any trailing slash from the destination.
-    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
-    # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
-      destname=
-    else
-      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
-      test "X$destdir" = "X$dest" && destdir=.
-      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
-      # Not a directory, so check to see that there is only one file specified.
-      set dummy $files
-      if test "$#" -gt 2; then
-	$echo "$modename: \`$dest' is not a directory" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-    fi
-    case $destdir in
-    [\\/]* | [A-Za-z]:[\\/]*) ;;
-    *)
-      for file in $files; do
-	case $file in
-	*.lo) ;;
-	*)
-	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-      done
-      ;;
-    esac
-
-    # This variable tells wrapper scripts just to set variables rather
-    # than running their programs.
-    libtool_install_magic="$magic"
-
-    staticlibs=
-    future_libdirs=
-    current_libdirs=
-    for file in $files; do
-
-      # Do each installation.
-      case $file in
-      *.$libext)
-	# Do the static libraries later.
-	staticlibs="$staticlibs $file"
-	;;
-
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	library_names=
-	old_library=
-	relink_command=
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Add the libdir to current_libdirs if it is the destination.
-	if test "X$destdir" = "X$libdir"; then
-	  case "$current_libdirs " in
-	  *" $libdir "*) ;;
-	  *) current_libdirs="$current_libdirs $libdir" ;;
-	  esac
-	else
-	  # Note the libdir as a future libdir.
-	  case "$future_libdirs " in
-	  *" $libdir "*) ;;
-	  *) future_libdirs="$future_libdirs $libdir" ;;
-	  esac
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
-	test "X$dir" = "X$file/" && dir=
-	dir="$dir$objdir"
-
-	if test -n "$relink_command"; then
-	  # Determine the prefix the user has applied to our future dir.
-	  inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
-	  # Don't allow the user to place us outside of our expected
-	  # location b/c this prevents finding dependent libraries that
-	  # are installed to the same prefix.
-	  # At present, this check doesn't affect windows .dll's that
-	  # are installed into $libdir/../bin (currently, that works fine)
-	  # but it's something to keep an eye on.
-	  if test "$inst_prefix_dir" = "$destdir"; then
-	    $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  if test -n "$inst_prefix_dir"; then
-	    # Stick the inst_prefix_dir data into the link command.
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
-	  else
-	    relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
-	  fi
-
-	  $echo "$modename: warning: relinking \`$file'" 1>&2
-	  $show "$relink_command"
-	  if $run eval "$relink_command"; then :
-	  else
-	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	fi
-
-	# See the names of the shared library.
-	set dummy $library_names
-	if test -n "$2"; then
-	  realname="$2"
-	  shift
-	  shift
-
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
-
-	  # Install the shared library and build the symlinks.
-	  $show "$install_prog $dir/$srcname $destdir/$realname"
-	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
-	  if test -n "$stripme" && test -n "$striplib"; then
-	    $show "$striplib $destdir/$realname"
-	    $run eval "$striplib $destdir/$realname" || exit $?
-	  fi
-
-	  if test "$#" -gt 0; then
-	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
-	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
-	    # so we also need to try rm && ln -s.
-	    for linkname
-	    do
-	      if test "$linkname" != "$realname"; then
-                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
-	      fi
-	    done
-	  fi
-
-	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
-	  cmds=$postinstall_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || {
-	      lt_exit=$?
-
-	      # Restore the uninstalled library and exit
-	      if test "$mode" = relink; then
-		$run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
-	      fi
-
-	      exit $lt_exit
-	    }
-	  done
-	  IFS="$save_ifs"
-	fi
-
-	# Install the pseudo-library for information purposes.
-	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	instname="$dir/$name"i
-	$show "$install_prog $instname $destdir/$name"
-	$run eval "$install_prog $instname $destdir/$name" || exit $?
-
-	# Maybe install the static library, too.
-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
-	;;
-
-      *.lo)
-	# Install (i.e. copy) a libtool object.
-
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# Deduce the name of the destination old-style object file.
-	case $destfile in
-	*.lo)
-	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
-	  ;;
-	*.$objext)
-	  staticdest="$destfile"
-	  destfile=
-	  ;;
-	*)
-	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	  ;;
-	esac
-
-	# Install the libtool object if requested.
-	if test -n "$destfile"; then
-	  $show "$install_prog $file $destfile"
-	  $run eval "$install_prog $file $destfile" || exit $?
-	fi
-
-	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
-	  # Deduce the name of the old-style object file.
-	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
-	  $show "$install_prog $staticobj $staticdest"
-	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
-	fi
-	exit $EXIT_SUCCESS
-	;;
-
-      *)
-	# Figure out destination file name, if it wasn't already specified.
-	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
-	else
-	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-	  destfile="$destdir/$destfile"
-	fi
-
-	# If the file is missing, and there is a .exe on the end, strip it
-	# because it is most likely a libtool script we actually want to
-	# install
-	stripped_ext=""
-	case $file in
-	  *.exe)
-	    if test ! -f "$file"; then
-	      file=`$echo $file|${SED} 's,.exe$,,'`
-	      stripped_ext=".exe"
-	    fi
-	    ;;
-	esac
-
-	# Do a test to see if this is really a libtool program.
-	case $host in
-	*cygwin*|*mingw*)
-	    wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
-	    ;;
-	*)
-	    wrapper=$file
-	    ;;
-	esac
-	if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
-	  notinst_deplibs=
-	  relink_command=
-
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  # Check the variables that should have been set.
-	  if test -z "$notinst_deplibs"; then
-	    $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-
-	  finalize=yes
-	  for lib in $notinst_deplibs; do
-	    # Check to see that each library is installed.
-	    libdir=
-	    if test -f "$lib"; then
-	      # If there is no directory component, then add one.
-	      case $lib in
-	      */* | *\\*) . $lib ;;
-	      *) . ./$lib ;;
-	      esac
-	    fi
-	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
-	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
-	      finalize=no
-	    fi
-	  done
-
-	  relink_command=
-	  # Note that it is not necessary on cygwin/mingw to append a dot to
-	  # foo even if both foo and FILE.exe exist: automatic-append-.exe
-	  # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-	  # `FILE.' does not work on cygwin managed mounts.
-	  #
-	  # If there is no directory component, then add one.
-	  case $wrapper in
-	  */* | *\\*) . ${wrapper} ;;
-	  *) . ./${wrapper} ;;
-	  esac
-
-	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
-	    if test "$finalize" = yes && test -z "$run"; then
-	      tmpdir=`func_mktempdir`
-	      file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
-	      outputname="$tmpdir/$file"
-	      # Replace the output file specification.
-	      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
-
-	      $show "$relink_command"
-	      if $run eval "$relink_command"; then :
-	      else
-		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
-		${rm}r "$tmpdir"
-		continue
-	      fi
-	      file="$outputname"
-	    else
-	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
-	    fi
-	  else
-	    # Install the binary that we compiled earlier.
-	    file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
-	  fi
-	fi
-
-	# remove .exe since cygwin /usr/bin/install will append another
-	# one anyway 
-	case $install_prog,$host in
-	*/usr/bin/install*,*cygwin*)
-	  case $file:$destfile in
-	  *.exe:*.exe)
-	    # this is ok
-	    ;;
-	  *.exe:*)
-	    destfile=$destfile.exe
-	    ;;
-	  *:*.exe)
-	    destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
-	    ;;
-	  esac
-	  ;;
-	esac
-	$show "$install_prog$stripme $file $destfile"
-	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
-	test -n "$outputname" && ${rm}r "$tmpdir"
-	;;
-      esac
-    done
-
-    for file in $staticlibs; do
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
-      # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
-
-      $show "$install_prog $file $oldlib"
-      $run eval "$install_prog \$file \$oldlib" || exit $?
-
-      if test -n "$stripme" && test -n "$old_striplib"; then
-	$show "$old_striplib $oldlib"
-	$run eval "$old_striplib $oldlib" || exit $?
-      fi
-
-      # Do each command in the postinstall commands.
-      cmds=$old_postinstall_cmds
-      save_ifs="$IFS"; IFS='~'
-      for cmd in $cmds; do
-	IFS="$save_ifs"
-	eval cmd=\"$cmd\"
-	$show "$cmd"
-	$run eval "$cmd" || exit $?
-      done
-      IFS="$save_ifs"
-    done
-
-    if test -n "$future_libdirs"; then
-      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
-    fi
-
-    if test -n "$current_libdirs"; then
-      # Maybe just do a dry run.
-      test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
-    else
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool finish mode
-  finish)
-    modename="$modename: finish"
-    libdirs="$nonopt"
-    admincmds=
-
-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
-      for dir
-      do
-	libdirs="$libdirs $dir"
-      done
-
-      for libdir in $libdirs; do
-	if test -n "$finish_cmds"; then
-	  # Do each command in the finish commands.
-	  cmds=$finish_cmds
-	  save_ifs="$IFS"; IFS='~'
-	  for cmd in $cmds; do
-	    IFS="$save_ifs"
-	    eval cmd=\"$cmd\"
-	    $show "$cmd"
-	    $run eval "$cmd" || admincmds="$admincmds
-       $cmd"
-	  done
-	  IFS="$save_ifs"
-	fi
-	if test -n "$finish_eval"; then
-	  # Do the single finish_eval.
-	  eval cmds=\"$finish_eval\"
-	  $run eval "$cmds" || admincmds="$admincmds
-       $cmds"
-	fi
-      done
-    fi
-
-    # Exit here if they wanted silent mode.
-    test "$show" = : && exit $EXIT_SUCCESS
-
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    $echo "Libraries have been installed in:"
-    for libdir in $libdirs; do
-      $echo "   $libdir"
-    done
-    $echo
-    $echo "If you ever happen to want to link against installed libraries"
-    $echo "in a given directory, LIBDIR, you must either use libtool, and"
-    $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
-    $echo "flag during linking and do at least one of the following:"
-    if test -n "$shlibpath_var"; then
-      $echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
-      $echo "     during execution"
-    fi
-    if test -n "$runpath_var"; then
-      $echo "   - add LIBDIR to the \`$runpath_var' environment variable"
-      $echo "     during linking"
-    fi
-    if test -n "$hardcode_libdir_flag_spec"; then
-      libdir=LIBDIR
-      eval flag=\"$hardcode_libdir_flag_spec\"
-
-      $echo "   - use the \`$flag' linker flag"
-    fi
-    if test -n "$admincmds"; then
-      $echo "   - have your system administrator run these commands:$admincmds"
-    fi
-    if test -f /etc/ld.so.conf; then
-      $echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
-    fi
-    $echo
-    $echo "See any operating system documentation about shared libraries for"
-    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
-    $echo "X----------------------------------------------------------------------" | $Xsed
-    exit $EXIT_SUCCESS
-    ;;
-
-  # libtool execute mode
-  execute)
-    modename="$modename: execute"
-
-    # The first argument is the command name.
-    cmd="$nonopt"
-    if test -z "$cmd"; then
-      $echo "$modename: you must specify a COMMAND" 1>&2
-      $echo "$help"
-      exit $EXIT_FAILURE
-    fi
-
-    # Handle -dlopen flags immediately.
-    for file in $execute_dlfiles; do
-      if test ! -f "$file"; then
-	$echo "$modename: \`$file' is not a file" 1>&2
-	$echo "$help" 1>&2
-	exit $EXIT_FAILURE
-      fi
-
-      dir=
-      case $file in
-      *.la)
-	# Check to see that this really is a libtool archive.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
-	else
-	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
-	  $echo "$help" 1>&2
-	  exit $EXIT_FAILURE
-	fi
-
-	# Read the libtool library.
-	dlname=
-	library_names=
-
-	# If there is no directory component, then add one.
-	case $file in
-	*/* | *\\*) . $file ;;
-	*) . ./$file ;;
-	esac
-
-	# Skip this library if it cannot be dlopened.
-	if test -z "$dlname"; then
-	  # Warn if it was a shared library.
-	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
-	  continue
-	fi
-
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-
-	if test -f "$dir/$objdir/$dlname"; then
-	  dir="$dir/$objdir"
-	else
-	  if test ! -f "$dir/$dlname"; then
-	    $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
-	    exit $EXIT_FAILURE
-	  fi
-	fi
-	;;
-
-      *.lo)
-	# Just add the directory containing the .lo file.
-	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-	test "X$dir" = "X$file" && dir=.
-	;;
-
-      *)
-	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
-	continue
-	;;
-      esac
-
-      # Get the absolute pathname.
-      absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
-
-      # Now add the directory to shlibpath_var.
-      if eval "test -z \"\$$shlibpath_var\""; then
-	eval "$shlibpath_var=\"\$dir\""
-      else
-	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
-      fi
-    done
-
-    # This variable tells wrapper scripts just to set shlibpath_var
-    # rather than running their programs.
-    libtool_execute_magic="$magic"
-
-    # Check if any of the arguments is a wrapper script.
-    args=
-    for file
-    do
-      case $file in
-      -*) ;;
-      *)
-	# Do a test to see if this is really a libtool program.
-	if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  # If there is no directory component, then add one.
-	  case $file in
-	  */* | *\\*) . $file ;;
-	  *) . ./$file ;;
-	  esac
-
-	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
-	fi
-	;;
-      esac
-      # Quote arguments (to preserve shell metacharacters).
-      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
-      args="$args \"$file\""
-    done
+}
 
-    if test -z "$run"; then
-      if test -n "$shlibpath_var"; then
-	# Export the shlibpath_var.
-	eval "export $shlibpath_var"
-      fi
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
 
-      # Restore saved environment variables
-      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-      do
-	eval "if test \"\${save_$lt_var+set}\" = set; then
-		$lt_var=\$save_$lt_var; export $lt_var
-	      fi"
-      done
 
-      # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
-	$echo "export $shlibpath_var"
-      fi
-      $echo "$cmd$args"
-      exit $EXIT_SUCCESS
-    fi
-    ;;
-
-  # libtool clean and uninstall mode
-  clean | uninstall)
-    modename="$modename: $mode"
-    rm="$nonopt"
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
     files=
     rmforce=
     exit_status=0
@@ -6539,30 +8202,28 @@ relink_command=\"$relink_command\""
     for arg
     do
       case $arg in
-      -f) rm="$rm $arg"; rmforce=yes ;;
-      -*) rm="$rm $arg" ;;
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
       *) files="$files $arg" ;;
       esac
     done
 
-    if test -z "$rm"; then
-      $echo "$modename: you must specify an RM program" 1>&2
-      $echo "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
 
     rmdirs=
 
     origobjdir="$objdir"
     for file in $files; do
-      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
-      if test "X$dir" = "X$file"; then
-	dir=.
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
 	objdir="$origobjdir"
       else
 	objdir="$dir/$origobjdir"
       fi
-      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      func_basename "$file"
+      name="$func_basename_result"
       test "$mode" = uninstall && objdir="$dir"
 
       # Remember objdir for removal later, being careful to avoid duplicates
@@ -6574,9 +8235,9 @@ relink_command=\"$relink_command\""
       fi
 
       # Don't error if the file doesn't exist and rm -f was used.
-      if (test -L "$file") >/dev/null 2>&1 \
-	|| (test -h "$file") >/dev/null 2>&1 \
-	|| test -f "$file"; then
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
 	:
       elif test -d "$file"; then
 	exit_status=1
@@ -6590,8 +8251,8 @@ relink_command=\"$relink_command\""
       case $name in
       *.la)
 	# Possibly a libtool archive, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	  . $dir/$name
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
 
 	  # Delete the libtool libraries and symlinks.
 	  for n in $library_names; do
@@ -6606,39 +8267,17 @@ relink_command=\"$relink_command\""
 	    *" $dlname "*) ;;
 	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
 	    esac
-	     test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 	    ;;
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      cmds=$postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      cmds=$old_postuninstall_cmds
-	      save_ifs="$IFS"; IFS='~'
-	      for cmd in $cmds; do
-		IFS="$save_ifs"
-		eval cmd=\"$cmd\"
-		$show "$cmd"
-		$run eval "$cmd"
-		if test "$?" -ne 0 && test "$rmforce" != yes; then
-		  exit_status=1
-		fi
-	      done
-	      IFS="$save_ifs"
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -6648,20 +8287,20 @@ relink_command=\"$relink_command\""
 
       *.lo)
 	# Possibly a libtool object, so verify it.
-	if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	if func_lalib_p "$file"; then
 
 	  # Read the .lo file
-	  . $dir/$name
+	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" \
-	     && test "$pic_object" != none; then
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
 	    rmfiles="$rmfiles $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" \
-	     && test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
 	    rmfiles="$rmfiles $dir/$non_pic_object"
 	  fi
 	fi
@@ -6672,17 +8311,26 @@ relink_command=\"$relink_command\""
 	  noexename=$name
 	  case $file in
 	  *.exe)
-	    file=`$echo $file|${SED} 's,.exe$,,'`
-	    noexename=`$echo $name|${SED} 's,.exe$,,'`
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
 	    # $file with .exe has already been added to rmfiles,
 	    # add $file without .exe
 	    rmfiles="$rmfiles $file"
 	    ;;
 	  esac
 	  # Do a test to see if this is a libtool program.
-	  if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-	    relink_command=
-	    . $dir/$noexename
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
@@ -6697,239 +8345,38 @@ relink_command=\"$relink_command\""
 	fi
 	;;
       esac
-      $show "$rm $rmfiles"
-      $run $rm $rmfiles || exit_status=1
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
     objdir="$origobjdir"
 
     # Try to remove the ${objdir}s in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
-	$show "rmdir $dir"
-	$run rmdir $dir >/dev/null 2>&1
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
       fi
     done
 
     exit $exit_status
-    ;;
+}
 
-  "")
-    $echo "$modename: you must specify a MODE" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-    ;;
-  esac
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
 
-  if test -z "$exec_cmd"; then
-    $echo "$modename: invalid operation mode \`$mode'" 1>&2
-    $echo "$generic_help" 1>&2
-    exit $EXIT_FAILURE
-  fi
-fi # test -z "$show_help"
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
 
 if test -n "$exec_cmd"; then
-  eval exec $exec_cmd
+  eval exec "$exec_cmd"
   exit $EXIT_FAILURE
 fi
 
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
-    --config          show all configuration variables
-    --debug           enable verbose shell tracing
--n, --dry-run         display commands without modifying any files
-    --features        display basic configuration information and exit
-    --finish          same as \`--mode=finish'
-    --help            display this help message and exit
-    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
-    --quiet           same as \`--silent'
-    --silent          don't print informational messages
-    --tag=TAG         use configuration variables from tag TAG
-    --version         print version information
-
-MODE must be one of the following:
-
-      clean           remove files from the build directory
-      compile         compile a source file into a libtool object
-      execute         automatically set library path, then run a program
-      finish          complete the installation of libtool libraries
-      install         install libraries or executables
-      link            create a library or an executable
-      uninstall       remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool at gnu.org>."
-  exit $EXIT_SUCCESS
-  ;;
-
-clean)
-  $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
-  ;;
+exit $exit_status
 
-compile)
-  $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
-  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
-  -prefer-pic       try to building PIC objects only
-  -prefer-non-pic   try to building non-PIC objects only
-  -static           always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
-  ;;
-
-execute)
-  $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
-  -dlopen FILE      add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
-  ;;
-
-finish)
-  $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
-  ;;
-
-install)
-  $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
-  ;;
-
-link)
-  $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
-  -all-static       do not do any dynamic linking at all
-  -avoid-version    do not add a version suffix if possible
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
-  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
-  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-  -export-symbols SYMFILE
-                    try to export only the symbols listed in SYMFILE
-  -export-symbols-regex REGEX
-                    try to export only the symbols matching REGEX
-  -LLIBDIR          search LIBDIR for required installed libraries
-  -lNAME            OUTPUT-FILE requires the installed library libNAME
-  -module           build a library that can dlopened
-  -no-fast-install  disable the fast-install mode
-  -no-install       link a not-installable executable
-  -no-undefined     declare that a library does not refer to external symbols
-  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
-  -precious-files-regex REGEX
-                    don't remove output files matching REGEX
-  -release RELEASE  specify package release information
-  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
-  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
-  -static           do not do any dynamic linking of uninstalled libtool libraries
-  -static-libtool-libs
-                    do not do any dynamic linking of libtool libraries
-  -version-info CURRENT[:REVISION[:AGE]]
-                    specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename.  Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
-  ;;
-
-uninstall)
-  $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
-  ;;
-
-*)
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$help" 1>&2
-  exit $EXIT_FAILURE
-  ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
 
 # The TAGs below are defined such that we never get into a situation
 # in which we disable both kinds of libraries.  Given conflicting
@@ -6943,14 +8390,17 @@ exit $?
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
+build_libtool_libs=no
+build_old_libs=yes
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:
 # mode:shell-script
 # sh-indentation:2
 # End:
+# vi:sw=2
+
diff --git a/ltoptions.m4 b/ltoptions.m4
new file mode 100644
index 0000000..34151a3
--- /dev/null
+++ b/ltoptions.m4
@@ -0,0 +1,368 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/ltsugar.m4 b/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/ltversion.m4 b/ltversion.m4
new file mode 100644
index 0000000..b8e154f
--- /dev/null
+++ b/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3012 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.6])
+m4_define([LT_PACKAGE_REVISION], [1.3012])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.6'
+macro_revision='1.3012'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/lt~obsolete.m4 b/lt~obsolete.m4
new file mode 100644
index 0000000..637bb20
--- /dev/null
+++ b/lt~obsolete.m4
@@ -0,0 +1,92 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 4 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/man/ChangeLog b/man/ChangeLog
index e7e4722..a347d08 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,16 @@
+2009-10-11  Ankit Jain  <jankit at novell.com>
+
+	* xbuild.1: Add info about env var XBUILD_COLORS.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* xbuild.1: Add info about env var XBUILD_EMIT_SOLUTION.
+
+2009-08-21  Ankit Jain  <jankit at novell.com>
+
+	* Makefile.am (man_MANS): Add xbuild.1
+	* xbuild.1: New.
+
 2009-04-09  Jonathan Pryor  <jpryor at novell.com>
 
 	* mdoc-update.1: Document -L, -r options.
diff --git a/man/Makefile.am b/man/Makefile.am
index 1c3fc40..41d9ea0 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -11,6 +11,7 @@ man_MANS = \
 	genxs.1               \
 	httpcfg.1             \
 	ilasm.1               \
+	lc.1                  \
 	macpack.1             \
 	makecert.1            \
 	mconfig.1             \
@@ -49,6 +50,7 @@ man_MANS = \
 	soapsuds.1            \
 	sqlsharp.1            \
 	wsdl.1                \
+	xbuild.1	      \
 	xsd.1
 
 EXTRA_DIST = $(man_MANS)
diff --git a/man/Makefile.in b/man/Makefile.in
index 97cb4b2..ed43c4f 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = man
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -74,10 +77,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -87,14 +86,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -112,6 +110,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -120,6 +119,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -131,11 +131,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -164,8 +167,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -205,6 +207,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -228,6 +231,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 man_MANS = \
@@ -243,6 +247,7 @@ man_MANS = \
 	genxs.1               \
 	httpcfg.1             \
 	ilasm.1               \
+	lc.1                  \
 	macpack.1             \
 	makecert.1            \
 	mconfig.1             \
@@ -281,6 +286,7 @@ man_MANS = \
 	soapsuds.1            \
 	sqlsharp.1            \
 	wsdl.1                \
+	xbuild.1	      \
 	xsd.1
 
 EXTRA_DIST = $(man_MANS)
diff --git a/man/lc.1 b/man/lc.1
new file mode 100644
index 0000000..9e5f307
--- /dev/null
+++ b/man/lc.1
@@ -0,0 +1,87 @@
+.\" 
+.\" lc manual page.
+.\" (C) 2009 Carlo Kok
+.\"  
+.\" Author:
+.\"   Carlo Kok (ck at remobjects.com)
+.\"
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.TH lc "Mono 2.6"
+.SH NAME
+lc \- Mono License Compiler
+.SH SYNOPSIS
+.PP
+.B lc -c filename -t targetassembly [-i reference...] [-v] [-o outputpath] [-nologo]
+.SH DESCRIPTION
+\fIlc\fP tool is a license compiler for Mono. It's used to convert a 
+licenses.licx file to a resource that can be embedded into an executable. 
+.PP
+When using commercial components for .NET they often require a license
+resource at runtime to make sure the developer was licensed to use this 
+control. The most common way of making sure the component was properly
+licensed is by using license resources. At compile time the developer
+uses the \fIlc\fP tool to convert a licenses.licx file to a 
+programname.exe.resources file and embed that as a managed resource 
+during compilation.
+.SH RUNTIME OPTIONS
+The following options are available:
+.TP
+\fB--complist=filename\fR, \fB-c filename\fR
+This option is used to specify the input file, the licenses.licx file
+to create a license reesource for. This option is required. The license 
+compiler will read each line in this file and try to load the types
+specified on that line.
+.TP
+\fB--target=assemblyname\fR, \fB-t targetassembly\fR
+full assembly name with file extension for the target assembly. The
+license compiler uses this as a key when compiling the licenses. It
+has to match the assembly the resource will be embedded in. This option
+is required.
+.TP
+\fB--load=reference\fR, \fB-i reference\fR
+Assembly reference to load before trying to compile a license. This
+option is needed for assemblies where the references are not in the 
+gac. Compilers should pass all references to the license compiler.
+.TP
+\fB--verbose,\fR, \fB-v\fR
+Gives more verbose output about the license compiling process.
+.TP
+\fB--help\fR, \fB-h\fR
+Displays usage instructions.
+.TP
+\fB--output=path\fR, \fB-o path\fR
+Target path file the licenses resource. By default the license
+compiler emits the resource in the current directory. The filename
+will always match the target assembly passed to --target with .licenses 
+added.
+.TP
+\fB--nologo\fR
+Do not emit the "Mono License Compiler" logo  on stdout while compilng.
+
+.SH LICENSE FILES
+The format for the license files (licenses.licx) is the following:
+.nf
+	# comment
+	namespace.type, assemblyname
+	namespace.type, full-assemblyname
+.fi
+.Sp
+All lines starting with a # are ignored. the first form requires
+that the assembly was loaded through the --load,-i option but
+does not require the full assembly name, only the first part.
+
+The second form requires the full assembly name including locale,
+version and publickeytoken.
+
+.SH MAILING LISTS
+Mailing lists are listed at the
+http://www.mono-project.com/Mailing_Lists
+.SH WEB SITE
+http://www.mono-project.com
+.SH SEE ALSO
+.PP
+mono(1), mcs(1)
+
diff --git a/man/mono.1 b/man/mono.1
index a9e0937..bc6b261 100644
--- a/man/mono.1
+++ b/man/mono.1
@@ -5,7 +5,7 @@
 .\" Author:
 .\"   Miguel de Icaza (miguel at gnu.org)
 .\"
-.TH Mono "Mono 2.2"
+.TH Mono "Mono 2.4"
 .SH NAME
 mono \- Mono's ECMA-CLI native code generator (Just-in-Time and Ahead-of-Time)
 .SH SYNOPSIS
@@ -1184,13 +1184,14 @@ For example, this would work from the shell:
 .fi
 If you are using mod_mono to host your web applications, you can use
 the 
-.B MonoSetEnv
-directive, like this:
+.B MonoIOMAP
+directive instead, like this:
 .nf
 
-	MonoSetEnv MONO_IOMAP=all
+	MonoIOMAP <appalias> all
 
 .fi
+See mod_mono(8) for more details.
 .TP
 \fBMONO_MANAGED_WATCHER\fR
 If set to "disabled", System.IO.FileSystemWatcher will use a file watcher 
@@ -1218,8 +1219,8 @@ the Global Assembly Cache (see gacutil(1)) or having the dependent
 libraries side-by-side with the main executable.
 .Sp
 For a complete description of recommended practices for application
-deployment, see the
-http://www.mono-project.com/Guidelines:Application_Deployment page. 
+deployment, see
+http://www.mono-project.com/Guidelines:Application_Deployment
 .TP
 \fBMONO_RTC\fR
 Experimental RTC support in the statistical profiler: if the user has
@@ -1500,7 +1501,8 @@ http://www.mono-project.com/Mailing_Lists
 http://www.mono-project.com
 .SH SEE ALSO
 .PP
-certmgr(1), csharp(1), mcs(1), mdb(1), monocov(1), monodis(1), mono-config(5), mozroots(1), xsp(1).
+certmgr(1), csharp(1), mcs(1), mdb(1), monocov(1), monodis(1),
+mono-config(5), mozroots(1), pdb2mdb(1), xsp(1), mod_mono(8).
 .PP
 For more information on AOT:
 http://www.mono-project.com/AOT
diff --git a/man/xbuild.1 b/man/xbuild.1
new file mode 100644
index 0000000..ec9472f
--- /dev/null
+++ b/man/xbuild.1
@@ -0,0 +1,88 @@
+.TH "xbuild" 1
+.SH NAME
+xbuild \- Mono's tool to build MSBuild project files
+.SH SYNOPSIS
+.B xbuild
+[option] [project-file]
+.SH DESCRIPTION
+xbuild can be used to build MSBuild project files. Integrated Development
+Environments like MonoDevelop and "Microsoft Visual Studio .NET" use msbuild
+project file format.
+
+xbuild takes the path of the project or solution file to build, as the main argument.
+If no file is specified then it tries to build any solution file or project file in
+the current directory, that has a *proj extension.
+.SH OPTIONS
+.TP
+.B \//target:T1[,TN]
+List of targets to build
+.TP
+.B \//property:Name=Value
+Set or override project properties
+.TP
+.B \//logger:<logger>
+Custom logger to log build events
+.TP
+.B \//verbosity:<level>
+Logger verbosity level : quiet, minimal, normal, detailed, diagnostic
+.TP
+.B \//validate
+Validate the project file against the schema
+.TP
+.B \//validate:<schema>
+Validate the project file against the specified schema
+.TP
+.B \//consoleloggerparameters:<params>
+Parameters for the console logger
+.TP
+.B \//nologo
+Don't show the initial xbuild banner
+.TP
+.B \//help
+Show xbuild usage
+.TP
+.B \//version
+Display xbuild version
+.SH ENVIRONMENT VARIABLES
+.TP
+.I "XBUILD_EMIT_SOLUTION"
+If this variable is set, then the project file generated from a solution
+file is emitted.
+.TP
+.I "XBUILD_COLORS"
+If this variable is set, it contains a string of the form
+"type=foreground,type=.." that specifies which color to use to display
+errors/warnings etc on some terminals. Type here can be:
+
+.nf
+	errors, warnings, messages or events
+
+	events: These are project/target/task start and end event
+	        messages.
+.fi
+
+.Sp
+The possible colors for foreground are:
+.B black, red, brightred, green, brightgreen, yellow, brightyellow,
+blue, brightblue, magenta, brightmagenta, cyan, brightcyan, grey,
+white and brightwhite.
+
+.Sp
+For example, you could set this variable from your shell:
+.nf
+	export XBUILD_COLORS
+	XBUILD_COLORS=errors=brightred,warnings=blue
+.fi
+.Sp
+
+You can disable the built-in color scheme by setting this variable to
+"disable".
+
+.SH SEE ALSO
+.BR mono(1), mcs(1)
+.SH COPYRIGHT
+Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+.SH MAILING LISTS
+Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
+.SH WEB SITE
+Visit: http://www.mono-project.com for details
diff --git a/mcs/build/common/Consts.cs b/mcs/build/common/Consts.cs
index 5de080a..0633646 100644
--- a/mcs/build/common/Consts.cs
+++ b/mcs/build/common/Consts.cs
@@ -46,7 +46,7 @@ internal
 	// Use these assembly version constants to make code more maintainable.
 	//
 
-	public const string MonoVersion = "2.4.2.3";
+	public const string MonoVersion = "2.4.3.0";
 	public const string MonoCompany = "MONO development team";
 	public const string MonoProduct = "MONO Common language infrastructure";
 	public const string MonoCopyright = "(c) various MONO Authors";
diff --git a/mcs/build/profiles/basic.make b/mcs/build/profiles/basic.make
index e6f05e4..19a3634 100644
--- a/mcs/build/profiles/basic.make
+++ b/mcs/build/profiles/basic.make
@@ -81,7 +81,7 @@ do-profile-check-monolite: $(depsdir)/.stamp
 endif
 
 $(PROFILE_CS): $(topdir)/build/profiles/basic.make $(depsdir)/.stamp
-	echo 'class X { static int Main () { return 0; } }' > $@
+	echo 'class X { static int Main () { try { System.Activator.CreateInstance ("mscorlib", "System.Runtime.CompilerServices.CompilerGeneratedAttribute"); return 1; } catch { return 0; } } }' > $@
 
 $(PROFILE_EXE): $(PROFILE_CS)
 	$(BOOTSTRAP_MCS) /out:$@ $<
diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2/ChangeLog b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/ChangeLog
new file mode 100644
index 0000000..f55becb
--- /dev/null
+++ b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/ChangeLog
@@ -0,0 +1,6 @@
+2009-09-01 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DB2CLIWrapper.cs: changed libname to 'db2'. Use 'int' instead of
+	'IntPtr' for most of the SQL handles. Only SQLPOINTER is 64 bits in
+	64-bit machines.
+
diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2CLIWrapper.cs b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2CLIWrapper.cs
index a0e8390..307adc6 100644
--- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2CLIWrapper.cs
+++ b/mcs/class/IBM.Data.DB2/IBM.Data.DB2/DB2CLIWrapper.cs
@@ -443,88 +443,245 @@ namespace IBM.Data.DB2
 
 		public class StaticWrapper36
 		{
-			private const string libname = "db2_36";
+			const string libname = "db2";
+			static int intptr_size = IntPtr.Size;
 		
-			[DllImport(libname, EntryPoint = "SQLAllocHandle")]
-			public static extern short SQLAllocHandle(short handleType, IntPtr inputHandle,  out IntPtr outputHandle);
-			[DllImport(libname, EntryPoint = "SQLFreeHandle")]
-			public static extern short SQLFreeHandle(short handleType, IntPtr inputHandle);
+			[DllImport (libname, EntryPoint = "SQLAllocHandle")]
+                        static extern short SQLAllocHandle_ (short handleType, int inputHandle,  out int outputHandle);
+
+                        public static short SQLAllocHandle (short handleType, IntPtr inputHandle,  out IntPtr outputHandle)
+			{
+				int output;
+				short ret = SQLAllocHandle_ (handleType, (int) inputHandle, out output);
+				outputHandle = new IntPtr (output);
+				return ret;
+                        }
+
+			[DllImport (libname, EntryPoint = "SQLFreeHandle")]
+			static extern short SQLFreeHandle_ (short handleType, int inputHandle);
+
+			public static short SQLFreeHandle(short handleType, IntPtr inputHandle)
+			{
+				return SQLFreeHandle_ (handleType, (int) inputHandle);
+			}
 
-			[DllImport(libname, EntryPoint = "SQLFreeStmt")]
-			public static extern short SQLFreeStmt(IntPtr StatementHandle, short option);
+			[DllImport (libname, EntryPoint = "SQLFreeStmt")]
+			static extern short SQLFreeStmt_ (int StatementHandle, short option); // should be 'ushort'
+
+			public static short SQLFreeStmt (IntPtr StatementHandle, short option)
+			{
+				return SQLFreeStmt_ ((int) StatementHandle, option);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLConnect", CharSet=CharSet.Ansi)]
+			static extern short SQLConnect_ (int sqlHdbc, string serverName, short serverNameLength, string userName,
+							short userNameLength, string authentication, short authenticationLength);
+			public static short SQLConnect (IntPtr sqlHdbc, string serverName, short serverNameLength, string userName,
+							short userNameLength, string authentication, short authenticationLength)
+			{
+				return SQLConnect_ ((int) sqlHdbc, serverName, serverNameLength, userName, userNameLength, authentication, authenticationLength);
+			}
 
-			public static extern short SQLConnect(IntPtr sqlHdbc, string serverName, short serverNameLength, string userName, short userNameLength, string authentication, short authenticationLength);
-			[DllImport(libname, EntryPoint = "SQLColAttributeW", CharSet=CharSet.Unicode)]
-			public static extern short SQLColAttribute(IntPtr StatementHandle, short ColumnNumber, short FieldIdentifier, [Out] StringBuilder CharacterAttribute, short BufferLength,  out short StringLength, out int NumericAttribute);
+			[DllImport (libname, EntryPoint = "SQLColAttributeW", CharSet=CharSet.Unicode)]
+			static extern short SQLColAttribute_ (int StatementHandle, short ColumnNumber, short FieldIdentifier,
+							[Out] StringBuilder CharacterAttribute, short BufferLength,  out short StringLength,
+							out int NumericAttribute);
+			public static short SQLColAttribute (IntPtr StatementHandle, short ColumnNumber, short FieldIdentifier,
+							[Out] StringBuilder CharacterAttribute, short BufferLength,  out short StringLength,
+							out int NumericAttribute)
+			{
+				return SQLColAttribute_ ((int) StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength,
+							out StringLength, out NumericAttribute);
+			}
 
-			[DllImport(libname, EntryPoint = "SQLGetConnectAttrW", CharSet=CharSet.Unicode)]
-			public static extern short SQLGetConnectAttr(IntPtr ConnectionHandle, int Attribute, [Out] IntPtr ValuePtr, int BufferLength, out int StringLengthPtr);
+			[DllImport (libname, EntryPoint = "SQLGetConnectAttrW", CharSet=CharSet.Unicode)]
+			static extern short SQLGetConnectAttr_ (int ConnectionHandle, int Attribute, [Out] IntPtr ValuePtr, int BufferLength, out int StringLengthPtr);
 
-			[DllImport(libname, EntryPoint = "SQLGetConnectAttrW", CharSet=CharSet.Unicode)]
-			public static extern short SQLGetConnectAttr(IntPtr ConnectionHandle, int Attribute, out int Value, int BufferLength, IntPtr Zero);
+			public static short SQLGetConnectAttr (IntPtr ConnectionHandle, int Attribute, [Out] IntPtr ValuePtr, int BufferLength, out int StringLengthPtr)
+			{
+				return SQLGetConnectAttr_ ((int) ConnectionHandle, Attribute, ValuePtr, BufferLength, out StringLengthPtr);
+			}
+
+			[DllImport (libname, EntryPoint = "SQLGetConnectAttrW", CharSet=CharSet.Unicode)]
+			static extern short SQLGetConnectAttr_ (int ConnectionHandle, int Attribute, out int Value, int BufferLength, IntPtr Zero);
+			public static short SQLGetConnectAttr (IntPtr ConnectionHandle, int Attribute, out int Value, int BufferLength, IntPtr Zero)
+			{
+				return SQLGetConnectAttr_ ((int) ConnectionHandle, Attribute, out Value, BufferLength, Zero);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLColAttributeW", CharSet=CharSet.Unicode)]
-			public static extern short SQLColAttribute(IntPtr StatementHandle, short ColumnNumber, short FieldIdentifier, IntPtr CharacterAttribute, short BufferLength,  ref short StringLength,  ref int NumericAttribute);
+			static extern short SQLColAttribute_ (int StatementHandle, short ColumnNumber, short FieldIdentifier, IntPtr CharacterAttribute, short BufferLength,  ref short StringLength,  ref int NumericAttribute);
+			public static short SQLColAttribute(IntPtr StatementHandle, short ColumnNumber, short FieldIdentifier, IntPtr CharacterAttribute, short BufferLength,  ref short StringLength,  ref int NumericAttribute)
+			{
+				return SQLColAttribute_ ((int) StatementHandle, ColumnNumber, FieldIdentifier, CharacterAttribute, BufferLength,
+							ref StringLength, ref NumericAttribute);
+			}
+
 			[DllImport(libname, EntryPoint="SQLMoreResults")]
-			public static extern short SQLMoreResults(IntPtr StatementHandle);
+			static extern short SQLMoreResults_ (int StatementHandle);
+
+			public static short SQLMoreResults(IntPtr StatementHandle)
+			{
+				return SQLMoreResults_ ((int) StatementHandle);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLGetData")]
-			public static extern short SQLGetData(IntPtr StatementHandle, short ColumnNumber, short TargetType, [Out] StringBuilder sb, int BufferLength, out int StrLen_or_Ind);
+			static extern short SQLGetData_ (int StatementHandle, short ColumnNumber, short TargetType, [Out] StringBuilder sb, int BufferLength, out int StrLen_or_Ind);
+			public static short SQLGetData (IntPtr StatementHandle, short ColumnNumber, short TargetType, [Out] StringBuilder sb,
+							int BufferLength, out int StrLen_or_Ind)
+			{
+				return SQLGetData_ ((int) StatementHandle, ColumnNumber, TargetType, sb, BufferLength, out StrLen_or_Ind);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLGetData")]
-			public static extern short SQLGetData(IntPtr StatementHandle, short ColumnNumber, short TargetType, IntPtr TargetPtr, int BufferLength, out int StrLen_or_Ind);
+			static extern short SQLGetData_ (int StatementHandle, short ColumnNumber, short TargetType, IntPtr TargetPtr, int BufferLength, out int StrLen_or_Ind);
+			public static short SQLGetData (IntPtr StatementHandle, short ColumnNumber, short TargetType, IntPtr TargetPtr, int BufferLength, out int StrLen_or_Ind)
+			{
+				return SQLGetData_ ((int) StatementHandle, ColumnNumber, TargetType, TargetPtr, BufferLength, out StrLen_or_Ind);
+			}
+
 		
 			[DllImport(libname, EntryPoint = "SQLGetData")]
-			public static extern short SQLGetData(IntPtr StatementHandle, short ColumnNumber, short TargetType, [Out] byte[] TargetPtr, int BufferLength, out int StrLen_or_Ind);
+			static extern short SQLGetData_ (int StatementHandle, short ColumnNumber, short TargetType, [Out] byte[] TargetPtr, int BufferLength, out int StrLen_or_Ind);
+			public static short SQLGetData (IntPtr StatementHandle, short ColumnNumber, short TargetType, [Out] byte[] TargetPtr, int BufferLength, out int StrLen_or_Ind)
+			{
+				return SQLGetData_ ((int) StatementHandle, ColumnNumber, TargetType, TargetPtr, BufferLength, out StrLen_or_Ind);
+			}
 
 			[DllImport(libname,  EntryPoint = "SQLDisconnect")]
-			public static extern short SQLDisconnect(IntPtr sqlHdbc);
+			static extern short SQLDisconnect_ (int sqlHdbc);
+			public static short SQLDisconnect (IntPtr sqlHdbc)
+			{
+				return SQLDisconnect_ ((int) sqlHdbc);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLGetDiagRec")]
-			public static extern short SQLGetDiagRec( short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, out int nativeError, [Out] StringBuilder errorMessage, int bufferLength, out short textLengthPtr);
+			static extern short SQLGetDiagRec_ ( short handleType, int handle, short recNum, [Out] StringBuilder sqlState, out int nativeError, [Out] StringBuilder errorMessage, int bufferLength, out short textLengthPtr);
+			public static short SQLGetDiagRec (short handleType, IntPtr handle, short recNum, [Out] StringBuilder sqlState, out int nativeError, [Out] StringBuilder errorMessage, int bufferLength, out short textLengthPtr)
+			{
+				return SQLGetDiagRec_ (handleType, (int) handle, recNum, sqlState, out nativeError, errorMessage, bufferLength, out textLengthPtr);
+			}
+
 
 			[DllImport(libname, EntryPoint = "SQLSetConnectAttr")]
-			public static extern short SQLSetConnectAttr(IntPtr sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength);
+			static extern short SQLSetConnectAttr_ (int sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength);
+			public static short SQLSetConnectAttr(IntPtr sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength)
+			{
+				return SQLSetConnectAttr_ ((int) sqlHdbc, sqlAttr, sqlValuePtr, sqlValueLength);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLSetStmtAttr")]
-			public static extern short SQLSetStmtAttr(IntPtr sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength);
+			static extern short SQLSetStmtAttr_ (int sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength);
+			public static short SQLSetStmtAttr (IntPtr sqlHdbc, int sqlAttr, [In] IntPtr sqlValuePtr, int sqlValueLength)
+			{
+				return SQLSetStmtAttr_ ((int) sqlHdbc, sqlAttr, sqlValuePtr, sqlValueLength);
+			}
+
 	
 			//for bulk operations
 			[DllImport(libname, EntryPoint = "SQLSetStmtAttr")]
-			public static extern short SQLSetStmtAttr(IntPtr sqlHdbc, int sqlAttr, ushort[] sqlValuePtr, int sqlValueLength);
+			static extern short SQLSetStmtAttr_ (int sqlHdbc, int sqlAttr, ushort[] sqlValuePtr, int sqlValueLength);
+			public static short SQLSetStmtAttr (IntPtr sqlHdbc, int sqlAttr, ushort[] sqlValuePtr, int sqlValueLength)
+			{
+				return SQLSetStmtAttr_ ((int) sqlHdbc, sqlAttr, sqlValuePtr, sqlValueLength);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLEndTran")]
-			public static extern short SQLEndTran (short handleType, IntPtr handle, short fType);
+			static extern short SQLEndTran_ (short handleType, int handle, short fType);
+			public static short SQLEndTran (short handleType, IntPtr handle, short fType)
+			{
+				return SQLEndTran_ (handleType, (int) handle, fType);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLCancel")]
-			public static extern short SQLCancel(IntPtr handle);
+			static extern short SQLCancel_ (int handle);
+			public static short SQLCancel (IntPtr handle)
+			{
+				return SQLCancel_ ((int) handle);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLNumResultCols")]
-			public static extern short SQLNumResultCols(IntPtr handle, out short numCols);
+			static extern short SQLNumResultCols_ (int handle, out short numCols);
+			public static short SQLNumResultCols (IntPtr handle, out short numCols)
+			{
+				return SQLNumResultCols_ ((int) handle, out numCols);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLFetch")]
-			public static extern short SQLFetch(IntPtr handle);
+			static extern short SQLFetch_ (int handle);
+			public static short SQLFetch (IntPtr handle)
+			{
+				return SQLFetch_ ((int) handle);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLRowCount")]
-			public static extern short SQLRowCount(IntPtr stmtHandle, out int numRows);
+			static extern short SQLRowCount_ (int stmtHandle, out int numRows);
+			public static short SQLRowCount (IntPtr stmtHandle, out int numRows)
+			{
+				return SQLRowCount_ ((int) stmtHandle, out numRows);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLExecute")]
-			public static extern short SQLExecute(IntPtr handle);
+			static extern short SQLExecute_ (int handle);
+			public static short SQLExecute (IntPtr handle)
+			{
+				return SQLExecute_ ((int) handle);
+			}
+
 			[DllImport (libname, EntryPoint = "SQLExecDirectW", CharSet=CharSet.Unicode)]
-			public static extern short SQLExecDirect(IntPtr stmtHandle, string stmt, int length);
+			static extern short SQLExecDirect_ (int stmtHandle, string stmt, int length);
+			public static short SQLExecDirect (IntPtr stmtHandle, string stmt, int length)
+			{
+				return SQLExecDirect_ ((int) stmtHandle, stmt, length);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLDriverConnectW", CharSet=CharSet.Unicode)]
-			public static extern short SQLDriverConnect(IntPtr hdbc, IntPtr windowHandle, [In] string inConnectStr, [In] short inStrLength, [Out] StringBuilder outConnectStr, [Out] short outStrCapacity, out short outStrLengthReturned, [In] int completion);
+			static extern short SQLDriverConnect_ (int hdbc, IntPtr windowHandle, [In] string inConnectStr, [In] short inStrLength, [Out] StringBuilder outConnectStr, [Out] short outStrCapacity, out short outStrLengthReturned, [In] int completion);
+			public static short SQLDriverConnect (IntPtr hdbc, IntPtr windowHandle, [In] string inConnectStr, [In] short inStrLength, [Out] StringBuilder outConnectStr, [Out] short outStrCapacity, out short outStrLengthReturned, [In] int completion)
+			{
+				return SQLDriverConnect_ ((int) hdbc, windowHandle, inConnectStr, inStrLength, outConnectStr, outStrCapacity, out outStrLengthReturned, completion);
+			}
+
 			[DllImport(libname, EntryPoint = "SQLPrepareW", CharSet=CharSet.Unicode)]
-			public static extern short SQLPrepare(IntPtr stmtHandle, string stmt, int length);
-			[DllImport(libname)]
-			public static extern short SQLBindParameter(IntPtr stmtHandle, short paramNumber, 
+			static extern short SQLPrepare_ (int stmtHandle, string stmt, int length);
+			public static short SQLPrepare (IntPtr stmtHandle, string stmt, int length)
+			{
+				return SQLPrepare_ ((int) stmtHandle, stmt, length);
+			}
+
+			[DllImport(libname, EntryPoint = "SQLBindParameter")]
+			static extern short SQLBindParameter_ (int stmtHandle, short paramNumber, 
 				short dataType, short valueType, short paramType, int colSize, short decDigits, 
 				IntPtr dataBufferPtr, int dataBufferLength, IntPtr StrLen_or_IndPtr);
+			public static short SQLBindParameter(IntPtr stmtHandle, short paramNumber, 
+				short dataType, short valueType, short paramType, int colSize, short decDigits, 
+				IntPtr dataBufferPtr, int dataBufferLength, IntPtr StrLen_or_IndPtr)
+			{
+				return SQLBindParameter_ ((int) stmtHandle, paramNumber, 
+							dataType, valueType, paramType, colSize, decDigits, 
+							dataBufferPtr, dataBufferLength, StrLen_or_IndPtr);
+			}
 
-			[DllImport(libname)]
-			public static extern short SQLBindParameter(IntPtr stmtHandle, short paramNumber, 
+			[DllImport(libname, EntryPoint = "SQLBindParameter")]
+			static extern short SQLBindParameter_ (int stmtHandle, short paramNumber, 
 				short dataType, short valueType, short paramType, int colSize, short decDigits, 
 				int[] dataBufferPtr, int dataBufferLength, IntPtr StrLen_or_IndPtr);
+			public static short SQLBindParameter(IntPtr stmtHandle, short paramNumber, 
+				short dataType, short valueType, short paramType, int colSize, short decDigits, 
+				int[] dataBufferPtr, int dataBufferLength, IntPtr StrLen_or_IndPtr)
+			{
+				return SQLBindParameter_ ((int) stmtHandle, paramNumber, 
+							dataType, valueType, paramType, colSize, decDigits, 
+							dataBufferPtr, dataBufferLength, StrLen_or_IndPtr);
+			}
 
 			[DllImport(libname, EntryPoint = "SQLGetInfoW", CharSet=CharSet.Unicode)]
-			public static extern short SQLGetInfo(IntPtr sqlHdbc, short fInfoType, [Out] StringBuilder rgbInfoValue, short cbInfoValueMax, out short pcbInfoValue);
-
+			static extern short SQLGetInfo_ (int sqlHdbc, short fInfoType, [Out] StringBuilder rgbInfoValue, short cbInfoValueMax, out short pcbInfoValue);
+			public static short SQLGetInfo(IntPtr sqlHdbc, short fInfoType, [Out] StringBuilder rgbInfoValue, short cbInfoValueMax, out short pcbInfoValue)
+			{
+				return SQLGetInfo_ ((int) sqlHdbc, fInfoType, rgbInfoValue, cbInfoValueMax, out pcbInfoValue);
+			}
 		}
 	}
 }
+
diff --git a/mcs/class/Makefile b/mcs/class/Makefile
index 62af4c6..a65bd32 100644
--- a/mcs/class/Makefile
+++ b/mcs/class/Makefile
@@ -101,8 +101,8 @@ net_2_0_dirs := \
 	Microsoft.Build.Framework	\
 	Microsoft.Build.Utilities	\
 	Microsoft.Build.Engine		\
-	Microsoft.Build.Tasks		\
 	System.Core			\
+	Microsoft.Build.Tasks		\
 	System.Xml.Linq			\
 	System.Data.DataSetExtensions	\
 	System.Data.Linq		\
diff --git a/mcs/class/Managed.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/ChangeLog
index 2ef34cf..b20ab0c 100644
--- a/mcs/class/Managed.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/ChangeLog
@@ -1,3 +1,11 @@
+2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* System.Windows.Forms_test.dll.sources: Add a new test file.
+
+2009-03-30  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* System.Windows.Forms.dll.sources: Add X11Clipboard.cs.
+
 2009-01-16  Carlos Alberto Cortez <calberto.cortez at gmail.com>
 
 	* System.Windows.Forms_test.dll.sources: Add ClipboardTest.cs.
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
index b0cc0ec..264e831 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-26  Atsushi Enomoto  <atsushi at ximian.com>
+
+	* KeyboardHandler.cs : support multi-byte text input.
+	  Fixed bug #501276.
+
 2009-01-07  Geoff Norton  <gnorton at novell.com>
 
 	* WindowHandler.cs: Don't attempt to activate a disposed Form.
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/KeyboardHandler.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/KeyboardHandler.cs
index b42b92f..edc2416 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/KeyboardHandler.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.CarbonInternal/KeyboardHandler.cs
@@ -55,6 +55,8 @@ namespace System.Windows.Forms.CarbonInternal {
 
 		internal static bool translate_modifier = false;
 
+		internal string ComposedString;
+
 		static KeyboardHandler () {
 			// our key filter table is a 256 byte array - if the corresponding byte 
 			// is set the key should be filtered from WM_CHAR (apple pushes unicode events
@@ -196,11 +198,17 @@ namespace System.Windows.Forms.CarbonInternal {
 			Marshal.FreeHGlobal (buffer);
 
 			if (key_filter_table [bdata [0]] == 0x00) {
-				// TODO: We support 2byte/4byte unicode? how does this get packed
-				msg.message = Msg.WM_CHAR;
-				msg.wParam = BitConverter.IsLittleEndian ? (IntPtr) bdata [0] : (IntPtr) bdata [size-1];
-				msg.lParam = IntPtr.Zero;
-				msg.hwnd = XplatUICarbon.FocusWindow;
+				if (size == 1) {
+					msg.message = Msg.WM_CHAR;
+					msg.wParam = BitConverter.IsLittleEndian ? (IntPtr) bdata [0] : (IntPtr) bdata [size-1];
+					msg.lParam = IntPtr.Zero;
+					msg.hwnd = XplatUICarbon.FocusWindow;
+				} else {
+					msg.message = Msg.WM_IME_COMPOSITION;
+					Encoding enc = BitConverter.IsLittleEndian ? Encoding.Unicode : Encoding.BigEndianUnicode;
+					ComposedString = enc.GetString (bdata);
+					msg.hwnd = XplatUICarbon.FocusWindow;
+				}
 			}
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog
index 98ec00d..e235bd8 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* RTF.cs: If the rtf specified a code page outside the valid values,
+	fallback to the default one.
+	Fixes #503174.
+
 2008-01-29  Jonathan Pobst  <monkey at jpobst.com>
 
 	* Picture.cs: Don't create a bitmap just to get the dpi.
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
index c3868f5..3b02df8 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.RTF/RTF.cs
@@ -37,6 +37,7 @@ namespace System.Windows.Forms.RTF {
 		#region	Local Variables
 		internal const char	EOF = unchecked((char)-1);
 		internal const int	NoParam = -1000000;
+		internal const int	DefaultEncodingCodePage = 1252;
 
 		private TokenClass	rtf_class;
 		private Major		major;
@@ -44,7 +45,7 @@ namespace System.Windows.Forms.RTF {
 		private int		param;
 		private string encoded_text;
 		private Encoding encoding;
-		private int encoding_code_page = 1252;
+		private int encoding_code_page = DefaultEncodingCodePage;
 		private StringBuilder	text_buffer;
 		private Picture picture;
 		private int		line_num;
@@ -381,6 +382,10 @@ SkipCRLF:
 
 			if (CheckCMM (TokenClass.Control, Major.Unicode, Minor.UnicodeAnsiCodepage)) {
 				encoding_code_page = param;
+
+				// fallback to the default one in case we have an invalid value
+				if (encoding_code_page < 0 || encoding_code_page > 65535)
+					encoding_code_page = DefaultEncodingCodePage;
 			}
 
 			if (((this.cur_charset.Flags & CharsetFlags.Read) != 0) && CheckCM(TokenClass.Control, Major.CharSet)) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
index bd74465..21946d5 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms.dll.sources
@@ -799,6 +799,7 @@ System.Windows.Forms/WebBrowserSiteBase.cs
 System.Windows.Forms/Win32DnD.cs
 System.Windows.Forms/WindowsFormsSection.cs
 System.Windows.Forms/WindowsFormsSynchronizationContext.cs
+System.Windows.Forms/X11Clipboard.cs
 System.Windows.Forms/X11DesktopColors.cs
 System.Windows.Forms/X11Dnd.cs
 System.Windows.Forms/X11Keyboard.cs
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
index 45d4a3e..e8ee5b9 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
@@ -511,6 +511,8 @@ namespace System.Windows.Forms
 #if NET_2_0
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public
+#else
+		internal
 #endif
 		static bool FilterMessage (ref Message message)
 		{
@@ -909,7 +911,7 @@ namespace System.Windows.Forms
 					// give it the message, and then drop the message
 					if (keyboard_capture != null) {
 						// WM_SYSKEYUP does not make it into ProcessCmdKey, so do it here
-						if ((Msg)m.Msg == Msg.WM_SYSKEYUP)
+						if ((Msg)m.Msg == Msg.WM_SYSKEYDOWN)
 							if (m.WParam.ToInt32() == (int)Keys.Menu) {
 								keyboard_capture.GetTopLevelToolStrip ().Dismiss (ToolStripDropDownCloseReason.Keyboard);
 								continue;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AsyncMethodResult.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AsyncMethodResult.cs
index 8c52ca7..7e0e6c9 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AsyncMethodResult.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/AsyncMethodResult.cs
@@ -34,6 +34,7 @@ namespace System.Windows.Forms {
 		private object state;
 		private bool completed;
 		private object return_value;
+		private Exception exception;
 
 		public AsyncMethodResult ()
 		{
@@ -68,10 +69,18 @@ namespace System.Windows.Forms {
 		public object EndInvoke ()
 		{
 			lock (this) {
-				if (completed)
-					return return_value;
+				if (completed) {
+					if (exception == null)
+						return return_value;
+					else
+						throw exception;
+				}
 			}
 			handle.WaitOne ();
+			
+			if (exception != null)
+				throw exception;
+				
 			return return_value;
 		}
 
@@ -83,6 +92,15 @@ namespace System.Windows.Forms {
 				handle.Set ();
 			}
 		}
+		
+		public void CompleteWithException (Exception ex)
+		{
+			lock (this) {
+				completed = true;
+				exception = ex;
+				handle.Set ();
+			}
+		}
 	}
 
 }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs
index 6a90453..2823f19 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingContext.cs
@@ -213,9 +213,9 @@ namespace System.Windows.Forms {
 			}
 		}
 #if NET_2_0
+		[MonoTODO ("Stub, does nothing")]
 		public static void UpdateBinding (BindingContext newBindingContext, Binding binding)
 		{
-			throw new NotImplementedException ();
 		}
 #endif
 		#endregion	// Protected Instance Methods
@@ -252,7 +252,7 @@ namespace System.Windows.Forms {
 		#endregion	// ICollection Interfaces
 
 		#region IEnumerable Interfaces
-		[MonoTODO ("our enumerator is slightly different.  in MS's implementation the Values are WeakReferences to the managers.")]
+		[MonoInternalNote ("our enumerator is slightly different.  in MS's implementation the Values are WeakReferences to the managers.")]
 		IEnumerator IEnumerable.GetEnumerator() {
 			return managers.GetEnumerator ();
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs
index 663818f..a3c32ac 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingManagerBase.cs
@@ -117,13 +117,13 @@ namespace System.Windows.Forms
 		}
 
 		#region Protected Instance Methods
-		[MonoTODO]
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
 		protected internal virtual PropertyDescriptorCollection GetItemProperties (ArrayList dataSources, ArrayList listAccessors)
 		{
 			throw new NotImplementedException();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
 		protected virtual PropertyDescriptorCollection GetItemProperties (Type listType, int offset, ArrayList dataSources, ArrayList listAccessors)
 		{
 			throw new NotImplementedException();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingNavigator.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingNavigator.cs
index b3877e8..b7e83c2 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingNavigator.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingNavigator.cs
@@ -355,8 +355,8 @@ namespace System.Windows.Forms
 			}
 		}
 
-		[MonoTODO("implement this")]
-		public bool Validate()
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public bool Validate ()
 		{
 			throw new NotImplementedException();
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs
index 5d3a1eb..c8c9d28 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/BindingSource.cs
@@ -194,6 +194,36 @@ namespace System.Windows.Forms {
 			ResetBindings (true);
 		}
 
+		private void ConnectDataSourceEvents (object dataSource)
+		{
+			if (dataSource == null)
+				return;
+			
+			ICurrencyManagerProvider currencyManagerProvider = dataSource as ICurrencyManagerProvider;
+			if (currencyManagerProvider != null && currencyManagerProvider.CurrencyManager != null) {
+				currencyManagerProvider.CurrencyManager.CurrentItemChanged += OnParentCurrencyManagerChanged;
+				currencyManagerProvider.CurrencyManager.MetaDataChanged += OnParentCurrencyManagerChanged;
+			}
+		}
+
+		private void OnParentCurrencyManagerChanged (object sender, EventArgs args)
+		{
+			// Essentially handles chained data sources (e.g. chained BindingSource)
+			ResetList ();
+		}
+
+		private void DisconnectDataSourceEvents (object dataSource)
+		{
+			if (dataSource == null)
+				return;
+
+			ICurrencyManagerProvider currencyManagerProvider = dataSource as ICurrencyManagerProvider;
+			if (currencyManagerProvider != null && currencyManagerProvider.CurrencyManager != null) {
+				currencyManagerProvider.CurrencyManager.CurrentItemChanged -= OnParentCurrencyManagerChanged;
+				currencyManagerProvider.CurrencyManager.MetaDataChanged -= OnParentCurrencyManagerChanged;
+			}
+		}
+
 		void IBindingListChangedHandler (object o, ListChangedEventArgs args)
 		{
 			if (raise_list_changed_events)
@@ -319,7 +349,9 @@ namespace System.Windows.Forms {
 					if (datasource == null)
 						datamember = String.Empty;
 
+					DisconnectDataSourceEvents (datasource);
 					datasource = value;
+					ConnectDataSourceEvents (datasource);
 					ResetList ();
 
 					OnDataSourceChanged (EventArgs.Empty);
@@ -925,7 +957,7 @@ namespace System.Windows.Forms {
 		public void ResetBindings (bool metadataChanged)
 		{
 			if (metadataChanged)
-				OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorChanged, 0));
+				OnListChanged (new ListChangedEventArgs (ListChangedType.PropertyDescriptorChanged, null));
 
 			OnListChanged (new ListChangedEventArgs (ListChangedType.Reset, -1, -1));
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
index e4c5d4c..7897bd5 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
@@ -630,8 +630,12 @@ namespace System.Windows.Forms {
 				}
 
 				if (ClientRectangle.Contains (mevent.Location))
-					if (!ValidationFailed)
+					if (!ValidationFailed) {
 						OnClick (EventArgs.Empty);
+#if NET_2_0
+						OnMouseClick (mevent);
+#endif
+					}
 			}
 			
 			base.OnMouseUp (mevent);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index e255cef..c1e3084 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,1259 @@
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* DataGridTextBoxColumn.cs:
+	* DataGrid.cs: Position the cursor in the add row should *not* show
+	yet another new row - that will happen till we get any real input data
+	from the user. When that happens, we will also mark the new row as
+	ready to commit - otherwise, when the cursor moves to a different row,
+	the just added row will be discarded. This is exactly what .Net seems
+	to do.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGrid.cs: The large value for our vertical scrollbar should
+	depend on the number of visible rows, instead of trying to re-use the
+	value of VisibleRowCount, which is the value of *current* visible
+	rows, and can easily end messed up if new rows are added/removed.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGrid.cs: When moving the scroll, *dont* ever end the current
+	edit - this could seriously mess up our current edit cycle, specially
+	when adding new rows.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TabControl.cs: In OnKeyDown call the base implementation first -
+	this way we let the user tell us whether we should handle the key or
+	not.
+	Fixes #543717.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGridTextBoxColumn.cs:
+	* DataGrid.cs: Don't use this add-pending behaviour to try to add a
+	new row until we have the first input char - it was helping us to fix
+	other issues we have/had, but it's not matching .net.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGrid.cs: Implement removal of rows the Correct Way by creating a
+	copy of the indexes, as any direct write access to the source will cause to
+	reset the entire selection - also, do the linear de-selection in
+	reverse order to avoid any index mismatch in the source, due to out of
+	synchronization removing the rows.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TextBoxBase.cs: When returning the preferred height, and we are
+	supposed to be borderless, return the TopMargin value - usually in
+	borderless mode it has a value of 0, but in the ToolStrip controls we
+	need to set the margin manually.
+	Fixes #551214.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolTip.cs: ShowAlways works at the form level, not at the control
+	level. Fixes #544565.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ButtonBase.cs: Usually the click routines are handled in Control,
+	but in this class we are handling it ourselved, thus we need to have
+	the same calls, and we were missing the call to MouseClick.
+	Patch by Eric Petit <surfzoid at gmail.com>.
+
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ComboBox.cs: When setting Text and data source is being used, if the
+	passed value is not matching any of the items in the source, don't
+	pass it to GetItemText, since it's useless, as GetItemText expects a
+	valid item.
+	Fixes #546009.
+
+2009-10-30  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+[merge -r 142756:144751 from trunk, which basically contains ListView related
+bug fixes, specially large speed ups for VirtualMode].
+
+	2009-10-23  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: When retrieving an item in virtual mode, as part of the
+		process calculate its layout, instead of trying to do it later.
+		* ListViewItem.cs: There's no need to try to infer whether we need to
+		compute layout or not anymore - we just do it every time we are
+		returning an item.
+		This way we should be fixing View changes with cached items, which
+		were storing the previous value, and not updating their contents
+		properly.
+
+	2009-10-23  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+	
+		* ColumnHeader.cs: Remove the double linear search in the Index
+		property, by removing the call to Contains, which is not needed.
+		Also, Columns collection can never be null.
+
+	2009-10-23  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ColumnHeader.cs: When calculating the width and height of the
+		column, try to expand to the right and use all the free space if we
+		are the last column *and* the resize mode is set to -2/header content.
+		Fixes #544716.
+
+	2009-10-14  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: When retrieving the top item, take into account the
+		offset represented by the header control, to retrieve the proper
+		value. Patch by Christoph von Wittich (Christoph at ApiViewer.de)
+		Fixes the remaining bits of #543773.
+
+	2009-10-14  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+	
+		* ListView.cs: TopItem setter should set the value as the top, not
+		only ensuring its visibility.
+		Fixes part of #543773.
+
+	2009-10-12  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: For virtual mode, when navigating the items using keyboard,
+		don't use the matrix of positions, and instead calculate the positions
+		based on the number of cols and rows, taking advantage of the fixed
+		positions of items. Use the same idea to implement FirstVisibleIndex,
+		so we avoid iterating over all the items. Patch by Stephen Robinson
+		mono at esar.org.uk.
+		Fixes part of #467418.
+
+	2009-10-12  Dick Porter  <dporter at codicesoftware.com>
+
+		* Splitter.cs: Adjust offsets when more than one splitter is
+		present in a control.  Fixes bug 509472.
+
+	2009-10-07  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: When computing the value for groups height don't use
+		text_size field, since in LargeIcon view it sometimes contains a
+		double height value - use Font.Height directly, and also improve the
+		padding value.
+		* ThemeWin32Classic: The same as above.
+		This way the space between the group header, the line, and the items
+		area is not that big in LargeIcon view.
+
+	2009-10-04  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: When retrieving the fixed positions for the items in
+		virtual mode, use the row value to compute the coords of the item,
+		instead of the col value, as opposed to SmallIcon/LargeIcon views.
+
+	2009-09-29  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: The location of the items should be computed on the fly
+		in virtual mode - that decreased speed overall, but reduces the load
+		time.that decreased speed overall, but reduces the load time. Also,
+		handle the cases where we were using data structures we don't need to
+		use/create for this mode.
+		Fixes part of #467418.
+
+2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+[merge -r 132698:142738 from trunk to 2-4 branch. Some changes were already
+there, so also keep this Changelog sane]
+
+	2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListView.cs: When calculating the layout for Details view, don't ask
+		for the items *at all* in case we are in virtual mode. This should
+		re-enable the proper behaviour of virtual mode.
+
+		2009-10-17  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+		* ToolBar.cs, ToolBarButton.cs: Add new UIA events to know
+		when a button gets focus, firing the events from the ToolBar.
+		r: jpobst
+
+		2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ComboBox.cs: When calculating the height of the ComboListBox,
+		specially for the 2.0 profile, use MaxDropDownItems if the
+		DropDownHeight property hasn't been set, and use the later if it has
+		been set. This way we support both properties.
+		Fixes #493308.
+
+		2009-10-17 Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* XplatUIX11.cs, X11Clipboard.cs: Text and Rtf formats must be
+		separated, and we cannot fallback on Text if Rtf is requested but not
+		present.
+		* Clipboard.cs: Actually use the format specified by our user when
+		putting data.
+
+		2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* XplatUIX11.cs: When handling the SelectionRequest event, use
+		SelectionRequestEvent instead of SelectionEvent, so we get the right
+		data for the app asking for clipboard data. Set the member of
+		SelectioneEvent.property to indicate the place where we are storing
+		the information as well - this is specially important for gnome/kde
+		apps using the TARGETS atom to ask for the supported permission before
+		actually asking for a specific format.
+		Fixes #489393.
+
+		2009-10-17  Jonathan Pobst  <monkey at jpobst.com>
+
+		* ToolStripDrowDown.cs: Remove some hardcoded values and assumptions.
+		* ToolStripDropDownButton.cs: This should use a ToolStripDropDownMenu,
+		not a ToolStripDropDown.
+		* ToolStripItem.cs: Don't use the item margins on a ToolStripDropDown.
+
+		2009-09-26  Jonathan Pobst  <monkey at jpobst.com>
+
+		* TreeNode.cs: When we invalidate a node, make sure we start at
+		0, instead of the node's Bounds.Left, which does not include
+		the +/-, checkbox, or stateimages.
+		[Fixes bug #542481]
+
+		2009-09-24  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Compare the name and not displayname of properties 
+		when checking if the column is already bound.
+
+		2009-09-21  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichTextBox.cs: For SelectedRtf, after inserting the stream, adjust
+		the position of the caret by adding the needed chars represented by the new line chars,
+		according to the system, using rich *or* hard new lines as needed. Also do a
+		check to be sure we don't move the cursor position beyond the limits
+		of our text. This should avoid problems with text being pasted,
+		regarding the position of the caret.
+
+		2009-09-16  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichTextBox.cs: When SelectedRtf is set, and we are in the 0
+		position in the x axis, force to re-use any already available line,
+		even if it is not empty. This way pasting text into our textbox in the
+		beginning for non empty lines should work fine.
+
+		2009-09-14  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichTextBox.cs: When we are inserting a flow of rtf text, and we are
+		*not* loading it from a file, try to re-use a line if already
+		available, since the default behaviour of the parser is to create new
+		lines for the document.
+		This should fix a regressions we found after the last fix for #513030.
+
+		2009-09-14  Tom Hindle <tom_hindle at sil.org>
+
+		* ToolStripOverflow.cs: Fixes #536036 by adding null ptr check.
+
+		2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* PropertyGrid.cs: Hide the splitter when the help is hidden.
+
+		2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* InternalWindowManager.cs: Call Invalidate-Update instead of 
+		Refresh for MS compitability. Note also that Refresh is virtual 
+		and several controls override it in order to provide data refresh 
+		functionallity on top of the redraw and they do not expect this 
+		extra refresh call.
+		* Control.cs: In Refresh Invalidate the control and all children 
+		insead of calling Refresh for each of them.
+		[Fixes bug #538336]
+
+		2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* PropertyGrid.cs: Always set the help panel properties on the 
+		internal control, because they are inherited and can change with 
+		the parent.
+		[Fixes bug #525305]
+
+		2009-09-08  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichTextBox.cs: When processing rtf, don't add a new line if we
+		already have one for that position. This way we avoid overriding by
+		mistake our lines when copying/pasting.
+		Fixes #513030.
+
+		2009-09-07  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TextControl.cs: When inserting new lines, look for the end of file
+		char, and remove chars after it. This is unlikely to happeng either
+		loading a file, pasting text or pressing a char, but can happen using
+		the TextBox.Text property.
+		Fixes #535884.
+
+		2009-09-06  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* Line.cs: In DeleteCharacters, cache line.Length for every tag, since
+		tag.Start changes will modify it indirectly and then we would end up
+		with wrong values.
+		Fixes #512521.
+
+		2009-09-03  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* BindingSource.cs: Implement support for chained data sources.
+		* ListBindingHelper.cs: Add support for ICurrencyManagerProvider and 
+		clean up.
+		[Fixes part of bug #536547]
+
+		2009-09-01  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichTextBox.cs: When saving the text to a file using SaveFile use
+		Environment.NewLine to separate the lines. This way we should be
+		saving the files according to the system.
+		Fixes the remaining part of #511515.
+
+		2009-08-31  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RichText.cs: Remove some unix new line characters and use
+		Environment.NewLine. Fixes part of #511515.
+
+		2009-08-28  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TextBoxBase.cs: Modified should *not* be modified from the Text
+		property, as our new tests show. It should be to false, however, in
+		Append and Clear; and Paste, Cut, Undo, and direct user input should set it
+		to true. Also, as opposed to what the .net docs say -but proven by our
+		tests-, the changes should be generating a ModifiedChanged event
+		(thus we set the property, instead of the field).
+		Fixes #511267.
+
+		2009-08-27  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Fire the CellDoubleClicked event.
+		[Fixes bug #533430]
+
+		2009-08-27  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Add support for column DataGridViewAutoSizeColumnMode
+		DisplayedCells and DisplayedCellsExceptHeader.
+		[Fixes bug #533435]
+
+		2009-08-27  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TextControl.cs: When removing a simple char, actually record the
+		action in the undo manager. This way we both support undoing the
+		removal of chars using backspace/delete, as well as keeping data
+		integrity when other undo tasks are performed.
+		Fixes #531983.
+
+		2009-08-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* Control.cs: Remove the ancient code in ResetText, which was setting
+		the internal field to String.Empty, instead of doing it for our Text
+		property, as .net does (which also causes a TextChanged event and all
+				the other related routines).
+		Fixes #531587.
+
+		2009-08-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TreeNodeCollection.cs: Correctly implement Contains by using a
+		linear search - there's no possible way to use a binary search, since
+		the node instances are not implementing IComparable, nor have a
+		specific order.
+		Fixes #529927.
+
+		2009-08-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: If we are *not* changing a row
+		already added to the source, and thus we are adding a new 
+		row instead, try to move to the previous row when Esc is
+		pressed -if possible-.
+		Fixes some bits of #322974.
+
+		2009-08-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGridTextBoxColumn.cs:
+		* DataGrid.cs: Moving the cell to the add row (the last one) should
+		not immediately add a new row - this should happen until the very
+		first change happens in that textbox.
+		Fixes part of #322974.
+
+		2009-08-19  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripDropDown.cs: When assigning the owner item, use its Font as
+		well.
+
+		2009-08-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripItem.cs: When the owner changes its Font, call the
+		OnFontChanged event, so we let our users know that we likely have a
+		new font - since Font is an ambient property.
+		* ToolStripDropDownItem.cs: When our Font changes, propagate that
+		information to our DropDown control, if any.
+		Fixes #531515.
+
+		2009-08-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: 
+		* ThemeWin32Classic.cs: When the user clicks on a new cell, we should reset any
+		previous selection, just like .net does. Also, in the cases where a
+		cell is being edited and it keeps the selected status, use the normal
+		colors for it, and use the selected colors for the rest of the columns of
+		that row.
+		Fixes the remaining bits of #323051.
+
+		2009-08-16  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: When getting ProcessKeyPreview fired, call Edit() if we
+		are not editing already - so the edition is actually active on our
+		column style textbox. Also, it seems the code handling process the
+		grid keys is repeated, but instead of removing it, just comment it for
+		now.
+		Fixes part of #323051.
+
+		2009-08-13  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* AsyncMethodResult.cs: Store a exception field in case the called
+		method actually caused an exception. This way we can throw it later.
+		* XplatUIDriver.cs: Check if the async method result has an exception
+		- throw it if needed. 
+		The idea is that Control.Invoke throws the exception from the thread
+		that called it, not the main MWF thread. 
+		Patch by Tom Spink <tspink at gmail.com>. Fixes #497175.
+
+		2009-08-12  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: In mouse move we need to shift the selection in case
+		the pointer is on the row headers.
+		Fixes #323052.
+
+		2009-08-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* SplitContainer.cs: Avoid updating the splitter distance if it hasn't 
+		moved. Updating the distance was causing a re-layout which was resetting 
+		the clicks counter and preventing DoubleClick from every firing.
+		[Fixes bug #521387]
+
+		2009-08-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: When a new TableStyle is added, don't create new
+		columns for it unless it is empty - this is the correct way to both
+		respect the columns if they were provided by our user, or create them
+		for him in case the column collection is empty.
+		Fixes #323111.
+
+		2009-08-10  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* DataGrid.cs: Actually call BindColumns in the handler for
+		ListManager.MetaDataChanged, since the current code is already taking
+		into account the scenario when a custom table style is used - this was
+		confusing us before, and that's why we commented the call to
+		BindColumns. Also call CallAreasAndInvalidate, to properly reflect the
+		changes as needed.
+		Fixes #465021.
+
+		2009-08-10  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: When setting the data source, if we have a user
+		provided table style available, force a complete bind in case the
+		column styles for that table style is empty.
+
+		2009-08-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridViewCell.cs: Handle null and DBNull values.
+
+		2009-08-07 Rodrigo Kumpera  <rkumpera at novell.com>
+
+		* ListBindingHelper.cs: Fix the 1.0 build by making this type available
+		under that profile.
+
+		2009-08-07  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* CurrencyManager.cs: Remove duplicate code.
+
+		2009-08-07  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs, DataGridViewCell.cs, DataGridViewColumn.cs: 
+		Massive population performance boost. From seconds to ms.
+		[Fixes bug #528887]
+
+		2009-08-04  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: When handling mouse down on a column, don't do any sort
+		even if the list supports it if we are empty. This way we avoid an exc
+		sorting the empty list, and keep the UI compatible with .net.
+
+		2009-08-04  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGrid.cs: In Edit () check we have any row before trying to use
+		the current row. Fixes a IOOR exc with an empty data grid.
+
+		2009-08-03  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataGridColumnStyle.cs: Don't call CheckValidDataSource when setting
+		the owner DataGrid - even if this seems to be the right thing to do,
+		.net is not doind this check at this point, but in later operations.
+		Fixes #465019.
+
+		2009-07-28  Mike Gorse  <mgorse at novell.com>
+
+		* ToolStripMenuItem.cs: Added UIA CheckOnClickChanged event.
+
+		2009-07-28  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* Application.cs: Make FilterMessage internal for 1.1. Fixes the 1.1 build.
+
+		2009-07-28  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* XplatUIX11.cs:
+		* XplatUIWin32.cs: We need to filter the messages using
+		Application.FilterMessage for our DoEvents implementations. Observe
+		that I don't like the idea of XplatUI call the upper level Application
+		class, but at this point is easier and simpler to do this call - based
+		on the fact it's only one simple call.
+		Fixes #516735.
+
+		2009-07-28  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TreeNodeCollection.cs: When removing the selected node, set the
+		SelectedNode value of TreeView to null if there aren't more nodes left - 
+		this is better than to clear the selected node in Clear, since we need
+		to handle the situation in the Remove methods as well.
+		Fixes #525002.
+
+		2009-07-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripItemCollection.cs: Find should do a case insensitive
+		search, and should throw an ArgumentNullException if the parameter is
+		an empty string.
+
+		2009-07-23  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* PropertyGrid.cs: Use click handlers for each ToolStripButton instead
+		of using a global handler for the ToolStrip. This way the buttons can
+		be recovered and can have its PerformClick method called properly.
+		Fixes #522454.
+
+		2009-07-20  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* X11Dnd.cs: Implement support for XdndActionList, so we can get the
+		complete list of the supported actions in the drag source, and use the
+		action passed in the Position message only as a fallback. This will
+		help us with dnd operations with non winforms apps.
+		Fixes #402158.
+
+		2009-07-20  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripItemCollection.cs: Use a List<> instead of an ArrayList in
+		Find. This should fix the exception we were getting when trying to
+		convert the ArrayList to an array of objects (since we were losing the
+				type parameter).
+		Fixes #519944.
+
+		2009-07-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* RadioButton.cs: Setting Checked when none of the sibligs is checked
+		should happen *not* in GotFocus, but in the Enter event. This is
+		specially important since we should get that Checked behaviour even if
+		no handle is created yet - and thus, no actual GotFocus call happens at
+		the time.
+		Fixes #520764.
+
+		2009-07-16  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ComboBox.cs: Adjust manually the top border for out internal
+		ComboBox, since removing the border from it leaves it without any
+		margin. This is not noticeable in a default ComboBox, but it is in an
+		instance shown on top of ToolStrip.
+		Fixes the remaining part of #507462.
+
+		2009-07-13  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TextBoxBase.cs: Expose the margin top width as a property, to keep
+		the code clean.
+		* ToolStripTextBox.cs: Since we are actually using no border in the
+		default TextBox impl, and we are drawing the border ourselves, we need
+		to manually set the top margin.
+		Fixes part of #507462.
+
+		2009-07-06  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* PrintPreviewDialog.cs: Record when left was pressed, so we can
+		simulate Tab+Alt when moving the focus throughout our buttons and
+		controls.
+		Fixes the remaining bits of #509142.
+
+		2009-07-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TabControl.cs: When computing the width of each tab page, use the
+		page's Font instead of the tab control one.
+		Fixes #514368.
+
+		2009-07-03  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* MenuAPI.cs: When handling the Keys.Left key, don't close the menu if
+		the current menu is specifically a ContextMenu (this is what .net does
+				as well). This way we also avoid a crash caused by MenuTracker trying
+		to use the menu when it was already hidden.
+
+		2009-07-03  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* PrintPreviewDialog.cs: Remove the code used to handle the
+		DropDown menu, since we are now doing it by default in ToolBar, and
+		just call the base impl as needed.Also, deactivate the dropdown menu
+		before moving the focus to a different button in our toolbar, as .net
+		does.
+		* ContextMenu.cs:
+		* MenuAPI.cs: Make as internal the needed bits to deactivate a
+		ContextMenu, and also to keep some beauty in our api.
+
+		2009-07-02  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolBar.cs: When handling the key down message, if we are on a
+		drop down button, either show the DropDownMenu or pass the key to its
+		ProcessCmdKey method as needed.
+		Fixes the remaining bits of #509985.
+
+		2009-06-29  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolBar.cs: Isolate the event logic related to OnButtonClick. Also
+		set current_item when navigating with the keyboard, so we can use it
+		properly later. Finally, handle both Enter and Space to fire
+		OnButtonClick *only*, without any other impact, as .net does.
+		Fixes part of #509985.
+
+		2009-06-29  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* MenuAPI.cs: Close any active menu when we get a simple Alt.
+		Fixes #509299.
+
+		2009-06-26  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolBar.cs: In OnButtonClick only change the Pushed value for
+		buttons with toogle style. We were previously doing it for
+		DropDownButton's buttons, but that's not what .net is doing.
+		Fixes #510030.
+
+		2009-06-26  Atsushi Enomoto  <atsushi at ximian.com>
+
+		* XplatUICarbon.cs : support multi-byte text input.
+		Fixed bug #501276.
+
+		2009-06-22  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* ListBox.cs: When creating DrawItemEventArgs, pass either
+		Theme.ColorHighlightText or ForeColor depending on the selected state
+		of our item, as .net does.
+		Fixes #512115.
+
+		2009-06-22  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ComboBox.cs: When handling WM_CHAR, process the message first, and
+		send it to the textbox only if it wasn't handled.
+		Fixes #507459.
+
+		2009-06-18  Jonathan Pobst  <monkey at jpobst.com>
+
+		* ComboBox.cs: Only do my big sort at the end of AddRange if
+		the combobox is actually set to Sorted.
+
+		2009-06-18 Tom Hindle <tom_hindle at sil.org>
+
+		* XplatUIX11.cs: Enabled Text to coexist with custom data formats.
+		Fixes #511849.
+
+		2009-06-18  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListBox.cs: When calculating the scrollbars for non MultiColumn
+		mode, force the use of the horizontal scrollbar only if
+		ScrollAlwaysVisible is true as well.
+		Fixes #513029.
+
+		2009-06-17  Jonathan Pobst  <monkey at jpobst.com>
+
+		* ComboBox.cs: When using AddRange on a sorted combobox, don't
+		try to use our inefficient sorted insert method, just append
+		it and sort the whole thing at then end.
+		[Fixes bug #511247]
+
+		2009-06-16  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolBar.cs: Expose as internal the code used to show a dropdown menu.
+		* PrintPreviewDialog.cs: Handle the down/up arrow keys for our
+		DropDown element.
+		Fixes #509152.
+
+		2009-06-16  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Scrolling fixes.
+		[Fixes bug #512816]
+
+		2009-06-16  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs, DataGridViewRowCollection.cs: Clean up a bit and 
+		optimize for batch adding rows.
+
+		2009-06-16  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Avoid calling ReBind twice during the initial data 
+		binding.
+		[Fixes bug #512807]
+
+		2009-06-16  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Suppress invalidation during data binding.
+		[Fixes part of bug #512807]
+
+		2009-06-15  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* PrintPreviewDialog.cs: Tune the navigation among the buttons and
+		controls that are part of our ToolBar, so we can mimic the behaviour
+		observed in .Net, by handling also the arrow keys and doing the
+		preprocess for them too.
+		Fixes the remaining bits of #509142.
+
+		2009-06-12  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolBar.cs: Expose the current item as internal.
+		* PrintPreviewDialog.cs: Tune the TabStop property for
+		PrintPreviewControl/ToolBar so we match the .net scenario regarding
+		Tab navigation. Also implement support to navigate throughout the
+		items in the ToolBar.
+		Fixes #509142.
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridViewComboBoxCell.cs, DataGridViewComboBoxColumn.cs: 
+		Implement items syncing in the non-databound scenario.
+		[Fixes bug #494031]
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridView.cs: Call OnCellValidating and OnCellValidated and 
+		handle the Cancel accordingly.
+		[Fixes bug #506838]
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridViewBand.cs: Fix a typo in DefaultHeaderCellType.
+		[Fixes bug #506796]
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* DataGridViewColumnCollection.cs, DataGridViewRowCollection.cs, 
+		DataGridView.cs: Fire CollectionChangeAction.Refresh collection 
+		changed when Clearing the collections so that the DataGridView 
+		can know and reset the current cell.
+		[Fixes bug #492549]
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* BindingSource.cs: In ResetBindings use the ListChangedEventArgs ctor 
+		with the PropertyDescriptor parameter instead of index, because the 
+		latter will set some irelevant indices. Fixes a bug uncovered by recent
+		fix to ListChangedEventArgs.
+
+		2009-06-09  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* DataObject.cs: When looking for any specific format, do a case
+		insensitive search, as .net does.
+		Fixes #509199.
+
+		2009-06-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+		* CurrencyManager.cs: In AllowNew firstly check if the list is a 
+		IBindingList and proxy to AllowNew. IBindingList has slightly differet 
+		logic and eventhough it's an IList IsReadOnly should not be used in this 
+		case as it might be True but AllowNew could be True as well.
+		Fixes a bug uncovered by a fix to the Array class.
+
+		2009-06-08  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListBindingHelper.cs: In GetListItemType do a null check when
+		looking for IList.Item, since the impl could be explicit, and thus
+		private. Fix by Florent Fayolle (p.ricca at odyssee-ingenierie.com).
+		Fixes the remaining part of #507120
+
+		2009-06-07  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DataObject.cs: Map StringFormat/Text/UnicodeText formats properly,
+		to match them in all the cases, as this is exactly what .net does.
+		Fixes #510728.
+
+		2009-06-06  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ListBindingHelper.cs: In GetListItemType handle gracefully the case
+		where an instance of IEnumerator returns a null value for its Current
+		property. Fix by Florent Fayolle (p.ricca at odyssee-ingenierie.com).
+		Fixes #507120.
+
+		2009-06-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ComboBox.cs: Properly detect whether we need to use our vertical
+		scrollbar or not, specially for DropDownList/DropDown styles,
+		depending on the value of DropDownHeight.
+		Fixes #508541.
+
+		2009-06-01  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* ToolTip.cs: Call the base implementation in Dispose, but do it
+		before anything else to avoid a regression. This way we do the default
+		routines related to any System.ComponentModel.Container.
+		Fixes #508586.
+
+		2009-06-01  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* Clipboard.cs:
+		* XplatUIX11.cs:
+		* DataFormats.cs: Implement support for serializable types in our
+		clipboard.
+		Fixes #357642.
+
+		2009-05-25  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ColorDialog.cs: Actually add the help button to the form, so it can
+		be visible.
+		Fixes #478555.
+
+		2009-05-25  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* PrintPreviewDialog.cs: Don't use Dock.Fill for the
+		PrintPreviewControl, since it will be hidden in the top by our
+		toolbar. Use manual location and anchoring instead.
+		Fixes #474889.
+
+		2009-05-25  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* FileDialog.cs: When saving the size of the dialog, use the
+		ClientSize instead of Size, so we have always the same size for the
+		form. Patch by Alex Shulgin.
+		Fixes #503064.
+
+		2009-05-25  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* MessageBox.cs: When showing the dialog call XplatUI.AudibleAlert to
+		show a beep, similar to what .net does. 
+		Fixes #473725.
+
+		2009-05-23  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ContainerControl.cs:
+		* MenuStrip.cs
+		* ToolStrip.cs: Implicit mnemonic processing should happen for every
+		ToolStrip child, not only for MenuStrip, so we are going to do that in
+		ToolStrip.ProcessMnemonic, where we already had that exactly
+		functionality, but we are only just checking that either this instance
+		is a ToolStripDropDownMenu instance or Alt has been pressed. Finally
+		remove the extra code, since we are not going to use it now.
+		Fixes the remaining bits of #503663.
+
+		2009-05-21  Neville Gao  <nevillegao at gmail.com>
+
+		* ContextMenu.cs: Cleaned up UIA properties.
+
+		2009-05-20  Dick Porter  <dick at acm.org>
+
+		* XplatUICarbon.cs: Add more locking around MessageQueue
+		manipulations.
+
+		2009-05-18  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* DateTimePicker.cs: Call Focus in HideMonthCalendar to avoid
+		duplication of code, as well as actually getting the focus back in
+		*any* scenario where the drop down is closed.
+
+		2009-05-18 Tom Hindle <tom_hindle at sil.org>
+		* ScrollableControl.cs: Ignore setting properties HScroll and 
+		VScroll when AutoScroll is true.
+		[Fixes bug #500213]
+
+		2009-05-18  Jonathan Pobst  <monkey at jpobst.com>
+
+		* ToolStripRenderer.cs: Apply patch from Thomas Goldstein to make
+		disabled graphics look closer to the ones that .Net produces.
+		[Fixes bug #473660]
+
+		2009-05-18  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* DateTimePicker.cs: When calculating the max width for the year part,
+		use the current value, since *all* the possible values are exactly a 4
+		digits number. This way we avoid a ArgumentOutOfRangeException trying
+		to check against different values.
+		Fixes #500917.
+
+		2009-05-15  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* MessageBox.cs: When handling ProcessDialogChar, check that
+		CancelButton is not null before trying to use it, to avoid a null ref
+		exception. We don't need to do that on the ok/yes buttons, since they
+		always exist.
+		Fixes #503935.
+
+		2009-05-15  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* ListBox.cs: Handle the key down event in WndProc instead of doing it
+		in an event handler, as we need to avoid any operation in case
+		the user has handled it in its own OnKeyDown handler, and this can't
+		be achieved since our handler would be the first one always.
+		* FontDialog.cs: Update the calls since our method handling key down
+		has been renamed.
+		Fixes #503469.
+
+		2009-05-15  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* Application.cs: We should dismiss the active ToolStrip when we
+		receive a WM_SYSKEYDOWN message, instead of WM_SYSKEYUP, so the next
+		keyboard short cut can be properly processed by another menu item.
+		Fixes part of #503663.
+
+		2009-05-13  Andreia Gaita  <avidigal at novell.com>
+
+		* HtmlDocument.cs: If the objects are strings, wrap them in ""
+
+		2009-05-13  Andreia Gaita  <avidigal at novell.com>
+
+		* HtmlDocument.cs: Fix InvokeScript call (duh).
+
+		2009-05-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* TextBox.cs: Expose IsAutoCompleteAvailable as internal.
+		* ComboBox.cs: If auto complete is being used, it is needed to update
+		the actual value of the combo box, doing it immediately if the user
+		presses Enter, or doing it when our combo box loses focus. Finally,
+		when handling Enter and Escape keys for the combobox, don't try to
+		hide the listbox if it is not visible in the first place. 
+		Fixes part of #489339.
+
+		2009-05-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripDropDownMenu.cs: Use the height returned by
+		ToolStripItem.GetPreferredHeight to calculate our own height.
+
+		2009-05-10  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* TreeNode.cs: When setting Checked, do a double null check, since the
+		current node can still get a null parent handling
+		TreeView.OnAfterCheck.
+		Fixes #502567.
+
+		2009-05-10  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* Control.cs: When assigning ContextMenu, do a null check before
+		assigning its container field.
+
+		2009-05-08  Brad Taylor  <brad at getcoded.net>
+
+		* DateTimePicker.cs: Add a UIA-specific property to ensure that if
+		is_checkbox_checked is changed, we won't break.
+
+		2009-05-08  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+		* ToolStripItem.cs: Prevent NRE when our holder is a
+		ToolStripDropDownButton and we get Select()ed.
+
+		2009-05-08  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* ToolStripControlHost.cs: DefaultSize must return the current size of
+		the Control, not the value returned by GetPreferredSize. Also connect
+		a handle to the control Resize event, and use it to fire
+		OnHostedControlReize.
+		Fixes the remaining bits of #483146.
+
+		2009-05-08  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ToolStripDropDown.cs: When performing the layout, use
+		ToolStripItem.GetPreferredSize ().Height instead of
+		ToolStripItem.Height, since we are already using it that way in this
+		same method.
+		Fixes part of ##483146.
+
+		2009-05-08  Brad Taylor  <brad at getcoded.net>
+
+		* DateTimePicker.cs: Wrap UIA specific code in NET_2_0 wrappers.  Send
+		OnUIASelectionChanged when ShowCheckbox is true and the checkbox
+		recieves focus.  Part of fix for #502029.
+
+		2009-05-06  Mike Gorse  <mgorse at novell.com>
+
+		* FileDialog.cs: Add UIAFocusedItemChanged to PopupButtonPanel.
+		Add PerformClick and PerformDoubleClick to PopupButton.
+		Fixes #499851.
+
+		2009-05-04  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+		* TabControl.cs: call Focus() to emit GotFocus event at the
+		proper time when SelectionIndex changes. Fixes #499887.
+
+		2009-05-03  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* MonthCalendar.cs: In SetBoundsCore always do the bounds check to
+		have valid values, even if BoundSpecified is not including
+		Size/Height/Width - this is useful when we are in a control using Dock
+		or Anchor.
+		Fixes part of #483146.
+
+		2009-04-27  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+		* ComboBox.cs: When losing the focus, if our textbox is not null,
+		close its auto complete list, if any.
+		Fixes part of #489339.
+
+		2009-04-27  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+		* ListView.cs: Make OnColumnClick +internal to be used by a11y.
+
+		2009-04-27  Brad Taylor  <brad at getcoded.net>
+
+		* ToolStripButton.cs: Emit an internal event when CheckOnClick is
+		changed.
+
+		2009-04-26  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+		* ToolStripDropDownItem.cs: When assigning a new
+		ToolStripDropDownMenu, let it know we are its OwnerItem. This way the
+		Capture duties performed by Application/ToolStripManager are handled
+		nicely and we don't end up in an inconsisten stat.
+		Fixes #492815.
+
+2009-10-14  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStrip.cs: Even if we are not exactly a MenuStrip instance, close
+	any ToolStripDropDownItem when receiving a mouse down event in an
+	empty area.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* DateTimePicker.cs: Call Focus in HideMonthCalendar to avoid
+	duplication of code, as well as actually getting the focus back in
+	*any* scenario where the drop down is closed.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DateTimePicker.cs: When calculating the max width for the year part,
+	use the current value, since *all* the possible values are exactly a 4
+	digits number. This way we avoid a ArgumentOutOfRangeException trying
+	to check against different values.
+	Fixes #500917.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TextBox.cs: Expose IsAutoCompleteAvailable as internal.
+	* ComboBox.cs: If auto complete is being used, it is needed to update
+	the actual value of the combo box, doing it immediately if the user
+	presses Enter, or doing it when our combo box loses focus. Finally,
+	when handling Enter and Escape keys for the combobox, don't try to
+	hide the listbox if it is not visible in the first place. 
+	Fixes part of #489339.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ComboBox.cs: When losing the focus, if our textbox is not null,
+	close its auto complete list, if any.
+	Fixes part of #489339.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* Control.cs, ContextMenuStrip.cs, ToolStripMenuItem.cs: Only process any 
+	shortchut in ToolStripMenuItem.ProcessCmdKey if the control generating the 
+	event is the same as the owner of the menu item. Also set properly 
+	SourceControl for ContextMenuStrip, as well as add an internal field to 
+	contain the control that owns the ContextMenuStrip (we need to know this 
+	even before the public property is assigned).
+	Fixes bits of #393775.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* ListBox.cs: The default instance StringFormat field used to draw our
+	items should use the StringFormatFlags.NoWrap value, so it doesn't try
+	to put in a different line the text that doesn't fit our bounds, but
+	show it partially.
+	Fixes #475581.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* CheckedListbox.cs: When executing OnItemClick check that the index
+	is different to -1 before trying to retrieve an item using that value.
+	Fixes a ArgumentOutOfRangeException thrown when the horizontal
+	scrollbar was visible but not needed, and then a clicked was received
+	on its area.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+ 
+	* ListView.cs: In EnsureVisible avoid any direct access to items if we
+	are using virtual mode - otherwise use the bounds stored in a specific
+	item in a given index. This is specially important when using groups
+	or when items are re-arranged, since the position in the items
+	collection can be different than that one being displayed.
+	Fixes the rest of #491978.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TabControl.cs: When removing a tab that was previously selected, set
+	internally the value of selected_index to -1, to avoid trying to
+	access the previous one when trying to set the new one (and was
+	already removed from the collection). This is what .net seems to do
+	too.
+	Fixes #490937.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+	
+	* X11Clipboard.cs: Actually look for the RtfText format when calling
+	GetRftText in our clipboard formats list, instead of using the
+	generical Text format.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TextBox.cs: Process auto completion properly when we are using the
+	internal source provided by ComboBox, and also remove some repeated
+	checks.
+	Fixes #489339.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* X11Structs:
+	* X11Clipboard.cs: Move internal ClipboardStruct from X11Structs to
+	its own file, since it is adding some functionality and thus is not a
+	simple struct as before.
+	* XplatUIX11.cs: Add support to store different formats that could
+	have been specified by the user when puting data in the Clipboard -
+	this is important when more than one format is supported (such plain
+	text and rtf text). Update in the needed places, as well as simplify
+	the code.
+	Fixes #489625.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* XplatUIX11.cs: When handling the SelectionRequest event, use
+	SelectionRequestEvent instead of SelectionEvent, so we get the right
+	data for the app asking for clipboard data. Set the member of
+	SelectioneEvent.property to indicate the place where we are storing
+	the information as well - this is specially important for gnome/kde
+	apps using the TARGETS atom to ask for the supported permission before
+	actually asking for a specific format.
+	Fixes #489393.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStrip.cs: When disposing, iterate over the items in reverse
+	order, since disposing the items modifies the collection.
+	* ToolStripItem.cs: Remove from the owner when disposing.
+	Fixes #485769.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* DomainUpDown.cs: When ReadOnly is true, all the text entered by the
+	user should use a different handling, trying to use every pressed char
+	as a unique and only one prefix to compare against the items. Also,
+	refactor some input check code to avoid duplication.
+	Fixes #458607.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* Form.cs: When calling ProcessCmdKey, just after checking for any
+	MainMenu, check if there's an active ContextMenu that is *not* owned
+	by the form - this is needed when a non-focusable control owns a
+	ContextMenu but its ProcessCmdKey method can't be called since it
+	can't receive any input.
+	Fixes #477655.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* RichTextBox.cs: LoadFile(string path) should pass by default
+	RichTextBoxStreamType.RichText, without caring about the detection or
+	extension of the file.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ListView.cs: In our MouseDown handler in ItemControl use the item in
+	the very specific *real* position where the mouse was pressed, using
+	GetItemAtDisplayIndex for that purpose, instead of directly accessing
+	Items - this is specially useful when groups with Details view is
+	used. This is what we do in other places when using groups.
+	Fixes part of #478689.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ListView.cs: For EnsureVisible, adjust the view port bounds based on
+	the existence of the column headers, as well as using this information
+	to adjust the vscrollbar value, so items never get hidden by the
+	column headers.
+	Fixes #478498.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TextBox.cs: Some code lifting for AutoComplete's support. First,
+	when handling non-navigation keys, save the original Text typed by the
+	user, and don't motify it BEFORE. This was a design mistake, since the
+	re-assignation happens only when navigating the append/suggest list,
+	not while creating the matches. Also, process the Delete key just like 
+	the backspace one. Finally, when handling WM_CHAR, ignore both Escape
+	and Enter keys.
+	Fixes some missing bits of #469967.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* TextBox.cs: When handling WndProc with autocomplete activated,
+	event if the new text is not causing any change in the look up
+	algorithm, save it as we normally do when numbers and letters.
+	Fixes #469967.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TreeView.cs: When canceling selection in our MouseUp handler,
+	invalidate also the previous selected node bounds.
+	Fixes #464191.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* TreeView.cs: When handling the MouseMove event, check if
+	focused_node and selected_node fields are null - usually they are non
+	null, since we have always a selected node, but canceling selection by
+	handling BeforeSelect event leaves the two of them as null.
+	Fixes #470451.
+
+2009-10-05  Carlos Alberto Cortez <calberto.cortez at gmail.com> 
+
+	* TreeView.cs: When drawing the node's image, check that the index
+	specified by the node is valid for the ImageList.
+	Fixes #471094.
+
+2009-09-24  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DataGridView.cs: Compare the name and not displayname of properties 
+	when checking if the column is already bound.
+
+2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* PropertyGrid.cs: Hide the splitter when the help is hidden.
+
+2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* InternalWindowManager.cs: Call Invalidate-Update instead of 
+	Refresh for MS compitability. Note also that Refresh is virtual 
+	and several controls override it in order to provide data refresh 
+	functionallity on top of the redraw and they do not expect this 
+	extra refresh call.
+	* Control.cs: In Refresh Invalidate the control and all children 
+	insead of calling Refresh for each of them.
+	[Fixes bug #538336]
+
+2009-09-11  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* PropertyGrid.cs: Always set the help panel properties on the 
+	internal control, because they are inherited and can change with 
+	the parent.
+	[Fixes bug #525305]
+
+2009-09-03  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* BindingSource.cs: Implement support for chained data sources.
+	* ListBindingHelper.cs: Add support for ICurrencyManagerProvider and 
+	clean up.
+	[Fixes part of bug #536547]
+
+2009-09-02  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* Backport DataGridView and PropertyGrid bug fixes.
+
+2009-07-28  Mike Gorse  <mgorse at novell.com>
+
+	* ToolStripMenuItem.cs: Added UIA CheckOnClickChanged event.
+
+2009-06-26  Atsushi Enomoto  <atsushi at ximian.com>
+
+	* XplatUICarbon.cs : support multi-byte text input.
+	  Fixed bug #501276.
+
 2009-05-20  Dick Porter  <dick at acm.org>
 
 	* XplatUICarbon.cs: Add more locking around MessageQueue
@@ -38970,4 +40226,3 @@
 	  XplatUIX11.cs, lang.cs:
 	  - Initial check-in
 
-
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckedListBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
index c0f3ba1..52b842a 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CheckedListBox.cs
@@ -371,7 +371,7 @@ namespace System.Windows.Forms
 
 		internal override void OnItemClick (int index)
 		{			
-			if (CheckOnClick || last_clicked_index == index) {
+			if ((CheckOnClick || last_clicked_index == index) && index > -1) {
 				if (GetItemChecked (index))
 					SetItemCheckState (index, CheckState.Unchecked);
 				else
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs
index 62b52e4..861bd99 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Clipboard.cs
@@ -30,6 +30,7 @@ using System;
 using System.Drawing;
 using System.IO;
 using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
 using System.Collections;
 using System.Collections.Specialized;
 using System.ComponentModel;
@@ -216,13 +217,13 @@ namespace System.Windows.Forms {
 			SetData (DataFormats.WaveAudio, audioStream);
 		}
 
-		[MonoInternalNote ("Does not use requested format")]
 		public static void SetData (string format, Object data)
 		{
 			if (data == null)
 				throw new ArgumentNullException ("data");
 				
-			SetDataObject (data);
+			DataObject data_object = new DataObject (format, data);
+			SetDataObject (data_object);
 		}
 #endif
 
@@ -250,14 +251,21 @@ namespace System.Windows.Forms {
 			if (data is IDataObject) {
 				string[] formats;
 
-				formats = ((IDataObject)data).GetFormats();
+				IDataObject data_object = data as IDataObject;
+				formats = data_object.GetFormats();
 				for (int i = 0; i < formats.Length; i++) {
 					item_format = DataFormats.GetFormat(formats[i]);
 					if ((item_format != null) && (item_format.Name != DataFormats.StringFormat)) {
 						native_format = item_format.Id;
 					}
 
-					XplatUI.ClipboardStore(clipboard_handle, ((IDataObject)data).GetData(formats[i]), native_format, converter);
+					object obj = data_object.GetData (formats [i]);
+
+					// this is used only by custom formats
+					if (IsDataSerializable (obj))
+						item_format.is_serializable = true;
+
+					XplatUI.ClipboardStore(clipboard_handle, obj, native_format, converter);
 				}
 			} else {
 				item_format = DataFormats.Format.Find(data.GetType().FullName);
@@ -270,6 +278,15 @@ namespace System.Windows.Forms {
 			XplatUI.ClipboardClose(clipboard_handle);
 		}
 
+		static bool IsDataSerializable (object obj)
+		{
+			if (obj is ISerializable)
+				return true;
+
+			AttributeCollection attrs = TypeDescriptor.GetAttributes (obj);
+			return attrs [typeof (SerializableAttribute)] != null;
+		}
+
 #if NET_2_0
 		public 
 #else
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs
index 57fd78f..ca3ffcb 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColorDialog.cs
@@ -263,6 +263,7 @@ namespace System.Windows.Forms {
 			form.Controls.Add (okButton);
 			form.Controls.Add (cancelButton);
 			form.Controls.Add (addColoursButton);
+			form.Controls.Add (helpButton);
 			
 			form.Controls.Add (baseColorControl);
 			form.Controls.Add (colorMatrixControl);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
index db6170e..b6be86d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
@@ -156,13 +156,27 @@ namespace System.Windows.Forms
 			else
 				column_rect.Height = ThemeEngine.Current.ListViewGetHeaderHeight (null, ThemeEngine.Current.DefaultFont);
 
-			if (width >= 0)
+			column_rect.Width = 0;
+
+			if (width >= 0) // manual width
 				column_rect.Width = width;
-			else if (Index != -1) {
+			else if (Index != -1) { // automatic width, either -1 or -2
+				// try to expand if we are the last column
+				bool expand_to_right = Index == owner.Columns.Count - 1 && width == -2;
+				Rectangle visible_area = owner.ClientRectangle;
+
 				column_rect.Width = owner.GetChildColumnSize (Index).Width;
 				width = column_rect.Width;
-			} else
-				column_rect.Width = 0;
+
+				// expand only if we have free space to the right
+				if (expand_to_right && column_rect.X + column_rect.Width < visible_area.Width) {
+					width = visible_area.Width - column_rect.X;
+					if (owner.v_scroll.Visible)
+						width -= owner.v_scroll.Width;
+
+					column_rect.Width = width;
+				}
+			}
 		}
 
 		internal void SetListView (ListView list_view)
@@ -251,10 +265,9 @@ namespace System.Windows.Forms
 		[Browsable (false)]
 		public int Index {
 			get {
-				if (owner != null && owner.Columns != null
-				    && owner.Columns.Contains (this)) {
+				if (owner != null)
 					return owner.Columns.IndexOf (this);
-				}
+
 				return -1;
 			}
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
index 869f94a..2e1fde5 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
@@ -76,8 +76,9 @@ namespace System.Windows.Forms
 		private AutoCompleteStringCollection auto_complete_custom_source = null;
 		private AutoCompleteMode auto_complete_mode = AutoCompleteMode.None;
 		private AutoCompleteSource auto_complete_source = AutoCompleteSource.None;
-		private int drop_down_height;
 		private FlatStyle flat_style;
+		private int drop_down_height;
+		const int default_drop_down_height = 106;
 #endif
 
 		[ComVisible(true)]
@@ -104,7 +105,7 @@ namespace System.Windows.Forms
 			border_style = BorderStyle.None;
 
 #if NET_2_0
-			drop_down_height = 106;
+			drop_down_height = default_drop_down_height;
 			flat_style = FlatStyle.Standard;
 #endif
 
@@ -390,6 +391,9 @@ namespace System.Windows.Forms
 				if (value < 1)
 					throw new ArgumentOutOfRangeException ("DropDownHeight", "DropDownHeight must be greater than 0.");
 					
+				if (value == drop_down_height)
+					return;
+
 				drop_down_height = value;
 				IntegralHeight = false;
 			}
@@ -453,6 +457,7 @@ namespace System.Windows.Forms
 					textbox_ctrl.KeyPress += new KeyPressEventHandler (OnTextKeyPress);
 					textbox_ctrl.Click += new EventHandler (OnTextBoxClick);
 					textbox_ctrl.ContextMenu = ContextMenu;
+					textbox_ctrl.TopMargin = 1; // since we don't have borders, adjust manually the top
 
 					if (IsHandleCreated == true)
 						Controls.AddImplicit (textbox_ctrl);
@@ -804,8 +809,9 @@ namespace System.Windows.Forms
 					return;
 				}
 
+				// set directly the passed value, since we already know it's not matching any item
 				if (dropdown_style != ComboBoxStyle.DropDownList)
-					textbox_ctrl.Text = GetItemText (value);
+					textbox_ctrl.Text = value;
 			}
 		}
 
@@ -1137,6 +1143,9 @@ namespace System.Windows.Forms
 				textbox_ctrl.ActivateCaret (false);
 				textbox_ctrl.ShowSelection = false;
 				textbox_ctrl.SelectionLength = 0;
+#if NET_2_0
+				textbox_ctrl.HideAutoCompleteList ();
+#endif
 			}
 
 			base.OnLostFocus (e);
@@ -1389,9 +1398,10 @@ namespace System.Windows.Forms
 					break;
 				goto case Msg.WM_CHAR;
 			case Msg.WM_CHAR:
-				if (textbox_ctrl != null)
+				// Call our own handler first and send the message to the TextBox if still needed
+				if (!ProcessKeyMessage (ref m) && textbox_ctrl != null)
 					XplatUI.SendMessage (textbox_ctrl.Handle, (Msg) m.Msg, m.WParam, m.LParam);
-				break;
+				return;
 			case Msg.WM_MOUSELEAVE:
 				Point location = PointToClient (Control.MousePosition);
 				if (ClientRectangle.Contains (location))
@@ -1710,7 +1720,8 @@ namespace System.Windows.Forms
 				
 				case Keys.Enter:	
 				case Keys.Escape:
-					DropDownListBoxFinished ();
+					if (listbox_ctrl != null && listbox_ctrl.Visible)
+						DropDownListBoxFinished ();
 					break;
 					
 				case Keys.Home:
@@ -2072,7 +2083,7 @@ namespace System.Windows.Forms
 			{
 				int idx;
 
-				idx = AddItem (item);
+				idx = AddItem (item, false);
 				owner.UpdatedItems ();
 				return idx;
 			}
@@ -2083,8 +2094,11 @@ namespace System.Windows.Forms
 					throw new ArgumentNullException ("items");
 
 				foreach (object mi in items)
-					AddItem (mi);
-					
+					AddItem (mi, true);
+
+				if (owner.sorted)
+					Sort ();
+				
 				owner.UpdatedItems ();
 			}
 
@@ -2159,7 +2173,7 @@ namespace System.Windows.Forms
 				owner.BeginUpdate ();
 				
 				if (owner.Sorted)
-					AddItem (item);
+					AddItem (item, false);
 				else {
 					object_items.Insert (index, item);
 #if NET_2_0
@@ -2206,12 +2220,14 @@ namespace System.Windows.Forms
 			#endregion Public Methods
 
 			#region Private Methods
-			private int AddItem (object item)
+			private int AddItem (object item, bool suspend)
 			{
+				// suspend means do not sort as we put new items in, we will do a
+				// big sort at the end
 				if (item == null)
 					throw new ArgumentNullException ("item");
 
-				if (owner.Sorted) {
+				if (owner.Sorted && !suspend) {
 					int index = 0;
 					foreach (object o in object_items) {
 						if (String.Compare (item.ToString (), o.ToString ()) < 0) {
@@ -2246,7 +2262,10 @@ namespace System.Windows.Forms
 			internal void AddRange (IList items)
 			{
 				foreach (object mi in items)
-					AddItem (mi);
+					AddItem (mi, false);
+				
+				if (owner.sorted)
+					Sort ();
 				
 				owner.UpdatedItems ();
 			}
@@ -2289,8 +2308,33 @@ namespace System.Windows.Forms
 				this.owner = owner;
 				ShowSelection = false;
 				HideSelection = false;
+#if NET_2_0
+				owner.LostFocus += OwnerLostFocusHandler;
+#endif
 			}
 
+#if NET_2_0
+			void OwnerLostFocusHandler (object o, EventArgs args)
+			{
+				if (IsAutoCompleteAvailable)
+					owner.Text = Text;
+			}
+
+			protected override void OnKeyDown (KeyEventArgs args)
+			{
+				if (args.KeyCode == Keys.Enter && IsAutoCompleteAvailable)
+					owner.Text = Text;
+
+				base.OnKeyDown (args);
+			}
+
+			internal override void OnAutoCompleteValueSelected (EventArgs args)
+			{
+				base.OnAutoCompleteValueSelected (args);
+				owner.Text = Text;
+			}
+#endif
+
 			internal void SetSelectable (bool selectable)
 			{
 				SetStyle (ControlStyles.Selectable, selectable);
@@ -2462,16 +2506,18 @@ namespace System.Windows.Forms
 			internal void CalcListBoxArea ()
 			{
 				int width, height;
-				bool show_scrollbar = false;
+				bool show_scrollbar;
 
 				if (owner.DropDownStyle == ComboBoxStyle.Simple) {
 					Rectangle area = owner.listbox_area;
 					width = area.Width;
 					height = area.Height;
+					show_scrollbar = owner.Items.Count * owner.ItemHeight > height;
 
 					// No calculation needed
 					if (height <= 0 || width <= 0)
 						return;
+
 				}
 				else { // DropDown or DropDownList
 					
@@ -2483,12 +2529,21 @@ namespace System.Windows.Forms
 						for (int i = 0; i < count; i++) {
 							height += owner.GetItemHeight (i);
 						}
+
+						show_scrollbar = owner.Items.Count > owner.MaxDropDownItems;
 						
 					} else	{
 #if NET_2_0
-						height = owner.DropDownHeight;
+						if (owner.DropDownHeight == default_drop_down_height) { // ignore DropDownHeight
+							height = owner.ItemHeight * count;
+							show_scrollbar = owner.Items.Count > owner.MaxDropDownItems;
+						} else {
+							height = owner.DropDownHeight;
+							show_scrollbar = (count * owner.ItemHeight) > height;
+						}
 #else		
 						height = owner.ItemHeight * count;
+						show_scrollbar = owner.Items.Count > owner.MaxDropDownItems;
 #endif
 					}
 				}
@@ -2496,8 +2551,7 @@ namespace System.Windows.Forms
 				page_size = Math.Max (height / owner.ItemHeight, 1);
 
 				ComboBoxStyle dropdown_style = owner.DropDownStyle;
-				if ((dropdown_style != ComboBoxStyle.Simple && owner.Items.Count <= owner.MaxDropDownItems)
-					|| (dropdown_style == ComboBoxStyle.Simple && owner.Items.Count * owner.ItemHeight < height)) {
+				if (!show_scrollbar) {
 
 					if (vscrollbar_ctrl != null)
 						vscrollbar_ctrl.Visible = false;
@@ -2526,7 +2580,7 @@ namespace System.Windows.Forms
 					if (large < 1)
 						large = 1;
 					vscrollbar_ctrl.LargeChange = large;
-					show_scrollbar = vscrollbar_ctrl.Visible = true;
+					vscrollbar_ctrl.Visible = true;
 
 					int hli = HighlightedIndex;
 					if (hli > 0) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
index e735026..51e9488 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContainerControl.cs
@@ -419,7 +419,7 @@ namespace System.Windows.Forms {
 		}
 #endif
 
-		[MonoTODO]
+		[MonoTODO ("Stub, not implemented")]
 		static bool ValidateWarned;
 		public bool Validate() {
 			//throw new NotImplementedException();
@@ -566,16 +566,8 @@ namespace System.Windows.Forms {
 			wrapped = false;
 			c = active_control;
 
-#if NET_2_0
-			System.Collections.Generic.List<MenuStrip> strips = new System.Collections.Generic.List<MenuStrip> ();
-#endif
-
 			do {
 				c = GetNextControl(c, true);
-#if NET_2_0
-				if (c is MenuStrip)
-					strips.Add ((MenuStrip)c);
-#endif
 				if (c != null) {
 					// This is stupid. I want to be able to call c.ProcessMnemonic directly
 					if (c.ProcessControlMnemonic(charCode)) {
@@ -590,14 +582,6 @@ namespace System.Windows.Forms {
 				}
 			} while (c != active_control);
 
-#if NET_2_0
-			// No one has an explicit mnemonic for this key.
-			// Let MenuStrips have a chance at implicit mnemonics.
-			foreach (MenuStrip ms in strips)
-				if (ms.ProcessImplicitMnemonic (charCode))
-					return true;
-#endif
-
 			return false;
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs
index 73bc82e..115dcdd 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenu.cs
@@ -140,5 +140,9 @@ namespace System.Windows.Forms
 		}
 #endif
 		#endregion Public Methods
+		internal void Hide ()
+		{
+			tracker.Deactivate ();
+		}
 	}
 }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenuStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenuStrip.cs
index b41b06d..a57ce86 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenuStrip.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ContextMenuStrip.cs
@@ -36,7 +36,8 @@ namespace System.Windows.Forms
 	[DefaultEvent ("Opening")]
 	public class ContextMenuStrip : ToolStripDropDownMenu
 	{
-		private Control source_control;
+		Control source_control;
+		internal Control container;
 
 		#region Public Construtors
 		public ContextMenuStrip () : base ()
@@ -71,6 +72,11 @@ namespace System.Windows.Forms
 				XplatUI.SetTopmost (this.Handle, true);
 		}
 		#endregion
+
+		internal void SetSourceControl (Control source_control)
+		{
+			container = this.source_control = source_control;
+		}
 	}
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
index 16debfe..b4341dd 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
@@ -323,17 +323,18 @@ namespace System.Windows.Forms
 				return base.GetHelpTopic (out fileName);
 			}
 
-			[MonoTODO ("Implement this")]
-			public void NotifyClients(AccessibleEvents accEvent) {
-				throw new NotImplementedException();
+			[MonoTODO ("Stub, does nothing")]
+			public void NotifyClients (AccessibleEvents accEvent)
+			{
 			}
 
-			[MonoTODO ("Implement this")]
-			public void NotifyClients(AccessibleEvents accEvent, int childID) {
+			[MonoTODO ("Stub, does nothing")]
+			public void NotifyClients (AccessibleEvents accEvent, int childID)
+			{
 			}
 
 #if NET_2_0
-			[MonoTODO ("Implement this")]
+			[MonoTODO ("Stub, does nothing")]
 			public void NotifyClients (AccessibleEvents accEvent, int objectID, int childID)
 			{
 			}
@@ -2087,7 +2088,7 @@ namespace System.Windows.Forms
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		[Browsable (false)]
-		[MonoTODO]
+		[MonoTODO ("Stub, value is not used")]
 		public static bool CheckForIllegalCrossThreadCalls 
 		{
 			get {
@@ -2589,6 +2590,8 @@ namespace System.Windows.Forms
 			set { 
 				if (this.context_menu_strip != value) {
 					this.context_menu_strip = value;
+					if (value != null)
+						value.container = this;
 					OnContextMenuStripChanged (EventArgs.Empty);
 				}
 			}
@@ -4200,14 +4203,8 @@ namespace System.Windows.Forms
 
 		public virtual void Refresh() {
 			if (IsHandleCreated && Visible) {
-				Invalidate();
-				XplatUI.UpdateWindow(window.Handle);
-
-				Control [] controls = child_controls.GetAllControls ();
-				for (int i=0; i < controls.Length; i++) {
-					controls[i].Refresh();
-				}
-				
+				Invalidate(true);
+				Update ();
 			}
 		}
 
@@ -4248,7 +4245,7 @@ namespace System.Windows.Forms
 		}
 
 		public virtual void ResetText() {
-			text = String.Empty;
+			Text = String.Empty;
 		}
 
 		public void ResumeLayout() {
@@ -5748,6 +5745,7 @@ namespace System.Windows.Forms
 						pt = this.PointToScreen (pt);
 					}
 					
+					context_menu_strip.SetSourceControl (this);
 					context_menu_strip.Show (this, PointToClient (pt));
 					return;
 				}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
index dd48a04..23c4970 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ControlPaint.cs
@@ -162,15 +162,21 @@ namespace System.Windows.Forms {
 		#endregion	// Public Static Properties
 
 		#region Public Static Methods
-		public static IntPtr CreateHBitmap16Bit(Bitmap bitmap, Color background){
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public static IntPtr CreateHBitmap16Bit (Bitmap bitmap, Color background)
+		{
 			throw new NotImplementedException ();
 		}
 
-		public static IntPtr CreateHBitmapColorMask(Bitmap bitmap, IntPtr monochromeMask){
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public static IntPtr CreateHBitmapColorMask (Bitmap bitmap, IntPtr monochromeMask)
+		{
 			throw new NotImplementedException ();
 		}
 
-		public static IntPtr CreateHBitmapTransparencyMask(Bitmap bitmap){
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public static IntPtr CreateHBitmapTransparencyMask (Bitmap bitmap)
+		{
 			throw new NotImplementedException ();
 		}
 
@@ -454,7 +460,7 @@ namespace System.Windows.Forms {
 			ThemeEngine.Current.CPDrawScrollButton (graphics, rectangle, button, state);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		private static bool DSFNotImpl = false;
 		public static void DrawSelectionFrame(Graphics graphics, bool active, Rectangle outsideRect, Rectangle insideRect, Color backColor) {
 			if (!DSFNotImpl) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs
index 70a1727..87348eb 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/CurrencyManager.cs
@@ -116,30 +116,7 @@ namespace System.Windows.Forms {
 
 		public override PropertyDescriptorCollection GetItemProperties ()
 		{
-			if (list is Array) {
-				Type element = list.GetType ().GetElementType ();
-				return TypeDescriptor.GetProperties (element);
-			}
-
-			if (list is ITypedList) {
-				return ((ITypedList)list).GetItemProperties (null);
-			}
-
-			PropertyInfo [] props = data_source.GetType().GetProperties ();
-			for (int i = 0; i < props.Length; i++) {
-				if (props [i].Name == "Item") {
-					Type t = props [i].PropertyType;
-					if (t == typeof (object))
-						continue;
-					return GetBrowsableProperties (t);
-				}
-			}
-
-			if (list.Count > 0) {
-				return GetBrowsableProperties (list [0].GetType ());
-			}
-			
-			return new PropertyDescriptorCollection (null);
+			return ListBindingHelper.GetListItemProperties (list);
 		}
 
 		public override void RemoveAt (int index)
@@ -169,13 +146,12 @@ namespace System.Windows.Forms {
 
                 internal bool AllowNew {
                 	get {
-				/* if we're readonly, don't even bother checking if we can add new rows */
-				if (list.IsReadOnly)
-					return false;
-
 				if (list is IBindingList)
 					return ((IBindingList)list).AllowNew;
 
+				if (list.IsReadOnly)
+					return false;
+
 				return false;
 			}
 		}
@@ -350,7 +326,9 @@ namespace System.Windows.Forms {
 			foreach (Binding binding in Bindings)
 				binding.UpdateIsBinding ();
 
+			//Console.WriteLine ("UpdateIsBinding BEFORE count = " + Count);
 			ChangeRecordState (listposition, false, false, true, false);
+			//Console.WriteLine ("UpdateIsBinding AFTER count = " + Count);
 
 			OnItemChanged (new ItemChangedEventArgs (-1));
 		}
@@ -374,8 +352,10 @@ namespace System.Windows.Forms {
 			if (old_index != -1 && listposition != -1)
 				OnCurrentChanged (EventArgs.Empty);
 
+			//Console.WriteLine ("Change record state, BEFORE new pos = " + newPosition);
 			if (firePositionChanged)
 				OnPositionChanged (EventArgs.Empty);
+			//Console.WriteLine ("Change record state, AFTER new pos = " + newPosition);
 		}
 
 		private void UpdateItem ()
@@ -422,6 +402,7 @@ namespace System.Windows.Forms {
 				break;
 			case ListChangedType.ItemDeleted:
 				if (list.Count == 0) {
+					// THIS IS OUR FAULTY CODE
 					/* the last row was deleted */
 					listposition = -1;
 					UpdateIsBinding ();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs
index cf1151b..70be1d1 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Cursor.cs
@@ -191,7 +191,8 @@ namespace System.Windows.Forms {
 				return rect;
 			}
 
-			[MonoTODO("First need to add ability to set cursor clip rectangle to XplatUI drivers to implement this property")]
+			[MonoTODO ("Stub, does nothing")]
+			[MonoInternalNote ("First need to add ability to set cursor clip rectangle to XplatUI drivers to implement this property")]
 			set {
 				;
 			}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataFormats.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataFormats.cs
index aa5f88d..ec20342 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataFormats.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataFormats.cs
@@ -42,6 +42,7 @@ namespace System.Windows.Forms
 			private string		name;
 			private int		id;
 			private Format		next;
+			internal bool		is_serializable;
 
 			public Format (string name, int id)
 			{
@@ -162,6 +163,17 @@ namespace System.Windows.Forms
 		private static object lock_object = new object ();
 		private static bool initialized;
 
+		// we don't want to force the creation of a new format
+		internal static bool ContainsFormat (int id)
+		{
+			lock (lock_object) {
+				if (!initialized)
+					Init ();
+
+				return Format.Find (id) != null;
+			}
+		}
+
 		public static Format GetFormat (int id)
 		{
 			lock (lock_object) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs
index ac06292..13a43c7 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGrid.cs
@@ -268,8 +268,10 @@ namespace System.Windows.Forms
 		/* editing state */
 		bool cursor_in_add_row;
 		bool add_row_changed;
-		bool is_editing;		// Current cell is edit mode
+		internal bool is_editing;		// Current cell is edit mode
 		bool is_changing;
+		bool commit_row_changes = true;		// Whether to commit current edit or cancel it
+		bool adding_new_row;			// Used to temporary ignore the new row added by CurrencyManager.AddNew in CurrentCell
 
 		internal Stack data_source_stack;
 
@@ -513,7 +515,10 @@ namespace System.Windows.Forms
 				if (value.RowNumber != current_cell.RowNumber) {
 					if (!from_positionchanged_handler) {
 						try {
-							ListManager.EndCurrentEdit ();
+							if (commit_row_changes)
+								ListManager.EndCurrentEdit ();
+							else
+								ListManager.CancelCurrentEdit ();
 						}
 						catch (Exception e) {
 							DialogResult r = MessageBox.Show (String.Format ("{0} Do you wish to correct the value?", e.Message),
@@ -541,13 +546,20 @@ namespace System.Windows.Forms
 
 				EnsureCellVisibility (value);
 
+				// by default, edition in existing rows is commited, and for new ones is discarded, unless
+				// we receive actual input data from the user
 				if (CurrentRow == RowsCount && ListManager.AllowNew) {
+					commit_row_changes = false;
 					cursor_in_add_row = true;
 					add_row_changed = false;
+
+					adding_new_row = true;
 					AddNewRow ();
+					adding_new_row = false;
 				}
 				else {
 					cursor_in_add_row = false;
+					commit_row_changes = true;
 				}
 
 				InvalidateRowHeader (old_row);
@@ -564,6 +576,16 @@ namespace System.Windows.Forms
 			}
 		}
 
+		internal void EditRowChanged (DataGridColumnStyle column_style)
+		{
+			if (cursor_in_add_row) {
+				if (!commit_row_changes) { // first change in add row, time to show another row in the ui
+					commit_row_changes = true;
+					RecreateDataGridRows (true);
+				}
+			}
+		}
+
 		int CurrentRow {
 			get { return current_cell.RowNumber; }
 			set { CurrentCell = new DataGridCell (value, current_cell.ColumnNumber); }
@@ -977,7 +999,6 @@ namespace System.Windows.Forms
 			}
 		}
 
-		[MonoTODO]
 		public bool BeginEdit (DataGridColumnStyle gridColumn, int rowNumber)
 		{
 			if (is_changing)
@@ -1020,7 +1041,6 @@ namespace System.Windows.Forms
 			is_editing = false;
 		}
 
-		[MonoTODO]
 		public void Collapse (int row)
 		{
 			if (!rows[row].IsExpanded)
@@ -1068,6 +1088,7 @@ namespace System.Windows.Forms
 			return CreateGridColumn (prop, false);
 		}
 
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
 		protected virtual DataGridColumnStyle CreateGridColumn (PropertyDescriptor prop, bool isDefault)
 		{
 			throw new NotImplementedException();
@@ -1288,7 +1309,6 @@ namespace System.Windows.Forms
 			return rows[row].IsSelected;
 		}
 
-		[MonoTODO]
 		public void NavigateBack ()
 		{
 			if (data_source_stack.Count == 0)
@@ -1304,7 +1324,6 @@ namespace System.Windows.Forms
 			CurrentCell = source.current;
 		}
 
-		[MonoTODO]
 		public void NavigateTo (int rowNumber, string relationName)
 		{
 			if (allow_navigation == false)
@@ -1421,20 +1440,24 @@ namespace System.Windows.Forms
 			base.OnHandleDestroyed (e);
 		}
 
+		// It seems we have repeated code with ProcessKeyPreview, specifically
+		// the call to ProcessGridKey. In practice it seems this event is *never* fired
+		// since the key events are handled by the current column's textbox. 
+		// We are keeping commented anyway, in case we need to actually call it.
 		protected override void OnKeyDown (KeyEventArgs ke)
 		{
 			base.OnKeyDown (ke);
 			
-			if (ProcessGridKey (ke) == true)
+			/*if (ProcessGridKey (ke) == true)
 				ke.Handled = true;
 
-			/* TODO: we probably don't need this check,
-			 * since current_cell wouldn't have been set
-			 * to something invalid */
+			// TODO: we probably don't need this check,
+			// since current_cell wouldn't have been set
+			// to something invalid
 			if (CurrentTableStyle.GridColumnStyles.Count > 0) {
 				CurrentTableStyle.GridColumnStyles[current_cell.ColumnNumber].OnKeyDown
 					(ke, current_cell.RowNumber, current_cell.ColumnNumber);
-			}
+			}*/
 		}
 
 		protected override void OnKeyPress (KeyPressEventArgs kpe)
@@ -1487,6 +1510,7 @@ namespace System.Windows.Forms
 				DataGridCell new_cell = new DataGridCell (testinfo.Row, testinfo.Column);
 
 				if ((new_cell.Equals (current_cell) == false) || (!is_editing)) {
+					ResetSelection ();
 					CurrentCell = new_cell;
 					Edit ();
 				} else {
@@ -1536,6 +1560,10 @@ namespace System.Windows.Forms
 
 				if (ListManager.List is IBindingList == false)
 					break;
+
+				// Don't do any sort if we are empty, as .net does
+				if (ListManager.Count == 0)
+					return;
 			
 				ListSortDirection direction = ListSortDirection.Ascending;
 				PropertyDescriptor prop = CurrentTableStyle.GridColumnStyles[testinfo.Column].PropertyDescriptor;
@@ -1679,6 +1707,12 @@ namespace System.Windows.Forms
 
 					Cursor = Cursors.Default;
 					break;
+				case HitTestType.RowHeader:
+					if (e.Button == MouseButtons.Left)
+						ShiftSelection (testinfo.Row);
+
+					Cursor = Cursors.Default;
+					break;
 				default:
 					Cursor = Cursors.Default;
 					break;
@@ -1858,8 +1892,13 @@ namespace System.Windows.Forms
 			case Keys.Escape:
 				if (is_changing)
 					AbortEditing ();
-				else
+				else {
 					CancelEditing ();
+
+					if (cursor_in_add_row && CurrentRow > 0)
+						CurrentRow--;
+				}
+
 				Edit ();
 				return true;
 				
@@ -1992,9 +2031,15 @@ namespace System.Windows.Forms
 				if (is_editing)
 					return false;
 				else if (selected_rows.Keys.Count > 0) {
-					foreach (int row in selected_rows.Keys)
-						ListManager.RemoveAt (row);
-					selected_rows.Clear ();
+					// the removal of the items in the source will cause to
+					// reset the selection, so we need a copy of it.
+					int [] rows = new int [selected_rows.Keys.Count];
+					selected_rows.Keys.CopyTo (rows, 0);
+
+					// reverse order to keep index sanity
+					for (int i = rows.Length - 1; i >= 0; i--)
+						ListManager.RemoveAt (rows [i]);
+
 					CalcAreasAndInvalidate ();
 				}
 
@@ -2011,6 +2056,14 @@ namespace System.Windows.Forms
 				KeyEventArgs ke = new KeyEventArgs (key);
 				if (ProcessGridKey (ke))
 					return true;
+
+				// if we receive a key event, make sure that input is actually
+				// taken into account.
+				if (!is_editing) {
+					Edit ();
+					InvalidateRow (current_cell.RowNumber);
+					return true;
+				}
 			}
 
 			return base.ProcessKeyPreview (ref m);
@@ -2448,8 +2501,10 @@ namespace System.Windows.Forms
 				} else if (CurrentTableStyle == grid_style ||
 					 CurrentTableStyle.MappingName != list_name) {
 					// If the style has been defined by the user, use it
+					// Also, if the user provided style is empty,
+					// force a bind for it
 					CurrentTableStyle = styles_collection[list_name];
-					current_style.CreateColumnsForTable (true);
+					current_style.CreateColumnsForTable (current_style.GridColumnStyles.Count > 0);
 				} else {
 					current_style.CreateColumnsForTable (true);
 				}
@@ -2459,12 +2514,8 @@ namespace System.Windows.Forms
 
 		private void OnListManagerMetaDataChanged (object sender, EventArgs e)
 		{
-			// XXX
-
-			//we need to rethink this, as in 2.0 we get this event when a column is added to a table.
-			// forcing a rebind of columns means that we fail bug #80422.  disable this for now.
-			//
-			// BindColumns ();
+			BindColumns ();
+			CalcAreasAndInvalidate ();
 		}
 
 		private void OnListManagerPositionChanged (object sender, EventArgs e)
@@ -2476,6 +2527,10 @@ namespace System.Windows.Forms
 
 		private void OnListManagerItemChanged (object sender, ItemChangedEventArgs e)
 		{
+			// if it was us who created the new row in CurrentCell, ignore it and don't recreate the rows yet.
+			if (adding_new_row)
+				return;
+
 			if (e.Index == -1) {
 				ResetSelection ();
 				if (rows == null || RowsCount != rows.Length - (ShowEditRow ? 1 : 0))
@@ -2495,7 +2550,8 @@ namespace System.Windows.Forms
 			case CollectionChangeAction.Add:
 				if (e.Element != null && String.Compare (list_name, ((DataGridTableStyle)e.Element).MappingName, true) == 0) {
 					CurrentTableStyle = (DataGridTableStyle)e.Element;
-					((DataGridTableStyle) e.Element).CreateColumnsForTable (false);
+					// force to auto detect columns in case the new style is completely empty
+					((DataGridTableStyle) e.Element).CreateColumnsForTable (CurrentTableStyle.GridColumnStyles.Count > 0);
 				}
 				break;
 			case CollectionChangeAction.Remove:
@@ -2537,6 +2593,9 @@ namespace System.Windows.Forms
 			if (!CurrentTableStyle.GridColumnStyles[CurrentColumn].bound)
 				return;
 
+			if (ListManager != null && ListManager.Count == 0)
+				return;
+
 			is_editing = true;
 			is_changing = false;
 
@@ -2628,8 +2687,6 @@ namespace System.Windows.Forms
 			if (pixels == 0)
 				return;
 
-			EndEdit ();
-
 			Rectangle rows_area = cells_area; // Cells area - partial rows space
 
 			if (RowHeadersVisible) {
@@ -3287,7 +3344,10 @@ namespace System.Windows.Forms
 		}
 
 		int VLargeChange {
-			get { return VisibleRowCount; }
+			get { 
+				// the possible number of visible rows
+				return cells_area.Height / RowHeight;
+			}
 		}
 
 		#endregion Instance Properties
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
index 1a6e827..0127178 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridBoolColumn.cs
@@ -172,9 +172,10 @@ namespace System.Windows.Forms
 			return true;
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		protected internal override void ConcedeFocus ()
 		{
+			base.ConcedeFocus ();
 		}
 
 #if NET_2_0
@@ -194,10 +195,10 @@ namespace System.Windows.Forms
 			grid.Invalidate (grid.GetCurrentCellBounds ());
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		protected internal override void EnterNullValue ()
 		{
-
+			base.EnterNullValue ();
 		}
 
 		private bool ValueEquals (object value, object obj)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
index 65a6a78..c28bf4b 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridColumnStyle.cs
@@ -56,7 +56,7 @@ namespace System.Windows.Forms
 			#endregion //Constructors
 
 			#region Public Instance Properties
-			[MonoTODO]
+			[MonoTODO ("Not implemented, will throw NotImplementedException")]
 			public override Rectangle Bounds {
 				get {
 					throw new NotImplementedException ();
@@ -87,7 +87,7 @@ namespace System.Windows.Forms
 			#endregion
 
 			#region Public Instance Methods
-			[MonoTODO]
+			[MonoTODO ("Not implemented, will throw NotImplementedException")]
 			public override AccessibleObject Navigate (AccessibleNavigation navdir)
 			{
 				throw new NotImplementedException ();
@@ -102,7 +102,7 @@ namespace System.Windows.Forms
 			}
 
 			#region Public Instance Methods
-			[MonoTODO]
+			[MonoTODO ("Not implemented, will throw NotImplementedException")]
 			public static TraceSwitch DGEditColumnEditing {
 				get {
 					throw new NotImplementedException ();
@@ -355,7 +355,7 @@ namespace System.Windows.Forms
 		#region Public Instance Methods
 		protected internal abstract void Abort (int rowNum);
 
-		[MonoTODO]
+		[MonoTODO ("Will not suspend updates")]
 		protected void BeginUpdate ()
 		{
 		}
@@ -383,7 +383,6 @@ namespace System.Windows.Forms
 			}
 		}
 
-		[MonoTODO]
 		protected internal virtual void ColumnStartedEditing (Control editingControl)
 		{
 		}
@@ -426,7 +425,6 @@ namespace System.Windows.Forms
 			bool cellIsVisible);
 
 
-		[MonoTODO]
 		protected void EndUpdate ()
 		{
 		}
@@ -489,8 +487,8 @@ namespace System.Windows.Forms
 
 			property_descriptor = null;
 
-			if (value != null && value.ListManager != null)
-				CheckValidDataSource (value.ListManager);
+			// we don't check whether the DataGrid.ListManager is valid or not.
+			// This is done by .net later as requiered, but not at this point.
 		}
 
 		protected virtual void SetDataGridInColumn (DataGrid value)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
index 3a02fe6..356311d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTableStyle.cs
@@ -531,8 +531,8 @@ namespace System.Windows.Forms
 
 		#region Public Instance Methods
 
-		[MonoTODO]
-		public bool BeginEdit (DataGridColumnStyle gridColumn,  int rowNumber)
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public bool BeginEdit (DataGridColumnStyle gridColumn, int rowNumber)
 		{
 			throw new NotImplementedException ();
 		}
@@ -566,8 +566,8 @@ namespace System.Windows.Forms
 			base.Dispose (disposing);
 		}
 
-		[MonoTODO]
-		public bool EndEdit ( DataGridColumnStyle gridColumn,  int rowNumber,  bool shouldAbort)
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		public bool EndEdit (DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort)
 		{
 			throw new NotImplementedException ();
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
index 4c230c4..21d9b8c 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridTextBoxColumn.cs
@@ -161,7 +161,6 @@ namespace System.Windows.Forms
 			return true;
 		}
 
-		[MonoTODO]
 		protected internal override void ConcedeFocus ()
 		{
 			HideEditBox ();
@@ -208,6 +207,7 @@ namespace System.Windows.Forms
 		void textbox_TextChanged (object o, EventArgs e)
 		{
 			textbox.IsInEditOrNavigateMode = false;
+			grid.EditRowChanged (this);
 		}
 
 		protected void EndEdit ()
@@ -242,7 +242,6 @@ namespace System.Windows.Forms
 			return s;
 		}
 
-		[MonoTODO]
 		protected void HideEditBox ()
 		{
 			if (!textbox.Visible)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
index 14d4a9a..1e1b95c 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs
@@ -135,9 +135,6 @@ namespace System.Windows.Forms {
 		private DataGridViewSelectedColumnCollection selected_columns;
 		private DataGridViewRow editing_row;
 		
-		private int gridWidth;
-		private int gridHeight;
-
 		DataGridViewHeaderCell pressed_header_cell;
 		DataGridViewHeaderCell entered_header_cell;
 
@@ -275,8 +272,14 @@ namespace System.Windows.Forms {
 			set {
 				if (allowUserToAddRows != value) {
 					allowUserToAddRows = value;
+					if (!value) {
+						if (new_row_editing)
+							CancelEdit ();
+						RemoveEditingRow ();
+					} else {
+						PrepareEditingRow (false, false);
+					}
 					OnAllowUserToAddRowsChanged(EventArgs.Empty);
-					PrepareEditingRow (false, false);
 					Invalidate ();
 				}
 			}
@@ -579,12 +582,12 @@ namespace System.Windows.Forms {
 					throw new InvalidOperationException("Cant change column count if DataSource is set.");
 				}
 				if (value < columns.Count) {
-					for (int i = value; i < columns.Count; i++) {
+					for (int i = columns.Count -1; i >= value; i--) {
 						columns.RemoveAt(i);
 					}
 				}
 				else if (value > columns.Count) {
-					for (int i = 0; i < value; i++) {
+					for (int i = columns.Count; i < value; i++) {
 						DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn ();
 						columns.Add(col);
 					}
@@ -711,7 +714,7 @@ namespace System.Windows.Forms {
 			set {
 				if (dataMember != value) {
 					dataMember = value;
-					if (IsHandleCreated)
+					if (BindingContext != null)
 						ReBind ();
 					OnDataMemberChanged(EventArgs.Empty);
 				}
@@ -734,9 +737,15 @@ namespace System.Windows.Forms {
 					throw new NotSupportedException ("Type cannot be bound.");
 					
 				ClearBinding ();
-				dataSource = value;
-				if (IsHandleCreated)
+
+				// Do not set dataSource prior to te BindingContext check because there is some lazy initialization 
+				// code which might result in double call to ReBind here and in OnBindingContextChanged
+				if (BindingContext != null) {
+					dataSource = value;
 					ReBind ();
+				} else {
+					dataSource = value;
+				}
 				OnDataSourceChanged (EventArgs.Empty);
 			}
 		}
@@ -905,11 +914,12 @@ namespace System.Windows.Forms {
 		[Browsable (false)]
 		public bool IsCurrentRowDirty {
 			get {
-				if (!virtualMode) {
+				if (!virtualMode)
 					return IsCurrentCellDirty;
-				}
-				// Calcular
-				throw new NotImplementedException();
+
+				QuestionEventArgs args = new QuestionEventArgs ();
+				OnRowDirtyStateNeeded (args);
+				return args.Response;
 			}
 		}
 
@@ -1007,24 +1017,28 @@ namespace System.Windows.Forms {
 				if (dataSource != null) {
 					throw new InvalidOperationException("Cant change row count if DataSource is set.");
 				}
+
 				if (value < rows.Count) {
-					for (int i = value; i < rows.Count; i++) {
+					int removeRangeEndIndex = rows.Count - 1;
+					if (AllowUserToAddRows)
+						removeRangeEndIndex--; // do not remove editing row
+
+					int removeRangeStartIndex = value - 1;
+					if (AllowUserToAddRows)
+						removeRangeStartIndex--; // remove an extra row before/instead of the editing row
+
+					for (int i = removeRangeEndIndex; i > removeRangeStartIndex; i--)
 						rows.RemoveAt(i);
-					}
-				}
-				else if (value > rows.Count) {
+				} else if (value > rows.Count) {
 					// If we need to add rows and don't have any columns,
 					// we create one column
 					if (ColumnCount == 0)
 						ColumnCount = 1;
 
-					for (int i = rows.Count; i < value; i++) {
-						DataGridViewRow row = (DataGridViewRow) RowTemplateFull;
-						rows.AddInternal (row, false);
-						
-						foreach (DataGridViewColumn col in columns)
-							row.Cells.Add (col.CellTemplate.Clone () as DataGridViewCell);
-					}
+					List<DataGridViewRow> newRows = new List<DataGridViewRow> (value - rows.Count);
+					for (int i = rows.Count; i < value; i++)
+						newRows.Add ((DataGridViewRow) RowTemplateFull);
+					rows.AddRange (newRows.ToArray());
 				}
 			}
 		}
@@ -1127,7 +1141,6 @@ namespace System.Windows.Forms {
 			}
 			set {
 				rowTemplate = value;
-				rowTemplate.SetDataGridView(this);
 			}
 		}
 
@@ -1295,8 +1308,16 @@ namespace System.Windows.Forms {
 				return topLeftHeaderCell;
 			}
 			set {
+				if (topLeftHeaderCell == value)
+					return;
+
+				if (topLeftHeaderCell != null)
+					topLeftHeaderCell.SetDataGridView (null);
+
 				topLeftHeaderCell = value;
-				topLeftHeaderCell.SetDataGridView (this);
+
+				if (topLeftHeaderCell != null)
+					topLeftHeaderCell.SetDataGridView (this);
 			}
 		}
 
@@ -2359,8 +2380,22 @@ namespace System.Windows.Forms {
 				return true;
 
 			try {
-				currentCell.Value = currentCell.ParseFormattedValue (currentCell.EditedFormattedValue, 
-										     currentCell.InheritedStyle, null, null);
+				// convert
+				object newValue = currentCell.ParseFormattedValue (currentCell.EditedFormattedValue, 
+										   currentCell.InheritedStyle, null, null);
+
+				DataGridViewCellValidatingEventArgs validateArgs = new DataGridViewCellValidatingEventArgs (currentCell.ColumnIndex, 
+															    currentCell.RowIndex, 
+															    newValue);
+				// validate
+				OnCellValidating (validateArgs);
+				if (validateArgs.Cancel)
+					return false;
+				OnCellValidated (new DataGridViewCellEventArgs (currentCell.ColumnIndex, currentCell.RowIndex));
+
+				// commit
+				currentCell.Value = newValue;
+
 			} catch (Exception e) {
 				DataGridViewDataErrorEventArgs args = new DataGridViewDataErrorEventArgs (e, currentCell.ColumnIndex, currentCell.RowIndex, 
 													  DataGridViewDataErrorContexts.Commit);
@@ -2372,17 +2407,32 @@ namespace System.Windows.Forms {
 			return true;
 		}
 
-		[MonoTODO ("Always includes partial columns")]
 		public int DisplayedColumnCount (bool includePartialColumns)
 		{
 			int result = 0;
-			
-			for (int i = first_col_index; i < Columns.Count; i++)
-				if (Columns.ColumnDisplayIndexSortedArrayList[i].Displayed)
+			int columnLeft = 0;
+
+			if (RowHeadersVisible)
+				columnLeft += RowHeadersWidth;
+
+			Size visibleClientArea = ClientSize;
+			if (verticalScrollBar.Visible)
+				visibleClientArea.Width -= verticalScrollBar.Width;
+			if (horizontalScrollBar.Visible)
+				visibleClientArea.Height -= horizontalScrollBar.Height;
+
+			for (int index = first_col_index; index < Columns.Count; index++) {
+				DataGridViewColumn column = Columns[ColumnDisplayIndexToIndex (index)];
+				if (columnLeft + column.Width <= visibleClientArea.Width) {
 					result++;
-				else
+					columnLeft += column.Width;
+				} else {
+					if (includePartialColumns)
+						result++;
 					break;
-
+				}
+			}
+					
 			return result;
 		}
 
@@ -2394,9 +2444,15 @@ namespace System.Windows.Forms {
 			if (ColumnHeadersVisible)
 				rowTop += ColumnHeadersHeight;
 
+			Size visibleClientArea = ClientSize;
+			if (verticalScrollBar.Visible)
+				visibleClientArea.Width -= verticalScrollBar.Width;
+			if (horizontalScrollBar.Visible)
+				visibleClientArea.Height -= horizontalScrollBar.Height;
+
 			for (int index = first_row_index; index < Rows.Count; index++) {
 				DataGridViewRow row = GetRowInternal (index);
-				if (rowTop + row.Height <= ClientSize.Height) {
+				if (rowTop + row.Height <= visibleClientArea.Height) {
 					result++;
 					rowTop += row.Height;
 				} else {
@@ -2494,7 +2550,10 @@ namespace System.Windows.Forms {
 			}
 			
 			for (int i = first_row_index; i < Rows.Count; i++) {
-				if (i == rowIndex) {
+				if (!rows[i].Visible)
+					continue;
+					
+				if (rows[i].Index == rowIndex) {
 					h = rows [i].Height;
 					break;
 				}
@@ -2754,13 +2813,17 @@ namespace System.Windows.Forms {
 			if (ColumnHeadersVisible)
 				y += ColumnHeadersHeight;
 
+
 			for (int i = first_row_index; i < Rows.Count; i++) {
-				if (i == rowIndex) {
-					h = rows[i].Height;
+				if (!rows[i].Visible)
+					continue;
+					
+				if (rows[i].Index == rowIndex) {
+					h = rows [i].Height;
 					break;
 				}
-
-				y += rows[i].Height;
+				
+				y += rows [i].Height;
 			}
 
 			return new Rectangle (0, y, Width, h);
@@ -2796,6 +2859,8 @@ namespace System.Windows.Forms {
 			
 			for (int i = first_row_index; i < Rows.Count; i++) {
 				DataGridViewRow row = Rows[i];
+				if (!row.Visible)
+					continue;
 				
 				if (y > top && y <= (top + row.Height)) {
 					rowindex = i;
@@ -2833,7 +2898,6 @@ namespace System.Windows.Forms {
 			return new HitTestInfo (-1, x, -1, y, DataGridViewHitTestType.None);
 		}
 
-		[MonoTODO ("Invalidates whole grid")]
 		public void InvalidateCell (DataGridViewCell dataGridViewCell)
 		{
 			if (dataGridViewCell == null)
@@ -2845,7 +2909,6 @@ namespace System.Windows.Forms {
 			InvalidateCell (dataGridViewCell.ColumnIndex, dataGridViewCell.RowIndex);
 		}
 
-		[MonoTODO ("Invalidates whole grid")]
 		public void InvalidateCell (int columnIndex, int rowIndex)
 		{
 			if (columnIndex < 0 || columnIndex >= columns.Count)
@@ -2854,25 +2917,26 @@ namespace System.Windows.Forms {
 			if (rowIndex < 0 || rowIndex >= rows.Count)
 				throw new ArgumentOutOfRangeException ("Row index is out of range.");
 
-			Invalidate (GetCellDisplayRectangle (columnIndex, rowIndex, true));
+			if (!is_binding)
+				Invalidate (GetCellDisplayRectangle (columnIndex, rowIndex, true));
 		}
 
-		[MonoTODO ("Invalidates whole grid")]
 		public void InvalidateColumn (int columnIndex)
 		{
 			if (columnIndex < 0 || columnIndex >= columns.Count)
 				throw new ArgumentOutOfRangeException ("Column index is out of range.");
 
-			Invalidate (GetColumnDisplayRectangle (columnIndex, true));
+			if (!is_binding)
+				Invalidate (GetColumnDisplayRectangle (columnIndex, true));
 		}
 
-		[MonoTODO ("Invalidates whole grid")]
 		public void InvalidateRow (int rowIndex)
 		{
 			if (rowIndex < 0 || rowIndex >= rows.Count)
 				throw new ArgumentOutOfRangeException ("Row index is out of range.");
 
-			Invalidate (GetRowDisplayRectangle (rowIndex, true));
+			if (!is_binding)
+				Invalidate (GetRowDisplayRectangle (rowIndex, true));
 		}
 
 		public virtual void NotifyCurrentCellDirty (bool dirty) {
@@ -3033,8 +3097,53 @@ namespace System.Windows.Forms {
 				InvalidateRow (i);
 		}
 
-		public void UpdateRowHeightInfo (int rowIndex, bool updateToEnd) {
-			throw new NotImplementedException();
+		public void UpdateRowHeightInfo (int rowIndex, bool updateToEnd)
+		{
+			if (rowIndex < 0 && updateToEnd)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+			if (rowIndex < -1 && !updateToEnd)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+			if (rowIndex >= Rows.Count)
+				throw new ArgumentOutOfRangeException ("rowIndex");
+			
+			if (!VirtualMode && DataManager == null)
+				return;
+
+			if (rowIndex == -1) {
+				updateToEnd = true;
+				rowIndex = 0;
+			}
+
+			if (updateToEnd) {
+				for (int i = rowIndex; i < Rows.Count; i++) {
+					DataGridViewRow row = Rows[i];
+					if (!row.Visible)
+						continue;
+
+					DataGridViewRowHeightInfoNeededEventArgs rowInfo = 
+						new DataGridViewRowHeightInfoNeededEventArgs (row.Index, row.Height, row.MinimumHeight);
+					OnRowHeightInfoNeeded (rowInfo);
+
+					if (row.Height != rowInfo.Height || row.MinimumHeight != rowInfo.MinimumHeight) {
+						row.Height = rowInfo.Height;
+						row.MinimumHeight = rowInfo.MinimumHeight;
+						OnRowHeightInfoPushed (new DataGridViewRowHeightInfoPushedEventArgs (row.Index, rowInfo.Height, 
+														     rowInfo.MinimumHeight));
+					}
+				}
+			} else {
+				DataGridViewRow row = Rows[rowIndex];
+				DataGridViewRowHeightInfoNeededEventArgs rowInfo = 
+					new DataGridViewRowHeightInfoNeededEventArgs (row.Index, row.Height, row.MinimumHeight);
+				OnRowHeightInfoNeeded (rowInfo);
+
+				if (row.Height != rowInfo.Height || row.MinimumHeight != rowInfo.MinimumHeight) {
+					row.Height = rowInfo.Height;
+					row.MinimumHeight = rowInfo.MinimumHeight;
+					OnRowHeightInfoPushed (new DataGridViewRowHeightInfoPushedEventArgs (row.Index, rowInfo.Height, 
+													     rowInfo.MinimumHeight));
+				}
+			}
 		}
 
 		protected override bool CanEnableIme {
@@ -3149,6 +3258,8 @@ namespace System.Windows.Forms {
 			}
 			
 			foreach (DataGridViewRow row in Rows) {
+				if (!row.Visible)
+					continue;
 				if (!displayed_only || row.Displayed) {
 					int new_height = row.GetPreferredHeight (row.Index, mode, fixedWidth);
 
@@ -3456,6 +3567,9 @@ namespace System.Windows.Forms {
 
 		protected virtual void OnCellEnter (DataGridViewCellEventArgs e)
 		{
+			DataGridViewCell cell = GetCellInternal (e.ColumnIndex, e.RowIndex);
+			cell.OnEnterInternal (e.RowIndex, true);
+
 			DataGridViewCellEventHandler eh = (DataGridViewCellEventHandler)(Events [CellEnterEvent]);
 			if (eh != null)
 				eh (this, e);
@@ -3489,6 +3603,9 @@ namespace System.Windows.Forms {
 
 		protected virtual void OnCellLeave (DataGridViewCellEventArgs e)
 		{
+			DataGridViewCell cell = GetCellInternal (e.ColumnIndex, e.RowIndex);
+			cell.OnLeaveInternal (e.RowIndex, true);
+
 			DataGridViewCellEventHandler eh = (DataGridViewCellEventHandler)(Events [CellLeaveEvent]);
 			if (eh != null)
 				eh (this, e);
@@ -3675,11 +3792,25 @@ namespace System.Windows.Forms {
 					row.Cells.Add ((DataGridViewCell)e.Column.CellTemplate.Clone ());
 			}
 			
+			e.Column.DataColumnIndex = FindDataColumnIndex (e.Column);
 			AutoResizeColumnsInternal ();
 			OnColumnAdded (e);
 			PrepareEditingRow (false, true);
 		}
 
+		private int FindDataColumnIndex (DataGridViewColumn column)
+		{
+			if (column != null && DataManager != null) {
+				PropertyDescriptorCollection properties = DataManager.GetItemProperties();
+				for (int i = 0; i < properties.Count; i++) {
+					if (String.Compare (column.DataPropertyName, properties[i].Name, true) == 0)
+						return i;
+				}
+			}
+
+			return -1;
+		}
+
 		protected virtual void OnColumnAdded (DataGridViewColumnEventArgs e)
 		{
 			DataGridViewColumnEventHandler eh = (DataGridViewColumnEventHandler)(Events [ColumnAddedEvent]);
@@ -3807,7 +3938,22 @@ namespace System.Windows.Forms {
 				eh (this, e);
 		}
 
-		internal void OnColumnRemovedInternal (DataGridViewColumnEventArgs e)
+		internal void OnColumnPreRemovedInternal (DataGridViewColumnEventArgs e)
+		{
+			if (Columns.Count - 1 == 0) {
+				MoveCurrentCell (-1, -1, true, false, false, true);
+				rows.ClearInternal ();
+			} else if (currentCell != null && CurrentCell.ColumnIndex == e.Column.Index) {
+				int nextColumnIndex = e.Column.Index;
+				if (nextColumnIndex >= Columns.Count - 1)
+					nextColumnIndex = Columns.Count - 1 - 1;
+				MoveCurrentCell (nextColumnIndex, currentCell.RowIndex, true, false, false, true);
+				if (hover_cell != null && hover_cell.ColumnIndex >= e.Column.Index)
+					hover_cell = null;
+			}
+		}
+
+		private void OnColumnPostRemovedInternal (DataGridViewColumnEventArgs e)
 		{
 			if (e.Column.CellTemplate != null) {
 				int index = e.Column.Index;
@@ -3817,8 +3963,9 @@ namespace System.Windows.Forms {
 			}
 
 			AutoResizeColumnsInternal ();
-			OnColumnRemoved (e);
 			PrepareEditingRow (false, true);
+
+			OnColumnRemoved (e);
 		}
 
 		protected virtual void OnColumnRemoved (DataGridViewColumnEventArgs e)
@@ -3917,6 +4064,11 @@ namespace System.Windows.Forms {
 
 		protected override void OnDoubleClick (EventArgs e) {
 			base.OnDoubleClick(e);
+
+			Point mouseLocation = this.PointToClient (Control.MousePosition);
+			HitTestInfo hitInfo = HitTest (mouseLocation.X, mouseLocation.Y);
+			if (hitInfo.Type == DataGridViewHitTestType.Cell)
+				OnCellDoubleClick (new DataGridViewCellEventArgs (hitInfo.ColumnIndex, hitInfo.RowIndex));
 		}
 
 		protected virtual void OnEditingControlShowing (DataGridViewEditingControlShowingEventArgs e) {
@@ -3973,7 +4125,7 @@ namespace System.Windows.Forms {
 			base.OnHandleCreated(e);
 			ReBind ();
 			
-			if (CurrentCell == null && Rows.Count > 0 && Columns.Count > 0)
+			if (DataManager == null && CurrentCell == null && Rows.Count > 0 && Columns.Count > 0)
 				MoveCurrentCell (ColumnDisplayIndexToIndex (0), 0, true, false, false, false);
 		}
 
@@ -4067,6 +4219,11 @@ namespace System.Windows.Forms {
 		protected override void OnMouseDoubleClick (MouseEventArgs e)
 		{
 			base.OnMouseDoubleClick(e);
+
+			HitTestInfo hitInfo = HitTest (e.X, e.Y);
+			if (hitInfo.Type == DataGridViewHitTestType.Cell)
+				OnCellMouseDoubleClick (new DataGridViewCellMouseEventArgs (hitInfo.ColumnIndex, hitInfo.RowIndex,
+											    hitInfo.ColumnX, hitInfo.RowY, e));
 		}
 
 		private void DoSelectionOnMouseDown (HitTestInfo hitTest)
@@ -4221,7 +4378,9 @@ namespace System.Windows.Forms {
 			DataGridViewRow row = null;
 			Rectangle cellBounds;
 
-			if (hitTest.Type == DataGridViewHitTestType.ColumnHeader && MouseOverColumnResize (hitTest.ColumnIndex, e.X)) {
+			if ((hitTest.Type == DataGridViewHitTestType.ColumnHeader ||
+			     (hitTest.Type == DataGridViewHitTestType.Cell && !ColumnHeadersVisible)) 
+			    && MouseOverColumnResize (hitTest.ColumnIndex, e.X)) {
 				if (e.Clicks == 2) {
 					AutoResizeColumn (hitTest.ColumnIndex);
 					return;
@@ -4325,7 +4484,12 @@ namespace System.Windows.Forms {
 			Cursor new_cursor = Cursors.Default;
 			HitTestInfo hit = this.HitTest (e.X, e.Y);
 			
-			if (hit.Type == DataGridViewHitTestType.Cell) {
+			if (hit.Type == DataGridViewHitTestType.ColumnHeader || 
+			    (!ColumnHeadersVisible && hit.Type == DataGridViewHitTestType.Cell && MouseOverColumnResize (hit.ColumnIndex, e.X))) {
+				EnteredHeaderCell = Columns [hit.ColumnIndex].HeaderCell;
+				if (MouseOverColumnResize (hit.ColumnIndex, e.X))
+					new_cursor = Cursors.VSplit;
+			} else if (hit.Type == DataGridViewHitTestType.Cell) {
 				EnteredHeaderCell = null;
 
 				DataGridViewCell new_cell = GetCellInternal (hit.ColumnIndex, hit.RowIndex);
@@ -4346,6 +4510,8 @@ namespace System.Windows.Forms {
 						MouseLeftErrorIcon (new_cell);
 				}
 				
+				Cursor = new_cursor;
+
 				// We have never been in a cell before
 				if (hover_cell == null) {
 					hover_cell = new_cell;
@@ -4421,13 +4587,7 @@ namespace System.Windows.Forms {
 				}
 			
 			} else {
-				if (hit.Type == DataGridViewHitTestType.ColumnHeader) {
-					EnteredHeaderCell = Columns [hit.ColumnIndex].HeaderCell;
-					
-					if (MouseOverColumnResize (hit.ColumnIndex, e.X))
-						new_cursor = Cursors.VSplit;
-				} else
-					EnteredHeaderCell = null;
+				EnteredHeaderCell = null;
 
 				// We have left the cell area
 				if (hover_cell != null) {
@@ -4483,6 +4643,14 @@ namespace System.Windows.Forms {
 		protected override void OnMouseWheel (MouseEventArgs e)
 		{
 			base.OnMouseWheel(e);
+
+			int delta = SystemInformation.MouseWheelScrollLines * verticalScrollBar.SmallChange;
+			if (e.Delta < 0)
+				verticalScrollBar.SafeValueSet (verticalScrollBar.Value + delta);
+			else
+				verticalScrollBar.SafeValueSet (verticalScrollBar.Value - delta);
+
+			OnVScrollBarScroll (this, new ScrollEventArgs (ScrollEventType.ThumbPosition, verticalScrollBar.Value));
 		}
 
 		protected virtual void OnMultiSelectChanged (EventArgs e)
@@ -4549,16 +4717,12 @@ namespace System.Windows.Forms {
 				bounds.Y += columnHeadersHeight;
 			}
 			
-			gridWidth = rowHeadersVisible ? rowHeadersWidth : 0;
-			gridHeight = 0;
-			
-			int first_row_height = Rows.Count > 0 ? Rows[Math.Min (Rows.Count - 1, first_row_index)].Height : 0;
-//			int room_left = this.Height;
-			
-			// Reset all columns to !Displayed
-			for (int i = 0; i < Columns.Count; i++)
+			// Reset not displayed columns to !Displayed
+			for (int i = 0; i < first_col_index; i++)
 				Columns[i].DisplayedInternal = false;
 			
+			int gridWidth = rowHeadersVisible ? rowHeadersWidth : 0;
+
 			// Set Displayed columns
 			for (int i = first_col_index; i < Columns.Count; i++) {
 				DataGridViewColumn col = Columns.ColumnDisplayIndexSortedArrayList[i];
@@ -4568,18 +4732,19 @@ namespace System.Windows.Forms {
 			
 				col.DisplayedInternal = true;
 				gridWidth += col.Width;
-				
 				if (gridWidth >= Width)
 					break;
 			}
 			
-			// Reset all rows to !Displayed
-			for (int i = 0; i < Rows.Count; i++)
+			// Reset all not displayed rows to !Displayed
+			for (int i = 0; i < first_row_index; i++)
 				GetRowInternal (i).DisplayedInternal = false;
 			
 			// Draw rows
 			for (int index = first_row_index; index < Rows.Count; index++) {
 				DataGridViewRow row = Rows[index];
+				if (!row.Visible)
+					continue;
 				GetRowInternal (index).DisplayedInternal = true;
 	
 				bounds.Height = row.Height;
@@ -4593,27 +4758,45 @@ namespace System.Windows.Forms {
 				
 				if (bounds.Y >= ClientSize.Height - (horizontalScrollBar.Visible ? horizontalScrollBar.Height : 0))
 					break;
-					
-				gridHeight += row.Height;
 			}
 
-			gridWidth = 0;
+			RefreshScrollBars ();
+			
+			// Paint the bottom right square if both scrollbars are displayed
+			if (horizontalScrollBar.Visible && verticalScrollBar.Visible)
+				g.FillRectangle (SystemBrushes.Control, new Rectangle (horizontalScrollBar.Right, verticalScrollBar.Bottom, verticalScrollBar.Width, horizontalScrollBar.Height));
+
+			// Paint the border
+			bounds = ClientRectangle;
 			
-			foreach (DataGridViewColumn col in sortedColumns)
+			switch (BorderStyle) {
+				case BorderStyle.FixedSingle:
+					g.DrawRectangle (Pens.Black, new Rectangle (bounds.Left, bounds.Top, bounds.Width - 1, bounds.Height - 1));
+					break;
+				case BorderStyle.Fixed3D:
+					ControlPaint.DrawBorder3D (g, bounds, Border3DStyle.Sunken);
+					break;
+			}
+		}
+
+		private void RefreshScrollBars ()
+		{
+			int gridWidth = 0;
+			int gridHeight = 0;
+
+			foreach (DataGridViewColumn col in columns.ColumnDisplayIndexSortedArrayList)
 				if (col.Visible)
 					gridWidth += col.Width;
-
-			gridHeight = 0;
 			
 			foreach (DataGridViewRow row in Rows)
-				gridHeight += row.Height;
+				if (row.Visible)
+					gridHeight += row.Height;
 
 			if (rowHeadersVisible)
 				gridWidth += rowHeadersWidth;
-
 			if (columnHeadersVisible)
 				gridHeight += columnHeadersHeight;
-			
+
 			bool horizontalVisible = false;
 			bool verticalVisible = false;
 			
@@ -4637,20 +4820,26 @@ namespace System.Windows.Forms {
 				if (scrollBars != ScrollBars.Horizontal && scrollBars != ScrollBars.Both)
 					horizontalVisible = false;
 
+				// MSNET compatibility here
+				if (RowCount <= 1)
+					verticalVisible = false;
+
 				if (horizontalVisible) {
 					horizontalScrollBar.Minimum = 0;
 					horizontalScrollBar.Maximum = gridWidth;
 					horizontalScrollBar.SmallChange = Columns[first_col_index].Width;
-					int largeChange = ClientSize.Width - rowHeadersWidth;
+					int largeChange = ClientSize.Width - rowHeadersWidth - horizontalScrollBar.Height;
 					if (largeChange <= 0)
 						largeChange = ClientSize.Width;
 					horizontalScrollBar.LargeChange = largeChange;
 				}
+
 				if (verticalVisible) {
 					verticalScrollBar.Minimum = 0;
 					verticalScrollBar.Maximum = gridHeight;
+					int first_row_height = Rows.Count > 0 ? Rows[Math.Min (Rows.Count - 1, first_row_index)].Height : 0;
 					verticalScrollBar.SmallChange = first_row_height + 1;
-					int largeChange = ClientSize.Height - columnHeadersHeight;
+					int largeChange = ClientSize.Height - columnHeadersHeight - verticalScrollBar.Width;
 					if (largeChange <= 0)
 						largeChange = ClientSize.Height;
 					verticalScrollBar.LargeChange = largeChange;
@@ -4659,22 +4848,6 @@ namespace System.Windows.Forms {
 
 			horizontalScrollBar.Visible = horizontalVisible;
 			verticalScrollBar.Visible = verticalVisible;
-			
-			// Paint the bottom right square if both scrollbars are displayed
-			if (horizontalScrollBar.Visible && verticalScrollBar.Visible)
-				g.FillRectangle (SystemBrushes.Control, new Rectangle (horizontalScrollBar.Right, verticalScrollBar.Bottom, verticalScrollBar.Width, horizontalScrollBar.Height));
-
-			// Paint the border
-			bounds = ClientRectangle;
-			
-			switch (BorderStyle) {
-				case BorderStyle.FixedSingle:
-					g.DrawRectangle (Pens.Black, new Rectangle (bounds.Left, bounds.Top, bounds.Width - 1, bounds.Height - 1));
-					break;
-				case BorderStyle.Fixed3D:
-					ControlPaint.DrawBorder3D (g, bounds, Border3DStyle.Sunken);
-					break;
-			}
 		}
 
 		protected virtual void OnReadOnlyChanged (EventArgs e) {
@@ -4794,6 +4967,7 @@ namespace System.Windows.Forms {
 
 		protected internal virtual void OnRowHeightChanged (DataGridViewRowEventArgs e)
 		{
+			UpdateRowHeightInfo (e.Row.Index, false);
 			DataGridViewRowEventHandler eh = (DataGridViewRowEventHandler)(Events [RowHeightChangedEvent]);
 			if (eh != null) eh (this, e);
 		}
@@ -4839,6 +5013,11 @@ namespace System.Windows.Forms {
 			if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
 				hover_cell = null;
 
+			// Select the first row if we are not databound. 
+			// If we are databound selection is managed by the data manager.
+			if (IsHandleCreated && DataManager == null && CurrentCell == null && Rows.Count > 0 && Columns.Count > 0)
+				MoveCurrentCell (ColumnDisplayIndexToIndex (0), 0, true, false, false, true);
+
 			AutoResizeColumnsInternal ();
 			Invalidate ();
 			OnRowsAdded (e);
@@ -4856,29 +5035,32 @@ namespace System.Windows.Forms {
 			if (eh != null) eh (this, e);
 		}
 
-		internal void OnRowsRemovedInternal (DataGridViewRowsRemovedEventArgs e)
+		internal void OnRowsPreRemovedInternal (DataGridViewRowsRemovedEventArgs e)
 		{
 			if (selected_rows != null)
 				selected_rows.InternalClear ();
 			if (selected_columns != null)
 				selected_columns.InternalClear ();
 
-			if (Rows.Count == 0) {
+			if (Rows.Count - e.RowCount <= 0) {
 				MoveCurrentCell (-1, -1, true, false, false, true);
 				hover_cell = null;
 			} else if (Columns.Count == 0) {
 				MoveCurrentCell (-1, -1, true, false, false, true);
 				hover_cell = null;
-			} else {
+			} else if (currentCell != null && currentCell.RowIndex == e.RowIndex) {
 				int nextRowIndex = e.RowIndex;
-				if (nextRowIndex >= Rows.Count)
-					nextRowIndex = Rows.Count - 1;
+				if (nextRowIndex >= Rows.Count - e.RowCount)
+					nextRowIndex = Rows.Count - 1 - e.RowCount;
 				MoveCurrentCell (currentCell != null ? currentCell.ColumnIndex : 0, nextRowIndex, 
 						 true, false, false, true);
 				if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex)
 					hover_cell = null;
 			}
+		}
 
+		internal void OnRowsPostRemovedInternal (DataGridViewRowsRemovedEventArgs e)
+		{
 			Invalidate ();
 			OnRowsRemoved (e);
 		}
@@ -5179,7 +5361,7 @@ namespace System.Windows.Forms {
 			return false;
 		}
 
-		[MonoTODO ("What does insert do?")]
+		[MonoInternalNote ("What does insert do?")]
 		protected bool ProcessInsertKey (Keys keyData)
 		{
 			return false;
@@ -5437,6 +5619,10 @@ namespace System.Windows.Forms {
 							return false;
 						else if (currentCell.RowIndex == NewRowIndex && new_row_editing)
 							CancelEdit ();
+					} else {
+						// CancelEdit will replace the uncommited real editing row with a place holder row
+						if (new_row_editing && currentCell.RowIndex == NewRowIndex)
+							CancelEdit ();
 					}
 					OnCellLeave (new DataGridViewCellEventArgs(currentCell.ColumnIndex, currentCell.RowIndex));
 					OnRowLeave (new DataGridViewCellEventArgs (currentCell.ColumnIndex, currentCell.RowIndex));
@@ -5455,7 +5641,7 @@ namespace System.Windows.Forms {
 				OnCurrentCellChanged (EventArgs.Empty);
 
 				if (cell != null) {
-					// If the user begins an edit in the NewRow, add a new row
+					// If the user begins an edit in the NewRow, add a new real row
 					if (AllowUserToAddRows && cell.RowIndex == NewRowIndex && !is_binding && !new_row_editing) {
 						// OnUserAddedRow will add a real row and reset the current cell
 						OnUserAddedRow (new DataGridViewRowEventArgs (Rows[NewRowIndex]));
@@ -5562,13 +5748,18 @@ namespace System.Windows.Forms {
 
 		internal void OnHScrollBarScroll (object sender, ScrollEventArgs e)
 		{
+			int lastRightVisibleColumntIndex = Columns.Count - DisplayedColumnCount (false);
 			horizontalScrollingOffset = e.NewValue;
 			int left = 0;
 
 			for (int index = 0; index < Columns.Count; index++) {
 				DataGridViewColumn col = Columns[index];
 
-				if (e.NewValue < left + col.Width) {
+				if (col.Index >= lastRightVisibleColumntIndex) {
+					first_col_index = lastRightVisibleColumntIndex;
+					Invalidate ();
+					OnScroll (e);
+				} else if (e.NewValue < left + col.Width) {
 					if (first_col_index != index) {
 						first_col_index = index;
 						Invalidate ();
@@ -5589,10 +5780,18 @@ namespace System.Windows.Forms {
 				return;
 
 			int top = 0;
-			
+			int lastTopVisibleRowIndex = Rows.Count - DisplayedRowCount (false);
+
 			for (int index = 0; index < Rows.Count; index++) {
 				DataGridViewRow row = Rows[index];
-				if (e.NewValue < top + row.Height) {
+				if (!row.Visible)
+					continue;
+
+				if (row.Index >= lastTopVisibleRowIndex) {
+					first_row_index = lastTopVisibleRowIndex;
+					Invalidate ();
+					OnScroll (e);
+				} else if (e.NewValue < top + row.Height) {
 					if (first_row_index != index) {
 						first_row_index = index;
 						Invalidate ();
@@ -5605,7 +5804,7 @@ namespace System.Windows.Forms {
 				top += row.Height;
 			}
 			
-			first_row_index = Rows.Count - DisplayedRowCount (false);
+			first_row_index = lastTopVisibleRowIndex;
 			Invalidate ();
 			OnScroll (e);
 		}
@@ -5620,9 +5819,11 @@ namespace System.Windows.Forms {
 					OnColumnAddedInternal(new DataGridViewColumnEventArgs(e.Element as DataGridViewColumn));
 					break;
 				case CollectionChangeAction.Remove:
-					OnColumnRemovedInternal(new DataGridViewColumnEventArgs(e.Element as DataGridViewColumn));
+					OnColumnPostRemovedInternal(new DataGridViewColumnEventArgs(e.Element as DataGridViewColumn));
 					break;
 				case CollectionChangeAction.Refresh:
+					hover_cell = null;
+					MoveCurrentCell (-1, -1, true, false, false, true);
 					break;
 			}
 		}
@@ -5655,6 +5856,9 @@ namespace System.Windows.Forms {
 			for (int i = 0; i < Columns.Count; i++) {
 				DataGridViewColumn col = Columns [i];
 
+				if (!col.Visible)
+					continue;
+
 				switch (col.InheritedAutoSizeMode) {
 				case DataGridViewAutoSizeColumnMode.Fill:
 					FillCount++;
@@ -5681,6 +5885,9 @@ namespace System.Windows.Forms {
 					
 					if (col.InheritedAutoSizeMode != DataGridViewAutoSizeColumnMode.Fill)
 						continue;
+				
+					if (!col.Visible)
+						continue;
 						
 					if (fixed_widths [i] != 0)
 						continue;
@@ -5705,7 +5912,10 @@ namespace System.Windows.Forms {
 			for (int i = 0; i < columns.Count; i++) {
 				if (Columns [i].InheritedAutoSizeMode != DataGridViewAutoSizeColumnMode.Fill)
 					continue;
-					
+
+				if (!Columns[i].Visible)
+					continue;
+
 				Columns [i].Width = new_widths [i];
 			}
 		}
@@ -5746,24 +5956,20 @@ namespace System.Windows.Forms {
 		internal int CalculateColumnCellWidth (int index, DataGridViewAutoSizeColumnMode mode)
 		{
 			int first_row = 0;
+			int last_row = Rows.Count;
 			int result = 0;
-			bool only_visible = false;
-			
-			if (mode == DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader || 
-				mode == DataGridViewAutoSizeColumnMode.AllCellsExceptHeader)
-				first_row++;
-			
-			only_visible = (mode == DataGridViewAutoSizeColumnMode.DisplayedCells || mode == DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader);
+
+			if (mode == DataGridViewAutoSizeColumnMode.DisplayedCells || 
+			    mode == DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader) {
+				first_row = first_row_index;
+				last_row = DisplayedRowCount (true);;
+			}
 			
-			for (int i = first_row; i < Rows.Count; i++) {
-				if (only_visible) {
-					Rectangle row_rect = this.GetRowDisplayRectangle (i, false);
-					if (!ClientRectangle.IntersectsWith (row_rect))
-						continue;
-				}
+			for (int i = first_row; i < last_row; i++) {
+				if (!Rows[i].Visible)
+					continue;
 				
 				int cell_width = Rows[i].Cells[index].PreferredSize.Width;
-
 				result = Math.Max (result, cell_width);
 			}
 			
@@ -5841,30 +6047,13 @@ namespace System.Windows.Forms {
 				return;
 				
 			DataGridViewRow row = (DataGridViewRow)RowTemplateFull;
-			rows.InternalAdd (row);
-
-			PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (element);
-			
-			foreach (PropertyDescriptor property in properties) {
-				if (property.PropertyType == typeof (IBindingList))
-					continue;
-				
-				// We do it this way because there may not be a column
-				// for every cell, ignore cells with no column	
-				DataGridViewCell cell = row.Cells.GetBoundCell (property.Name);
-				
-				if (cell == null)
-					continue;
-					
-				cell.Value = property.GetValue (element);
-				cell.ValueType = property.PropertyType;
-			}
+			rows.AddInternal (row, false);
 		}
 		
 		private bool IsColumnAlreadyBound (string name)
 		{
 			foreach (DataGridViewColumn col in Columns)
-				if (col.DataPropertyName == name)
+				if (String.Compare (col.DataPropertyName, name, true) == 0)
 					return true;
 
 			return false;
@@ -5924,13 +6113,15 @@ namespace System.Windows.Forms {
 						// This keeps out things like arrays
 						if ((typeof(ICollection).IsAssignableFrom (property.PropertyType)))
 							continue;
+						if (!property.IsBrowsable)
+							continue;
 
-						if (IsColumnAlreadyBound (property.DisplayName))
+						if (IsColumnAlreadyBound (property.Name))
 							continue;
 
 						DataGridViewColumn col = CreateColumnByType (property.PropertyType);
 						col.Name = property.DisplayName;
-						col.DataPropertyName = property.DisplayName;
+						col.DataPropertyName = property.Name;
 						col.ReadOnly = !DataManager.AllowEdit || property.IsReadOnly;
 						col.SetIsDataBound (true);
 						col.ValueType = property.PropertyType;
@@ -5942,11 +6133,10 @@ namespace System.Windows.Forms {
 				}
 
 				// DataBind both autogenerated and not columns if there is a matching property
-				foreach (PropertyDescriptor property in DataManager.GetItemProperties()) {
-					foreach (DataGridViewColumn col in Columns) {
-						if (col.DataPropertyName == property.Name)
-							col.SetIsDataBound (true);
-					}
+				foreach (DataGridViewColumn column in columns) {
+					column.DataColumnIndex = FindDataColumnIndex (column);
+					if (column.DataColumnIndex != -1)
+						column.SetIsDataBound (true);
 				}
 
 				foreach (object element in DataManager.List)
@@ -5962,14 +6152,40 @@ namespace System.Windows.Forms {
 			}
 
 			PrepareEditingRow (false, true);
-			PerformLayout();
-			Invalidate ();
 		}
 		
 		private void MoveCurrentCell (int x, int y, bool select, bool isControl, bool isShift, bool scroll)
 		{
 			if (x == -1 || y == -1)
 				x = y = -1;
+			else {
+				if (x < 0 || x > Columns.Count - 1)
+					throw new ArgumentOutOfRangeException ("x");
+				if (y < 0 || y > Rows.Count - 1)
+					throw new ArgumentOutOfRangeException ("y");
+
+				if (!Rows[y].Visible) {
+					for (int i = y; i < Rows.Count; i++) {
+						if (Rows[i].Visible) {
+							y = i;
+							break;
+						}
+					}
+				}
+
+				if (!Columns[x].Visible) {
+					for (int i = x; i < Columns.Count; i++) {
+						if (Columns[i].Visible) {
+							x = i;
+							break;
+						}
+					}
+				}
+
+				// in case either no visible columns or rows
+				if (!Rows[y].Visible || !Columns[x].Visible)
+					x = y = -1;
+			}
 
 			if (!SetCurrentCellAddressCore (x, y, true, false, false)) {
 				ClearSelection ();
@@ -6001,18 +6217,40 @@ namespace System.Windows.Forms {
 			// If the current cell isn't visible, scroll to it
 			if (scroll) {
 				int disp_x = ColumnIndexToDisplayIndex (x);
+				bool scrollbarsRefreshed = false;
+				int displayedColumnsCount = DisplayedColumnCount (false);
+				int delta_x = 0;
 
+				// The trick here is that in order to avoid unnecessary calculations each time a row/column 
+				// is added/removed we recalculate the whole grid size just before the scroll to selection.
 				if (disp_x < first_col_index) {
-					int delta_x = 0;
+					RefreshScrollBars ();
+					scrollbarsRefreshed = true;
 
 					if (disp_x == 0)
 						delta_x = horizontalScrollBar.Value;
-					else
+					else {
+						// in case the column got removed
+						if (first_col_index >= ColumnCount)
+							first_col_index = ColumnCount - 1;
 						for (int i = disp_x; i < first_col_index; i++)
 							delta_x += Columns[ColumnDisplayIndexToIndex (i)].Width;
+					}
 				
 					horizontalScrollBar.SafeValueSet (horizontalScrollBar.Value - delta_x);
 					OnHScrollBarScroll (this, new ScrollEventArgs (ScrollEventType.ThumbPosition, horizontalScrollBar.Value));
+				} else if (disp_x > first_col_index + displayedColumnsCount - 1) {
+					RefreshScrollBars ();
+					scrollbarsRefreshed = true;
+					
+					if (disp_x == Columns.Count - 1)
+						delta_x = horizontalScrollBar.Maximum - horizontalScrollBar.Value;
+					else
+						for (int i = first_col_index + displayedColumnsCount - 1; i < disp_x; i++)
+							delta_x += Columns[ColumnDisplayIndexToIndex (i)].Width;
+
+					horizontalScrollBar.SafeValueSet (horizontalScrollBar.Value + delta_x);
+					OnHScrollBarScroll (this, new ScrollEventArgs (ScrollEventType.ThumbPosition, horizontalScrollBar.Value));
 				}
 
 				int disp_y = y;
@@ -6020,15 +6258,25 @@ namespace System.Windows.Forms {
 				int delta_y = 0;
 
 				if (disp_y < first_row_index) {
+					if (!scrollbarsRefreshed)
+						RefreshScrollBars ();
+
 					if (disp_y == 0)
 						delta_y = verticalScrollBar.Value;
-					else
+					else {
+						// in case the row got removed
+						if (first_row_index >= RowCount)
+							first_row_index = RowCount - 1;
 						for (int i = disp_y; i < first_row_index; i++)
 							delta_y += GetRowInternal (i).Height;
+					}
 
 					verticalScrollBar.SafeValueSet (verticalScrollBar.Value - delta_y);
 					OnVScrollBarScroll (this, new ScrollEventArgs (ScrollEventType.ThumbPosition, verticalScrollBar.Value));
 				} else if (disp_y > first_row_index + displayedRowsCount - 1) {
+					if (!scrollbarsRefreshed)
+						RefreshScrollBars ();
+
 					if (disp_y == Rows.Count - 1)
 						delta_y = verticalScrollBar.Maximum - verticalScrollBar.Value;
 					else
@@ -6105,10 +6353,15 @@ namespace System.Windows.Forms {
 		private void ReBind ()
 		{
 			if (!is_binding) {
+				SuspendLayout ();
+
 				is_binding = true;
 				ClearBinding ();
 				DoBinding ();
 				is_binding = false;
+
+				ResumeLayout (true);
+				Invalidate ();
 			}
 		}
 		
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewBand.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewBand.cs
index 4152379..112aa1e 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewBand.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewBand.cs
@@ -79,7 +79,7 @@ namespace System.Windows.Forms {
 		public Type DefaultHeaderCellType {
 			get { return defaultHeaderCellType; }
 			set {
-				if (value.IsSubclassOf(typeof(DataGridViewHeaderCell))) {
+				if (!value.IsSubclassOf(typeof(DataGridViewHeaderCell))) {
 					throw new ArgumentException("Type is not DataGridViewHeaderCell or a derived type.");
 				}
 				defaultHeaderCellType = value;
@@ -95,7 +95,15 @@ namespace System.Windows.Forms {
 		[DefaultValue (false)]
 		public virtual bool Frozen {
 			get { return frozen; }
-			set { frozen = value; }
+			set {
+				if (frozen != value) {
+					frozen = value;
+					if (frozen)
+						SetState (State | DataGridViewElementStates.Frozen);
+					else
+						SetState (State & ~DataGridViewElementStates.Frozen);
+				}
+			}
 		}
 
 		[Browsable (false)]
@@ -116,7 +124,15 @@ namespace System.Windows.Forms {
 		[DefaultValue (false)]
 		public virtual bool ReadOnly {
 			get { return readOnly; }
-			set { readOnly = value; }
+			set {
+				if (readOnly != value) {
+					readOnly = value;
+					if (readOnly)
+						SetState (State | DataGridViewElementStates.ReadOnly);
+					else
+						SetState (State & ~DataGridViewElementStates.ReadOnly);
+				}
+			}
 		}
 
 		[Browsable (true)]
@@ -126,7 +142,15 @@ namespace System.Windows.Forms {
 					return DataGridView.AllowUserToResizeColumns ? DataGridViewTriState.True : DataGridViewTriState.False;
 				}
 				return resizable; }
-			set { resizable = value; }
+			set {
+				if (value != resizable) {
+					resizable = value;
+					if (resizable == DataGridViewTriState.True)
+						SetState (State | DataGridViewElementStates.Resizable);
+					else
+						SetState (State & ~DataGridViewElementStates.Resizable);
+				}
+			}
 		}
 
 		[Browsable (false)]
@@ -150,13 +174,28 @@ namespace System.Windows.Forms {
 				return selected;
 			}
 			set {
-				selected = value;
+				if (selected != value) {
+					selected = value;
+
+					if (selected)
+						SetState (State | DataGridViewElementStates.Selected);
+					else
+						SetState (State & ~DataGridViewElementStates.Selected);
+				}
 			}
 		}
 
 		internal bool DisplayedInternal {
 			get { return displayed; }
-			set { displayed = value; }
+			set {
+				if (value != displayed) {
+					displayed = value;
+					if (displayed)
+						SetState (State | DataGridViewElementStates.Displayed);
+					else
+						SetState (State & ~DataGridViewElementStates.Displayed);
+				}
+			}
 		}
 		
 		[Browsable (false)]
@@ -169,7 +208,15 @@ namespace System.Windows.Forms {
 		[DefaultValue (true)]
 		public virtual bool Visible {
 			get { return visible; }
-			set { visible = value; }
+			set {
+				if (visible != value) {
+					visible = value;
+					if (visible)
+						SetState (State | DataGridViewElementStates.Visible);
+					else
+						SetState (State & ~DataGridViewElementStates.Visible);
+				}
+			}
 		}
 
 		public virtual object Clone ()
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
index 4d5e25d..60ad734 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs
@@ -223,7 +223,7 @@ namespace System.Windows.Forms {
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public DataGridViewColumn OwningColumn {
 			get {
-				if (DataGridView == null || columnIndex == -1)
+				if (DataGridView == null || columnIndex < 0 || columnIndex >= DataGridView.Columns.Count)
 					return null;
 					
 				return DataGridView.Columns[columnIndex];
@@ -388,7 +388,16 @@ namespace System.Windows.Forms {
 
 		[Browsable (false)]
 		public virtual Type ValueType {
-			get { return valueType; }
+			get { 
+				if (valueType == null) {
+					if (DataProperty != null)
+						valueType = DataProperty.PropertyType;
+					else if (OwningColumn != null)
+						valueType = OwningColumn.ValueType;
+				}
+
+				return valueType;
+			}
 			set { valueType = value; }
 		}
 
@@ -716,7 +725,7 @@ namespace System.Windows.Forms {
 		}
 
 		public override string ToString () {
-			return String.Format("{0} {RowIndex = {1}, ColumnIndex = {2}}", this.GetType().FullName, RowIndex, columnIndex);
+			return String.Format("{0} {{ ColumnIndex={1}, RowIndex={2} }}", this.GetType().Name, ColumnIndex, RowIndex);
 		}
 
 		protected virtual Rectangle BorderWidths (DataGridViewAdvancedBorderStyle advancedBorderStyle)
@@ -878,6 +887,11 @@ namespace System.Windows.Forms {
 				value = e.Value;
 			}
 			
+			if (value == null || (cellStyle != null && value == cellStyle.DataSourceNullValue)) {
+				if (FormattedValueType == typeof (string))
+					return String.Empty;
+			}
+
 			if (FormattedValueType == typeof(string) && value is IFormattable && !String.IsNullOrEmpty (cellStyle.Format))
 				return ((IFormattable) value).ToString (cellStyle.Format, cellStyle.FormatProvider);
 			if (value != null && FormattedValueType.IsAssignableFrom (value.GetType()))
@@ -912,8 +926,11 @@ namespace System.Windows.Forms {
 		protected virtual object GetValue (int rowIndex) {
 			if (DataGridView != null && (RowIndex < 0 || RowIndex >= DataGridView.Rows.Count))
 				throw new ArgumentOutOfRangeException ("rowIndex", "Specified argument was out of the range of valid values.");
-				
-			if (DataProperty != null)
+		
+			if (OwningRow != null && OwningRow.Index == DataGridView.NewRowIndex)
+				return DefaultNewRowValue;
+
+			if (DataProperty != null && OwningRow.DataBoundItem != null)
 				return DataProperty.GetValue (OwningRow.DataBoundItem);
 			
 			if (valuex != null)
@@ -927,9 +944,9 @@ namespace System.Windows.Forms {
 		
 		private PropertyDescriptor DataProperty {
 			get {
-				if (OwningColumn != null && !String.IsNullOrEmpty (OwningColumn.DataPropertyName) && 
-				    OwningRow != null && OwningRow.DataBoundItem != null)
-					return TypeDescriptor.GetProperties (OwningRow.DataBoundItem)[OwningColumn.DataPropertyName];
+				if (OwningColumn != null && OwningColumn.DataColumnIndex != -1 && 
+				    DataGridView != null && DataGridView.DataManager != null)
+					return DataGridView.DataManager.GetItemProperties()[OwningColumn.DataColumnIndex];
 				return null;
 			}
 		}
@@ -1160,11 +1177,11 @@ namespace System.Windows.Forms {
 					if (DataGridView.CellBorderStyle != DataGridViewCellBorderStyle.Single)
 						graphics.DrawLine (pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
 					break;
+				case DataGridViewAdvancedCellBorderStyle.Outset:
 				case DataGridViewAdvancedCellBorderStyle.Inset:
 					graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
 					break;
 				case DataGridViewAdvancedCellBorderStyle.InsetDouble:
-				case DataGridViewAdvancedCellBorderStyle.Outset:
 				case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
 					graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X, bounds.Y + bounds.Height - 1);
 					graphics.DrawLine(pen, bounds.X + 2, bounds.Y, bounds.X + 2, bounds.Y + bounds.Height - 1);
@@ -1176,7 +1193,10 @@ namespace System.Windows.Forms {
 				case DataGridViewAdvancedCellBorderStyle.Single:
 					graphics.DrawLine(pen, bounds.X + bounds.Width - 1, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
 					break;
+				case DataGridViewAdvancedCellBorderStyle.Outset:
 				case DataGridViewAdvancedCellBorderStyle.Inset:
+				case DataGridViewAdvancedCellBorderStyle.InsetDouble:
+				case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
 					graphics.DrawLine(pen, bounds.X + bounds.Width, bounds.Y, bounds.X + bounds.Width, bounds.Y + bounds.Height - 1);
 					break;
 			}
@@ -1187,14 +1207,21 @@ namespace System.Windows.Forms {
 					if (DataGridView.CellBorderStyle != DataGridViewCellBorderStyle.Single)
 						graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y);
 					break;
+				case DataGridViewAdvancedCellBorderStyle.Outset:
 				case DataGridViewAdvancedCellBorderStyle.Inset:
+				case DataGridViewAdvancedCellBorderStyle.InsetDouble:
+				case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
 					graphics.DrawLine(pen, bounds.X, bounds.Y, bounds.X + bounds.Width - 1, bounds.Y);
 					break;
 			}
 			
 			// Paint the bottom border, if any
 			switch (advancedBorderStyle.Bottom) {
+				case DataGridViewAdvancedCellBorderStyle.Outset:
+				case DataGridViewAdvancedCellBorderStyle.Inset:
 				case DataGridViewAdvancedCellBorderStyle.Single:
+				case DataGridViewAdvancedCellBorderStyle.InsetDouble:
+				case DataGridViewAdvancedCellBorderStyle.OutsetDouble:
 					graphics.DrawLine(pen, bounds.X, bounds.Y + bounds.Height - 1, bounds.X + bounds.Width - 1, bounds.Y + bounds.Height - 1);
 					break;
 			}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellCollection.cs
index b286c19..7574f28 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellCollection.cs
@@ -114,10 +114,10 @@ namespace System.Windows.Forms
 
 		public virtual int Add (DataGridViewCell dataGridViewCell)
 		{
+			int result = base.List.Add (dataGridViewCell);
 			dataGridViewCell.SetOwningRow (dataGridViewRow);
-			dataGridViewCell.SetColumnIndex (base.List.Count);
+			dataGridViewCell.SetColumnIndex (result);
 			dataGridViewCell.SetDataGridView (dataGridViewRow.DataGridView);
-			int result = base.List.Add (dataGridViewCell);
 			OnCollectionChanged (new CollectionChangeEventArgs (
 				CollectionChangeAction.Add, dataGridViewCell));
 			return result;
@@ -167,10 +167,10 @@ namespace System.Windows.Forms
 
 		public virtual void Insert (int index, DataGridViewCell dataGridViewCell)
 		{
+			base.List.Insert (index, dataGridViewCell);
 			dataGridViewCell.SetOwningRow (dataGridViewRow);
 			dataGridViewCell.SetColumnIndex (index);
 			dataGridViewCell.SetDataGridView (dataGridViewRow.DataGridView);
-			base.List.Insert (index, dataGridViewCell);
 			OnCollectionChanged (new CollectionChangeEventArgs (
 				CollectionChangeAction.Add, dataGridViewCell));
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellPaintingEventArgs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellPaintingEventArgs.cs
index 04cf8ec..f6a6dbc 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellPaintingEventArgs.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCellPaintingEventArgs.cs
@@ -136,7 +136,7 @@ namespace System.Windows.Forms {
 			Paint (clipBounds, DataGridViewPaintParts.Background | DataGridViewPaintParts.Border);
 		}
 			
-		[MonoTODO ("Needs row header cell edit pencil glyph")]
+		[MonoInternalNote ("Needs row header cell edit pencil glyph")]
 		public void PaintContent (Rectangle clipBounds)
 		{
 			Paint (clipBounds, DataGridViewPaintParts.ContentBackground | DataGridViewPaintParts.ContentForeground);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumn.cs
index 5309811..b7b3295 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumn.cs
@@ -57,6 +57,7 @@ namespace System.Windows.Forms {
 		private Type valueType;
 		private bool visible = true;
 		private int width = 100;
+		private int dataColumnIndex;
 
 		private bool headerTextSet = false;
 
@@ -68,6 +69,7 @@ namespace System.Windows.Forms {
 			headerCell.SetColumnIndex(Index);
 			headerCell.Value = string.Empty;
 			displayIndex = -1;
+			dataColumnIndex = -1;
 			dataPropertyName = string.Empty;
 			fillWeight = 100.0F;
 			sortMode = DataGridViewColumnSortMode.NotSortable;
@@ -100,12 +102,7 @@ namespace System.Windows.Forms {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public virtual DataGridViewCell CellTemplate {
 			get { return cellTemplate; }
-			set {
-				cellTemplate = value;
-				if (DataGridView != null) {
-					cellTemplate.SetDataGridView(DataGridView);
-				}
-			}
+			set { cellTemplate = value; }
 		}
 
 		[Browsable (false)]
@@ -187,6 +184,11 @@ namespace System.Windows.Forms {
 			}
 		}
 
+		internal int DataColumnIndex {
+			get { return dataColumnIndex; }
+			set { dataColumnIndex = value; }
+		}
+
 		[DefaultValue (0)]
 		public int DividerWidth {
 			get { return dividerWidth; }
@@ -373,8 +375,13 @@ Example */
 		public DataGridViewColumnSortMode SortMode {
 			get { return sortMode; }
 			set {
-				if (value == DataGridViewColumnSortMode.Automatic && DataGridView != null && DataGridView.SelectionMode == DataGridViewSelectionMode.FullColumnSelect)
-					throw new InvalidOperationException ("Column's SortMode cannot be set to Automatic while the DataGridView control's SelectionMode is set to FullColumnSelect.");
+				if (DataGridView != null && value == DataGridViewColumnSortMode.Automatic) {
+					if (DataGridView.SelectionMode == DataGridViewSelectionMode.FullColumnSelect ||
+					    DataGridView.SelectionMode == DataGridViewSelectionMode.ColumnHeaderSelect)
+						throw new InvalidOperationException ("Column's SortMode cannot be set to Automatic "+
+										     "while the DataGridView control's SelectionMode "+
+										     "is set to FullColumnSelect or ColumnHeaderSelect.");
+				}
 
 				if (sortMode != value) {
 					sortMode = value;
@@ -414,7 +421,11 @@ Example */
 		[Localizable (true)]
 		public override bool Visible {
 			get { return visible; }
-			set { visible = value; }
+			set {
+				visible = value;
+				if (DataGridView != null)
+					DataGridView.Invalidate ();
+			}
 		}
 
 		[Localizable (true)]
@@ -479,9 +490,6 @@ Example */
 			}
 			
 			base.SetDataGridView (dataGridView);
-			if (cellTemplate != null) {
-				cellTemplate.SetDataGridView(dataGridView);
-			}
 			headerCell.SetDataGridView(dataGridView);
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
index c5bbd9c..cf5b792 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewColumnCollection.cs
@@ -77,9 +77,9 @@ namespace System.Windows.Forms
 
 		public virtual int Add (DataGridViewColumn dataGridViewColumn)
 		{
-			dataGridViewColumn.SetIndex(base.List.Count);
-			dataGridViewColumn.SetDataGridView(dataGridView);
 			int result = base.List.Add(dataGridViewColumn);
+			dataGridViewColumn.SetIndex(result);
+			dataGridViewColumn.SetDataGridView(dataGridView);
 			OnCollectionChanged(new CollectionChangeEventArgs(CollectionChangeAction.Add, dataGridViewColumn));
 			return result;
 		}
@@ -108,6 +108,8 @@ namespace System.Windows.Forms
 			dataGridView.RemoveEditingRow ();
 			
 			RegenerateSortedList ();
+
+			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
 		}
 
 		bool IList.Contains (object value)
@@ -185,9 +187,9 @@ namespace System.Windows.Forms
 
 		public virtual void Insert (int columnIndex, DataGridViewColumn dataGridViewColumn)
 		{
+			base.List.Insert (columnIndex, dataGridViewColumn);
 			dataGridViewColumn.SetIndex (columnIndex);
 			dataGridViewColumn.SetDataGridView (dataGridView);
-			base.List.Insert (columnIndex, dataGridViewColumn);
 			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewColumn));
 		}
 
@@ -198,6 +200,7 @@ namespace System.Windows.Forms
 
 		public virtual void Remove (DataGridViewColumn dataGridViewColumn)
 		{
+			DataGridView.OnColumnPreRemovedInternal (new DataGridViewColumnEventArgs (dataGridViewColumn));
 			base.List.Remove (dataGridViewColumn);
 			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, dataGridViewColumn));
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs
index 44fdaab..7374b39 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxCell.cs
@@ -46,6 +46,7 @@ namespace System.Windows.Forms {
 		private int maxDropDownItems;
 		private bool sorted;
 		private string valueMember;
+		private DataGridViewComboBoxColumn owningColumnTemlate;
 
 		public DataGridViewComboBoxCell () : base() {
 			autoComplete = true;
@@ -57,6 +58,7 @@ namespace System.Windows.Forms {
 			items = new ObjectCollection(this);
 			maxDropDownItems = 8;
 			sorted = false;
+			owningColumnTemlate = null;
 		}
 
 		[DefaultValue (true)]
@@ -129,11 +131,11 @@ namespace System.Windows.Forms {
 			get {
 				if (DataGridView != null && DataGridView.BindingContext != null 
 				    && DataSource != null && !String.IsNullOrEmpty (ValueMember)) {
-					items.Clear ();
+					items.ClearInternal ();
 					CurrencyManager dataManager = (CurrencyManager) DataGridView.BindingContext[DataSource];
 					if (dataManager != null && dataManager.Count > 0) {
 						foreach (object item in dataManager.List)
-							items.Add (item);
+							items.AddInternal (item);
 					}
 				}
 
@@ -175,6 +177,12 @@ namespace System.Windows.Forms {
 			get { return typeof(string); }
 		}
 
+		// Valid only for template Cells and used as a bridge to push items
+		internal DataGridViewComboBoxColumn OwningColumnTemplate {
+			get { return owningColumnTemlate; }
+			set { owningColumnTemlate = value; }
+		}
+
 		public override object Clone () {
 			DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell) base.Clone();
 			cell.autoComplete = this.autoComplete;
@@ -185,7 +193,7 @@ namespace System.Windows.Forms {
 			cell.displayStyleForCurrentCellOnly = this.displayStyleForCurrentCellOnly;
 			cell.dropDownWidth = this.dropDownWidth;
 			cell.flatStyle = this.flatStyle;
-			cell.items.AddRange(this.items);
+			cell.items.AddRangeInternal(this.items);
 			cell.maxDropDownItems = this.maxDropDownItems;
 			cell.sorted = this.sorted;
 			return cell;
@@ -214,9 +222,32 @@ namespace System.Windows.Forms {
 				editingControl.DisplayMember = DisplayMember;
 			} else {
 				editingControl.Items.AddRange (this.Items);
+				if (FormattedValue != null && editingControl.Items.IndexOf (FormattedValue) != -1)
+					editingControl.SelectedItem = FormattedValue;
 			}
 		}
 
+		internal void SyncItems ()
+		{
+			if (DataSource != null || OwningColumnTemplate == null)
+				return;
+
+			if (OwningColumnTemplate.DataGridView != null) {
+				DataGridViewComboBoxEditingControl editor = OwningColumnTemplate.DataGridView.EditingControl
+									    as DataGridViewComboBoxEditingControl;
+				if (editor != null) {
+					object selectedItem = editor.SelectedItem;
+					editor.Items.Clear ();
+					editor.Items.AddRange (items);
+					if (editor.Items.IndexOf (selectedItem) != -1)
+						editor.SelectedItem = selectedItem;
+				}
+			}
+
+			// Push the new items to the column
+			OwningColumnTemplate.SyncItems (Items);
+		}
+
 		public override bool KeyEntersEditMode (KeyEventArgs e)
 		{
 			if (e.KeyCode == Keys.Space)
@@ -365,15 +396,19 @@ namespace System.Windows.Forms {
 			return button_area;
 		}
 
+		// IMPORTANT: Only call the internal methods from within DataGridViewComboBoxCell
+		// for adding/removing/clearing because the other methods invoke an update of the 
+		// column items collection and you might end up in an endless loop.
+		//
 		[ListBindable (false)]
 		public class ObjectCollection : IList, ICollection, IEnumerable {
 
 			private ArrayList list;
+			private DataGridViewComboBoxCell owner;
 
-			//private DataGridViewComboBoxCell owner;
-
-			public ObjectCollection (DataGridViewComboBoxCell owner) {
-				//this.owner = owner;
+			public ObjectCollection (DataGridViewComboBoxCell owner)
+			{
+				this.owner = owner;
 				list = new ArrayList();
 			}
 
@@ -399,26 +434,71 @@ namespace System.Windows.Forms {
 
 			public virtual object this [int index] {
 				get { return list[index]; }
-				set { list[index] = value; }
+				set {
+					ThrowIfOwnerIsDataBound ();
+					list[index] = value;
+				}
+			}
+
+			public int Add (object item)
+			{
+				ThrowIfOwnerIsDataBound ();
+				int index = AddInternal (item);
+				SyncOwnerItems ();
+				return index;
+			}
+			
+			internal int AddInternal (object item)
+			{
+				return list.Add (item);
+			}
+
+			internal void AddRangeInternal (ICollection items)
+			{
+				list.AddRange (items);
+			}
+
+			public void AddRange (ObjectCollection value)
+			{
+				ThrowIfOwnerIsDataBound ();
+				AddRangeInternal (value);
+				SyncOwnerItems ();
 			}
 
-			public int Add (object item) {
-				return list.Add(item);
+			private void SyncOwnerItems ()
+			{
+				ThrowIfOwnerIsDataBound ();
+				if (owner != null)
+					owner.SyncItems ();
 			}
 
-			public void AddRange (ObjectCollection value) {
-				list.AddRange(value.list);
+			public void ThrowIfOwnerIsDataBound ()
+			{
+				if (owner != null && owner.DataGridView != null && owner.DataSource != null)
+					throw new ArgumentException ("Cannot modify collection if the cell is data bound.");
 			}
 
-			public void AddRange (params object[] items) {
-				list.AddRange(items);
+			public void AddRange (params object[] items)
+			{
+				ThrowIfOwnerIsDataBound ();
+				AddRangeInternal (items);
+				SyncOwnerItems ();
 			}
 
-			public void Clear () {
-				list.Clear();
+			public void Clear ()
+			{
+				ThrowIfOwnerIsDataBound ();
+				ClearInternal ();
+				SyncOwnerItems ();
 			}
 
-			public bool Contains (object value) {
+			internal void ClearInternal ()
+			{
+				list.Clear ();
+			}
+
+			public bool Contains (object value)
+			{
 				return list.Contains(value);
 			}
 
@@ -432,26 +512,51 @@ namespace System.Windows.Forms {
 				list.CopyTo (destination, arrayIndex);
 			}
 
-			public IEnumerator GetEnumerator () {
+			public IEnumerator GetEnumerator ()
+			{
 				return list.GetEnumerator();
 			}
 
-			public int IndexOf (object value) {
+			public int IndexOf (object value)
+			{
 				return list.IndexOf(value);
 			}
 
-			public void Insert (int index, object item) {
-				list.Insert(index, item);
+			public void Insert (int index, object item)
+			{
+				ThrowIfOwnerIsDataBound ();
+				InsertInternal (index, item);
+				SyncOwnerItems ();
+			}
+
+			internal void InsertInternal (int index, object item)
+			{
+				list.Insert (index, item);
 			}
 
-			public void Remove (object value) {
-				list.Remove(value);
+			public void Remove (object value)
+			{
+				ThrowIfOwnerIsDataBound ();
+				RemoveInternal (value);
+				SyncOwnerItems ();
 			}
 
-			public void RemoveAt (int index) {
-				list.RemoveAt(index);
+			internal void RemoveInternal (object value)
+			{
+				list.Remove (value);
 			}
 
+			public void RemoveAt (int index)
+			{
+				ThrowIfOwnerIsDataBound ();
+				RemoveAtInternal (index);
+				SyncOwnerItems ();
+			}
+
+			internal void RemoveAtInternal (int index)
+			{
+				list.RemoveAt (index);
+			}
 
 			int IList.Add (object item)
 			{
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxColumn.cs
index 5cbaca8..1fb5608 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewComboBoxColumn.cs
@@ -26,6 +26,7 @@
 
 #if NET_2_0
 
+using System.Collections;
 using System.ComponentModel;
 using System.Drawing.Design;
 using System.Drawing;
@@ -45,6 +46,7 @@ namespace System.Windows.Forms {
 		public DataGridViewComboBoxColumn ()
 		{
 			CellTemplate = new DataGridViewComboBoxCell();
+			((DataGridViewComboBoxCell) CellTemplate).OwningColumnTemplate = this;
 			SortMode = DataGridViewColumnSortMode.NotSortable;
 			autoComplete = true;
 			displayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton;
@@ -62,7 +64,15 @@ namespace System.Windows.Forms {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public override DataGridViewCell CellTemplate {
 			get { return base.CellTemplate; }
-			set { base.CellTemplate = value as DataGridViewComboBoxCell; }
+			set {
+
+				DataGridViewComboBoxCell cellTemplate = value as DataGridViewComboBoxCell;
+				if (cellTemplate == null)
+					throw new InvalidCastException ("Invalid cell tempalte type.");
+
+				cellTemplate.OwningColumnTemplate = this;
+				base.CellTemplate = cellTemplate;
+			}
 		}
 
 		[AttributeProvider (typeof (IListSource))]
@@ -201,6 +211,20 @@ namespace System.Windows.Forms {
 			}
 		}
 
+		internal void SyncItems (IList items)
+		{
+			if (DataSource != null || DataGridView == null)
+				return;
+
+			for (int i = 0; i < DataGridView.RowCount; i++) {
+				DataGridViewComboBoxCell comboCell = DataGridView.Rows[i].Cells[base.Index] as DataGridViewComboBoxCell;
+				if (comboCell != null) {
+					comboCell.Items.ClearInternal ();
+					comboCell.Items.AddRangeInternal (this.Items);
+				}
+			}
+		}
+
 		public override object Clone ()
 		{
 			DataGridViewComboBoxColumn col = (DataGridViewComboBoxColumn) base.Clone();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewElement.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewElement.cs
index 5079ce3..0faca1e 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewElement.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewElement.cs
@@ -93,10 +93,6 @@ namespace System.Windows.Forms {
 		}
 
 		internal virtual void SetDataGridView (DataGridView dataGridView) {
-			if (this.DataGridView == null && dataGridView != null) {
-				this.dataGridView = dataGridView;
-				return;
-			}
 			if (dataGridView != this.DataGridView) {
 				this.dataGridView = dataGridView;
 				OnDataGridViewChanged();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkCell.cs
index 4fc3539..3d9c01d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkCell.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkCell.cs
@@ -315,13 +315,13 @@ namespace System.Windows.Forms
 				//DO NOTHING
 			}
 
-			[MonoTODO]
+			[MonoTODO ("Stub, does nothing")]
 			[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
 			public override void DoDefaultAction ()
 			{
-				DataGridViewLinkCell cell = base.Owner as DataGridViewLinkCell;
-				if (cell.DataGridView != null && cell.RowIndex == -1)
-					throw new InvalidOperationException ();
+				//DataGridViewLinkCell cell = base.Owner as DataGridViewLinkCell;
+				//if (cell.DataGridView != null && cell.RowIndex == -1)
+				//        throw new InvalidOperationException ();
 			}
 
 			public override int GetChildCount ()
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkColumn.cs
index 7bdff17..143ee63 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewLinkColumn.cs
@@ -148,7 +148,7 @@ namespace System.Windows.Forms
 				DataGridView.InvalidateColumn (Index);
 			}
 		}
-		[MonoTODO]
+		[MonoInternalNote ("")]
 		[DefaultValue ((string) null)]
 		public string Text {
 			get {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
index a556ea5..24ff521 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs
@@ -330,7 +330,13 @@ namespace System.Windows.Forms
 				if (IsNewRow && value == false) {
 					throw new InvalidOperationException("Cant make invisible a new row.");
 				}
+				if (!value && DataGridView != null && DataGridView.DataManager != null && 
+				    DataGridView.DataManager.Position == Index)
+					throw new InvalidOperationException("Row associated with the currency manager's position cannot be made invisible.");
+
 				base.Visible = value;
+				if (DataGridView != null)
+					DataGridView.Invalidate ();
 			}
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
index e46dffc..9af26a9 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs
@@ -106,19 +106,21 @@ namespace System.Windows.Forms
 			return Add (value as DataGridViewRow);
 		}
 
-		internal int AddInternal (DataGridViewRow dataGridViewRow, bool sharable)
+		private int AddCore (DataGridViewRow dataGridViewRow, bool sharable)
 		{
 			if (dataGridView.Columns.Count == 0)
 				throw new InvalidOperationException ("DataGridView has no columns.");
 			
 			int result;
 			
+			dataGridViewRow.SetDataGridView (dataGridView);
+
 			// 
 			// Add the row just before the editing row (if there is an editing row).
 			// 
 			int editing_index = -1;
 			if (DataGridView != null && DataGridView.EditingRow != null && DataGridView.EditingRow != dataGridViewRow) {
-				editing_index = list.IndexOf (DataGridView.EditingRow);
+				editing_index = list.Count - 1; // always the last row
 				DataGridView.EditingRow.SetIndex (list.Count);
 			}
 			
@@ -134,16 +136,17 @@ namespace System.Windows.Forms
 			} else {
 				dataGridViewRow.SetIndex (result);
 			}
-			dataGridViewRow.SetDataGridView (dataGridView);
+
 			CompleteRowCells (dataGridViewRow);
 			for (int i = 0; i < dataGridViewRow.Cells.Count; i++) {
 				dataGridViewRow.Cells [i].SetOwningColumn (dataGridView.Columns [i]);
 			}
 
-			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRow));
 			if (raiseEvent) {
+				OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRow));
 				DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (result, 1));
 			}
+
 			return result;
 		}
 
@@ -163,7 +166,7 @@ namespace System.Windows.Forms
 		{
 			if (dataGridView.DataSource != null)
 				throw new InvalidOperationException ("DataSource of DataGridView is not null.");
-			return AddInternal (dataGridViewRow, true);
+			return AddCore (dataGridViewRow, true);
 		}
 		
 		private bool CanBeShared (DataGridViewRow row)
@@ -212,7 +215,7 @@ namespace System.Windows.Forms
 				throw new InvalidOperationException("DataGridView is in virtual mode.");
 
 			DataGridViewRow row = (DataGridViewRow)dataGridView.RowTemplateFull;
-			int result = AddInternal (row, false);
+			int result = AddCore (row, false);
 			row.SetValues(values);
 			return result;
 		}
@@ -239,21 +242,25 @@ namespace System.Windows.Forms
 			if (dataGridView.DataSource != null)
 				throw new InvalidOperationException ("DataSource of DataGridView is not null.");
 
-			raiseEvent = false;
 			int count = 0;
 			int lastIndex = -1;
+			raiseEvent = false;
 			foreach (DataGridViewRow row in dataGridViewRows) {
 				lastIndex = Add (row);
 				count++;
 			}
-			DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
 			raiseEvent = true;
+
+			DataGridView.OnRowsAddedInternal (new DataGridViewRowsAddedEventArgs (lastIndex - count + 1, count));
+			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, dataGridViewRows));
 		}
 
 		public virtual void Clear ()
 		{
 			int total = list.Count;
 			
+			DataGridView.OnRowsPreRemovedInternal (new DataGridViewRowsRemovedEventArgs (0, total));
+
 			for (int i = 0; i < total; i++) {
 				DataGridViewRow row = (DataGridViewRow)list[0];
 				
@@ -264,6 +271,14 @@ namespace System.Windows.Forms
 				list.Remove (row);
 				ReIndex ();
 			}
+
+			DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (0, total));
+			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, null));
+		}
+
+		internal void ClearInternal ()
+		{
+			list.Clear ();
 		}
 
 		bool IList.Contains (object value)
@@ -399,6 +414,7 @@ namespace System.Windows.Forms
 			Insert (index, value as DataGridViewRow);
 		}
 
+		// FIXME: Do *not* allow insertation *after* the editing row!
 		public virtual void Insert (int rowIndex, DataGridViewRow dataGridViewRow)
 		{
 			dataGridViewRow.SetIndex (rowIndex);
@@ -470,18 +486,20 @@ namespace System.Windows.Forms
 			if (dataGridViewRow.IsNewRow)
 				throw new InvalidOperationException ("Cannot delete the new row");
 				
+			DataGridView.OnRowsPreRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
 			list.Remove (dataGridViewRow);
 			ReIndex ();
 			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, dataGridViewRow));
-			DataGridView.OnRowsRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
+			DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
 		}
 
 		internal virtual void RemoveInternal (DataGridViewRow dataGridViewRow)
 		{
+			DataGridView.OnRowsPreRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
 			list.Remove (dataGridViewRow);
 			ReIndex ();
 			OnCollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, dataGridViewRow));
-			DataGridView.OnRowsRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
+			DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (dataGridViewRow.Index, 1));
 		}
 		
 		public virtual void RemoveAt (int index)
@@ -522,18 +540,11 @@ namespace System.Windows.Forms
 				CollectionChanged (this, e);
 		}
 
-		internal void InternalAdd (DataGridViewRow dataGridViewRow)
+		internal void AddInternal (DataGridViewRow dataGridViewRow, bool sharable)
 		{
-			dataGridViewRow.SetDataGridView (dataGridView);
-			
-			// Add the row just before the editing row (if there is an editing row).
-			if (DataGridView != null && DataGridView.EditingRow != null && DataGridView.NewRowIndex >= 0) {
-				DataGridView.EditingRow.SetIndex (list.Count);
-				list.Insert (DataGridView.NewRowIndex, dataGridViewRow);
-			} else
-				list.Add (dataGridViewRow);
-				
-			dataGridViewRow.SetIndex (list.IndexOf (dataGridViewRow));
+			raiseEvent = false;
+			AddCore (dataGridViewRow, sharable);
+			raiseEvent = true;
 		}
 
 		internal ArrayList RowIndexSortedArrayList {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowHeaderCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowHeaderCell.cs
index 378e050..64e67c3 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowHeaderCell.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowHeaderCell.cs
@@ -185,7 +185,7 @@ namespace System.Windows.Forms {
 			return null;
 		}
 
-		[MonoTODO ("Needs row header cell selected/edit pencil glyphs")]
+		[MonoInternalNote ("Needs row header cell selected/edit pencil glyphs")]
 		protected override void Paint (Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
 		{
 			// Prepaint
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxCell.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxCell.cs
index ffd3f8b..0fb543d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxCell.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxCell.cs
@@ -137,7 +137,7 @@ namespace System.Windows.Forms {
 
 		public override string ToString ()
 		{
-			return this.GetType().Name;
+			return string.Format ("DataGridViewTextBoxCell {{ ColumnIndex={0}, RowIndex={1} }}", ColumnIndex, RowIndex);
 		}
 
 		protected override Rectangle GetContentBounds (Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxColumn.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxColumn.cs
index eace307..84936a2 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxColumn.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewTextBoxColumn.cs
@@ -64,12 +64,7 @@ namespace System.Windows.Forms {
 		[DefaultValue (DataGridViewColumnSortMode.Automatic)]
 		public new DataGridViewColumnSortMode SortMode {
 			get { return base.SortMode; }
-			set {
-				if (DataGridView != null && DataGridView.SelectionMode == DataGridViewSelectionMode.FullRowSelect && value != DataGridViewColumnSortMode.NotSortable) {
-					throw new InvalidOperationException("Value conflicts with DataGridView.SelectionMode.");
-				}
-				base.SortMode = value;
-			}
+			set { base.SortMode = value; }
 		}
 
 		public override string ToString ()
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataObject.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataObject.cs
index 8caf4d4..90dc248 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataObject.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataObject.cs
@@ -101,7 +101,7 @@ namespace System.Windows.Forms {
 					bool available = true;
 					if (only_convertible && !entries.autoconvert)
 						available = false;
-					if (available && entries.type.Equals(type)) {
+					if (available && String.Compare (entries.type, type, true) == 0) {
 						return entries;
 					}
 					entries = entries.next;
@@ -118,24 +118,15 @@ namespace System.Windows.Forms {
 					return e;
 				}
 
-				e = entries;
-				while (e != null) {
-					if (type == DataFormats.Text) {
-						if (e.type == DataFormats.UnicodeText) {
-							return e;
-						}
-					} else if (type == DataFormats.UnicodeText) {
-						if (e.type == DataFormats.Text) {
-							return e;
-						}
-					} else if (type == DataFormats.StringFormat) {
-						if (e.type == DataFormats.Text) {
-							return e;
-						} else if (e.type == DataFormats.UnicodeText) {
+				// map to *any* other text format if needed
+				if (type == DataFormats.StringFormat || type == DataFormats.Text || type == DataFormats.UnicodeText) {
+					e = entries;
+					while (e != null) {
+						if (e.type == DataFormats.StringFormat || e.type == DataFormats.Text || e.type == DataFormats.UnicodeText)
 							return e;
-						}
+
+						e = e.next;
 					}
-					e = e.next;
 				}
 
 				return null;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs
index 36886a4..fc97311 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DateTimePicker.cs
@@ -1099,11 +1099,11 @@ namespace System.Windows.Forms {
 				case "y":
 				case "yy":
 				case "yyyy":
-					for (int i = 1; i <= 10; i++) {
-						text = PartData.GetText (Value.AddYears (i), format);
-						size = gr.MeasureString (text, font, int.MaxValue, string_format);
-						result = Math.Max (result, size.Width);
-					}
+					// Actually all the allowed year values are between MinDateTime and MaxDateTime,
+					// which are 4 digits always
+					text = PartData.GetText (Value, format);
+					size = gr.MeasureString (text, font, int.MaxValue, string_format);
+					result = Math.Max (result, size.Width);
 					return result;
 				default:
 					return gr.MeasureString (format, font, int.MaxValue, string_format).Width;
@@ -1274,7 +1274,8 @@ namespace System.Windows.Forms {
 			if (month_calendar.Visible) {
 				month_calendar.Hide ();
 			}
-	}
+			Focus ();
+		}
 
 		private int GetSelectedPartIndex()
 		{
@@ -1737,7 +1738,6 @@ namespace System.Windows.Forms {
 		private void MonthCalendarDateSelectedHandler (object sender, DateRangeEventArgs e)
 		{
 			this.HideMonthCalendar ();	
-			this.Focus ();			
 		} 
 
 		private void MouseUpHandler(object sender, MouseEventArgs e)
@@ -1803,7 +1803,6 @@ namespace System.Windows.Forms {
     				// mouse down on this control anywhere else collapses it
     				if (is_drop_down_visible) {    				
     					HideMonthCalendar ();
-					this.Focus ();
     				}
 				if (!(ShowCheckBox && Checked == false))
 				{
@@ -1844,7 +1843,6 @@ namespace System.Windows.Forms {
 				DropDownMonthCalendar ();
 			} else {
 				HideMonthCalendar ();
-				this.Focus ();
 			}
 		}
 		
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DomainUpDown.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DomainUpDown.cs
index 0a7d31c..fa58af3 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DomainUpDown.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DomainUpDown.cs
@@ -260,7 +260,54 @@ namespace System.Windows.Forms
 			Select(base.txtView.SelectionStart + base.txtView.SelectionLength, 0);
 		}
 
+		int SearchTextWithPrefix (char key_char)
+		{
+			string prefix = key_char.ToString ();
+			int start_index, i;
+
+			start_index = selected_index == -1 ? 0 : selected_index;
+			i = selected_index == -1 || selected_index + 1 >= items.Count ? 0 : start_index + 1;
+
+			while (true) {
+				string item_text = items [i].ToString ();
+				if (String.Compare (prefix, 0, item_text, 0, 1, true) == 0)
+					return i;
+
+				if (i + 1 >= items.Count)
+					i = 0;
+				else
+					i++;
+
+				if (i == start_index)
+					break;
+			}
+
+			return -1;
+		}
+
+		bool IsValidInput (char key_char)
+		{
+			return Char.IsLetterOrDigit (key_char)
+					|| Char.IsNumber (key_char)
+					|| Char.IsPunctuation (key_char)
+					|| Char.IsSymbol (key_char)
+					|| Char.IsWhiteSpace (key_char);
+		}
+
 		private void TextBoxKeyDown(object source, KeyPressEventArgs e) {
+			if (ReadOnly) {
+				char key_char = e.KeyChar;
+				if (IsValidInput (key_char) && items.Count > 0) {
+					int idx = SearchTextWithPrefix (key_char);
+					if (idx > -1) {
+						SelectedIndex = idx;
+						e.Handled = true;
+					}
+				}
+
+				return;
+			}
+
 			if (!UserEdit) {
 				base.txtView.SelectionLength = 0;
 				typed_to_index = -1;
@@ -324,11 +371,7 @@ namespace System.Windows.Forms
 			else {
 				char key_char = e.KeyChar;
 
-				if (char.IsLetterOrDigit(key_char)
-					|| char.IsNumber(key_char)
-					|| char.IsPunctuation(key_char)
-					|| char.IsSymbol(key_char)
-					|| char.IsWhiteSpace(key_char)) {
+				if (IsValidInput (key_char)) {
 					string prefix = base.txtView.SelectedText + key_char;
 
 					bool found = false;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ErrorProvider.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ErrorProvider.cs
index 34a9182..575cc24 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ErrorProvider.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ErrorProvider.cs
@@ -409,8 +409,8 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
-		[DefaultValue(null)]
+		[MonoTODO ("Stub, does nothing")]
+		[DefaultValue (null)]
 		[Editor ("System.Windows.Forms.Design.DataMemberListEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
 		public string DataMember {
 			get {
@@ -423,8 +423,8 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO]
-		[DefaultValue(null)]
+		[MonoTODO ("Stub, does nothing")]
+		[DefaultValue (null)]
 #if NET_2_0
 		[AttributeProvider (typeof (IListSource))]
 #else
@@ -483,8 +483,9 @@ namespace System.Windows.Forms {
 		#endregion	// Public Instance Properties
 
 		#region Public Instance Methods
-		[MonoTODO]
-		public void BindToDataAndErrors(object newDataSource, string newDataMember) {
+		[MonoTODO ("Stub, does nothing")]
+		public void BindToDataAndErrors (object newDataSource, string newDataMember)
+		{
 			datasource = newDataSource;
 			datamember = newDataMember;
 			// FIXME - finish
@@ -540,8 +541,9 @@ namespace System.Windows.Forms {
 			GetErrorProperty(control).Padding = padding;
 		}
 
-		[MonoTODO]
-		public void UpdateBinding() {
+		[MonoTODO ("Stub, does nothing")]
+		public void UpdateBinding ()
+		{
 		}
 		#endregion	// Public Instance Methods
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
index eaf1761..ad36c70 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FileDialog.cs
@@ -702,9 +702,9 @@ namespace System.Windows.Forms
 				return Title;
 			}
 		}
-		
-		[MonoTODO]
-		protected  override IntPtr HookProc (IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
+
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
+		protected override IntPtr HookProc (IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam)
 		{
 			throw new NotImplementedException ();
 		}
@@ -1300,8 +1300,8 @@ namespace System.Windows.Forms
 		
 		private void WriteConfigValues ()
 		{
-			MWFConfig.SetValue (filedialog_string, width_string, form.Width);
-			MWFConfig.SetValue (filedialog_string, height_string, form.Height);
+			MWFConfig.SetValue (filedialog_string, width_string, form.ClientSize.Width);
+			MWFConfig.SetValue (filedialog_string, height_string, form.ClientSize.Height);
 			MWFConfig.SetValue (filedialog_string, x_string, form.Location.X);
 			MWFConfig.SetValue (filedialog_string, y_string, form.Location.Y);
 			
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs
index 2fcc2b4..b73d475 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/FontDialog.cs
@@ -900,7 +900,7 @@ namespace System.Windows.Forms
 				case Keys.Down:
 				case Keys.PageDown:
 				case Keys.PageUp:
-					fontListBox.OnKeyDownLB (sender, e);
+					fontListBox.HandleKeyDown (e.KeyCode);
 					break;
 			}
 		}
@@ -913,7 +913,7 @@ namespace System.Windows.Forms
 				case Keys.Down:
 				case Keys.PageDown:
 				case Keys.PageUp:
-					fontstyleListBox.OnKeyDownLB (sender, e);
+					fontstyleListBox.HandleKeyDown (e.KeyCode);
 					break;
 			}
 		}
@@ -926,7 +926,7 @@ namespace System.Windows.Forms
 				case Keys.Down:
 				case Keys.PageDown:
 				case Keys.PageUp:
-					fontsizeListBox.OnKeyDownLB (sender, e);
+					fontsizeListBox.HandleKeyDown (e.KeyCode);
 					break;
 			}
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
index 903fa5c..1cadc81 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
@@ -2262,7 +2262,16 @@ namespace System.Windows.Forms {
 
 			// Give our menu a shot
 			if (ActiveMenu != null) {
-				return ActiveMenu.ProcessCmdKey(ref msg, keyData);
+				if (ActiveMenu.ProcessCmdKey (ref msg, keyData))
+					return true;
+			}
+
+			// Detect any active ContextMenu for a child control that
+			// can't receive focus (which means: both input and preprocess)
+			if (ActiveTracker != null && ActiveTracker.TopMenu is ContextMenu) {
+				ContextMenu cmenu = ActiveTracker.TopMenu as ContextMenu;
+				if (cmenu.SourceControl != this && cmenu.ProcessCmdKey (ref msg, keyData))
+					return true;
 			}
 
 			if (IsMdiChild) {
@@ -3241,7 +3250,7 @@ namespace System.Windows.Forms {
 				eh (this, e);
 		}
 
-		[MonoTODO ("Not hooked up to event")]
+		[MonoTODO ("Will never be called")]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		protected virtual void OnHelpButtonClicked (CancelEventArgs e)
 		{
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Help.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Help.cs
index df94178..c2b12ce 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Help.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Help.cs
@@ -50,7 +50,7 @@ namespace System.Windows.Forms
 			ShowHelp(parent, url, navigator, null);
 		}
 
-		[MonoTODO("Create glue code to tie into libCHM")]
+[MonoTODO ("Stub, does nothing")]
 #if NET_2_0
 		public static void ShowHelp (Control parent, string url, HelpNavigator command, object parameter)
 		{
@@ -59,10 +59,6 @@ namespace System.Windows.Forms
 		public static void ShowHelp (Control parent, string url, HelpNavigator command, object param)
 		{
 #endif
-			MessageBox.Show(parent, Locale.GetText("Help (" + command +
-					(param != null ? "(" + param + ")" : String.Empty) +
-					") not yet implemented"), Locale.GetText("Popup Help"),
-					MessageBoxButtons.OK, MessageBoxIcon.Stop);
 		}
 
 		public static void ShowHelp (Control parent, string url, string keyword)
@@ -77,11 +73,9 @@ namespace System.Windows.Forms
 			ShowHelp (parent, url, HelpNavigator.Index, null);
 		}
 
-		[MonoTODO("Create glue code to tie into libCHM")]
+		[MonoTODO ("Stub, does nothing")]
 		public static void ShowPopup (Control parent, string caption, Point location)
 		{
-			MessageBox.Show (parent, Locale.GetText ("Popup Help not yet implemented"),
-				Locale.GetText ("Popup Help"), MessageBoxButtons.OK, MessageBoxIcon.Stop);
 		}
 		#endregion	// Public Static Methods
 	}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlDocument.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlDocument.cs
index 3da9d75..8b50c19 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlDocument.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlDocument.cs
@@ -135,7 +135,10 @@ namespace System.Windows.Forms
 		{
 			string[] strArgs = new string[args.Length];
 			for (int i = 0; i < args.Length; i++) {
-				strArgs[i] = args.ToString();
+				if (args[i] is string)
+					strArgs[i] = "\"" + args[i].ToString() + "\"";
+				else
+					strArgs[i] = args[i].ToString();
 			}
 			return document.InvokeScript ("eval ('" + scriptName + "(" + String.Join (",", strArgs) + ")');");
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlElement.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlElement.cs
index 6e9d709..0f94c80 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlElement.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlElement.cs
@@ -167,7 +167,6 @@ namespace System.Windows.Forms
 			get { return element.TagName; }
 		}
 
-		[MonoTODO ("Needs implementation")]
 		public short TabIndex {
 			get { return (short)element.TabIndex; }
 			set { element.TabIndex = value; }
@@ -187,7 +186,6 @@ namespace System.Windows.Forms
 			set { this.element.OuterText = value; }
 		}
 
-		[MonoTODO ("Needs implementation")]
 		public string Style {
 			get { return this.element.Style; }
 			set { this.element.Style = value; }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlHistory.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlHistory.cs
index 686824d..105e17d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlHistory.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/HtmlHistory.cs
@@ -65,7 +65,7 @@ namespace System.Windows.Forms
 			get { return webHost.Navigation.HistoryCount; }
 		}
 
-		[MonoTODO ("Needs implementation")]
+		[MonoTODO ("Not supported, will throw NotSupportedException")]
 		public object DomHistory {
 			get { throw new NotSupportedException ("Retrieving a reference to an mshtml interface is not supported. Sorry."); } 
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs
index 3bff67e..1802d03 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InputLanguage.cs
@@ -38,7 +38,7 @@ namespace System.Windows.Forms {
 		private static InputLanguage	default_input;
 
 		#region Private Constructor
-		[MonoTODO("Pull Microsofts InputLanguages and enter them here")]
+		[MonoInternalNote ("Pull Microsofts InputLanguages and enter them here")]
 		internal InputLanguage()
 		{
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
index 254a1ba..4d76099 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/InternalWindowManager.cs
@@ -447,7 +447,8 @@ namespace System.Windows.Forms {
 
 		protected virtual void Activate ()
 		{
-			form.Refresh ();
+			form.Invalidate (true);
+			form.Update ();
 		}
 
 		public virtual bool IsActive {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
index 6089a56..1f3c8e6 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
@@ -269,12 +269,15 @@ namespace System.Windows.Forms
 				
 				// Update the start of each tag
 				while ((tag != null) && (left > 0)) {
+					// Cache tag.Length as is will be indireclty modified
+					// by changes to tag.Start
+					int tag_length = tag.Length;
 					tag.Start -= count - left;
 
-					if (tag.Length > left) {
+					if (tag_length > left) {
 						left = 0;
 					} else {
-						left -= tag.Length;
+						left -= tag_length;
 						tag = tag.Next;
 					}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs
index 03e380f..6c33435 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingConverter.cs
@@ -43,7 +43,6 @@ namespace System.Windows.Forms {
 			return base.CanConvertTo (context, destinationType);
 		}
 
-		[MonoTODO]
 		public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) {
 			return base.ConvertTo (context, culture, value, destinationType);
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs
index 6b57f6d..5547459 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBindingHelper.cs
@@ -21,6 +21,7 @@
 //
 // Author:
 // 	Carlos Alberto Cortez <calberto.cortez at gmail.com>
+//      Ivan Zlatev <contact at i-nz.net>
 //
 
 using System;
@@ -29,48 +30,64 @@ using System.ComponentModel;
 using System.Reflection;
 
 #if NET_2_0
-
 using System.Collections.Generic;
+#endif
 
 namespace System.Windows.Forms
 {
-	public static class ListBindingHelper 
+
+#if NET_2_0
+	public
+#else
+	internal
+#endif
+	static class ListBindingHelper 
 	{
 		public static object GetList (object list)
 		{
-			return GetList (list, String.Empty);
+			if (list is IListSource)
+				return ((IListSource) list).GetList ();
+			return list;
 		}
 
 		public static object GetList (object dataSource, string dataMember)
 		{
-			if (dataSource is IListSource)
-				dataSource = ((IListSource) dataSource).GetList ();
+			dataSource = GetList (dataSource);
+			if (dataSource == null || dataMember == null || dataMember.Length == 0)
+				return dataSource;
 
-			if (dataSource == null)
-				return null;
+			PropertyDescriptor property = GetListItemProperties (dataSource).Find (dataMember, true);
+			if (property == null)
+				throw new ArgumentException ("dataMember");
 
-			if (dataMember == null || dataMember.Length == 0)
-				return dataSource;
+			object item = null;
+#if NET_2_0
+			ICurrencyManagerProvider currencyManagerProvider = dataSource as ICurrencyManagerProvider;
+			if (currencyManagerProvider != null && currencyManagerProvider.CurrencyManager != null) {
+				CurrencyManager currencyManager = currencyManagerProvider.CurrencyManager;
+				if (currencyManager != null && currencyManager.Count > 0 && currencyManager.Current != null)
+					item = currencyManager.Current;
+			}
+#endif
 
-			if (dataSource is IEnumerable) {
-				IEnumerator e = ((IEnumerable) dataSource).GetEnumerator ();
-				if (e == null || !e.MoveNext () || e.Current == null) {
-					PropertyDescriptorCollection properties = GetListItemProperties (dataSource);
-					if (properties [dataMember] == null)
-						throw new ArgumentException ("dataMember");
-
-					// Weird
-					return null;
+			if (item == null) {
+				if (dataSource is IEnumerable) {
+					if (dataSource is IList) {
+						IList list = (IList) dataSource;
+						item = list.Count > 0 ? list[0] : null;
+					} else {
+						IEnumerator e = ((IEnumerable) dataSource).GetEnumerator ();
+						if (e != null && e.MoveNext ())
+							item = e.Current;
+					}
+				} else {
+					item = dataSource;
 				}
-					
-				dataSource = e.Current;
 			}
 
-			PropertyDescriptor property = GetProperty (dataSource, dataMember);
-			if (property == null)
-				throw new ArgumentException ("dataMember");
-
-			return property.GetValue (dataSource);
+			if (item != null)
+				return property.GetValue (item);
+			return null;
 		}
 
 		public static Type GetListItemType (object list)
@@ -97,12 +114,17 @@ namespace System.Windows.Forms
 			// IEnumerable seems to have higher precedence over IList
 			if (dataSource is IEnumerable) {
 				IEnumerator enumerator = ((IEnumerable) dataSource).GetEnumerator ();
-				if (enumerator.MoveNext ())
+				if (enumerator.MoveNext () && enumerator.Current != null)
 					return enumerator.Current.GetType ();
 
-				if (dataSource is IList || dataSource.GetType () == typeof (IList<>)) {
+				if (dataSource is IList
+#if NET_2_0
+ 					|| dataSource.GetType () == typeof (IList<>)
+#endif
+					) {
 					PropertyInfo property = GetPropertyByReflection (dataSource.GetType (), "Item");
-					return property.PropertyType;
+					if (property != null) // `Item' could be interface-explicit, and thus private
+						return property.PropertyType;
 				}
 
 				// fallback to object
@@ -135,8 +157,11 @@ namespace System.Windows.Forms
 
 			// Take into account only the first property
 			Type property_type = listAccessors [0].PropertyType;
-			if (typeof (IList).IsAssignableFrom (property_type) || 
-				typeof (IList<>).IsAssignableFrom (property_type)) {
+			if (typeof (IList).IsAssignableFrom (property_type)
+#if NET_2_0
+				|| typeof (IList<>).IsAssignableFrom (property_type)
+#endif
+				) {
 
 				PropertyInfo property = GetPropertyByReflection (property_type, "Item");
 				return TypeDescriptor.GetProperties (property.PropertyType);
@@ -162,15 +187,8 @@ namespace System.Windows.Forms
 
 		static PropertyDescriptor GetProperty (object obj, string property_name)
 		{
-			Attribute [] attrs = new Attribute [] { new BrowsableAttribute (true) };
-
-			PropertyDescriptorCollection properties;
-			if (obj is ICustomTypeDescriptor)
-				properties = ((ICustomTypeDescriptor)obj).GetProperties (attrs);
-			else
-				properties = TypeDescriptor.GetProperties (obj.GetType (), attrs);
-
-			return properties [property_name];
+			return TypeDescriptor.GetProperties (obj, 
+							     new Attribute [] { new BrowsableAttribute (true) })[property_name];
 		}
 
 		// 
@@ -186,5 +204,3 @@ namespace System.Windows.Forms
 		}
 	}
 }
-
-#endif
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
index 3d9320f..4aa74f7 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListBox.cs
@@ -137,7 +137,6 @@ namespace System.Windows.Forms
 			MouseMove += new MouseEventHandler (OnMouseMoveLB);
 			MouseUp += new MouseEventHandler (OnMouseUpLB);
 			MouseWheel += new MouseEventHandler (OnMouseWheelLB);
-			KeyDown += new KeyEventHandler (OnKeyDownLB);
 			KeyUp += new KeyEventHandler (OnKeyUpLB);
 			GotFocus += new EventHandler (OnGotFocus);
 			LostFocus += new EventHandler (OnLostFocus);
@@ -1205,6 +1204,17 @@ namespace System.Windows.Forms
 
 		protected override void WndProc (ref Message m)
 		{
+			if ((Msg)m.Msg == Msg.WM_KEYDOWN) {
+				if (ProcessKeyMessage (ref m))
+					m.Result = IntPtr.Zero;
+				else {
+					HandleKeyDown ((Keys)m.WParam.ToInt32 ());
+					DefWndProc (ref m);
+				}
+
+				return;
+			}
+
 			base.WndProc (ref m);
 		}
 
@@ -1335,7 +1345,8 @@ namespace System.Windows.Forms
 					rect.Width += hscrollbar.Value;
 				}
 
-				OnDrawItem (new DrawItemEventArgs (dc, Font, rect, i, state, ForeColor, BackColor));
+				Color fore_color = (state & DrawItemState.Selected) != 0 ? ThemeEngine.Current.ColorHighlightText : ForeColor;
+				OnDrawItem (new DrawItemEventArgs (dc, Font, rect, i, state, fore_color, BackColor));
 			}
 		}
 
@@ -1649,17 +1660,17 @@ namespace System.Windows.Forms
 			return true;
 		}
 
-		internal void OnKeyDownLB (object sender, KeyEventArgs e)
+		internal void HandleKeyDown (Keys key)
 		{
 			int new_item = -1;
 			
 			if (Items.Count == 0)
 				return;
 
-			if (KeySearch (e.KeyCode))
+			if (KeySearch (key))
 				return;
 
-			switch (e.KeyCode) {
+			switch (key) {
 				
 				case Keys.ControlKey:
 					ctrl_pressed = true;
@@ -2091,6 +2102,8 @@ namespace System.Windows.Forms
 			get {
 				if (string_format == null) {
 					string_format = new StringFormat ();
+					string_format.FormatFlags = StringFormatFlags.NoWrap;
+
 					if (RightToLeft == RightToLeft.Yes)
 						string_format.Alignment = StringAlignment.Far;
 					else
@@ -2196,7 +2209,7 @@ namespace System.Windows.Forms
 				show = true;
 				hscrollbar.Maximum = canvas_size.Width;
 				hscrollbar.LargeChange = Math.Max (0, items_area.Width);
-			} else if (horizontal_scrollbar) {
+			} else if (scroll_always_visible && horizontal_scrollbar) {
 				show = true;
 				enabled = false;
 				hscrollbar.Maximum = 0;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
index c46c174..a6ce911 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
@@ -1027,9 +1027,10 @@ namespace System.Windows.Forms
 					return this.items [0];
 				// do a hit test for the scrolled position
 				else {
+					int header_offset = header_control.Height;
 					for (int i = 0; i < items.Count; i++) {
 						Point item_loc = GetItemLocation (i);
-						if (item_loc.X >= 0 && item_loc.Y >= 0)
+						if (item_loc.X >= 0 && item_loc.Y - header_offset >= 0)
 							return items [i];
 					}
 					return null;
@@ -1044,7 +1045,8 @@ namespace System.Windows.Forms
 				if (value == null || value.ListView != this)
 					return;
 
-				EnsureVisible (value.Index);
+				// Take advantage this property is only valid for Details view.
+				SetScrollValue (v_scroll, item_size.Height * value.Index);
 			}
 #endif
 		}
@@ -1145,6 +1147,29 @@ namespace System.Windows.Forms
 					return 0;
 				
 				Size item_size = ItemSize;
+#if NET_2_0
+				// In virtual mode we always have fixed positions, and we can infer the positon easily
+				if (virtual_mode) {
+					int first = 0;
+					switch (view) {
+						case View.Details:
+							first = v_marker / item_size.Height;
+							break;
+						case View.LargeIcon:
+						case View.SmallIcon:
+							first = (v_marker / (item_size.Height + y_spacing)) * cols;
+							break;
+						case View.List:
+							first = (h_marker / (item_size.Width * x_spacing)) * rows;
+							break;
+					}
+
+					if (first >= items.Count)
+						first = items.Count;
+
+					return first;
+				}
+#endif
 				for (int i = 0; i < items.Count; i++) {
 					Rectangle item_rect = new Rectangle (GetItemLocation (i), item_size);
 					if (item_rect.Right >= 0 && item_rect.Bottom >= 0)
@@ -1344,25 +1369,30 @@ namespace System.Windows.Forms
 			text_size.Height += 2;
 		}
 
-		private void Scroll (ScrollBar scrollbar, int delta)
+		private void SetScrollValue (ScrollBar scrollbar, int val)
 		{
-			if (delta == 0 || !scrollbar.Visible)
-				return;
-
 			int max;
 			if (scrollbar == h_scroll)
 				max = h_scroll.Maximum - item_control.Width;
 			else
 				max = v_scroll.Maximum - item_control.Height;
 
-			int val = scrollbar.Value + delta;
 			if (val > max)
 				val = max;
 			else if (val < scrollbar.Minimum)
 				val = scrollbar.Minimum;
+
 			scrollbar.Value = val;
 		}
 
+		private void Scroll (ScrollBar scrollbar, int delta)
+		{
+			if (delta == 0 || !scrollbar.Visible)
+				return;
+
+			SetScrollValue (scrollbar, scrollbar.Value + delta);
+		}
+
 		private void CalculateScrollBars ()
 		{
 			Rectangle client_area = ClientRectangle;
@@ -1719,6 +1749,11 @@ namespace System.Windows.Forms
 		}
 #endif
 
+#if NET_2_0
+		// cache the spacing to let virtualmode compute the positions on the fly
+		int x_spacing;
+		int y_spacing;
+#endif
 		int rows;
 		int cols;
 		int[,] item_index_matrix;
@@ -1804,21 +1839,29 @@ namespace System.Windows.Forms
 			item_control.Visible = true;
 			item_control.Location = Point.Empty;
 			ItemSize = item_size; // Cache item size
+#if NET_2_0
+			this.x_spacing = x_spacing;
+			this.y_spacing = y_spacing;
+#endif
 
 			if (items.Count == 0)
 				return;
 
 			Size sz = item_size;
-#if NET_2_0
-			bool using_groups = UsingGroups;
-#endif
 
 			CalculateRowsAndCols (sz, left_aligned, x_spacing, y_spacing);
 
 			layout_wd = UseCustomColumnWidth ? cols * custom_column_width : cols * (sz.Width + x_spacing) - x_spacing;
 			layout_ht = rows * (sz.Height + y_spacing) - y_spacing;
+
 #if NET_2_0
-			if (using_groups)
+			if (virtual_mode) { // no actual assignment is needed on items for virtual mode
+				item_control.Size = new Size (layout_wd, layout_ht);
+				return;
+			}
+
+			bool using_groups = UsingGroups;
+			if (using_groups) // the groups layout will override layout_ht
 				CalculateGroupsLayout (sz, y_spacing, 0);
 #endif
 
@@ -1827,9 +1870,10 @@ namespace System.Windows.Forms
 			int display_index = 0;
 
 			for (int i = 0; i < items.Count; i++) {
+				ListViewItem item = items [i];
 #if NET_2_0
 				if (using_groups) {
-					ListViewGroup group = items [i].Group;
+					ListViewGroup group = item.Group;
 					if (group == null)
 						group = groups.DefaultGroup;
 
@@ -1871,19 +1915,12 @@ namespace System.Windows.Forms
 						}
 					}
 				}
-#if NET_2_0
-				if (!virtual_mode) 
-#endif
-				{
-					ListViewItem item = items [i];
-					item.Layout ();
-					item.DisplayIndex = display_index;
+
+				item.Layout ();
+				item.DisplayIndex = display_index;
 #if NET_2_0					
-					item.SetPosition (new Point (x, y));
+				item.SetPosition (new Point (x, y));
 #endif					
-				}
-
-
 			}
 
 			item_control.Size = new Size (layout_wd, layout_ht);
@@ -1909,7 +1946,7 @@ namespace System.Windows.Forms
 		int LayoutGroupHeader (ListViewGroup group, int y_origin, int item_height, int y_spacing, int rows)
 		{
 			Rectangle client_area = ClientRectangle;
-			int header_height = text_size.Height + 10;
+			int header_height = Font.Height + 15; // one line height + some padding
 
 			group.HeaderBounds = new Rectangle (0, y_origin, client_area.Width - v_scroll.Width, header_height);
 			group.items_area_location = new Point (0, y_origin + header_height);
@@ -1982,17 +2019,28 @@ namespace System.Windows.Forms
 			int item_height = GetDetailsItemHeight ();
 			ItemSize = new Size (0, item_height); // We only cache Height for details view
 			int y = header_control.Height;
+			layout_ht = y + (item_height * items.Count);
+			if (items.Count > 0 && grid_lines) // some space for bottom gridline
+				layout_ht += 2;
+
 #if NET_2_0
 			bool using_groups = UsingGroups;
 			if (using_groups) {
+				// Observe that this routines will override our layout_ht value
 				CalculateDetailsGroupItemsCount ();
 				CalculateGroupsLayout (ItemSize, 2, y);
 			}
+
+			if (virtual_mode) // no assgination on items is needed
+				return;
 #endif
 
 			for (int i = 0; i < items.Count; i++) {
 				ListViewItem item = items [i];
+
 				int display_index;
+				int item_y;
+
 #if NET_2_0
 				if (using_groups) {
 					ListViewGroup group = item.Group;
@@ -2003,42 +2051,33 @@ namespace System.Windows.Forms
 					Point group_items_loc = group.items_area_location;
 					display_index = group.starting_item + current_item;
 
-					y = current_item * (item_height + 2) + group_items_loc.Y;
-					SetItemLocation (display_index, 0, y, 0, 0);
+					y = item_y = current_item * (item_height + 2) + group_items_loc.Y;
+					SetItemLocation (display_index, 0, item_y, 0, 0);
 					SetItemAtDisplayIndex (display_index, i);
-					item.SetPosition (new Point (0, y));
 				} else
 #endif
 				{
 					display_index = i;
-					SetItemLocation (i, 0, y, 0, 0);
-#if NET_2_0					
-					item.SetPosition (new Point (0, y));
-#endif					
+					item_y = y;
+					SetItemLocation (i, 0, item_y, 0, 0);
 					y += item_height;
 				}
-#if NET_2_0
-				if (!virtual_mode) // Virtual mode sets Layout until draw time
-#endif
-				{
-					item.Layout ();
-					item.DisplayIndex = display_index;
-				}
 
+				item.Layout ();
+				item.DisplayIndex = display_index;
+#if NET_2_0					
+				item.SetPosition (new Point (0, item_y));
+#endif					
 			}
-
-			// some space for bottom gridline
-			if (items.Count > 0 && grid_lines)
-				y += 2;
-
-#if NET_2_0
-			if (!using_groups) // With groups it has been previously computed
-#endif
-				layout_ht = y;
 		}
 
 		private void AdjustItemsPositionArray (int count)
 		{
+#if  NET_2_0
+			// In virtual mode we compute the positions on the fly.
+			if (virtual_mode)
+				return;
+#endif
 			if (items_location.Length >= count)
 				return;
 
@@ -2092,20 +2131,60 @@ namespace System.Windows.Forms
 
 		internal Point GetItemLocation (int index)
 		{
-			Point loc = items_location [index];
+			Point loc = Point.Empty;
+#if NET_2_0
+			if (virtual_mode)
+				loc = GetFixedItemLocation (index);
+			else
+#endif
+				loc = items_location [index];
+
 			loc.X -= h_marker; // Adjust to scroll
 			loc.Y -= v_marker;
 
 			return loc;
 		}
 
+#if NET_2_0
+		Point GetFixedItemLocation (int index)
+		{
+			Point loc = Point.Empty;
+
+			switch (view) {
+				case View.LargeIcon:
+				case View.SmallIcon:
+					loc.X = index % cols * (item_size.Width + x_spacing);
+					loc.Y = index / cols * (item_size.Height + y_spacing);
+					break;
+				case View.List:
+					loc.X = index / rows * (item_size.Width + x_spacing);
+					loc.Y = index % rows * (item_size.Height + y_spacing);
+					break;
+				case View.Details:
+					loc.Y = header_control.Height + (index * item_size.Height);
+					break;
+			}
+
+			return loc;
+		}
+#endif
+
 		internal int GetItemIndex (int display_index)
 		{
+#if NET_2_0
+			if (virtual_mode)
+				return display_index; // no reordering in virtual mode.
+#endif
 			return reordered_items_indices [display_index];
 		}
 
 		internal ListViewItem GetItemAtDisplayIndex (int display_index)
 		{
+#if NET_2_0
+			// in virtual mode there's no reordering at all.
+			if (virtual_mode)
+				return items [display_index];
+#endif
 			return items [reordered_items_indices [display_index]];
 		}
 
@@ -2199,6 +2278,11 @@ namespace System.Windows.Forms
 				return result;
 			}
 
+#if NET_2_0
+			if (virtual_mode)
+				return GetFixedAdjustedIndex (key);
+#endif
+
 			ItemMatrixLocation item_matrix_location = items_matrix_location [FocusedItem.DisplayIndex];
 			int row = item_matrix_location.Row;
 			int col = item_matrix_location.Col;
@@ -2252,6 +2336,49 @@ namespace System.Windows.Forms
 			return items [adjusted_index].DisplayIndex;
 		}
 
+#if NET_2_0
+		// Used for virtual mode, where items *cannot* be re-arranged
+		int GetFixedAdjustedIndex (Keys key)
+		{
+			int result;
+
+			switch (key) {
+				case Keys.Left:
+					if (view == View.List)
+						result = focused_item_index - rows;
+					else
+						result = focused_item_index - 1;
+					break;
+				case Keys.Right:
+					if (view == View.List)
+						result = focused_item_index + rows;
+					else
+						result = focused_item_index + 1;
+					break;
+				case Keys.Up:
+					if (view != View.List)
+						result = focused_item_index - cols;
+					else
+						result = focused_item_index - 1;
+					break;
+				case Keys.Down:
+					if (view != View.List)
+						result = focused_item_index + cols;
+					else
+						result = focused_item_index + 1;
+					break;
+				default:
+					return -1;
+
+			}
+
+			if (result < 0 || result >= items.Count)
+				result = focused_item_index;
+
+			return result;
+		}
+#endif
+
 		ListViewItem selection_start;
 
 		private bool SelectItems (ArrayList sel_items)
@@ -2644,7 +2771,7 @@ namespace System.Windows.Forms
 					if (owner.View == View.Details) {
 						bool over_text = item.TextBounds.Contains (pt);
 						if (owner.FullRowSelect) {
-							clicked_item = owner.items [i];
+							clicked_item = item;
 							bool over_item_column = (me.X > owner.Columns[0].X && me.X < owner.Columns[0].X + owner.Columns[0].Width);
 							if (!over_text && over_item_column && owner.MultiSelect)
 								box_selecting = true;
@@ -3700,7 +3827,17 @@ namespace System.Windows.Forms
 				return;
 
 			Rectangle view_rect = item_control.ClientRectangle;
-			Rectangle bounds = new Rectangle (GetItemLocation (index), ItemSize);
+#if NET_2_0
+			// Avoid direct access to items in virtual mode, and use item bounds otherwise, since we could have reordered items
+			Rectangle bounds = virtual_mode ? new Rectangle (GetItemLocation (index), ItemSize) : items [index].Bounds;
+#else
+			Rectangle bounds = items [index].Bounds;
+#endif
+
+			if (view == View.Details && header_style != ColumnHeaderStyle.None) {
+				view_rect.Y += header_control.Height;
+				view_rect.Height -= header_control.Height;
+			}
 
 			if (view_rect.Contains (bounds))
 				return;
@@ -3712,8 +3849,8 @@ namespace System.Windows.Forms
 					h_scroll.Value += (bounds.Right - view_rect.Right);
 			}
 
-			if (bounds.Top < 0)
-				v_scroll.Value += bounds.Top;
+			if (bounds.Top < view_rect.Y)
+				v_scroll.Value += bounds.Top - view_rect.Y;
 			else if (bounds.Bottom > view_rect.Bottom)
 				v_scroll.Value += (bounds.Bottom - view_rect.Bottom);
 		}
@@ -5681,6 +5818,7 @@ namespace System.Windows.Forms
 				ListViewItem retval = args.Item;
 				retval.Owner = owner;
 				retval.DisplayIndex = displayIndex;
+				retval.Layout ();
 
 				return retval;
 			}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
index 1b182f4..805c2a2 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
@@ -740,12 +740,6 @@ namespace System.Windows.Forms
 				
 			Rectangle rect;
 
-#if NET_2_0
-			// Call Layout if bounds haven't been computed.
-			// since we can get different item instances at each invocation
-			if (owner.VirtualMode && bounds == Rectangle.Empty)
-				Layout ();
-#endif
 			switch (portion) {
 			case ItemBoundsPortion.Icon:
 				rect = icon_rect;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
index 2f12021..f7ff56d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
@@ -87,7 +87,7 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		void Deactivate ()
+		internal void Deactivate ()
 		{
 			bool redrawbar = (keynav_state != KeyNavState.Idle) && (TopMenu is MainMenu); 
 
@@ -680,6 +680,13 @@ namespace System.Windows.Forms {
 
 		public bool ProcessKeys (ref Message msg, Keys keyData)
 		{
+			// We should process Alt+key only if we don't have an active menu,
+			// and hide it otherwise.
+			if ((keyData & Keys.Alt) == Keys.Alt && active) {
+				Deactivate ();
+				return false;
+			}
+
 			// If we get Alt-F4, Windows will ignore it because we have a capture,
 			// release the capture and the program will exit.  (X11 doesn't care.)
 			if ((keyData & Keys.Alt) == Keys.Alt && (keyData & Keys.F4) == Keys.F4) {
@@ -784,7 +791,7 @@ namespace System.Windows.Forms {
 						SelectItem (item, item.MenuItems [0], false);
 						CurrentMenu = item;
 					}
-				} else {
+				} else if (!(CurrentMenu is ContextMenu)) { // ContextMenu root remains active.
 					HideSubPopups (CurrentMenu, TopMenu);
 					if (CurrentMenu.parent_menu != null)
 						CurrentMenu = CurrentMenu.parent_menu;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
index 986ed2b..27a71c0 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuStrip.cs
@@ -310,18 +310,6 @@ namespace System.Windows.Forms
 			return false;
 		}
 
-		internal bool ProcessImplicitMnemonic (char charCode)
-		{
-			string code = Char.ToUpper (charCode).ToString ();
-			
-			// If any item's text starts with our letter, it gets the message
-			foreach (ToolStripItem tsi in this.Items)
-				if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code))
-					return tsi.ProcessMnemonic (charCode);
-					
-			return false;
-		}
-		
 		private void ReorderMdiMenu ()
 		{
 			ToolStripItem[] loopitems = new ToolStripItem[this.mdi_window_list_item.DropDownItems.Count];
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs
index 02b3c17..3c1e25d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MessageBox.cs
@@ -190,6 +190,7 @@ namespace System.Windows.Forms
 				if (Owner != null)
 					TopMost = Owner.TopMost;
 					
+				XplatUI.AudibleAlert ();
 				this.ShowDialog ();
 
 				return this.DialogResult;
@@ -321,11 +322,11 @@ namespace System.Windows.Forms
 			protected override bool ProcessDialogChar (char charCode)
 			{
 				// Shortcut keys, kinda like mnemonics, except you don't have to press Alt
-				if ((charCode == 'N' || charCode == 'n') && (CancelButton as Button).Text == "No")
+				if ((charCode == 'N' || charCode == 'n') && (CancelButton != null && (CancelButton as Button).Text == "No"))
 					CancelButton.PerformClick ();
 				else if ((charCode == 'Y' || charCode == 'y') && (AcceptButton as Button).Text == "Yes")
 					AcceptButton.PerformClick ();
-				else if ((charCode == 'A' || charCode == 'a') && (CancelButton as Button).Text == "Abort")
+				else if ((charCode == 'A' || charCode == 'a') && (CancelButton != null && (CancelButton as Button).Text == "Abort"))
 					CancelButton.PerformClick ();
 				else if ((charCode == 'R' || charCode == 'r') && (AcceptButton as Button).Text == "Retry")
 					AcceptButton.PerformClick ();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
index 9e4898f..319d637 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs
@@ -1125,31 +1125,27 @@ namespace System.Windows.Forms {
 #endif
 		
 		// i think this is overriden to not allow the control to be changed to an arbitrary size
-		protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) {
-			if ((specified & BoundsSpecified.Height) == BoundsSpecified.Height ||
-				(specified & BoundsSpecified.Width) == BoundsSpecified.Width ||
-				(specified & BoundsSpecified.Size) == BoundsSpecified.Size) {
-				// only allow sizes = default size to be set
-				Size min_size = DefaultSize;
-				Size max_size = new Size (
-					DefaultSize.Width + SingleMonthSize.Width + calendar_spacing.Width,
-					DefaultSize.Height + SingleMonthSize.Height + calendar_spacing.Height);
-				int x_mid_point = (max_size.Width + min_size.Width)/2;
-				int y_mid_point = (max_size.Height + min_size.Height)/2;
-				if (width < x_mid_point) {
-					width = min_size.Width;
-				} else {
-					width = max_size.Width;
-				}
-				if (height < y_mid_point) {
-					height = min_size.Height;
-				} else {
-					height = max_size.Height;
-				}
-				base.SetBoundsCore (x, y, width, height, specified);
+		protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) 
+		{
+			// only allow sizes = default size to be set
+			Size default_size = DefaultSize;
+			Size min_size = default_size;
+			Size max_size = new Size (default_size.Width + SingleMonthSize.Width + calendar_spacing.Width,
+					default_size.Height + SingleMonthSize.Height + calendar_spacing.Height);
+			int x_mid_point = (max_size.Width + min_size.Width)/2;
+			int y_mid_point = (max_size.Height + min_size.Height)/2;
+
+			if (width < x_mid_point) {
+				width = min_size.Width;
+			} else {
+				width = max_size.Width;
+			}
+			if (height < y_mid_point) {
+				height = min_size.Height;
 			} else {
-				base.SetBoundsCore (x, y, width, height, specified);
+				height = max_size.Height;
 			}
+			base.SetBoundsCore (x, y, width, height, specified);
 		}
 
 		protected override void WndProc (ref Message m) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
index b19c69a..89e7b0a 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintControllerWithStatusDialog.cs
@@ -40,7 +40,6 @@ namespace System.Windows.Forms
 
 		#region Public Constructors
 
-		[MonoTODO("Localize Dialog Title")]
 		public PrintControllerWithStatusDialog(PrintController underlyingController) {
 			this.underlyingController = underlyingController;
 			dialog = new PrintingDialog();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintDialog.cs
index 2c48f8f..07806aa 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintDialog.cs
@@ -229,7 +229,7 @@ namespace System.Windows.Forms
 		}
 
 #if NET_2_0
-		[MonoTODO ("Stub, not implemented")]
+		[MonoTODO ("Stub, not implemented, will always use default dialog")]
 		[DefaultValue (false)]
 		public bool UseEXDialog {
 			get { return use_ex_dialog; }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintPreviewDialog.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintPreviewDialog.cs
index 5ac9f93..df29d03 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintPreviewDialog.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PrintPreviewDialog.cs
@@ -64,7 +64,9 @@ namespace System.Windows.Forms {
 
 			print_preview = new PrintPreviewControl();
 			print_preview.Location = new Point (0, toolbar.Location.Y + toolbar.Size.Height);
-			print_preview.Dock = DockStyle.Fill;
+			print_preview.Size = new Size (ClientSize.Width, ClientSize.Height - toolbar.Bottom);
+			print_preview.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
+			print_preview.TabStop = false;
 			Controls.Add (print_preview);
 			print_preview.Show ();
 		}
@@ -83,7 +85,7 @@ namespace System.Windows.Forms {
 			MenuItem mi;
 			mag_menu = new ContextMenu ();
 
-			ToolBar toolbar = new ToolBar();
+			ToolBar toolbar = new PrintToolBar();
 			ToolBarButton print = new ToolBarButton();
 			ToolBarButton zoom = new ToolBarButton();
 			ToolBarButton separator1 = new ToolBarButton();
@@ -105,6 +107,7 @@ namespace System.Windows.Forms {
 			toolbar.Appearance = ToolBarAppearance.Flat;
 			toolbar.ShowToolTips = true;
 			toolbar.DropDownArrows = true;
+			toolbar.TabStop = true;
 			toolbar.Buttons.AddRange(new ToolBarButton[] { print, zoom, separator1, 
 														   one_page, two_page, three_page, four_page, six_page, separator2 });
 			toolbar.ButtonClick += new ToolBarButtonClickEventHandler (OnClickToolBarButton);
@@ -187,7 +190,7 @@ namespace System.Windows.Forms {
 			/* close button */
 			close.Location = new Point(196, 2);
 			close.Size = new Size(50, 20);
-			close.TabIndex = 2;
+			close.TabIndex = 0;
 			close.FlatStyle = FlatStyle.Popup;
 			close.Text = "Close";
 			close.Click += new EventHandler (CloseButtonClicked);
@@ -202,6 +205,117 @@ namespace System.Windows.Forms {
 			return toolbar;
 		}
 
+		class PrintToolBar : ToolBar
+		{
+			bool left_pressed;
+
+			public int GetNext (int pos)
+			{
+				// Select the next button that is *not* a separator
+				while (++pos < items.Length && items [pos].Button.Style == ToolBarButtonStyle.Separator)
+					;
+
+				return pos;
+			}
+
+			public int GetPrev (int pos)
+			{
+				// Select the previous button that is *not* a separator
+				while (--pos > -1 && items [pos].Button.Style == ToolBarButtonStyle.Separator)
+					;
+
+				return pos;
+			}
+
+			void SelectNextOnParent (bool forward)
+			{
+				ContainerControl container = Parent as ContainerControl;
+				if (container != null && container.ActiveControl != null)
+					container.SelectNextControl (container.ActiveControl, forward, true, true, true);
+			}
+
+			protected override void OnGotFocus (EventArgs args)
+			{
+				base.OnGotFocus (args);
+
+				// Select either the last one or the first one, depending on the direction
+				CurrentItem = (Control.ModifierKeys & Keys.Shift) != 0 || left_pressed ? GetPrev (items.Length) : 0;
+				left_pressed = false;
+			}
+
+			// We need to handle Left/Right for our controls by ourselves, as opposed to
+			// Tab
+			protected override bool ProcessDialogKey (Keys keyData)
+			{
+				switch ((keyData & Keys.KeyCode)) {
+					case Keys.Left:
+						left_pressed = true; // Simulate Tab+Alt if focus goes to our buttons
+						SelectNextOnParent (false);
+						return true;
+					case Keys.Right:
+						SelectNextOnParent (true);
+						return true;
+				}
+
+				return base.ProcessDialogKey (keyData);
+			}
+
+			void NavigateItems (Keys key)
+			{
+				bool forward = true;
+				switch ((key & Keys.KeyCode)) {
+					case Keys.Left:
+						forward = false;
+						break;
+					case Keys.Right:
+						forward = true;
+						break;
+					case Keys.Tab:
+						forward = (Control.ModifierKeys & Keys.Shift) == 0;
+						break;
+				}
+
+				int pos = forward ? GetNext (CurrentItem) : GetPrev (CurrentItem);
+				if (pos < 0 || pos >= items.Length) { // go to the prev/next control
+					CurrentItem = -1;
+					SelectNextOnParent (forward);
+					return;
+				}
+				
+				CurrentItem = pos;
+			}
+
+			bool OnDropDownButton {
+				get {
+					return CurrentItem != -1 && items [CurrentItem].Button.Style == ToolBarButtonStyle.DropDownButton;
+				}
+			}
+
+			internal override bool InternalPreProcessMessage (ref Message msg)
+			{
+				Keys key = (Keys)msg.WParam.ToInt32 ();
+				switch (key) {
+					// Up/Down keys are processed only if we are
+					// on a dropdown button, and ignored otherwise.
+					case Keys.Up:
+					case Keys.Down:
+						if (OnDropDownButton)
+							break; // process base impl.
+						return true;
+					case Keys.Left:
+					case Keys.Right:
+					case Keys.Tab:
+						if (OnDropDownButton)
+							((ContextMenu)(items [CurrentItem].Button.DropDownMenu)).Hide ();
+
+						NavigateItems (key);
+						return true;
+				}
+
+				return base.InternalPreProcessMessage (ref msg);
+			}
+		}
+
 		void CloseButtonClicked (object sender, EventArgs e)
 		{
 			Close ();
@@ -855,7 +969,7 @@ namespace System.Windows.Forms {
 			set { base.WindowState = value; }
 		}
 
-		[MonoTODO("Throw InvalidPrinterException")]
+		[MonoInternalNote ("Throw InvalidPrinterException")]
 		protected override void CreateHandle() {
 
 //			if (this.Document != null && !this.Document.PrinterSettings.IsValid) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs
index aceffee..6d6dcfa 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ProgressBar.cs
@@ -404,7 +404,7 @@ namespace System.Windows.Forms
 			
 		[Localizable(true)]
 		[DefaultValue(false)]
-		[MonoTODO ("Layout is currently always from left to right")]
+		[MonoTODO ("RTL is not supported")]
 		public virtual bool RightToLeftLayout {
 				get { return right_to_left_layout;}
 				set	{ 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
index a7c32a7..06b34b6 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGrid.cs
@@ -174,7 +174,9 @@ namespace System.Windows.Forms
 								      new PropertyToolBarSeparator (),
 								      propertypages_toolbarbutton});
 			//toolbar.ButtonSize = new System.Drawing.Size (20, 20);
-			toolbar.ItemClicked += new ToolStripItemClickedEventHandler (toolbar_ButtonClick);
+			categorized_toolbarbutton.Click += new EventHandler (toolbarbutton_clicked);
+			alphabetic_toolbarbutton.Click += new EventHandler (toolbarbutton_clicked);
+			propertypages_toolbarbutton.Click += new EventHandler (toolbarbutton_clicked);
 #else
 			toolbar.Buttons.AddRange(new ToolBarButton [] {categorized_toolbarbutton,
 								      alphabetic_toolbarbutton,
@@ -430,10 +432,6 @@ namespace System.Windows.Forms
 				return help_panel.BackColor;
 			}
 			set {
-				if (help_panel.BackColor == value) {
-					return;
-				}
-
 				help_panel.BackColor = value;
 			}
 		}
@@ -447,10 +445,6 @@ namespace System.Windows.Forms
 			}
 
 			set {
-				if (help_panel.ForeColor == value) {
-					return;
-				}
-
 				help_panel.ForeColor = value;
 			}
 		}
@@ -463,10 +457,7 @@ namespace System.Windows.Forms
 			}
 
 			set {
-				if (help_panel.Visible == value) {
-					return;
-				}
-
+				splitter.Visible = value;
 				help_panel.Visible = value;
 			}
 		}
@@ -898,6 +889,13 @@ namespace System.Windows.Forms
 			}
 		}
 
+#if NET_2_0
+		private void toolbarbutton_clicked (object o, EventArgs args)
+		{
+			toolbar_Clicked (o as PropertyToolBarButton);
+		}
+#endif
+
 		private void SelectPropertyTab (PropertyTab propertyTab)
 		{
 			if (propertyTab != null && selected_tab != propertyTab) {
@@ -1077,7 +1075,7 @@ namespace System.Windows.Forms
 			return tab;
 		}
 		
-		[MonoTODO]
+		[MonoTODO ("Never called")]
 		protected void OnComComponentNameChanged(ComponentRenameEventArgs e)
 		{
 			ComponentRenameEventHandler eh = (ComponentRenameEventHandler)(Events [ComComponentNameChangedEvent]);
@@ -1319,41 +1317,37 @@ namespace System.Windows.Forms
 		#endregion
 
 		#region Com2Interop.IComPropertyBrowser Interface
-		[MonoTODO]
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
 		bool ComponentModel.Com2Interop.IComPropertyBrowser.InPropertySet {
 			get {
 				throw new NotImplementedException();
 			}
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		void ComponentModel.Com2Interop.IComPropertyBrowser.DropDownDone ()
 		{
-			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Not implemented, will throw NotImplementedException")]
 		bool ComponentModel.Com2Interop.IComPropertyBrowser.EnsurePendingChangesCommitted ()
 		{
 			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		void ComponentModel.Com2Interop.IComPropertyBrowser.HandleF4 ()
 		{
-			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		void ComponentModel.Com2Interop.IComPropertyBrowser.LoadState (Microsoft.Win32.RegistryKey optRoot)
 		{
-			throw new NotImplementedException ();
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		void ComponentModel.Com2Interop.IComPropertyBrowser.SaveState (Microsoft.Win32.RegistryKey optRoot)
 		{
-			throw new NotImplementedException ();
 		}
 
 		static object ComComponentNameChangedEvent = new object ();
@@ -1564,12 +1558,7 @@ namespace System.Windows.Forms
 			return null;
 		}
 
-#if NET_2_0
-		private void toolbar_ButtonClick (object sender, ToolStripItemClickedEventArgs e)
-		{
-			toolbar_Clicked (e.ClickedItem as PropertyToolBarButton);
-		}
-#else
+#if !NET_2_0
 		private void toolbar_ButtonClick (object sender, ToolBarButtonClickEventArgs e)
 		{
 			toolbar_Clicked (e.Button as PropertyToolBarButton);
@@ -1803,7 +1792,7 @@ namespace System.Windows.Forms
 		}
 
 
-		[MonoTODO ("not sure what this class does, but it's listed as a type converter for a property in this class, and this causes problems if it's not present")]
+		[MonoInternalNote ("not sure what this class does, but it's listed as a type converter for a property in this class, and this causes problems if it's not present")]
 		private class SelectedObjectConverter : TypeConverter
 		{
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs
index fdd6297..4590900 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyManager.cs
@@ -150,7 +150,7 @@ namespace System.Windows.Forms {
 			return String.Empty;
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		protected override void UpdateIsBinding ()
 		{
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs
index dcdd4a6..14ca465 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RadioButton.cs
@@ -114,16 +114,14 @@ namespace System.Windows.Forms {
 			radiobutton_alignment = ContentAlignment.MiddleLeft;
 			TextAlign = ContentAlignment.MiddleLeft;
 			TabStop = false;
-
-			GotFocus += new EventHandler (GotFocusHandler);
 		}
 		#endregion	// Public Constructors
 
 		#region Private Methods
 
-		// if we get focus, and no RadioButton in the parent control is
-		// checked, mark Checked as true for us
-		private void GotFocusHandler (object o, EventArgs args)
+		// When getting OnEnter we need to set Checked as true in case none of the sibling radio
+		// buttons is checked.
+		private void PerformDefaultCheck ()
 		{
 			// if we are already checked, no need to check the other controls
 			if (!auto_check || Checked)
@@ -353,6 +351,7 @@ namespace System.Windows.Forms {
 		}
 
 		protected override void OnEnter(EventArgs e) {
+			PerformDefaultCheck ();
 			base.OnEnter(e);
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
index f1c87d1..44e6328 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RichTextBox.cs
@@ -48,6 +48,7 @@ namespace System.Windows.Forms {
 		internal bool		auto_word_select;
 		internal int		bullet_indent;
 		internal bool		detect_urls;
+		private bool		reuse_line;	// Sometimes we are loading text with already available lines
 		internal int		margin_right;
 		internal float		zoom;
 		private StringBuilder	rtf_line;
@@ -229,7 +230,7 @@ namespace System.Windows.Forms {
 		}
 
 #if NET_2_0
-		[MonoTODO ("Stub")]
+		[MonoTODO ("Stub, does nothing")]
 		[DefaultValue (false)]
 		public bool EnableAutoDragDrop {
 			get { return enable_auto_drag_drop; }
@@ -274,7 +275,7 @@ namespace System.Windows.Forms {
 		}
 
 #if NET_2_0
-		[MonoTODO ("Stub")]
+		[MonoTODO ("Stub, does nothing")]
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public RichTextBoxLanguageOptions LanguageOption {
@@ -302,7 +303,6 @@ namespace System.Windows.Forms {
 
 		[Browsable(false)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
 		public string RedoActionName {
 			get {
 				return document.undo.RedoActionName;
@@ -310,7 +310,7 @@ namespace System.Windows.Forms {
 		}
 
 #if NET_2_0
-		[MonoTODO ("Stub")]
+		[MonoTODO ("Stub, does nothing")]
 		[Browsable (false)]
 		[DefaultValue (true)]
 		[EditorBrowsable (EditorBrowsableState.Never)]
@@ -322,7 +322,8 @@ namespace System.Windows.Forms {
 
 		[DefaultValue(0)]
 		[Localizable(true)]
-		[MonoTODO("Teach TextControl.RecalculateLine to consider the right margin as well")]
+		[MonoTODO ("Stub, does nothing")]
+		[MonoInternalNote ("Teach TextControl.RecalculateLine to consider the right margin as well")]
 		public int RightMargin {
 			get {
 				return margin_right;
@@ -407,10 +408,24 @@ namespace System.Windows.Forms {
 				sel_start = document.LineTagToCharIndex(document.selection_start.line, document.selection_start.pos);
 
 				data = new MemoryStream(Encoding.ASCII.GetBytes(value), false);
-				InsertRTFFromStream(data, document.selection_start.pos, document.selection_start.line.line_no, out x, out y, out chars);
+				int cursor_x = document.selection_start.pos;
+				int cursor_y = document.selection_start.line.line_no;
+
+				// The RFT parser by default, when finds our x cursor in 0, it thinks if needs to
+				// add a new line; but in *this* scenario the line is already created, so force it to reuse it.
+				// Hackish, but works without touching the heart of the buggy parser.
+				if (cursor_x == 0)
+					reuse_line = true;
+
+				InsertRTFFromStream(data, cursor_x, cursor_y, out x, out y, out chars);
 				data.Close();
 
-				document.CharIndexToLineTag(sel_start + chars + (y - document.selection_start.line.line_no) * 2, out line, out tag, out sel_start);
+				int nl_length = document.LineEndingLength (XplatUI.RunningOnUnix ? LineEnding.Rich : LineEnding.Hard);
+				document.CharIndexToLineTag(sel_start + chars + (y - document.selection_start.line.line_no) * nl_length, 
+						out line, out tag, out sel_start);
+				if (sel_start >= line.text.Length)
+					sel_start = line.text.Length -1;
+
 				document.SetSelection(line, sel_start);
 				document.PositionCaret(line, sel_start);
 				document.DisplayCaret();
@@ -487,7 +502,7 @@ namespace System.Windows.Forms {
 		}
 
 #if NET_2_0
-		[MonoTODO ("Stub")]
+		[MonoTODO ("Stub, does nothing")]
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public Color SelectionBackColor {
@@ -499,7 +514,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(false)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public bool SelectionBullet {
 			get {
 				return false;
@@ -512,7 +527,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(0)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public int SelectionCharOffset {
 			get {
 				return 0;
@@ -641,7 +656,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(0)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public int SelectionHangingIndent {
 			get {
 				return 0;
@@ -654,7 +669,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(0)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public int SelectionIndent {
 			get {
 				return 0;
@@ -679,7 +694,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(false)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public bool SelectionProtected {
 			get {
 				return false;
@@ -692,7 +707,7 @@ namespace System.Windows.Forms {
 		[Browsable(false)]
 		[DefaultValue(0)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public int SelectionRightIndent {
 			get {
 				return 0;
@@ -704,7 +719,7 @@ namespace System.Windows.Forms {
 
 		[Browsable(false)]
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public int[] SelectionTabs {
 			get {
 				return new int[0];
@@ -732,7 +747,7 @@ namespace System.Windows.Forms {
 		}
 
 		[DefaultValue(false)]
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		public bool ShowSelectionMargin {
 			get {
 				return false;
@@ -1017,13 +1032,8 @@ namespace System.Windows.Forms {
 			ScrollToCaret ();
 		}
 
-		[MonoTODO("Make smarter RTF detection?")]
 		public void LoadFile(string path) {
-			if (path.EndsWith(".rtf")) {
-				LoadFile(path, RichTextBoxStreamType.RichText);
-			} else {
-				LoadFile(path, RichTextBoxStreamType.PlainText);
-			}
+			LoadFile (path, RichTextBoxStreamType.RichText);
 		}
 
 		public void LoadFile(string path, RichTextBoxStreamType fileType) {
@@ -1082,7 +1092,9 @@ namespace System.Windows.Forms {
 					}
 
 					for (i = 1; i < document.Lines; i++) {
-						bytes = encoding.GetBytes(document.GetLine(i).text.ToString());
+						// Normalize the new lines to the system ones
+						string line_text = document.GetLine (i).TextWithoutEnding () + Environment.NewLine;
+						bytes = encoding.GetBytes(line_text);
 						data.Write(bytes, 0, bytes.Length);
 					}
 					bytes = encoding.GetBytes(document.GetLine(document.Lines).text.ToString());
@@ -1190,7 +1202,7 @@ namespace System.Windows.Forms {
 				eh (this, e);
 		}
 
-		[MonoTODO("Determine when to call this")]
+		[MonoTODO ("Stub, never called")]
 		protected virtual void OnImeChange(EventArgs e) {
 			EventHandler eh = (EventHandler)(Events [ImeChangeEvent]);
 			if (eh != null)
@@ -1354,7 +1366,7 @@ namespace System.Windows.Forms {
 			remove { base.QueryContinueDrag -= value; }
 		}
 
-		[MonoTODO("Currently does not ever fire")]
+		[MonoTODO ("Event never raised")]
 		public event EventHandler SelectionChanged {
 			add { Events.AddHandler (SelectionChangedEvent, value); }
 			remove { Events.RemoveHandler (SelectionChangedEvent, value); }
@@ -1424,7 +1436,7 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO("Add QuadJust support for justified alignment")]
+		[MonoInternalNote ("Add QuadJust support for justified alignment")]
 		private void HandleControl(RTF.RTF rtf) {
 			switch(rtf.Major) {
 				case RTF.Major.Unicode: {
@@ -1742,11 +1754,11 @@ namespace System.Windows.Forms {
 
 			rtf_chars += rtf_line.Length;
 
-
-
-			if (rtf_cursor_x == 0) {
-				if (newline && rtf_line.ToString ().EndsWith ("\n") == false)
-					rtf_line.Append ("\n");
+			// Try to re-use if we are told so - this usually happens when we are inserting a flow of rtf text
+			// with an already alive line.
+			if (rtf_cursor_x == 0 && !reuse_line) {
+				if (newline && rtf_line.ToString ().EndsWith (Environment.NewLine) == false)
+					rtf_line.Append (Environment.NewLine);
 
 				document.Add (rtf_cursor_y, rtf_line.ToString (), rtf_style.rtf_rtfalign, font, rtf_style.rtf_color,
 								newline ? LineEnding.Rich : LineEnding.Wrap);
@@ -1769,9 +1781,11 @@ namespace System.Windows.Forms {
 					line = document.GetLine (rtf_cursor_y);
 					line.ending = LineEnding.Rich;
 
-					if (line.Text.EndsWith ("\n") == false)
-						line.Text += "\n";
+					if (line.Text.EndsWith (Environment.NewLine) == false)
+						line.Text += Environment.NewLine;
 				}
+
+				reuse_line = false; // sanity assignment - in this case we have already re-used one line.
 			}
 
 			if (newline) {
@@ -1927,7 +1941,7 @@ namespace System.Windows.Forms {
 			}
 		}
 
-		[MonoTODO("Emit unicode and other special characters properly")]
+		[MonoInternalNote ("Emit unicode and other special characters properly")]
 		private void EmitRTFText(StringBuilder rtf, string text) {
 			rtf.Append(text);
 		}
@@ -2006,7 +2020,7 @@ namespace System.Windows.Forms {
 			sb.Append(String.Format("\\deff{0}", fonts.IndexOf(this.Font.Name)));
 
 			// Default Language 
-			sb.Append("\\deflang1033\n");	// FIXME - always 1033?
+			sb.Append("\\deflang1033" + Environment.NewLine);	// FIXME - always 1033?
 
 			// Emit the font table
 			sb.Append("{\\fonttbl");
@@ -2017,7 +2031,8 @@ namespace System.Windows.Forms {
 				sb.Append((string)fonts[i]);		// Font name
 				sb.Append(";}");			// }
 			}
-			sb.Append("}\n");
+			sb.Append("}");
+			sb.Append(Environment.NewLine);
 
 			// Emit the color table (if needed)
 			if ((colors.Count > 1) || ((((Color)colors[0]).R != this.ForeColor.R) || (((Color)colors[0]).G != this.ForeColor.G) || (((Color)colors[0]).B != this.ForeColor.B))) {
@@ -2028,7 +2043,8 @@ namespace System.Windows.Forms {
 					sb.Append(String.Format("\\blue{0}", ((Color)colors[i]).B));
 					sb.Append(";");
 				}
-				sb.Append("}\n");
+				sb.Append("}");
+				sb.Append(Environment.NewLine);
 			}
 
 			sb.Append("{\\*\\generator Mono RichTextBox;}");
@@ -2087,14 +2103,16 @@ namespace System.Windows.Forms {
 				}
 				if (pos >= line.text.Length) {
 					if (line.ending != LineEnding.Wrap) {
-						sb.Append("\\par\n");
+						sb.Append("\\par");
+						sb.Append(Environment.NewLine);
 					}
 				}
 				pos = 0;
 				line_no++;
 			}
 
-			sb.Append("}\n");
+			sb.Append("}");
+			sb.Append(Environment.NewLine);
 
 			return sb;
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RootGridEntry.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RootGridEntry.cs
index 4392807..b2fdc96 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RootGridEntry.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/RootGridEntry.cs
@@ -31,7 +31,7 @@ namespace System.Windows.Forms.PropertyGridInternal
 	/// <summary>
 	/// Summary description for PropertyGridRootGridItem
 	/// </summary>
-	[MonoTODO ("needs to implement IRootGridEntry")]
+	[MonoInternalNote ("needs to implement IRootGridEntry")]
 	internal class RootGridEntry : GridEntry /*, IRootGridEntry */
 	{
 		object[] val;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
index 4a6652a..f4d6003 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
@@ -568,7 +568,7 @@ namespace System.Windows.Forms {
 			}
 
 			set {
-				if (hscrollbar.VisibleInternal != value) {
+				if (!AutoScroll && hscrollbar.VisibleInternal != value) {
 					force_hscroll_visible = value;
 					Recalculate (false);
 				}
@@ -581,7 +581,7 @@ namespace System.Windows.Forms {
 			}
 
 			set {
-				if (vscrollbar.VisibleInternal != value) {
+				if (!AutoScroll && vscrollbar.VisibleInternal != value) {
 					force_vscroll_visible = value;
 					Recalculate (false);
 				}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SplitContainer.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SplitContainer.cs
index c85b582..534fc57 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SplitContainer.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SplitContainer.cs
@@ -51,6 +51,7 @@ namespace System.Windows.Forms
 		private int splitter_increment;
 		private Rectangle splitter_rectangle;
 		private Rectangle splitter_rectangle_moving;
+		private Rectangle splitter_rectangle_before_move;
 		private bool splitter_fixed;
 		private bool splitter_dragging;
 		private int splitter_prev_move;
@@ -425,7 +426,7 @@ namespace System.Windows.Forms
 
 		[Localizable (true)]
 		[DefaultValue (1)]
-		[MonoTODO ("Not implemented.")]
+		[MonoTODO ("Stub, never called")]
 		public int SplitterIncrement {
 			get { return this.splitter_increment; }
 			set { this.splitter_increment = value; }
@@ -457,7 +458,7 @@ namespace System.Windows.Forms
 
 		[DispId (-516)]
 		[DefaultValue (true)]
-		[MonoTODO ("Special focus semantics not implemented")]
+		[MonoTODO ("Stub, never called")]
 		new public bool TabStop {
 			get { return false; }
 			set { }
@@ -499,7 +500,6 @@ namespace System.Windows.Forms
 			return new SplitContainerTypedControlCollection (this);
 		}
 
-		[MonoTODO ("Special focus semantics not implemented")]
 		protected override void OnGotFocus (EventArgs e)
 		{
 			base.OnGotFocus (e);
@@ -580,13 +580,11 @@ namespace System.Windows.Forms
 			base.OnRightToLeftChanged (e);
 		}
 
-		[MonoTODO ("Special focus semantics not implemented")]
 		protected override bool ProcessDialogKey (Keys keyData)
 		{
 			return base.ProcessDialogKey (keyData);
 		}
 
-		[MonoTODO ("Special focus semantics not implemented")]
 		protected override bool ProcessTabKey (bool forward)
 		{
 			return base.ProcessTabKey (forward);
@@ -598,7 +596,6 @@ namespace System.Windows.Forms
 			base.ScaleControl (factor, specified);
 		}
 		
-		[MonoTODO ("Special focus semantics not implemented")]
 		protected override void Select (bool directed, bool forward)
 		{
 			base.Select (directed, forward);
@@ -632,6 +629,7 @@ namespace System.Windows.Forms
 		{
 			splitter_prev_move = orientation == Orientation.Vertical ? location.X : location.Y;
 			splitter_rectangle_moving = splitter_rectangle;
+			splitter_rectangle_before_move = splitter_rectangle;
 		}
 
 		private void SplitterMove (Point location)
@@ -693,8 +691,15 @@ namespace System.Windows.Forms
 		private void SplitterEndMove (Point location, bool cancel)
 		{
 			if (!cancel) {
-				splitter_rectangle = splitter_rectangle_moving;
-				UpdateSplitter ();
+				// Prevent updating the splitter distance if the user changes it in e.g. the
+				// DoubleClick handler, but no delta move has happened in our drag-handling. 
+				// We don't compare to splitter_rectangle for exactly that reason here 
+				// (if it gets changed externally) and compare to a cached value.
+				// 
+				if (splitter_rectangle_before_move != splitter_rectangle_moving) {
+					splitter_rectangle = splitter_rectangle_moving;
+					UpdateSplitter ();
+				}
 			}
 			SplitterEventArgs args = new SplitterEventArgs (location.X, location.Y, 
 									splitter_rectangle.X, splitter_rectangle.Y);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
index 9b2b1af..0b296d0 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Splitter.cs
@@ -62,6 +62,7 @@ namespace System.Windows.Forms {
 		private int			split_requested;	// If the user requests a position before we have ever laid out the doc
 		private int 			splitter_prev_move;
 		private Rectangle 		splitter_rectangle_moving;
+		private int			moving_offset;
 		#endregion	// Local Variables
 
 		#region Constructors
@@ -266,25 +267,38 @@ namespace System.Windows.Forms {
 
 				int widths = 0;
 				int heights = 0;
+				int vert_offset = 0;
+				int horiz_offset = 0;
 				foreach (Control c in this.Parent.Controls) {
 					if (c != affected) {
 						switch (c.Dock) {
 						case DockStyle.Left:
 						case DockStyle.Right:
 							widths += c.Width;
+
+							if (c.Location.X < this.Location.X)
+								vert_offset += c.Width;
 							break;
 						case DockStyle.Top:
 						case DockStyle.Bottom:
 							heights += c.Height;
+
+							if (c.Location.Y < this.Location.Y)
+								horiz_offset += c.Height;
 							break;
 						}
 					}
 				}
 
-				if (horizontal)
+				if (horizontal) {
+					moving_offset = horiz_offset;
+
 					return Parent.ClientSize.Height - heights - MinExtra;
-				else
+				} else {
+					moving_offset = vert_offset;
+
 					return Parent.ClientSize.Width - widths - MinExtra;
+				}
 			}
 		}
 		
@@ -448,8 +462,8 @@ namespace System.Windows.Forms {
 			int delta = currentMove - splitter_prev_move;
 			Rectangle prev_location = splitter_rectangle_moving;
 			bool moved = false;
-			int min = this.MinSize;
-			int max = max_size;
+			int min = this.MinSize + moving_offset;
+			int max = max_size + moving_offset;
 
 			if (horizontal) {
 				if (splitter_rectangle_moving.Y + delta > min && splitter_rectangle_moving.Y + delta < max) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
index 8549b48..78c229e 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs
@@ -231,7 +231,7 @@ namespace System.Windows.Forms {
 		}
 
 #if NET_2_0
-		[MonoTODO ("Saves the value and raises event, but needs actual implementation call")]
+		[MonoTODO ("RTL not supported")]
 		[Localizable (true)]
 		[DefaultValue (false)]
 		public virtual bool RightToLeftLayout {
@@ -770,6 +770,10 @@ namespace System.Windows.Forms {
 
 		protected override void OnKeyDown (KeyEventArgs ke)
 		{
+			base.OnKeyDown (ke);
+			if (ke.Handled)
+				return;
+
 			if (ke.KeyCode == Keys.Tab && (ke.KeyData & Keys.Control) != 0) {
 				if ((ke.KeyData & Keys.Shift) == 0)
 					SelectedIndex = (SelectedIndex + 1) % TabCount;
@@ -784,8 +788,6 @@ namespace System.Windows.Forms {
 				ke.Handled = true;
 			} else if (NavigateTabs (ke.KeyCode))
 				ke.Handled = true;
-
-			base.OnKeyDown (ke);
 		}
 
 		protected override bool IsInputKey (Keys keyData)
@@ -1203,7 +1205,7 @@ namespace System.Windows.Forms {
 			if (SizeMode == TabSizeMode.Fixed) {
 				width = item_size.Width;
 			} else {			
-				width = MeasureStringWidth (DeviceContext, page.Text, Font);
+				width = MeasureStringWidth (DeviceContext, page.Text, page.Font);
 				width += (Padding.X * 2) + 2;
 
 				if (ImageList != null && page.ImageIndex >= 0 && page.ImageIndex < ImageList.Images.Count) {
@@ -1626,9 +1628,14 @@ namespace System.Windows.Forms {
 				// We don't want to raise SelectedIndexChanged until after we
 				// have removed from the collection, so TabCount will be
 				// correct for the user.
-				if (change_index && Count > 0)
-					owner.SelectedIndex--;
-				else if (change_index) {
+				if (change_index && Count > 0) {
+					// Clear the selected index internally, to avoid trying to access the previous
+					// selected tab when setting the new one - this is what .net seems to do
+					int prev_selected_index = owner.SelectedIndex;
+					owner.selected_index = -1;
+
+					owner.SelectedIndex = --prev_selected_index;
+				} else if (change_index) {
 					owner.selected_index = -1;
 					owner.OnSelectedIndexChanged (EventArgs.Empty);
 				} else
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
index f26b1bd..4964b96 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBox.cs
@@ -133,20 +133,24 @@ namespace System.Windows.Forms {
 			auto_complete_listbox.Scroll (-lines);
 		}
 
-		private void ShowAutoCompleteListBox (bool is_backspace)
+		// Receives either WM_KEYDOWN or WM_CHAR that will likely need the generation/lookup
+		// of new matches
+		private void ProcessAutoCompleteInput (ref Message m, bool deleting_chars)
+		{
+			// Need to call base.WndProc before to have access to
+			// the updated Text property value
+			base.WndProc (ref m);
+			auto_complete_original_text = Text;
+			ShowAutoCompleteListBox (deleting_chars);
+		}
+
+		private void ShowAutoCompleteListBox (bool deleting_chars)
 		{
 			// 
 			// We only support CustomSource by now
 			//
 
-			IList source;
-			if (auto_complete_cb_source == null)
-				source = auto_complete_custom_source;
-			else
-				source = auto_complete_cb_source.Items;
-
-			if (source == null || source.Count == 0)
-				return;
+			IList source = auto_complete_cb_source == null ? auto_complete_custom_source : (IList)auto_complete_cb_source.Items;
 
 			bool append = auto_complete_mode == AutoCompleteMode.Append || auto_complete_mode == AutoCompleteMode.SuggestAppend;
 			bool suggest = auto_complete_mode == AutoCompleteMode.Suggest || auto_complete_mode == AutoCompleteMode.SuggestAppend;
@@ -192,7 +196,7 @@ namespace System.Windows.Forms {
 				auto_complete_listbox.ShowListBox ();
 			}
 
-			if (append && !is_backspace)
+			if (append && !deleting_chars)
 				AppendAutoCompleteMatch (0);
 
 			document.MoveCaret (CaretDirection.End);
@@ -204,14 +208,16 @@ namespace System.Windows.Forms {
 				auto_complete_listbox.HideListBox (false);
 		}
 
-		bool IsAutoCompleteAvailable {
+		internal bool IsAutoCompleteAvailable {
 			get {
 				if (auto_complete_source == AutoCompleteSource.None || auto_complete_mode == AutoCompleteMode.None)
 					return false;
 
-				// We only support CustomSource by now
-				if (auto_complete_source != AutoCompleteSource.CustomSource || auto_complete_custom_source == null ||
-						auto_complete_custom_source.Count == 0)
+				// We only support CustomSource by now, as well as an internal custom source used by ComboBox
+				if (auto_complete_source != AutoCompleteSource.CustomSource)
+					return false;
+				IList custom_source = auto_complete_cb_source == null ? auto_complete_custom_source : (IList)auto_complete_cb_source.Items;
+				if (custom_source == null || custom_source.Count == 0)
 					return false;
 
 				return true;
@@ -318,6 +324,11 @@ namespace System.Windows.Forms {
 			SelectionLength = auto_complete_matches [index].Length - auto_complete_original_text.Length;
 		}
 
+		// this is called when the user selects a value from the autocomplete list
+		// *with* the mouse
+		internal virtual void OnAutoCompleteValueSelected (EventArgs args)
+		{
+		}
 #endif
 
 		private void UpdateAlignment ()
@@ -672,6 +683,9 @@ namespace System.Windows.Forms {
 							if (auto_complete_listbox != null && auto_complete_listbox.Visible)
 								auto_complete_listbox.HideListBox (false);
 							break;
+						case Keys.Delete:
+							ProcessAutoCompleteInput (ref m, true);
+							return;
 						default:
 							break;
 					}
@@ -680,20 +694,12 @@ namespace System.Windows.Forms {
 					if (!IsAutoCompleteAvailable)
 						break;
 
-					bool is_backspace = m.WParam.ToInt32 () == 8;
-					if (!Char.IsLetterOrDigit ((char)m.WParam) && !is_backspace)
+					// Don't handle either Enter or Esc - they are handled in the WM_KEYDOWN case
+					int char_value = m.WParam.ToInt32 ();
+					if (char_value == 13 || char_value == 27)
 						break;
-					
-					if (!is_backspace)
-						Text = auto_complete_original_text;
-
-					document.MoveCaret (CaretDirection.End);
 
-					// Need to call base.WndProc before to have access to
-					// the updated Text property value
-					base.WndProc (ref m);
-					auto_complete_original_text = Text;
-					ShowAutoCompleteListBox (is_backspace);
+					ProcessAutoCompleteInput (ref m, char_value == 8);
 					return;
 #endif
 				case Msg.WM_LBUTTONDOWN:
@@ -1046,6 +1052,7 @@ namespace System.Windows.Forms {
 				if (item_idx != -1 && !resizing)
 					HideListBox (true);
 
+				owner.OnAutoCompleteValueSelected (EventArgs.Empty); // internal
 				resizing = false;
 				Capture = false;
 			}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
index a4e145e..243b923 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
@@ -487,7 +487,12 @@ namespace System.Windows.Forms
 		[EditorBrowsable(EditorBrowsableState.Advanced)]
 		public int PreferredHeight {
 			get {
-				return Font.Height + (BorderStyle == BorderStyle.None ? 0 : 7);
+				if (BorderStyle != BorderStyle.None)
+					return Font.Height + 7;
+
+				// usually in borderless mode the top margin is 0, but
+				// try to access it, in case it was set manually, as ToolStrip* controls do
+				return Font.Height + TopMargin;
 			}
 		}
 
@@ -665,8 +670,6 @@ namespace System.Windows.Forms
 						CalculateDocument ();
 				}
 
-				// set the var so OnModifiedChanged is not raised
-				modified = false;
 				OnTextChanged(EventArgs.Empty);
 			}
 		}
@@ -779,11 +782,13 @@ namespace System.Windows.Forms
 			//
 			has_been_focused = true;
 
+			Modified = false;
 			OnTextChanged(EventArgs.Empty);
 		}
 
 		public void Clear ()
 		{
+			Modified = false;
 			Text = string.Empty;
 		}
 
@@ -815,6 +820,7 @@ namespace System.Windows.Forms
 			document.ReplaceSelection (String.Empty, false);
 			document.undo.EndUserAction ();
 
+			Modified = true;
 			OnTextChanged (EventArgs.Empty);
 		}
 
@@ -868,11 +874,13 @@ namespace System.Windows.Forms
 			return String.Concat (base.ToString (), ", Text: ", Text);
 		}
 
-		[MonoTODO("Deleting is classed as Typing, instead of its own Undo event")]
+		[MonoInternalNote ("Deleting is classed as Typing, instead of its own Undo event")]
 		public void Undo ()
 		{
-			if (document.undo.Undo ())
+			if (document.undo.Undo ()) {
+				Modified = true;
 				OnTextChanged (EventArgs.Empty);
+			}
 		}
 
 #if NET_2_0
@@ -1224,6 +1232,8 @@ namespace System.Windows.Forms
 					document.AlignCaret();
 					document.UpdateCaret();
 					CaretMoved(this, null);
+
+					Modified = true;
 					OnTextChanged (EventArgs.Empty);
 		
 					return true;
@@ -1377,6 +1387,7 @@ namespace System.Windows.Forms
 						document.InsertCharAtCaret ('\t', true);
 
 						CaretMoved(this, null);
+						Modified = true;
 						OnTextChanged (EventArgs.Empty);
 
 						return true;
@@ -1479,8 +1490,10 @@ namespace System.Windows.Forms
 
 			CaretMoved (this, null);
 
-			if (fire_changed)
+			if (fire_changed) {
+				Modified = true;
 				OnTextChanged(EventArgs.Empty);
+			}
 		}
 
 		private void HandleEnter ()
@@ -1500,6 +1513,7 @@ namespace System.Windows.Forms
 				
 				document.UpdateView (line, document.Lines - line.line_no, 0);
 				CaretMoved (this, null);
+				Modified = true;
 				OnTextChanged (EventArgs.Empty);
 			}
 		}
@@ -1579,6 +1593,7 @@ namespace System.Windows.Forms
 						OnTextUpdate ();
 #endif
 						CaretMoved (this, null);
+						Modified = true;
 						OnTextChanged(EventArgs.Empty);
 
 					} else {
@@ -1770,6 +1785,15 @@ namespace System.Windows.Forms
 			}
 		}
 
+		internal int TopMargin {
+			get {
+				return document.top_margin;
+			}
+			set {
+				document.top_margin = value;
+			}
+		}
+
 		#region UIA Framework Properties
 
 		internal ScrollBar UIAHScrollBar {
@@ -2433,6 +2457,7 @@ namespace System.Windows.Forms
 				document.undo.BeginUserAction (Locale.GetText ("Paste"));
 				((RichTextBox)this).SelectedRtf = (string)clip.GetData(DataFormats.Rtf);
 				document.undo.EndUserAction ();
+				Modified = true;
 				return true;
 			} else if (format.Name == DataFormats.Bitmap) {
 				document.undo.BeginUserAction (Locale.GetText ("Paste"));
@@ -2464,6 +2489,7 @@ namespace System.Windows.Forms
 				}
 			}
 
+			Modified = true;
 			return true;
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
index 9de29ae..9ada43e 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
@@ -1989,6 +1989,11 @@ namespace System.Windows.Forms {
 			base_line = line.line_no;
 			old_line_count = lines;
 
+			// Discard chars after any possible -unlikely- end of file
+			int eof_index = s.IndexOf ('\0');
+			if (eof_index != -1)
+				s = s.Substring (0, eof_index);
+
 			break_index = GetLineEnding (s, 0, out ending, LineEnding.Hard | LineEnding.Rich);
 
 			// There are no line feeds in our text to be pasted
@@ -2191,10 +2196,17 @@ namespace System.Windows.Forms {
 			if ((pos == 0 && forward == false) || (pos == line.text.Length && forward == true))
 				return;
 			
-			if (forward)
+			undo.BeginUserAction ("Delete");
+
+			if (forward) {
+				undo.RecordDeleteString (line, pos, line, pos + 1);
 				DeleteChars (line, pos, 1);
-			else
+			} else {
+				undo.RecordDeleteString (line, pos - 1, line, pos);
 				DeleteChars (line, pos - 1, 1);
+			}
+
+			undo.EndUserAction ();
 		}
 
 		// Combine two lines
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
index fe0ecb3..599ae0f 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
@@ -576,7 +576,7 @@ namespace System.Windows.Forms
 			else return value;
 		}
 
-		[MonoTODO("Figure out where to point for My Network Places")]
+		[MonoInternalNote ("Figure out where to point for My Network Places")]
 		public virtual string Places(UIIcon index) {
 			switch (index) {
 				case UIIcon.PlacesRecentDocuments: {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs
index 33d9b66..421a469 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeVisualStyles.cs
@@ -2071,7 +2071,7 @@ namespace System.Windows.Forms
 		}
 		#endregion
 		#region TreeView
-		[MonoTODO("Use the sizing information provided by the VisualStyles API.")]
+		[MonoInternalNote ("Use the sizing information provided by the VisualStyles API.")]
 		public override void TreeViewDrawNodePlusMinus (TreeView treeView, TreeNode node, Graphics dc, int x, int middle)
 		{
 			if (!RenderClientAreas) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
index bb9b950..9d691cd 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs
@@ -2223,6 +2223,7 @@ namespace System.Windows.Forms
 
 			// PaintCells at row, column
 			int column_cnt = grid.FirstVisibleColumn + grid.VisibleColumnCount;
+			DataGridCell current_cell = grid.CurrentCell;
 
 			if (column_cnt > 0) {
 				Region prev_clip = g.Clip;
@@ -2243,14 +2244,24 @@ namespace System.Windows.Forms
 						current_clip.Intersect (prev_clip);
 						g.Clip = current_clip;
 
+						Brush colBackBrush = backBrush;
+						Brush colForeBrush = foreBrush;
+
+						// If we are in the precise cell we are editing, then use the normal colors
+						// even if we are selected.
+						if (grid.is_editing && column == current_cell.ColumnNumber && row == current_cell.RowNumber) {
+							colBackBrush = ResPool.GetSolidBrush (grid.BackColor);
+							colForeBrush = ResPool.GetSolidBrush (grid.ForeColor);
+						}
+
 						if (is_newrow) {
 							grid.CurrentTableStyle.GridColumnStyles[column].PaintNewRow (g, rect_cell, 
-														     backBrush,
-														     foreBrush);
+														     colBackBrush,
+														     colForeBrush);
 						} else {
 							grid.CurrentTableStyle.GridColumnStyles[column].Paint (g, rect_cell, grid.ListManager, row,
-													       backBrush,
-													       foreBrush,
+													       colBackBrush,
+													       colForeBrush,
 													       grid.RightToLeft == RightToLeft.Yes);
 						}
 
@@ -3164,7 +3175,7 @@ namespace System.Windows.Forms
 			Rectangle header_bounds = group.HeaderBounds;
 			text_bounds.Offset (8, 0);
 			text_bounds.Inflate (-8, 0);
-			Size text_size = control.text_size;
+			int text_height = control.Font.Height + 2; // add a tiny padding between the text and the group line
 
 			Font font = new Font (control.Font, control.Font.Style | FontStyle.Bold);
 			Brush brush = new LinearGradientBrush (new Point (header_bounds.Left, 0), new Point (header_bounds.Left + ListViewGroupLineWidth, 0), 
@@ -3186,8 +3197,8 @@ namespace System.Windows.Forms
 
 			sformat.LineAlignment = StringAlignment.Near;
 			dc.DrawString (group.Header, font, SystemBrushes.ControlText, text_bounds, sformat);
-			dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_size.Height, header_bounds.Left + ListViewGroupLineWidth, 
-					header_bounds.Top + text_size.Height);
+			dc.DrawLine (pen, header_bounds.Left, header_bounds.Top + text_height, header_bounds.Left + ListViewGroupLineWidth, 
+					header_bounds.Top + text_height);
 
 			sformat.Dispose ();
 			font.Dispose ();
@@ -7093,7 +7104,7 @@ namespace System.Windows.Forms
 
 		}
 
-		[MonoTODO]
+		[MonoInternalNote ("Does not respect Mixed")]
 		public override void CPDrawMixedCheckBox (Graphics graphics, Rectangle rectangle, ButtonState state)
 		{
 			CPDrawCheckBox (graphics, rectangle, state);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
index ba4a1ee..00a1605 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBar.cs
@@ -525,6 +525,8 @@ namespace System.Windows.Forms
 		}
 
 #if NET_2_0
+		private ToolBarButton button_for_focus = null;
+		
 		internal void UIAPerformClick (ToolBarButton button)
 		{
 			ToolBarItem previous_item = current_item;
@@ -539,15 +541,16 @@ namespace System.Windows.Forms
 			try {
 				if (current_item == null)
 					throw new ArgumentException ("button", "The button specified is not part of this toolbar");
-				OnButtonClick (new ToolBarButtonClickEventArgs (button));
+				PerformButtonClick (new ToolBarButtonClickEventArgs (button));
 			} finally {
 				current_item = previous_item;
 			}
 		}
 #endif
 
-		protected virtual void OnButtonClick (ToolBarButtonClickEventArgs e)
+		void PerformButtonClick (ToolBarButtonClickEventArgs e)
 		{
+			// Only change pushed for ToogleButton
 			if (e.Button.Style == ToolBarButtonStyle.ToggleButton) {
 				if (! e.Button.Pushed)
 					e.Button.Pushed = true;
@@ -558,6 +561,15 @@ namespace System.Windows.Forms
 			current_item.Pressed = false;
 			current_item.Invalidate ();
 			
+#if NET_2_0
+			button_for_focus = current_item.Button;
+			button_for_focus.UIAHasFocus = true;
+#endif
+			OnButtonClick (e);
+		}
+
+		protected virtual void OnButtonClick (ToolBarButtonClickEventArgs e)
+		{			
 			ToolBarButtonClickEventHandler eh = (ToolBarButtonClickEventHandler)(Events [ButtonClickEvent]);
 			if (eh != null)
 				eh (this, e);
@@ -572,10 +584,13 @@ namespace System.Windows.Forms
 			if (e.Button.DropDownMenu == null)
 				return;
 
-			ToolBarItem item = current_item;
+			ShowDropDownMenu (current_item);
+		}
 
+		internal void ShowDropDownMenu (ToolBarItem item)
+		{
 			Point loc = new Point (item.Rectangle.X + 1, item.Rectangle.Bottom + 1);
-			((ContextMenu) e.Button.DropDownMenu).Show (this, loc);
+			((ContextMenu) item.Button.DropDownMenu).Show (this, loc);
 
 			item.DDPressed = false;
 			item.Hilight = false;
@@ -640,7 +655,7 @@ namespace System.Windows.Forms
 		{
 			if (msg.Msg == (int)Msg.WM_KEYDOWN) {
 				Keys key_data = (Keys)msg.WParam.ToInt32();
-				if (HandleKeyDown (key_data))
+				if (HandleKeyDown (ref msg, key_data))
 					return true;
 			} 
 			return base.InternalPreProcessMessage (ref msg);
@@ -649,8 +664,30 @@ namespace System.Windows.Forms
 		#endregion Protected Methods
 
 		#region Private Methods
+		internal int CurrentItem {
+			get {
+				return Array.IndexOf (items, current_item);
+			}
+			set {
+				if (current_item != null)
+					current_item.Hilight = false;
+
+				current_item = value == -1 ? null : items [value];
+
+				if (current_item != null)
+					current_item.Hilight = true;
+			}
+
+		}
+
 		private void FocusChanged (object sender, EventArgs args)
 		{
+#if NET_2_0
+			if (!Focused && button_for_focus != null)
+				button_for_focus.UIAHasFocus = false;
+			button_for_focus = null;
+#endif
+			
 			if (Appearance != ToolBarAppearance.Flat || Buttons.Count == 0)
 				return;
 
@@ -674,11 +711,15 @@ namespace System.Windows.Forms
 			}
 		}
 
-		private bool HandleKeyDown (Keys key_data)
+		private bool HandleKeyDown (ref Message msg, Keys key_data)
 		{
 			if (Appearance != ToolBarAppearance.Flat || Buttons.Count == 0)
 				return false;
 
+			// Handle the key as needed if the current item is a dropdownbutton.
+			if (HandleKeyOnDropDown (ref msg, key_data))
+				return true;
+
 			switch (key_data) {
 				case Keys.Left:
 				case Keys.Up:
@@ -688,9 +729,39 @@ namespace System.Windows.Forms
 				case Keys.Down:
 					HighlightButton (1);
 					return true;
-				default:
-					return false;
+				case Keys.Enter:
+				case Keys.Space:
+					if (current_item != null) {
+						OnButtonClick (new ToolBarButtonClickEventArgs (current_item.Button));
+						return true;
+					}
+					break;
+			}
+
+			return false;
+		}
+
+		bool HandleKeyOnDropDown (ref Message msg, Keys key_data)
+		{
+			if (current_item == null || current_item.Button.Style != ToolBarButtonStyle.DropDownButton ||
+					current_item.Button.DropDownMenu == null)
+				return false;
+
+			Menu dropdown_menu = current_item.Button.DropDownMenu;
+
+			if (dropdown_menu.Tracker.active) {
+				dropdown_menu.ProcessCmdKey (ref msg, key_data);
+				return true; // always true if the menu is active
 			}
+
+			if (key_data == Keys.Up || key_data == Keys.Down) {
+				current_item.DDPressed = true;
+				current_item.Invalidate ();
+				OnButtonDropDown (new ToolBarButtonClickEventArgs (current_item.Button));
+				return true;
+			}
+
+			return false;
 		}
 
 		void HighlightButton (int offset)
@@ -720,7 +791,9 @@ namespace System.Windows.Forms
 
 			if (curr_item != null)
 				curr_item.Hilight = false;
-			(enabled [next] as ToolBarItem).Hilight = true;
+
+			current_item = enabled [next] as ToolBarItem;
+			current_item.Hilight = true;
 		}
 
 		private void ToolBar_BackgroundImageChanged (object sender, EventArgs args)
@@ -798,7 +871,7 @@ namespace System.Windows.Forms
 					// Fire a ButtonClick
 					current_item = item;
 					if ((item.Pressed) && ((me.Button & MouseButtons.Left) == MouseButtons.Left))
-						OnButtonClick (new ToolBarButtonClickEventArgs (item.Button));
+						PerformButtonClick (new ToolBarButtonClickEventArgs (item.Button));
 				} else if (item.Pressed) {
 					item.Pressed = false;
 					item.Invalidate ();
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
index 7cdf093..f55ea29 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolBarButton.cs
@@ -318,7 +318,19 @@ namespace System.Windows.Forms
 		}
 		
 #if NET_2_0
-		static object UIATextChangedEvent = new object ();
+		bool uiaHasFocus = false;
+		internal bool UIAHasFocus {
+			get { return UIAHasFocus; }
+			set {
+				uiaHasFocus = value;
+				EventHandler eh = 
+					(EventHandler) (value ? Events [UIAGotFocusEvent] : Events [UIALostFocusEvent]);
+				if (eh != null)
+					eh (this, EventArgs.Empty);
+			}
+		}		
+
+                static object UIATextChangedEvent = new object ();
 		
 		internal event EventHandler UIATextChanged {
 			add { Events.AddHandler (UIATextChangedEvent, value); }
@@ -331,8 +343,22 @@ namespace System.Windows.Forms
 			if (eh != null)
 				eh (this, e);
 		}
-#endif
 
+
+		static object UIAGotFocusEvent = new object ();
+		static object UIALostFocusEvent = new object ();
+		
+		internal event EventHandler UIAGotFocus {
+			add { Events.AddHandler (UIAGotFocusEvent, value); }
+			remove { Events.RemoveHandler (UIAGotFocusEvent, value); }
+		}
+		
+		internal event EventHandler UIALostFocus {
+			add { Events.AddHandler (UIALostFocusEvent, value); }
+			remove { Events.RemoveHandler (UIALostFocusEvent, value); }
+		}
+#endif
+		
 		#endregion Internal Methods
 		
 		#region methods
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
index 043a61f..352da8f 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
@@ -127,13 +127,13 @@ namespace System.Windows.Forms
 		#endregion
 
 		#region Public Properties
-		[MonoTODO ()]
+		[MonoTODO ("Stub, does nothing")]
 		public override bool AllowDrop {
 			get { return base.AllowDrop; }
 			set { base.AllowDrop = value; }
 		}
-		
-		[MonoTODO ()]
+
+		[MonoTODO ("Stub, does nothing")]
 		[DefaultValue (false)]
 		public bool AllowItemReorder {
 			get { return this.allow_item_reorder; }
@@ -723,8 +723,10 @@ namespace System.Windows.Forms
 		protected override void Dispose (bool disposing)
 		{
 			if (!IsDisposed) {
-				foreach (ToolStripItem tsi in Items)
-					tsi.Dispose ();
+				// ToolStripItem.Dispose modifes the collection,
+				// so we iterate it in reverse order
+				for (int i = Items.Count - 1; i >= 0; i--)
+					Items [i].Dispose ();
 					
 				if (this.overflow_button != null && this.overflow_button.drop_down != null)
 					this.overflow_button.drop_down.Dispose ();
@@ -734,7 +736,7 @@ namespace System.Windows.Forms
 			}
 		}
 
-		[MonoTODO ("Not called")]
+		[MonoTODO ("Stub, never called")]
 		protected virtual void OnBeginDrag (EventArgs e)
 		{
 			EventHandler eh = (EventHandler)(Events[BeginDragEvent]);
@@ -747,7 +749,7 @@ namespace System.Windows.Forms
 			base.OnDockChanged (e);
 		}
 
-		[MonoTODO ("Not called")]
+		[MonoTODO ("Stub, never called")]
 		protected virtual void OnEndDrag (EventArgs e)
 		{
 			EventHandler eh = (EventHandler)(Events[EndDragEvent]);
@@ -882,8 +884,7 @@ namespace System.Windows.Forms
 				if (this is MenuStrip && mouse_currently_over is ToolStripMenuItem && !(mouse_currently_over as ToolStripMenuItem).HasDropDownItems)
 					return;
 			} else {
-				if (this is MenuStrip)
-					this.HideMenus (true, ToolStripDropDownCloseReason.AppClicked);
+				this.HideMenus (true, ToolStripDropDownCloseReason.AppClicked);
 			}
 			
 			if (this is MenuStrip)
@@ -1132,21 +1133,20 @@ namespace System.Windows.Forms
 			string code = Char.ToUpper (charCode).ToString ();
 			
 			// If any item's text starts with our letter, it gets the message
-			if (this is ToolStripDropDownMenu)
+			if ((Control.ModifierKeys & Keys.Alt) != 0 || this is ToolStripDropDownMenu)
 				foreach (ToolStripItem tsi in this.Items)
 					if (tsi.Enabled && tsi.Visible && !string.IsNullOrEmpty (tsi.Text) && tsi.Text.ToUpper ().StartsWith (code) && !(tsi is ToolStripControlHost))
 						return tsi.ProcessMnemonic (charCode);
 
 			return base.ProcessMnemonic (charCode);
 		}
-		
-		[MonoTODO ()]
+
+		[MonoTODO ("Stub, does nothing")]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		protected virtual void RestoreFocus ()
 		{
 		}
 
-		[MonoTODO ()]
 		protected override void Select (bool directed, bool forward)
 		{
 			foreach (ToolStripItem tsi in this.DisplayedItems)
@@ -1230,7 +1230,7 @@ namespace System.Windows.Forms
 			remove { base.AutoSizeChanged -= value; }
 		}
 
-		[MonoTODO ()]
+		[MonoTODO ("Event never raised")]
 		public event EventHandler BeginDrag {
 			add { Events.AddHandler (BeginDragEvent, value); }
 			remove { Events.RemoveHandler (BeginDragEvent, value); }
@@ -1262,7 +1262,7 @@ namespace System.Windows.Forms
 			remove { base.CursorChanged -= value; }
 		}
 
-		[MonoTODO ()]
+		[MonoTODO ("Event never raised")]
 		public event EventHandler EndDrag {
 			add { Events.AddHandler (EndDragEvent, value); }
 			remove { Events.RemoveHandler (EndDragEvent, value); }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripControlHost.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripControlHost.cs
index 6fb53ff..92b6299 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripControlHost.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripControlHost.cs
@@ -47,6 +47,7 @@ namespace System.Windows.Forms
 			this.control = c;
 			this.control_align = ContentAlignment.MiddleCenter;
 			this.control.TabStop = false;
+			this.control.Resize += ControlResizeHandler;
 			this.Size = DefaultSize;
 			this.OnSubscribeControlEvents (this.control);
 		}
@@ -250,7 +251,7 @@ namespace System.Windows.Forms
 				if (control == null)
 					return new Size (23, 23);
 
-				return control.GetPreferredSize (Size.Empty);
+				return control.Size;
 			}
 		}
 		#endregion
@@ -316,9 +317,17 @@ namespace System.Windows.Forms
 			if (eh != null)
 				eh (this, e);
 		}
+
+		void ControlResizeHandler (object obj, EventArgs args)
+		{
+			OnHostedControlResize (args);
+		}
 		
 		protected virtual void OnHostedControlResize (EventArgs e)
 		{
+			// Since the control size has been just adjusted, only update the location
+			if (control != null)
+				control.Location = AlignInRectangle (this.Bounds, control.Size, this.control_align).Location;
 		}
 		
 		protected virtual void OnKeyDown (KeyEventArgs e)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDown.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDown.cs
index 1603856..23474e5 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDown.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDown.cs
@@ -232,9 +232,12 @@ namespace System.Windows.Forms
 			get { return this.owner_item; }
 			set { this.owner_item = value; 
 				
-				if (this.owner_item != null)
+				if (this.owner_item != null) {
 					if (this.owner_item.Owner != null && this.owner_item.Owner.RenderMode != ToolStripRenderMode.ManagerRenderMode)
 						this.Renderer = this.owner_item.Owner.Renderer;
+
+					Font = owner_item.Font;
+				}
 			}
 		}
 
@@ -577,7 +580,7 @@ namespace System.Windows.Forms
 
 		protected override void OnLayout (LayoutEventArgs e)
 		{
-			// Find the widest menu item
+			// Find the widest menu item, so we know how wide to make our dropdown
 			int widest = 0;
 
 			foreach (ToolStripItem tsi in this.Items) {
@@ -586,12 +589,13 @@ namespace System.Windows.Forms
 					
 				tsi.SetPlacement (ToolStripItemPlacement.Main);
 				
-				if (tsi.GetPreferredSize (Size.Empty).Width > widest)
-					widest = tsi.GetPreferredSize (Size.Empty).Width;
+				widest = Math.Max (widest, tsi.GetPreferredSize (Size.Empty).Width + tsi.Margin.Horizontal);
 			}
 			
+			// Add any padding our dropdown has set
+			widest += this.Padding.Horizontal;
+			
 			int x = this.Padding.Left;
-			widest += 68 - this.Padding.Horizontal;
 			int y = this.Padding.Top;
 
 			foreach (ToolStripItem tsi in this.Items) {
@@ -602,13 +606,17 @@ namespace System.Windows.Forms
 
 				int height = 0;
 
-				if (tsi is ToolStripSeparator)
+				Size preferred_size = tsi.GetPreferredSize (Size.Empty);
+
+				if (preferred_size.Height > 22)
+					height = preferred_size.Height;
+				else if (tsi is ToolStripSeparator)
 					height = 7;
 				else
 					height = 22;
 
 				tsi.SetBounds (new Rectangle (x, y, widest, height));
-				y += tsi.Height + tsi.Margin.Bottom;
+				y += height + tsi.Margin.Bottom;
 			}
 
 			this.Size = new Size (widest + this.Padding.Horizontal, y + this.Padding.Bottom);// + 2);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownButton.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownButton.cs
index b578689..288ecc0 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownButton.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownButton.cs
@@ -104,7 +104,9 @@ namespace System.Windows.Forms
 		#region Protected Methods
 		protected override ToolStripDropDown CreateDefaultDropDown ()
 		{
-			return base.CreateDefaultDropDown ();
+			ToolStripDropDownMenu tsdd = new ToolStripDropDownMenu ();
+			tsdd.OwnerItem = this;
+			return tsdd;
 		}
 
 		protected override void OnMouseDown (MouseEventArgs e)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs
index d880899..5465739 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownItem.cs
@@ -73,7 +73,10 @@ namespace System.Windows.Forms
 			
 				return this.drop_down;
 			}
-			set { this.drop_down = value; }
+			set { 
+				this.drop_down = value;
+				this.drop_down.OwnerItem = this;
+			}
 		}
 
 		[Browsable (false)]
@@ -223,6 +226,11 @@ namespace System.Windows.Forms
 		protected override void OnFontChanged (EventArgs e)
 		{
 			base.OnFontChanged (e);
+
+			// don't use DropDown directly, since doing that
+			// would created the DropDown control
+			if (drop_down != null)
+				drop_down.Font = Font;
 		}
 
 		protected override void OnRightToLeftChanged (EventArgs e)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownMenu.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownMenu.cs
index 482763f..22aa34d 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownMenu.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripDropDownMenu.cs
@@ -140,14 +140,18 @@ namespace System.Windows.Forms
 				y += tsi.Margin.Top;
 
 				int height = 0;
+	
+				Size preferred_size = tsi.GetPreferredSize (Size.Empty);
 
-				if (tsi is ToolStripSeparator)
+				if (preferred_size.Height > 22)
+					height = preferred_size.Height;
+				else if (tsi is ToolStripSeparator)
 					height = 7;
 				else
 					height = 22;
 
 				tsi.SetBounds (new Rectangle (x, y, widest, height));
-				y += tsi.Height + tsi.Margin.Bottom;
+				y += height + tsi.Margin.Bottom;
 			}
 
 			this.Size = new Size (widest + this.Padding.Horizontal, y + this.Padding.Bottom);// + 2);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
index 4bd5fcf..d5c2d77 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
@@ -223,7 +223,7 @@ namespace System.Windows.Forms
 			}
 		}
 
-		[MonoTODO]
+		[MonoTODO ("Stub, does nothing")]
 		[Browsable (false)]
 		[DefaultValue (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
@@ -671,7 +671,7 @@ namespace System.Windows.Forms
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public virtual bool Pressed { get { return this.is_pressed; } }
 
-		[MonoTODO ("Stub, not implemented")]
+		[MonoTODO ("RTL not implemented")]
 		[Localizable (true)]
 		public virtual RightToLeft RightToLeft {
 			get { return this.right_to_left; }
@@ -859,7 +859,7 @@ namespace System.Windows.Forms
 		#endregion
 
 		#region Public Methods
-		[MonoTODO ("Stub")]
+		[MonoTODO ("Stub, does nothing")]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public DragDropEffects DoDragDrop (Object data, DragDropEffects allowedEffects)
 		{
@@ -924,11 +924,11 @@ namespace System.Windows.Forms
 		{
 			if (!this.is_selected && this.CanSelect) {
 				this.is_selected = true;
-			
-				if (this.Parent != null) {	
+				
+				if (this.Parent != null) {
 					if (this.Visible && this.Parent.Focused && this is ToolStripControlHost)
 						(this as ToolStripControlHost).Focus ();
-					
+						
 					this.Invalidate ();
 					this.Parent.NotifySelectedChanged (this);
 				}
@@ -958,6 +958,9 @@ namespace System.Windows.Forms
 				StopAnimation ();
 				image = null;
 			}
+
+			if (owner != null)
+				owner.Items.Remove (this);
 			
 			base.Dispose (disposing);
 		}
@@ -1173,6 +1176,7 @@ namespace System.Windows.Forms
 		protected internal virtual void OnOwnerFontChanged (EventArgs e)
 		{
 			this.CalculateAutoSize ();
+			OnFontChanged (EventArgs.Empty);
 		}
 		
 		protected virtual void OnPaint (PaintEventArgs e)
@@ -1348,7 +1352,7 @@ namespace System.Windows.Forms
 			remove {Events.RemoveHandler (DoubleClickEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event DragEventHandler DragDrop {
@@ -1356,7 +1360,7 @@ namespace System.Windows.Forms
 			remove { Events.RemoveHandler (DragDropEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event DragEventHandler DragEnter {
@@ -1364,7 +1368,7 @@ namespace System.Windows.Forms
 			remove { Events.RemoveHandler (DragEnterEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event EventHandler DragLeave {
@@ -1372,7 +1376,7 @@ namespace System.Windows.Forms
 			remove { Events.RemoveHandler (DragLeaveEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event DragEventHandler DragOver {
@@ -1390,7 +1394,7 @@ namespace System.Windows.Forms
 			remove {Events.RemoveHandler (ForeColorChangedEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event GiveFeedbackEventHandler GiveFeedback {
@@ -1443,13 +1447,13 @@ namespace System.Windows.Forms
 			remove {Events.RemoveHandler (PaintEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
 			add { Events.AddHandler (QueryAccessibilityHelpEvent, value); }
 			remove { Events.RemoveHandler (QueryAccessibilityHelpEvent, value); }
 		}
 
-		[MonoTODO ("Not raised")]
+		[MonoTODO ("Event never raised")]
 		[Browsable (false)]
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public event QueryContinueDragEventHandler QueryContinueDrag {
@@ -1858,7 +1862,7 @@ namespace System.Windows.Forms
 					return true;
 
 				if (!(this.Owner is ToolStripDropDownMenu))
-					return true;
+					return false;
 
 				ToolStripDropDownMenu tsddm = (ToolStripDropDownMenu)this.Owner;
 
@@ -1872,7 +1876,7 @@ namespace System.Windows.Forms
 					return true;
 
 				if (!(this.Owner is ToolStripDropDownMenu))
-					return true;
+					return false;
 
 				ToolStripDropDownMenu tsddm = (ToolStripDropDownMenu)this.Owner;
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection.cs
index 250e5a5..9fd726a 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItemCollection.cs
@@ -29,6 +29,7 @@
 
 using System.Drawing;
 using System.Collections;
+using System.Collections.Generic;
 using System.ComponentModel;
 using System.Windows.Forms.Layout;
 
@@ -187,17 +188,17 @@ namespace System.Windows.Forms
 			base.CopyTo (array, index);
 		}
 
-		[MonoTODO ()]
+		[MonoTODO ("searchAllChildren parameter isn't used")]
 		public ToolStripItem[] Find (string key, bool searchAllChildren)
 		{
-			if (key == null)
+			if (key == null || key.Length == 0)
 				throw new ArgumentNullException ("key");
 
-			ArrayList al = new ArrayList ();
+			List<ToolStripItem> list = new List<ToolStripItem> ();
 
 			foreach (ToolStripItem tsi in this) {
-				if (tsi.Name == key) {
-					al.Add (tsi);
+				if (String.Compare (tsi.Name, key, true) == 0) {
+					list.Add (tsi);
 
 					if (searchAllChildren) {
 						// TODO: tsi does not have an items property yet..
@@ -205,7 +206,7 @@ namespace System.Windows.Forms
 				}
 			}
 
-			return (ToolStripItem[])al.ToArray ();
+			return list.ToArray ();
 		}
 
 		public int IndexOf (ToolStripItem value)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs
index 69e163a..a38686c 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripManager.cs
@@ -177,14 +177,14 @@ namespace System.Windows.Forms
 			return false;
 		}
 
-		[MonoTODO ("Not implemented")]
+		[MonoTODO ("Stub, does nothing")]
 		public static void LoadSettings (Form targetForm)
 		{
 			if (targetForm == null)
 				throw new ArgumentNullException ("targetForm");
 		}
 
-		[MonoTODO ("Not implemented")]
+		[MonoTODO ("Stub, does nothing")]
 		public static void LoadSettings (Form targetForm, string key)
 		{
 			if (targetForm == null)
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
index 3276ba9..ea81064 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripMenuItem.cs
@@ -120,7 +120,12 @@ namespace System.Windows.Forms
 		[DefaultValue (false)]
 		public bool CheckOnClick {
 			get { return this.check_on_click; }
-			set { this.check_on_click = value; }
+			set {
+				if (this.check_on_click != value) {
+					this.check_on_click = value;
+					OnUIACheckOnClickChangedEvent (EventArgs.Empty);
+				}
+			}
 		}
 
 		[Bindable (true)]
@@ -396,7 +401,10 @@ namespace System.Windows.Forms
 
 		protected internal override bool ProcessCmdKey (ref Message m, Keys keyData)
 		{
-			if (this.Enabled && keyData == this.shortcut_keys) {
+			Control source = Control.FromHandle (m.HWnd);
+			Form f = source == null ? null : (Form)source.TopLevelControl;
+
+			if (this.Enabled && keyData == this.shortcut_keys && GetTopLevelControl () == f) {
 				this.FireEvent (EventArgs.Empty, ToolStripItemEventType.Click);
 				return true;
 			}
@@ -404,6 +412,24 @@ namespace System.Windows.Forms
 			return base.ProcessCmdKey (ref m, keyData);
 		}
 
+		Control GetTopLevelControl ()
+		{
+			ToolStripItem item = this;
+			while (item.OwnerItem != null)
+				item = item.OwnerItem;
+
+			if (item.Owner == null)
+				return null;
+
+			if (item.Owner is ContextMenuStrip) {
+				Control container = ((ContextMenuStrip)item.Owner).container;
+				return container == null ? null : container.TopLevelControl;
+			}
+
+			// MainMenuStrip
+			return item.Owner.TopLevelControl;
+		}
+
 		protected internal override bool ProcessMnemonic (char charCode)
 		{
 			if (!this.Selected)
@@ -440,6 +466,23 @@ namespace System.Windows.Forms
 		}
 		#endregion
 
+		#region UIA Framework Events
+		static object UIACheckOnClickChangedEvent = new object ();
+		
+		internal event EventHandler UIACheckOnClickChanged {
+			add { Events.AddHandler (UIACheckOnClickChangedEvent, value); }
+			remove { Events.RemoveHandler (UIACheckOnClickChangedEvent, value); }
+		}
+
+		internal void OnUIACheckOnClickChangedEvent (EventArgs args)
+		{
+			EventHandler eh
+				= (EventHandler) Events [UIACheckOnClickChangedEvent];
+			if (eh != null)
+				eh (this, args);
+		}
+		#endregion
+
 		#region Internal Properties
 		internal Form MdiClientForm {
 			get { return this.mdi_client_form; }
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripOverflow.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripOverflow.cs
index 92ab305..ba1eb15 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripOverflow.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripOverflow.cs
@@ -126,7 +126,7 @@ namespace System.Windows.Forms
 		{
 			this.displayed_items.Clear ();
 
-			if (this.OwnerItem != null)
+			if (this.OwnerItem != null && this.OwnerItem.Parent != null)
 				foreach (ToolStripItem tsi in this.OwnerItem.Parent.Items)
 					if (tsi.Placement == ToolStripItemPlacement.Overflow && tsi.Available && !(tsi is ToolStripSeparator)) {
 						this.displayed_items.AddNoOwnerOrLayout (tsi);
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
index 776a18d..75b06ab 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
@@ -545,8 +545,8 @@ namespace System.Windows.Forms
 			#region IList Members
 			object IList.this [int index] {
 				get { return this [index]; }
-				[MonoTODO]
-				set { throw new NotImplementedException (); }
+				[MonoTODO ("Stub, does nothing")]
+				set { }
 			}
 
 			bool IList.IsFixedSize {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs
index cb82bd1..fe40ba3 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripRenderer.cs
@@ -38,18 +38,11 @@ namespace System.Windows.Forms
 	public abstract class ToolStripRenderer
 	{
 		private static ColorMatrix grayscale_matrix = new ColorMatrix (new float[][] {
-						//new float[]{0.3f,0.3f,0.3f,0,0},
-						//new float[]{0.59f,0.59f,0.59f,0,0},
-						//new float[]{0.11f,0.11f,0.11f,0,0},
-						//new float[]{0,0,0,1,0,0},
-						//new float[]{0,0,0,0,1,0},
-						//new float[]{0,0,0,0,0,1}
-					  new float[]{0.2f,0.2f,0.2f,0,0},
-					  new float[]{0.41f,0.41f,0.41f,0,0},
-					  new float[]{0.11f,0.11f,0.11f,0,0},
-					  new float[]{0.15f,0.15f,0.15f,1,0,0},
-					  new float[]{0.15f,0.15f,0.15f,0,1,0},
-					  new float[]{0.15f,0.15f,0.15f,0,0,1}
+					  new float[] {0.22f, 0.22f, 0.22f, 0, 0},
+					  new float[] {0.27f, 0.27f, 0.27f, 0, 0},
+					  new float[] {0.04f, 0.04f, 0.04f, 0, 0},
+					  new float[] {0.365f, 0.365f, 0.365f, 0.7f, 0},
+					  new float[] {0, 0, 0, 0, 1}
 				  });
 
 		protected ToolStripRenderer () 
@@ -66,7 +59,7 @@ namespace System.Windows.Forms
 			ImageAttributes ia = new ImageAttributes();
 			ia.SetColorMatrix (grayscale_matrix);
 			
-			Bitmap b = new Bitmap(normalImage);
+			Bitmap b = new Bitmap(normalImage.Width, normalImage.Height);
 			Graphics.FromImage(b).DrawImage(normalImage, new Rectangle (0, 0, normalImage.Width, normalImage.Height), 0, 0, normalImage.Width, normalImage.Height, GraphicsUnit.Pixel, ia);
 			
 			return b;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripTextBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripTextBox.cs
index 98aa9cc..4e552bd 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripTextBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripTextBox.cs
@@ -41,9 +41,11 @@ namespace System.Windows.Forms
 		#region Public Constructors
 		public ToolStripTextBox () : base (new ToolStripTextBoxControl ())
 		{
-			(this.TextBox as ToolStripTextBoxControl).OwnerItem = this;
-			base.Control.border_style = BorderStyle.None;
-			(base.Control as ToolStripTextBoxControl).Border = BorderStyle.Fixed3D;
+			ToolStripTextBoxControl text_box = TextBox as ToolStripTextBoxControl;
+			text_box.OwnerItem = this;
+			text_box.border_style = BorderStyle.None;
+			text_box.TopMargin = 3; // need to explicitly set the margin
+			text_box.Border = BorderStyle.Fixed3D; // ToolStripTextBoxControl impl, not TextBox
 			this.border_style = BorderStyle.Fixed3D;
 		}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs
index 0623d2c..06d1454 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolTip.cs
@@ -747,6 +747,9 @@ namespace System.Windows.Forms {
 
 		#region Protected Instance Methods
 		protected override void Dispose(bool disposing) {
+			// call the base impl first to avoid conflicts with any parent's events
+			base.Dispose (disposing);
+
 			if (disposing) {
 				// Mop up the mess; or should we wait for the GC to kick in?
 				timer.Stop();
@@ -866,17 +869,11 @@ namespace System.Windows.Forms {
 			if (!is_active)
 				return;
 
-			// Display tooltips only for the controls in the active form
-			if (control.FindForm () != Form.ActiveForm)
+			// ShowAlways controls whether the controls in non-active forms
+			// can display its tooltips, even if they are not current active control.
+			if (!show_always && control.FindForm () != Form.ActiveForm)
 				return;
 
-			if (!show_always) {
-				IContainerControl cc = last_control.GetContainerControl ();
-				if ((cc == null) || (cc.ActiveControl == null)) {
-					return;
-				}
-			}
-
 			string text = (string)tooltip_strings[control];
 			if (text != null && text.Length > 0) {
 				if (active_control == null) {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs
index 9cf825d..e58baa9 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNode.cs
@@ -314,10 +314,12 @@ namespace System.Windows.Forms
 					TreeView.OnBeforeCheck (args);
 				if (!args.Cancel) {
 					check = value;
-					if (TreeView != null) {
+
+					// TreeView can become null after OnAfterCheck, this the double null check
+					if (TreeView != null)
 						TreeView.OnAfterCheck (new TreeViewEventArgs (this, check_reason));
+					if (TreeView != null)
 						TreeView.UpdateNode (this);
-					}
 				}
 				check_reason = TreeViewAction.Unknown;
 			}
@@ -1063,6 +1065,19 @@ namespace System.Windows.Forms
 			get { return width == -1; }
 		}
 
+		internal void Invalidate ()
+		{
+			// invalidate width first so Bounds retrieves 
+			// the updated value (we don't use it here however)
+			width = -1;
+
+			TreeView tv = TreeView;
+			if (tv == null)
+				return;
+
+			tv.UpdateNode (this);
+		}
+
 		internal void InvalidateWidth ()
 		{
 			// bounds.Width = 0;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
index ccab8d6..318a0fc 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
@@ -216,8 +216,6 @@ namespace System.Windows.Forms {
 			if (owner != null) {
 				tree_view = owner.TreeView;
 				if (tree_view != null) {
-					tree_view.highlighted_node = null;
-					tree_view.selected_node = null;
 					tree_view.UpdateBelow (owner);
 					tree_view.RecalculateVisibleOrder (owner);
 					tree_view.UpdateScrollBars (false);
@@ -227,7 +225,7 @@ namespace System.Windows.Forms {
 
 		public bool Contains (TreeNode node)
 		{
-			return (Array.BinarySearch (nodes, node) > 0);
+			return Array.IndexOf (nodes, node, 0, count) != -1;
 		}
 #if NET_2_0
 		public virtual bool ContainsKey (string key)
@@ -355,6 +353,7 @@ namespace System.Windows.Forms {
 			TreeNode removed = nodes [index];
 			TreeNode prev = GetPrevNode (removed);
 			TreeNode new_selected = null;
+			bool re_set_selected = false;
 			bool visible = removed.IsVisible;
 
 			TreeView tree_view = null;
@@ -365,13 +364,14 @@ namespace System.Windows.Forms {
 				tree_view.RecalculateVisibleOrder (prev);
 
 				if (removed == tree_view.SelectedNode) {
+					re_set_selected = true;
 					OpenTreeNodeEnumerator oe = new OpenTreeNodeEnumerator (removed);
 					if (oe.MoveNext () && oe.MoveNext ()) {
 						new_selected = oe.CurrentNode;
 					} else {
 						oe = new OpenTreeNodeEnumerator (removed);
 						oe.MovePrevious ();
-						new_selected = oe.CurrentNode;
+						new_selected = oe.CurrentNode == removed ? null : oe.CurrentNode;
 					}
 				}
 			}
@@ -384,7 +384,7 @@ namespace System.Windows.Forms {
 			if (nodes.Length > OrigSize && nodes.Length > (count * 2))
 				Shrink ();
 
-			if (tree_view != null && new_selected != null) {
+			if (tree_view != null && re_set_selected) {
 				tree_view.SelectedNode = new_selected;
 			}
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
index 6c4bc95..64ea57a 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs
@@ -1605,7 +1605,7 @@ namespace System.Windows.Forms {
 
 			int use_index = node.Image;
 
-			if (use_index != -1)
+			if (use_index > -1 && use_index < ImageList.Images.Count)
 				ImageList.Draw (dc, x, y, ImageList.ImageSize.Width, ImageList.ImageSize.Height, use_index);
 		}
 
@@ -2183,6 +2183,8 @@ namespace System.Windows.Forms {
 
 				highlighted_node = focused_node;
 				selected_node = focused_node;
+				if (selected_node != null)
+					Invalidate (selected_node.Bounds);
 			}
 		}
 
@@ -2227,8 +2229,10 @@ namespace System.Windows.Forms {
 				return;
 
 			Invalidate (highlighted_node.Bounds);
-			Invalidate (selected_node.Bounds);
-			Invalidate (focused_node.Bounds);
+			if (selected_node != null)
+				Invalidate (selected_node.Bounds);
+			if (focused_node != null)
+				Invalidate (focused_node.Bounds);
 
 			highlighted_node = selected_node;
 			focused_node = selected_node;
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WebBrowser.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WebBrowser.cs
index d27cd83..b7e6e2e 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WebBrowser.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/WebBrowser.cs
@@ -104,7 +104,7 @@ namespace System.Windows.Forms
 				if (WebHost.Document == null || WebHost.Document.DocumentElement == null)
 					return null;
 
-				return WebHost.Document.DocumentElement.ContentStream;
+				return null; //WebHost.Document.DocumentElement.ContentStream;
 			}
 			set { 
 				if (this.allowNavigation)
@@ -263,7 +263,7 @@ namespace System.Windows.Forms
 		
 		#endregion
 
-		[MonoTODO ("Stub, not implemented")]
+		[MonoTODO ("WebBrowser control is only supported on Linux/Windows. No support for OSX.")]
 		public WebBrowser ()
 		{
 		}
@@ -456,13 +456,11 @@ namespace System.Windows.Forms
 			base.DetachSink ();
 		}
 
-		[MonoTODO ("Stub, not implemented")]
 		protected override void Dispose (bool disposing)
 		{
 			base.Dispose (disposing);
 		}
 
-		[MonoTODO ("Stub, not implemented")]
 		protected override void WndProc (ref Message m)
 		{
 			base.WndProc (ref m);
@@ -681,10 +679,10 @@ namespace System.Windows.Forms
 
 
 		void SetScrollbars () {
-			if (!scrollbarsEnabled)
-				WebHost.ExecuteScript ("document.body.style.overflow='hidden';");
-			else
-				WebHost.ExecuteScript ("document.body.style.overflow='auto';");
+			//if (!scrollbarsEnabled)
+			//        WebHost.ExecuteScript ("document.body.style.overflow='hidden';");
+			//else
+			//        WebHost.ExecuteScript ("document.body.style.overflow='auto';");
 		}
 
 		[MonoTODO ("Stub, not implemented")]
@@ -704,4 +702,4 @@ namespace System.Windows.Forms
 	}
 }
 
-#endif
+#endif
\ No newline at end of file
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Clipboard.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Clipboard.cs
new file mode 100644
index 0000000..27a5c78
--- /dev/null
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Clipboard.cs
@@ -0,0 +1,105 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// Authors:
+//	Carlos Alberto Cortez (calberto.cortez at gmail.com)
+//
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.Collections.Specialized;
+
+namespace System.Windows.Forms {
+
+	internal class ClipboardData {
+		ListDictionary source_data;			// Source in its different formats, if any
+		string plain_text_source;			// Cached source as plain-text string
+		Image image_source;				// Cached source as image
+
+		internal object		Item;			// Object on the clipboard
+		internal ArrayList	Formats;		// list of formats available in the clipboard
+		internal bool		Retrieving;		// true if we are requesting an item
+		internal bool		Enumerating;		// true if we are enumerating through all known types
+		internal XplatUI.ObjectToClipboard Converter;
+
+		public ClipboardData ()
+		{
+			source_data = new ListDictionary ();
+		}
+
+		public void ClearSources ()
+		{
+			source_data.Clear ();
+			plain_text_source = null;
+			image_source = null;
+		}
+
+		public void AddSource (int type, object source)
+		{
+			// Try to detect plain text, based on the old behaviour of XplatUIX11, which usually assigns
+			// -1 as the type when a string is stored in the Clipboard
+			if (source is string && (type == DataFormats.GetFormat (DataFormats.Text).Id || type == -1))
+				plain_text_source = source as string;
+			else if (source is Image)
+				image_source = source as Image;
+
+			source_data [type] = source;
+		}
+
+		public object GetSource (int type)
+		{
+			return source_data [type];
+		}
+
+		public string GetPlainText ()
+		{
+			return plain_text_source;
+		}
+
+		public string GetRtfText ()
+		{
+			DataFormats.Format format = DataFormats.GetFormat (DataFormats.Rtf);
+			if (format == null)
+				return null; // FIXME - is RTF not supported on any system?
+
+			return (string)GetSource (format.Id);
+		}
+
+		public Image GetImage ()
+		{
+			return image_source;
+		}
+
+		public bool IsSourceText {
+			get {
+				return plain_text_source != null;
+			}
+		}
+
+		public bool IsSourceImage {
+			get {
+				return image_source != null;
+			}
+		}
+	}
+}
+
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Dnd.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Dnd.cs
index 4a41a62..ba86008 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Dnd.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Dnd.cs
@@ -320,7 +320,7 @@ namespace System.Windows.Forms {
 		private IntPtr XdndActionMove;
 		private IntPtr XdndActionLink;
 		//private IntPtr XdndActionPrivate;
-		//private IntPtr XdndActionList;
+		private IntPtr XdndActionList;
 		//private IntPtr XdndActionDescription;
 		//private IntPtr XdndActionAsk;
 
@@ -840,7 +840,7 @@ namespace System.Windows.Forms {
 			// Copy is implicitly allowed
 			Control source_control = MwfWindow (source);
 			if (source_control == null)
-				allowed = EffectFromAction (xevent.ClientMessageEvent.ptr5) | DragDropEffects.Copy;
+				allowed = EffectsFromX11Source (source, xevent.ClientMessageEvent.ptr5) | DragDropEffects.Copy;
 			else
 				allowed = drag_data.AllowedEffects;
 
@@ -965,18 +965,40 @@ namespace System.Windows.Forms {
 			return true;
 		}
 
-		private DragDropEffects EffectFromAction (IntPtr action)
+		private DragDropEffects EffectsFromX11Source (IntPtr source, IntPtr action_atom)
 		{
 			DragDropEffects allowed = DragDropEffects.None;
+			IntPtr type, count, remaining, data = IntPtr.Zero;
+			int format;
 
+			XplatUIX11.XGetWindowProperty (display, source, XdndActionList,
+					IntPtr.Zero, new IntPtr (32), false, (IntPtr) Atom.AnyPropertyType,
+					out type, out format, out count, out remaining, ref data);
+
+			int intptr_size = Marshal.SizeOf (typeof (IntPtr));
+			for (int i = 0; i < count.ToInt32 (); i++) {
+				IntPtr current_atom = Marshal.ReadIntPtr (data, i * intptr_size);
+				allowed |= EffectFromAction (current_atom);
+			}
+
+			// if source is not providing the action list, use the
+			// default action passed in the x11 dnd position message
+			if (allowed == DragDropEffects.None)
+				allowed = EffectFromAction (action_atom);
+
+			return allowed;
+		}
+
+		private DragDropEffects EffectFromAction (IntPtr action)
+		{
 			if (action == XdndActionCopy)
-				allowed = DragDropEffects.Copy;
+				return DragDropEffects.Copy;
 			else if (action == XdndActionMove)
-				allowed |= DragDropEffects.Move;
+				return DragDropEffects.Move;
 			if (action == XdndActionLink)
-				allowed |= DragDropEffects.Link;
+				return DragDropEffects.Link;
 
-			return allowed;
+			return DragDropEffects.None;
 		}
 
 		private IntPtr ActionFromEffect (DragDropEffects effect)
@@ -1184,7 +1206,7 @@ namespace System.Windows.Forms {
 			XdndActionMove = XplatUIX11.XInternAtom (display, "XdndActionMove", false);
 			XdndActionLink = XplatUIX11.XInternAtom (display, "XdndActionLink", false);
 			//XdndActionPrivate = XplatUIX11.XInternAtom (display, "XdndActionPrivate", false);
-			//XdndActionList = XplatUIX11.XInternAtom (display, "XdndActionList", false);
+			XdndActionList = XplatUIX11.XInternAtom (display, "XdndActionList", false);
 			//XdndActionDescription = XplatUIX11.XInternAtom (display, "XdndActionDescription", false);
 			//XdndActionAsk = XplatUIX11.XInternAtom (display, "XdndActionAsk", false);
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs
index 497d5a7..7b154d8 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/X11Structs.cs
@@ -1478,16 +1478,6 @@ namespace System.Windows.Forms {
 		internal Rectangle	Area;			// The area the current grab is confined to
 	}
 
-	internal struct ClipboardStruct {
-		internal object		Source;
-		internal object		Item;			// Object on the clipboard
-		internal object		Type;			// Type if object on the clipboard
-		internal ArrayList	Formats;		// list of formats available in the clipboard
-		internal bool		Retrieving;		// true if we are requesting an item
-		internal bool		Enumerating;		// true if we are enumerating through all known types
-		internal XplatUI.ObjectToClipboard Converter;
-	}
-
 	internal delegate int  XErrorHandler(IntPtr DisplayHandle, ref XErrorEvent error_event);
 
 	internal enum XRequest : byte {
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
index dd74978..c11f32f 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUICarbon.cs
@@ -1100,6 +1100,17 @@ namespace System.Windows.Forms {
 		internal override IntPtr DefWndProc(ref Message msg) {
 			Hwnd hwnd = Hwnd.ObjectFromHandle (msg.HWnd);
 			switch ((Msg)msg.Msg) {
+				case Msg.WM_IME_COMPOSITION:
+					string s = KeyboardHandler.ComposedString;
+					foreach (char c in s)
+						SendMessage (msg.HWnd, Msg.WM_IME_CHAR, (IntPtr) c, msg.LParam);
+					break;
+				case Msg.WM_IME_CHAR:
+					// On Windows API it sends two WM_CHAR messages for each byte, but
+					// I wonder if it is worthy to emulate it (also no idea how to 
+					// reconstruct those bytes into chars).
+					SendMessage (msg.HWnd, Msg.WM_CHAR, msg.WParam, msg.LParam);
+					return IntPtr.Zero;
 				case Msg.WM_QUIT: {
 					if (WindowMapping [hwnd.Handle] != null)
 
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
index 93bc594..bf8efc0 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
@@ -476,7 +476,19 @@ namespace System.Windows.Forms {
 		{
 			AsyncMethodData data = (AsyncMethodData) state;
 			AsyncMethodResult result = data.Result;
-			object ret = data.Method.DynamicInvoke (data.Args);
+			
+			object ret;
+			try {
+				ret = data.Method.DynamicInvoke (data.Args);
+			} catch (Exception ex) {
+				if (result != null) {
+					result.CompleteWithException (ex);
+					return;
+				}
+				
+				throw;
+			}
+		
 			if (result != null) {
 				result.Complete (ret);
 			}
@@ -511,12 +523,16 @@ namespace System.Windows.Forms {
 			}
 #endif
 
+			AsyncMethodResult result = data.Result;
+			object ret;
+
 			try {
-				AsyncMethodResult result = data.Result;
-				object ret = data.Method.DynamicInvoke (data.Args);
+				ret = data.Method.DynamicInvoke (data.Args);
 				result.Complete (ret);
-			}
-			finally {
+			} catch (Exception ex) {
+				result.CompleteWithException (ex);
+				return;
+			} finally {
 #if !MWF_ON_MSRUNTIME
 				if (data.Stack != null) {
 					// whatever occurs we must revert to the original compressed
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
index 8c3e71f..63ea893 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
@@ -1945,6 +1945,11 @@ namespace System.Windows.Forms {
 			MSG msg = new MSG();
 
 			while (GetMessage(ref msg, IntPtr.Zero, 0, 0, false)) {
+				Message m = Message.Create (msg.hwnd, (int)msg.message, msg.wParam, msg.lParam);
+
+				if (Application.FilterMessage (ref m))
+					continue;
+
 				XplatUI.TranslateMessage(ref msg);
 				XplatUI.DispatchMessage(ref msg);
 			}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
index 57fbc54..98ed4ac 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
@@ -62,6 +62,8 @@ using System.Net;
 using System.Net.Sockets;
 using System.Reflection;
 using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
 using System.Text;
 using System.Threading;
 
@@ -96,7 +98,7 @@ namespace System.Windows.Forms {
 
 		// Clipboard
 		private static IntPtr 		ClipMagic;
-		private static ClipboardStruct	Clipboard;		// Our clipboard
+		private static ClipboardData	Clipboard;		// Our clipboard
 
 		// Communication
 		private static IntPtr		PostAtom;		// PostMessage atom
@@ -256,6 +258,7 @@ namespace System.Windows.Forms {
 			MessageQueues = Hashtable.Synchronized (new Hashtable(7));
 			unattached_timer_list = ArrayList.Synchronized (new ArrayList (3));
 			messageHold = Hashtable.Synchronized (new Hashtable(3));
+			Clipboard = new ClipboardData ();
 			XInitThreads();
 
 			ErrorExceptions = false;
@@ -1260,6 +1263,18 @@ namespace System.Windows.Forms {
 					Clipboard.Item = Marshal.PtrToStringUni (prop, Encoding.Unicode.GetMaxCharCount ((int)nitems));
 				} else if (property == RICHTEXTFORMAT)
 					Clipboard.Item = Marshal.PtrToStringAnsi(prop);
+				else if (DataFormats.ContainsFormat (property.ToInt32 ())) {
+					if (DataFormats.GetFormat (property.ToInt32 ()).is_serializable) {
+						MemoryStream memory_stream = new MemoryStream ((int)nitems);
+						for (int i = 0; i < (int)nitems; i++)
+							memory_stream.WriteByte (Marshal.ReadByte (prop, i));
+
+						memory_stream.Position = 0;
+						BinaryFormatter formatter = new BinaryFormatter ();
+						Clipboard.Item = formatter.Deserialize (memory_stream);
+						memory_stream.Close ();
+					}
+				}
 
 				XFree(prop);
 			}
@@ -1700,56 +1715,75 @@ namespace System.Windows.Forms {
 					sel_event.SelectionEvent.time = xevent.SelectionRequestEvent.time;
 					sel_event.SelectionEvent.property = IntPtr.Zero;
 
+					IntPtr format_atom = xevent.SelectionRequestEvent.target;
+
 					// Seems that some apps support asking for supported types
-					if (xevent.SelectionEvent.target == TARGETS) {
+					if (format_atom == TARGETS) {
 						int[]	atoms;
 						int	atom_count;
 
 						atoms = new int[5];
 						atom_count = 0;
 
-						if (Clipboard.Item is String) {
+						if (Clipboard.IsSourceText) {
 							atoms[atom_count++] = (int)Atom.XA_STRING;
 							atoms[atom_count++] = (int)OEMTEXT;
 							atoms[atom_count++] = (int)UTF8_STRING;
 							atoms[atom_count++] = (int)UTF16_STRING;
 							atoms[atom_count++] = (int)RICHTEXTFORMAT;
-						} else if (Clipboard.Item is Image) {
+						} else if (Clipboard.IsSourceImage) {
 							atoms[atom_count++] = (int)Atom.XA_PIXMAP;
 							atoms[atom_count++] = (int)Atom.XA_BITMAP;
 						} else {
 							// FIXME - handle other types
 						}
 
-						XChangeProperty(DisplayHandle, xevent.SelectionEvent.requestor, (IntPtr)xevent.SelectionRequestEvent.property, (IntPtr)xevent.SelectionRequestEvent.target, 32, PropertyMode.Replace, atoms, atom_count);
-					} else if (Clipboard.Item is string) {
+						XChangeProperty(DisplayHandle, xevent.SelectionRequestEvent.requestor, (IntPtr)xevent.SelectionRequestEvent.property, 
+								(IntPtr)xevent.SelectionRequestEvent.target, 32, PropertyMode.Replace, atoms, atom_count);
+						sel_event.SelectionEvent.property = xevent.SelectionRequestEvent.property;
+					} else if (format_atom == (IntPtr)RICHTEXTFORMAT) {
+						string rtf_text = Clipboard.GetRtfText ();
+						if (rtf_text != null) {
+							// The RTF spec mentions that ascii is enough to contain it
+							Byte [] bytes = Encoding.ASCII.GetBytes (rtf_text);
+							int buflen = bytes.Length;
+							IntPtr buffer = Marshal.AllocHGlobal (buflen);
+
+							for (int i = 0; i < buflen; i++)
+								Marshal.WriteByte (buffer, i, bytes[i]);
+
+							XChangeProperty(DisplayHandle, xevent.SelectionRequestEvent.requestor, (IntPtr)xevent.SelectionRequestEvent.property,
+									(IntPtr)xevent.SelectionRequestEvent.target, 8, PropertyMode.Replace, buffer, buflen);
+							sel_event.SelectionEvent.property = xevent.SelectionRequestEvent.property;
+							Marshal.FreeHGlobal(buffer);
+						}
+					} else if (Clipboard.IsSourceText) {
 						IntPtr	buffer;
 						int	buflen;
 
 						buflen = 0;
 
-						// The RTF spec mentions that ascii is enough to contain it
-						if (xevent.SelectionRequestEvent.target == (IntPtr)Atom.XA_STRING ||
-								xevent.SelectionRequestEvent.target == (IntPtr)RICHTEXTFORMAT) {
+						IntPtr target_atom = xevent.SelectionRequestEvent.target;
+						if (target_atom == (IntPtr)Atom.XA_STRING) {
 							Byte[] bytes;
 
-							bytes = new ASCIIEncoding().GetBytes((string)Clipboard.Source);
+							bytes = Encoding.ASCII.GetBytes(Clipboard.GetPlainText ());
 							buffer = Marshal.AllocHGlobal(bytes.Length);
 							buflen = bytes.Length;
 
 							for (int i = 0; i < buflen; i++) {
 								Marshal.WriteByte(buffer, i, bytes[i]);
 							}
-						} else if (xevent.SelectionRequestEvent.target == OEMTEXT) {
+						} else if (target_atom == OEMTEXT) {
 							// FIXME - this should encode into ISO2022
-							buffer = Marshal.StringToHGlobalAnsi((string)Clipboard.Source);
+							buffer = Marshal.StringToHGlobalAnsi(Clipboard.GetPlainText ());
 							while (Marshal.ReadByte(buffer, buflen) != 0) {
 								buflen++;
 							}
-						} else if (xevent.SelectionRequestEvent.target == UTF16_STRING) {
+						} else if (target_atom == UTF16_STRING) {
 							Byte [] bytes;
 
-							bytes = Encoding.Unicode.GetBytes ((string)Clipboard.Source);
+							bytes = Encoding.Unicode.GetBytes (Clipboard.GetPlainText ());
 							buffer = Marshal.AllocHGlobal (bytes.Length);
 							buflen = bytes.Length;
 
@@ -1765,7 +1799,28 @@ namespace System.Windows.Forms {
 							sel_event.SelectionEvent.property = xevent.SelectionRequestEvent.property;
 							Marshal.FreeHGlobal(buffer);
 						}
-					} else if (Clipboard.Item is Image) {
+					} else if (Clipboard.GetSource (format_atom.ToInt32 ()) != null) { // check if we have an available value of this format
+						if (DataFormats.GetFormat (format_atom.ToInt32 ()).is_serializable) {
+							object serializable = Clipboard.GetSource (format_atom.ToInt32 ());
+
+							BinaryFormatter formatter = new BinaryFormatter ();
+							MemoryStream memory_stream = new MemoryStream ();
+							formatter.Serialize (memory_stream, serializable);
+
+							int buflen = (int)memory_stream.Length;
+							IntPtr buffer = Marshal.AllocHGlobal (buflen);
+							memory_stream.Position = 0;
+							for (int i = 0; i < buflen; i++)
+								Marshal.WriteByte (buffer, i, (byte)memory_stream.ReadByte ());
+							memory_stream.Close ();
+
+							XChangeProperty (DisplayHandle, xevent.SelectionRequestEvent.requestor, (IntPtr)xevent.SelectionRequestEvent.property, (IntPtr)xevent.SelectionRequestEvent.target,
+									8, PropertyMode.Replace, buffer, buflen);
+							sel_event.SelectionEvent.property = xevent.SelectionRequestEvent.property;
+							Marshal.FreeHGlobal (buffer);
+						}
+
+					} else if (Clipboard.IsSourceImage) {
 						if (xevent.SelectionEvent.target == (IntPtr)Atom.XA_PIXMAP) {
 							// FIXME - convert image and store as property
 						} else if (xevent.SelectionEvent.target == (IntPtr)Atom.XA_PIXMAP) {
@@ -1794,8 +1849,8 @@ namespace System.Windows.Forms {
 						if (xevent.SelectionEvent.property != IntPtr.Zero) {
 							TranslatePropertyToClipboard(xevent.SelectionEvent.property);
 						} else {
+							Clipboard.ClearSources ();
 							Clipboard.Item = null;
-							Clipboard.Source = null;
 						}
 					} else {
 						Dnd.HandleSelectionNotifyEvent (ref xevent);
@@ -2650,15 +2705,14 @@ namespace System.Windows.Forms {
 		}
 
 		internal override void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) {
-			Clipboard.Source = obj;
-			Clipboard.Item = obj;
-			Clipboard.Type = type;
 			Clipboard.Converter = converter;
 
 			if (obj != null) {
+				Clipboard.AddSource (type, obj);
 				XSetSelectionOwner(DisplayHandle, CLIPBOARD, FosterParent, IntPtr.Zero);
 			} else {
 				// Clearing the selection
+				Clipboard.ClearSources ();
 				XSetSelectionOwner(DisplayHandle, CLIPBOARD, IntPtr.Zero, IntPtr.Zero);
 			}
 		}
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources b/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
index 8f5894d..23ad463 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms_test.dll.sources
@@ -151,6 +151,7 @@ System.Windows.Forms/ToolStripComboBoxTest.cs
 System.Windows.Forms/ToolStripContainerTest.cs
 System.Windows.Forms/ToolStripContentPanelTest.cs
 System.Windows.Forms/ToolStripControlHostTest.cs
+System.Windows.Forms/ToolStripDropDownItemTest.cs
 System.Windows.Forms/ToolStripDropDownTest.cs
 System.Windows.Forms/ToolStripItemCollectionTest.cs
 System.Windows.Forms/ToolStripItemTest.cs
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
index 2d01a46..929f117 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
@@ -1,3 +1,113 @@
+2009-11-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ComboBoxTest.cs: New test case for data binding and Text
+	interaction.
+
+2009-10-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+[merge -r 132698:142738 from trunk]
+
+	2009-08-28  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+	
+	* TextBoxTest.cs: Improve the ModifiedTest test.
+
+	2009-08-28  Atsushi Enomoto  <atsushi at ximian.com>
+
+	* DataGridViewCellTest.cs : nunit test upgrade to modern style.
+
+	2009-08-19  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStripDropDownItemTest.cs: New test file.
+
+	2009-08-10  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGridTest.cs: Don't use DataGrid.Rows.Add() for our latest test,
+	since it is 2.0. Use DataGrid.NewRow() instead.
+
+	2009-08-10  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataGridTest.cs: New test for the interaction between DataSource and
+	TableStyles.
+
+	2009-08-03  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* GridColumnStylesCollectionTest.cs: New test for #465019. Also make
+	public the test class, so it is *actually* loaded by nunit.
+
+	2009-07-24  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStripItemCollectionTest.cs: New test for Find.
+
+	2009-07-17  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* RadioButtonTest.cs: Update the Checked test to not depend on
+	Form.Show, since we need to check the same behaviour even if no handle
+	has been created yet.
+
+	2009-06-16  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DataGridViewTest.cs: Duplicate test label fix.
+
+	2009-06-07  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* DataObjectTest.cs: New assertions for the text functionality.
+
+	2009-06-06  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ListBindingHelperTest.cs: New assertion for GetListItemType, as well
+	as a new helper collection class.
+
+	2009-06-01  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ClipboardTest.cs: New test for serializable types.
+
+	2009-05-11  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStripDropDownTest.cs: New test to assure the Height atfer
+	calculating the layout depends on ToolStripItem.GetPreferredHeight.
+
+	2009-05-08  Carlos Alberto Cortez <calberto.cortez at gmail.com>
+
+	* ToolStripControlHost.cs: New tests for DefaultSize and
+	OnHostedControlResize members.
+
+	2009-05-08  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: Improve test, and remove the
+	NotWorking attribute. Also remove the 'var' keywords, doh!
+
+	2009-05-08  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: Simplify test.
+
+	2009-05-08  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: Add yet another non-passing test
+	(wors in MS.NET).
+
+	2009-05-06  Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: add tests for Owner and OwnerItem.
+
+	2009-05-06  Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: more accurate test, and fix build
+	(namespace clash).
+
+	2009-05-06  Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* ToolStripMenuItemTest.cs: Add a test for GetCurrentParent
+	(passes on MS.NET). Related to a11y bugs #485524 and #479397.
+
+	2009-05-04  Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* TabControlTest.cs: More accurate test for bug#499887 showing
+	the SelectedIndex at the moment of the event (passes on MS.NET).
+
+	2009-04-30  Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* TabControlTest.cs: Added test for bug#499887.
+
 2009-05-08  Andrés G. Aragoneses  <aaragoneses at novell.com>
 
         * ToolStripMenuItemTest.cs: Add a test for a NRE bug.
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs
index b5e326a..dd8c2d9 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ClipboardTest.cs
@@ -44,6 +44,30 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (true, Clipboard.ContainsText (TextDataFormat.UnicodeText), "#A1");
 			Assert.AreEqual (text, Clipboard.GetText (TextDataFormat.UnicodeText), "#A2");
 		}
+
+		[Test]
+		public void CustomSerializableData ()
+		{
+			CustomSerializableClass obj = new CustomSerializableClass ();
+			obj.Name = "mono101";
+			obj.Id = -3;
+
+			Clipboard.SetData ("CustomSerializable", obj);
+
+			//Assert.AreEqual (true, Clipboard.ContainsData ("CustomSerializable"), "#A1");
+
+			CustomSerializableClass obj2 = (CustomSerializableClass)Clipboard.GetData ("CustomSerializable");
+
+			Assert.AreEqual ("mono101", obj2.Name, "#B1");
+			Assert.AreEqual (-3, obj2.Id, "#B2");
+		}
+
+		[Serializable]
+		private class CustomSerializableClass 
+		{
+			public string Name;
+			public int Id;
+		}
 #endif
 	}
 }
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
index 0da81a7..0466bdf 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ComboBoxTest.cs
@@ -1155,6 +1155,34 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (-1, cmbbox.SelectedIndex, "#S3");
 		}
 
+		[Test]
+		public void Text_DataBinding ()
+		{
+			ArrayList objects = new ArrayList ();
+			objects.Add (new MockItem ("A", 0));
+			objects.Add (new MockItem ("B", 1));
+
+			ComboBox cb = new ComboBox ();
+			cb.BindingContext = new BindingContext ();
+			cb.DataSource = objects;
+			cb.DisplayMember = "Text";
+
+			Assert.AreEqual ("A", cb.Text, "#A1");
+			Assert.AreEqual ("A", ((MockItem)cb.SelectedItem).Text, "#B2");
+			Assert.AreEqual (0, ((MockItem)cb.SelectedItem).Value, "#B3");
+
+			cb.Text = "B";
+			Assert.AreEqual ("B", cb.Text, "#B1");
+			Assert.AreEqual ("B", ((MockItem)cb.SelectedItem).Text, "#B2");
+			Assert.AreEqual (1, ((MockItem)cb.SelectedItem).Value, "#B3");
+
+			// the text will change graphically, but Text and
+			// SelectedItem will keep their previous valid values.
+			cb.Text = "dontexist";
+			Assert.AreEqual ("B", ((MockItem)cb.SelectedItem).Text, "#C2");
+			Assert.AreEqual (1, ((MockItem)cb.SelectedItem).Value, "#C3");
+		}
+
 		[Test]  // bug 360862
 		public void SizeChangesAtCreateHandle ()
 		{
@@ -1700,4 +1728,4 @@ namespace MonoTests.System.Windows.Forms
 			}
 		}
 	}
-}
\ No newline at end of file
+}
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridTest.cs
index eb9ad4f..f49ecd8 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridTest.cs
@@ -594,5 +594,30 @@ namespace MonoTests.System.Windows.Forms
 			dg.DataSource = ds;
 			Assert.AreEqual (0, data_source_changed_count, "A3");
 		}
+
+		[Test]
+		public void TestManagerSetDataSourceWithEmptyStyle ()
+		{
+			TestDataGrid dg = new TestDataGrid ();
+			dg.BindingContext = new BindingContext ();
+
+			DataSet ds = new DataSet ("DataSet");
+			DataTable dt = new DataTable ("MyTable");
+			dt.Columns.Add ("A", typeof (string));
+			dt.NewRow ();
+			ds.Tables.Add (dt);
+
+			// Add the style for the table we have, but leave it empty
+			// - this is, no column styles
+			DataGridTableStyle table_style = new DataGridTableStyle ();
+			table_style.MappingName = "MyTable";
+			dg.TableStyles.Add (table_style);
+
+			Assert.AreEqual (0, table_style.GridColumnStyles.Count, "#A1");
+
+			dg.DataSource = dt;
+
+			Assert.AreEqual (1, table_style.GridColumnStyles.Count, "#B1");
+		}
 	}
 }
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewCellTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewCellTest.cs
index 013e7ce..cba998f 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewCellTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewCellTest.cs
@@ -613,9 +613,9 @@ namespace MonoTests.System.Windows.Forms
 			ConcreteCollection myCollection;
 			myCollection = new ConcreteCollection();
 			....
-			AssertEquals ("#UniqueID", expected, actual);
+			Assert.AreEqual (expected, actual, "#UniqueID");
 			....
-			Fail ("Message");
+			Assert.Fail ("Message");
 		}
 		*/
 
@@ -1469,6 +1469,49 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreSame (cms2, dgv.Rows[0].Cells[0].GetInheritedContextMenuStrip (dgv.Rows[0].Cells[0].RowIndex), "A6");
 		}
 
+
+		[Test]
+		public void TestOnDataGridChangedMethod ()
+		{
+			DataGridView dataGridView1 = new DataGridView ();
+			DataGridView dataGridView2 = new DataGridView ();
+
+			TestHeaderCell testCell = new TestHeaderCell ();
+			Assert.AreEqual (0, testCell.OnDataGridViewChangedInvokeCount, "#1");
+
+			testCell.OnDataGridViewChangedInvokeCount = 0;
+			dataGridView1.TopLeftHeaderCell = testCell;
+			Assert.AreEqual (1, testCell.OnDataGridViewChangedInvokeCount, "#2");
+
+			testCell.OnDataGridViewChangedInvokeCount = 0;
+			dataGridView1.TopLeftHeaderCell = null;
+			Assert.AreEqual (1, testCell.OnDataGridViewChangedInvokeCount, "#3");
+
+			testCell.OnDataGridViewChangedInvokeCount = 0;
+			dataGridView2.TopLeftHeaderCell = testCell;
+			Assert.AreEqual (1, testCell.OnDataGridViewChangedInvokeCount, "#4");
+
+			testCell.OnDataGridViewChangedInvokeCount = 0;
+			dataGridView1.TopLeftHeaderCell = testCell;
+			Assert.AreEqual (1, testCell.OnDataGridViewChangedInvokeCount, "#5");
+
+			testCell.OnDataGridViewChangedInvokeCount = 0;
+			dataGridView1.TopLeftHeaderCell = testCell;
+			Assert.AreEqual (0, testCell.OnDataGridViewChangedInvokeCount, "#6");
+			
+		}
+
+		private class TestHeaderCell : DataGridViewHeaderCell
+		{
+			public int OnDataGridViewChangedInvokeCount = 0;
+
+			protected override void OnDataGridViewChanged ()
+			{
+				OnDataGridViewChangedInvokeCount++;
+				base.OnDataGridViewChanged ();
+			}
+		}
+
 		private class FormattedBaseCell : DataGridViewCell
 		{
 			public override Type FormattedValueType { get { return typeof (string); } }
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewColumnTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewColumnTest.cs
index f779606..5ea9648 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewColumnTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewColumnTest.cs
@@ -254,6 +254,15 @@ namespace MonoTests.System.Windows.Forms
 		}
 
 		private int columnChanged;
+
+		[Test]
+		public void CellTemplateDataGridView ()
+		{
+			DataGridView dgv = new DataGridView ();
+			DataGridViewColumn dvc = new DataGridViewTextBoxColumn ();
+			dgv.Columns.Add (dvc);
+			Assert.IsNull (dvc.CellTemplate.DataGridView, "#1");
+		}
 	}
 }
 #endif
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
index 1747520..211f448 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs
@@ -22,6 +22,7 @@
 // Author:
 //	Pedro Martínez Juliá <pedromj at gmail.com>
 //	Daniel Nauck    (dna(at)mono-project(dot)de)
+//	Ivan N. Zlatev  <contact at i-nz.net>
 
 
 #if NET_2_0
@@ -1161,18 +1162,41 @@ namespace MonoTests.System.Windows.Forms
 		[Test]
 		public void ColumnCount ()
 		{
-			DataGridView grid = new DataGridView ();
-			Assert.AreEqual (0, grid.ColumnCount, "#A1");
+			DataGridView dgv = new DataGridView ();
+
+			dgv.RowCount = 10;
+			dgv.ColumnCount = 2;
+
+			Assert.AreEqual (10, dgv.RowCount, "A1");
+			Assert.AreEqual (2, dgv.ColumnCount, "A2");
+
+			dgv.ColumnCount = 1;
+
+			Assert.AreEqual (10, dgv.RowCount, "B1");
+			Assert.AreEqual (1, dgv.ColumnCount, "B2");
+
+			dgv.ColumnCount = 3;
+
+			Assert.AreEqual (10, dgv.RowCount, "C1");
+			Assert.AreEqual (3, dgv.ColumnCount, "C2");
+
+
+			dgv.ColumnCount = 0;
+
+			Assert.AreEqual (0, dgv.RowCount, "D1");
+			Assert.AreEqual (0, dgv.ColumnCount, "D2");
+
+			Assert.AreEqual (0, dgv.ColumnCount, "E1");
 
 			try {
-				grid.ColumnCount = -1;
-				Assert.Fail ("#B1");
+				dgv.ColumnCount = -1;
+				Assert.Fail ("F1");
 			} catch (ArgumentOutOfRangeException ex) {
-				Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#B2");
-				Assert.IsNotNull (ex.Message, "#B3");
-				Assert.IsNotNull (ex.ParamName, "#B4");
-				Assert.AreEqual ("ColumnCount", ex.ParamName, "#B5");
-				Assert.IsNull (ex.InnerException, "#B6");
+				Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "F2");
+				Assert.IsNotNull (ex.Message, "F3");
+				Assert.IsNotNull (ex.ParamName, "F4");
+				Assert.AreEqual ("ColumnCount", ex.ParamName, "F5");
+				Assert.IsNull (ex.InnerException, "F6");
 			}
 		}
 
@@ -1186,11 +1210,33 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual ("System.Windows.Forms.DataGridViewTextBoxColumn", dgv.Columns[0].GetType ().ToString (), "A1");
 		}
 
+
+		[Test]
+		public void ColumnCountDecrease ()
+		{
+			DataGridView dgv = new DataGridView ();
+			dgv.ColumnCount = 6;
+			Assert.AreEqual (6, dgv.ColumnCount, "A1");
+
+			dgv.ColumnCount = 3;
+			Assert.AreEqual (3, dgv.ColumnCount, "A2");
+			
+			// Increasing the ColumnCount adds TextBoxColumns, not generic columns
+			Assert.AreEqual ("System.Windows.Forms.DataGridViewTextBoxColumn", dgv.Columns[0].GetType ().ToString (), "A3");
+			Assert.AreEqual ("System.Windows.Forms.DataGridViewTextBoxColumn", dgv.Columns[1].GetType ().ToString (), "A4");
+			Assert.AreEqual ("System.Windows.Forms.DataGridViewTextBoxColumn", dgv.Columns[2].GetType ().ToString (), "A5");
+		}
+
 		private class DataItem
 		{
 			public string Text {
 				get { return String.Empty; }
 			}
+
+			[Browsable (false)]
+			public string NotVisible {
+				get { return String.Empty; }
+			}
 		}
 
 		[Test]
@@ -1498,8 +1544,112 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (0, dgv.Rows[0].Index, "A3");
 			Assert.AreEqual (1, dgv.Rows[1].Index, "A4");
 			Assert.AreEqual (2, dgv.Rows[2].Index, "A5");
+
+
+			dgv.RowCount = 2;
+			
+			Assert.AreEqual (2, dgv.RowCount, "B1");
+			Assert.AreEqual (1, dgv.ColumnCount, "B2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "B3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "B4");
+
+			dgv.RowCount = 6;
+			
+			Assert.AreEqual (6, dgv.RowCount, "C1");
+			Assert.AreEqual (1, dgv.ColumnCount, "C2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "C3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "C4");
+			Assert.AreEqual (2, dgv.Rows[2].Index, "C5");
+
+			dgv.AllowUserToAddRows = false;
+
+			Assert.AreEqual (5, dgv.RowCount, "D1");
+			Assert.AreEqual (1, dgv.ColumnCount, "D2");
+
+			dgv.RowCount = 1;
+			
+			Assert.AreEqual (1, dgv.RowCount, "E1");
+			Assert.AreEqual (1, dgv.ColumnCount, "E2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "E3");
+
+			dgv.RowCount = 8;
+			
+			Assert.AreEqual (8, dgv.RowCount, "F1");
+			Assert.AreEqual (1, dgv.ColumnCount, "F2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "F3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "F4");
 		}
-		
+
+		[Test]
+		public void RowCountDecrease ()
+		{
+			DataGridView dgv = new DataGridView ();
+			dgv.RowCount = 6;
+			
+			Assert.AreEqual (6, dgv.RowCount, "A1");
+			Assert.AreEqual (1, dgv.ColumnCount, "A2");
+
+			dgv.RowCount = 3;
+			Assert.AreEqual (3, dgv.RowCount, "A3");
+			Assert.AreEqual (0, dgv.Rows[0].Index, "A4");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "A5");
+			Assert.AreEqual (2, dgv.Rows[2].Index, "A6");
+
+			try {
+				dgv.RowCount = 0;
+				Assert.Fail ("C1");
+			} catch {}
+
+
+			dgv.RowCount = 6;
+			
+			Assert.AreEqual (6, dgv.RowCount, "B1");
+			Assert.AreEqual (1, dgv.ColumnCount, "B2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "B3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "B4");
+			Assert.AreEqual (2, dgv.Rows[2].Index, "B5");
+
+
+			dgv.RowCount = 2;
+			
+			Assert.AreEqual (2, dgv.RowCount, "C1");
+			Assert.AreEqual (1, dgv.ColumnCount, "C2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "C3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "C4");
+
+			dgv.AllowUserToAddRows = false;
+
+			Assert.AreEqual (1, dgv.RowCount, "D1");
+			Assert.AreEqual (1, dgv.ColumnCount, "D2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "D3");
+
+			dgv.RowCount = 6;
+			
+			Assert.AreEqual (6, dgv.RowCount, "E1");
+			Assert.AreEqual (1, dgv.ColumnCount, "E2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "E3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "E4");
+			Assert.AreEqual (2, dgv.Rows[2].Index, "E5");
+
+
+			dgv.RowCount = 2;
+			
+			Assert.AreEqual (2, dgv.RowCount, "F1");
+			Assert.AreEqual (1, dgv.ColumnCount, "F2");
+
+			Assert.AreEqual (0, dgv.Rows[0].Index, "F3");
+			Assert.AreEqual (1, dgv.Rows[1].Index, "F4");
+
+		}
+
 		[Test]
 		public void BindToReadonlyProperty ()
 		{
@@ -1561,6 +1711,120 @@ namespace MonoTests.System.Windows.Forms
 			f.Close ();
 			f.Dispose ();
 		}
+
+		[Test]
+		public void ScrollToSelectionSynchronous()
+		{
+			DataGridView dgv = new DataGridView ();
+			dgv.RowCount = 1000;
+			dgv.CurrentCell = dgv[0, dgv.RowCount -1];		
+			Rectangle rowRect = dgv.GetRowDisplayRectangle (dgv.RowCount - 1, false);
+			Assert.AreEqual (true, dgv.DisplayRectangle.Contains (rowRect), "#01");
+		}
+
+		[Test]
+		public void CurrentCell()
+		{
+			DataGridView dgv = new DataGridView ();
+			dgv.AllowUserToAddRows = false;
+
+			Assert.IsNull (dgv.CurrentCell, "A1");
+
+			dgv.RowCount = 10;
+			dgv.ColumnCount = 2;
+			Assert.AreEqual (10, dgv.RowCount, "B1");
+			Assert.AreEqual (2, dgv.ColumnCount, "B2");
+			Assert.IsNull (dgv.CurrentCell, "B3");
+
+			dgv.CurrentCell = dgv[1, 9];
+			Assert.IsNotNull (dgv.CurrentCell, "H1");
+			Assert.AreEqual (9, dgv.CurrentCell.RowIndex, "H2");
+			Assert.AreEqual (1, dgv.CurrentCell.ColumnIndex, "H3");
+			
+			dgv.CurrentCell = null;
+			Assert.IsNull (dgv.CurrentCell, "C1");
+
+			dgv.CurrentCell = dgv[1, 9];
+			Assert.IsNotNull (dgv.CurrentCell, "D1");
+			Assert.AreEqual (9, dgv.CurrentCell.RowIndex, "D2");
+			Assert.AreEqual (1, dgv.CurrentCell.ColumnIndex, "D3");
+
+			dgv.RowCount = 9;
+			Assert.IsNotNull (dgv.CurrentCell, "E1");
+			Assert.AreEqual (8, dgv.CurrentCell.RowIndex, "E2");
+			Assert.AreEqual (1, dgv.CurrentCell.ColumnIndex, "E3");
+
+			dgv.CurrentCell = dgv[0, 4];
+			dgv.RowCount = 2;
+			Assert.IsNotNull (dgv.CurrentCell, "F1");
+			Assert.AreEqual (1, dgv.CurrentCell.RowIndex, "F2");
+			Assert.AreEqual (0, dgv.CurrentCell.ColumnIndex, "F3");
+
+			dgv.RowCount = 0;
+			Assert.IsNull (dgv.CurrentCell, "P1");
+
+			dgv.RowCount = 10;
+			Assert.AreEqual (10, dgv.RowCount, "I1");
+			dgv.CurrentCell = dgv[0, 4];
+			dgv.ColumnCount = 0;
+			Assert.AreEqual (0, dgv.RowCount, "I2");
+			Assert.IsNull (dgv.CurrentCell, "I3");
+
+			dgv.RowCount = 0;
+			dgv.ColumnCount = 0;
+			dgv.CreateControl ();
+			dgv.ColumnCount = 2;
+			dgv.RowCount = 3;
+
+			Assert.IsNotNull (dgv.CurrentCell, "G1");
+			Assert.AreEqual (0, dgv.CurrentCell.RowIndex, "G1");
+			Assert.AreEqual (0, dgv.CurrentCell.ColumnIndex, "G1");
+		}
+
+		[Test]
+		public void DataSourceBindingContextDependency ()
+		{
+			List<DataItem> dataList = new List<DataItem> ();
+			dataList.Add (new DataItem ());
+			dataList.Add (new DataItem ());
+
+			DataGridView dgv = new DataGridView ();
+			dgv.DataSource = dataList;
+			Assert.IsNull (dgv.BindingContext, "#1");
+			Assert.IsFalse (dgv.IsHandleCreated, "#2");
+			Assert.AreEqual (0, dgv.RowCount, "#3");
+
+			dgv.DataSource = null;
+
+			Form form = new Form ();
+			form.Controls.Add (dgv);
+			dgv.DataSource = dataList;
+
+			Assert.IsNotNull (dgv.BindingContext, "#4");
+			Assert.IsFalse (dgv.IsHandleCreated, "#5");
+			Assert.AreEqual (2, dgv.RowCount, "#6");
+
+			dgv.Dispose ();
+			dgv = new DataGridView ();
+			dgv.DataSource = dataList;
+
+			Assert.IsNull (dgv.BindingContext, "#7");
+			Assert.IsFalse (dgv.IsHandleCreated, "#8");
+			Assert.AreEqual (0, dgv.RowCount, "#9");
+
+			dgv.CreateControl ();
+
+			Assert.IsNull (dgv.BindingContext, "#10");
+			Assert.IsTrue (dgv.IsHandleCreated, "#11");
+			Assert.AreEqual (0, dgv.RowCount, "#12");
+		}
+
+		[Test]
+		public void RowTemplateDataGridView ()
+		{
+			DataGridView gdv = new DataGridView ();
+			Assert.IsNull (gdv.RowTemplate.DataGridView, "#1");
+		}
 	}
 	
 	[TestFixture]
@@ -1666,8 +1930,6 @@ namespace MonoTests.System.Windows.Forms
 				Assert.AreEqual (2, controls.Count, "#05");
 			}
 		}
-		
-		
 	}
 		
 }
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataObjectTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataObjectTest.cs
index 0dcea19..718be53 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataObjectTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataObjectTest.cs
@@ -148,6 +148,7 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (false, d.ContainsText (TextDataFormat.CommaSeparatedValue), "A5");
 
 			Assert.AreEqual ("yo", d.GetText (), "A6");
+			Assert.AreEqual ("yo", d.GetData (DataFormats.StringFormat), "A6-1");
 			
 			d.SetText ("<html></html>", TextDataFormat.Html);
 			Assert.AreEqual (true, d.ContainsText (), "A7");
@@ -156,6 +157,16 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (false, d.ContainsText (TextDataFormat.Rtf), "A10");
 			Assert.AreEqual (true, d.ContainsText (TextDataFormat.Text), "A11");
 			Assert.AreEqual (true, d.ContainsText (TextDataFormat.UnicodeText), "A12");
+
+			// directly put a string
+			d.SetData ("yo");
+
+			Assert.AreEqual (true, d.ContainsText (TextDataFormat.Text), "A13");
+			Assert.AreEqual (true, d.ContainsText (TextDataFormat.UnicodeText), "A14");
+
+			Assert.AreEqual ("yo", d.GetData (DataFormats.StringFormat), "A15");
+			Assert.AreEqual ("yo", d.GetData (DataFormats.Text), "A16");
+			Assert.AreEqual ("yo", d.GetData (DataFormats.UnicodeText), "A17");
 		}
 
 	}
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/GridColumnStylesCollectionTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/GridColumnStylesCollectionTest.cs
index d7cd458..d939299 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/GridColumnStylesCollectionTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/GridColumnStylesCollectionTest.cs
@@ -25,6 +25,7 @@
 //
 
 using System;
+using System.Data;
 using System.Collections;
 using System.ComponentModel;
 using System.Drawing;
@@ -35,7 +36,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Windows.Forms
 {
 	[TestFixture]
-	class GridColumnStylesCollectionTest : TestHelper
+	public class GridColumnStylesCollectionTest : TestHelper
 	{
 		private bool eventhandled;
 		private object Element;
@@ -83,6 +84,30 @@ namespace MonoTests.System.Windows.Forms
 			
 		}
 
+		// The idea of this test is to have a complete DataGrid system
+		// and assert that the Add method of the colleciton is _not_ forcing a 
+		// call to the protected CheckValidSource method in the new column style class.
+		// Bug #465019.
+		[Test]
+		public void TestAddWithBindingContext ()
+		{
+			DataGrid datagrid = new DataGrid ();
+			datagrid.BindingContext = new BindingContext ();
+			DataTable table = new DataTable ();
+			datagrid.DataSource = table;
+
+			DataGridTableStyle ts = new DataGridTableStyle ();
+			datagrid.TableStyles.Add (ts);
+
+			DataGridTextBoxColumn col1 = new DataGridTextBoxColumn ();
+			col1.MappingName = "Column1"; // Not valid mapping
+			ts.GridColumnStyles.Add (col1);
+
+			// More important: we should _not_ throw an exc here.
+			Assert.AreEqual (ts, col1.DataGridTableStyle, "#A1");
+			Assert.AreEqual (1, ts.GridColumnStyles.Count, "#A2");
+		}
+
 		[Test]
 		public void TestAddRange ()
 		{
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBindingHelperTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBindingHelperTest.cs
index d5003ea..f8ec2ac 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBindingHelperTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ListBindingHelperTest.cs
@@ -335,6 +335,132 @@ namespace MonoTests.System.Windows.Forms
 			// finally, objects that are not array nor list
 			Assert.AreEqual (typeof (double), ListBindingHelper.GetListItemType (3.1416), "#E1");
 			Assert.AreEqual (null, ListBindingHelper.GetListItemType (null), "#E2");
+
+			// bug #507120 - an IEnumerator instance with a Current value returning null,
+			// falling back to IList.this detection, if possible
+			Assert.AreEqual (typeof (string), ListBindingHelper.GetListItemType (new NullEnumerable (), null), "#F1");
+		}
+
+		// useless class that help us with a simple enumerator with a null Current property
+		// and implementing IList to let the ListBindingHelper get info from the this [] property
+		class NullEnumerable : IList, ICollection, IEnumerable
+		{
+			public IEnumerator GetEnumerator ()
+			{
+				return new NullEnumerator ();
+			}
+
+			class NullEnumerator : IEnumerator
+			{
+				int pos = -1;
+
+				// the idea is that we just move one time - the first time
+				public bool MoveNext ()
+				{
+					if (pos > -1)
+						return false;
+
+					pos = 0;
+					return true;
+				}
+
+				public void Reset ()
+				{
+					pos = -1;
+				}
+
+				public object Current {
+					get {
+						return null;
+					}
+				}
+			}
+
+			// make this return a string, and hide the interface impl,
+			// so we are sure ListBindingHelper is actually accessing this property
+			public string this [int index] {
+				get {
+					if (index != 0)
+						throw new ArgumentOutOfRangeException ("index");
+
+					return null;
+				}
+				set {
+				}
+			}
+
+			object IList.this [int index] {
+				get {
+					return this [index];
+				}
+				set {
+				}
+			}
+
+			public int Add (object o)
+			{
+				return 0;
+			}
+
+			public void Clear ()
+			{
+			}
+
+			public bool Contains (object o)
+			{
+				return false;
+			}
+
+			public int IndexOf (object o)
+			{
+				return -1;
+			}
+
+			public void Insert (int index, object o)
+			{
+			}
+
+			public void Remove (object o)
+			{
+			}
+
+			public void RemoveAt (int index)
+			{
+			}
+
+			public bool IsFixedSize {
+				get {
+					return true;
+				}
+			}
+
+			public bool IsReadOnly {
+				get {
+					return true;
+				}
+			}
+
+			public void CopyTo (Array array, int offset)
+			{
+			}
+
+			public int Count {
+				get {
+					return 1;
+				}
+			}
+
+			public bool IsSynchronized {
+				get {
+					return false;
+				}
+			}
+
+			public object SyncRoot {
+				get {
+					return this;
+				}
+			}
 		}
 
 		[Test]
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RadioButtonTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RadioButtonTest.cs
index 3bc7b42..cc8e1df 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RadioButtonTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RadioButtonTest.cs
@@ -67,7 +67,6 @@ namespace MonoTests.System.Windows.Forms
 			event_received = false;
 
 			f.ActiveControl = rb;
-			f.Show ();
 
 			Assert.AreEqual (true, event_received, "#D1");
 			Assert.AreEqual (true, rb.Checked, "#D2");
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
index 7f2f223..c2590f9 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TabControlTest.cs
@@ -666,7 +666,7 @@ namespace MonoTests.System.Windows.Forms
 
 			tc.DeselectTab ("Three");
 			Assert.AreEqual (0, tc.SelectedIndex, "A8");		
-}
+		}
 
 		[Test]
 		[ExpectedException (typeof (ArgumentOutOfRangeException))]
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs
index 1eb41cb..272e713 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs
@@ -815,8 +815,61 @@ namespace MonoTests.System.Windows.Forms
 			t.Modified = false;
 			Assert.AreEqual (false, t.Modified, "modified-3");
 
+			// Changes in Text property don't change Modified,
+			// as opposed what the .net docs say
+			t.ModifiedChanged += new EventHandler (TextBox_ModifiedChanged);
+
+			modified_changed_fired = false;
 			t.Text = "TEXT";
 			Assert.AreEqual (false, t.Modified, "modified-4");
+			Assert.AreEqual (false, modified_changed_fired, "modified-4-1");
+
+			t.Modified = true;
+			modified_changed_fired = false;
+			t.Text = "hello";
+			Assert.AreEqual (true, t.Modified, "modified-5");
+			Assert.AreEqual (false, modified_changed_fired, "modified-5-1");
+
+			t.Modified = false;
+			modified_changed_fired = false;
+			t.Text = "hello mono";
+			Assert.AreEqual (false, t.Modified, "modified-6");
+			Assert.AreEqual (false, modified_changed_fired, "modified-6-1");
+
+			// The methods changing the text value, however,
+			// do change Modified
+			t.Modified = true;
+			modified_changed_fired = false;
+			t.AppendText ("a");
+			Assert.AreEqual (false, t.Modified, "modified-7");
+			Assert.AreEqual (true, modified_changed_fired, "modified-7-1");
+
+			t.Modified = true;
+			modified_changed_fired = false;
+			t.Clear ();
+			Assert.AreEqual (false, t.Modified, "modified-8");
+			Assert.AreEqual (true, modified_changed_fired, "modified-8-1");
+
+			t.Text = "a message";
+			t.SelectAll ();
+			t.Modified = false;
+			t.Cut ();
+			Assert.AreEqual (true, t.Modified, "modified-9");
+
+			t.Modified = false;
+			t.Paste ();
+			Assert.AreEqual (true, t.Modified, "modified-10");
+
+			t.Modified = false;
+			t.Undo ();
+			Assert.AreEqual (true, t.Modified, "modified-11");
+		}
+
+		bool modified_changed_fired;
+
+		void TextBox_ModifiedChanged (object sender, EventArgs e)
+		{
+			modified_changed_fired = true;
 		}
 
 		void TextBox_TextChanged (object sender, EventArgs e)
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
index 2dcc27d..c5028d2 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripControlHostTest.cs
@@ -177,6 +177,19 @@ namespace MonoTests.System.Windows.Forms
 		}
 
 		[Test]
+		public void PropertyDefaultSize ()
+		{
+			VariableSizeControl c = new VariableSizeControl ();
+			ExposeProtectedProperties epp = new ExposeProtectedProperties (c);
+
+			Assert.AreEqual (new Size (-1, -1), epp.DefaultSize, "#A1");
+
+			c.Size = new Size (666, 666);
+			Assert.AreEqual (new Size (666, 666), c.Size, "#B99");
+			Assert.AreEqual (new Size (666, 666), epp.DefaultSize, "#B1");
+		}
+
+		[Test]
 		public void PropertyEnabled ()
 		{
 			ToolStripControlHost tsi = new ToolStripControlHost (new Control ());
@@ -432,7 +445,41 @@ namespace MonoTests.System.Windows.Forms
 			Assert.AreEqual (new Size (100, 50), tsi.Size, "H10");
 			Assert.AreEqual (new Size (292, 53), ts.Size, "H11");
 		}
-		
+
+		[Test]
+		public void MethodOnHostedControlResize ()
+		{
+			ToolStripControlHostChild control_host = new ToolStripControlHostChild (new Control ());
+			Control c = control_host.Control;
+
+			Assert.AreEqual (false, control_host.OnHostedControlResizeFired, "#A1");
+
+			c.Size = new Size (666, 666);
+			Assert.AreEqual (true, control_host.OnHostedControlResizeFired, "#A2");
+		}
+
+		private class ToolStripControlHostChild : ToolStripControlHost {
+			bool on_hosted_control_resize_fired;
+
+			public ToolStripControlHostChild (Control c) : base (c)
+			{
+			}
+
+			protected override void OnHostedControlResize (EventArgs e)
+			{
+				base.OnHostedControlResize (e);
+				on_hosted_control_resize_fired = true;
+			}
+
+			public bool OnHostedControlResizeFired
+			{
+				get
+				{
+					return on_hosted_control_resize_fired;
+				}
+			}
+		}
+
 		private class EventWatcher
 		{
 			private string events = string.Empty;
@@ -463,10 +510,25 @@ namespace MonoTests.System.Windows.Forms
 		
 		private class ExposeProtectedProperties : ToolStripControlHost
 		{
+			public ExposeProtectedProperties (Control c) : base (c) {}
 			public ExposeProtectedProperties () : base (new Control ()) {}
 			
 			public new Size DefaultSize { get { return base.DefaultSize; } }
 		}
+
+		private class VariableSizeControl : Control 
+		{
+			public override Size GetPreferredSize (Size proposedSize)
+			{
+				return new Size (999, 999);
+			}
+
+			protected override Size DefaultSize {
+				get {
+					return new Size (-1, -1);
+				}
+			}
+		}
 	}
 }
 #endif
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownItemTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownItemTest.cs
new file mode 100644
index 0000000..2cd3dbb
--- /dev/null
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownItemTest.cs
@@ -0,0 +1,68 @@
+//
+// ToolStripDropDownItemTests.cs
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
+//
+// Authors:
+//	Carlos Alberto Cortez <calberto.cortez at gmail.com>
+//
+
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace MonoTests.System.Windows.Forms
+{
+	[TestFixture]
+	public class ToolStripDropDownItemTest
+	{
+		[Test]
+		public void FontTest ()
+		{
+			ToolStripDropDownItem dropdown_item = new ToolStripMenuItem ();
+			ToolStrip tool_strip = new ToolStrip ();
+			tool_strip.Items.Add (dropdown_item);
+
+			Assert.AreEqual (tool_strip.Font, dropdown_item.Font, "#A1");
+
+			tool_strip.Font = new Font (tool_strip.Font, FontStyle.Bold);
+			Assert.AreEqual (tool_strip.Font, dropdown_item.Font, "#B1");
+
+			// force the creation of our DropDown
+			ToolStripDropDown dropdown = dropdown_item.DropDown;
+			Assert.AreEqual (tool_strip.Font, dropdown.Font, "#C1");
+
+			tool_strip.Font = new Font (tool_strip.Font, FontStyle.Italic);
+			Assert.AreEqual (tool_strip.Font, dropdown_item.Font, "#D1");
+			Assert.AreEqual (tool_strip.Font, dropdown.Font, "#D2");
+
+			dropdown_item.Font = new Font (dropdown_item.Font, FontStyle.Strikeout);
+			Assert.AreEqual (dropdown.Font, dropdown.Font, "#E1");
+		}
+	}
+}
+#endif
+
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
index 3aa6f9e..3c3f73f 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripDropDownTest.cs
@@ -62,6 +62,34 @@ namespace MonoTests.System.Windows.Forms
 		}
 
 		[Test]
+		public void Layout ()
+		{
+			ToolStripDropDown drop_down = new ToolStripDropDown ();
+			drop_down.Items.Add (new ToolStripVariableSizeItem ());
+			drop_down.PerformLayout ();
+
+			// We want to be sure the DropDown is using the size provided
+			// by GetPreferredSize, not DefaultSize, and since the extra padding/margin
+			// can change by some few pixels, we do a light check
+			Assert.AreEqual (true, drop_down.Size.Width >= 100, "A1");
+			Assert.AreEqual (true, drop_down.Size.Height >= 100, "A2");
+		}
+
+		private class ToolStripVariableSizeItem : ToolStripItem {
+
+			public override Size GetPreferredSize (Size constrainingSize) 
+			{
+				return new Size (100, 100);
+			}
+
+			protected override Size DefaultSize {
+				get {
+					return new Size (33, 33);
+				}
+			}
+		}
+
+		[Test]
 		public void ProtectedProperties ()
 		{
 			ExposeProtectedProperties epp = new ExposeProtectedProperties ();
@@ -144,4 +172,4 @@ namespace MonoTests.System.Windows.Forms
 		}
 	}
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripItemCollectionTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripItemCollectionTest.cs
index 5a3332b..88ea159 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripItemCollectionTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripItemCollectionTest.cs
@@ -115,6 +115,44 @@ namespace MonoTests.System.Windows.Forms
 		}
 
 		[Test]
+		public void Find ()
+		{
+			ToolStripItemCollection coll = new ToolStrip ().Items;
+
+			ToolStripItem item1 = new ToolStripLabel ("alpha");
+			item1.Name = "alpha";
+			ToolStripItem item2 = new ToolStripLabel ("beta");
+			item2.Name = "beta";
+			ToolStripItem item3 = new ToolStripLabel ("Alpha");
+			item3.Name = "Alpha";
+
+			coll.Add (item1);
+			coll.Add (item2);
+			coll.Add (item3);
+
+			ToolStripItem [] res = coll.Find ("alpha", true);
+			Assert.AreEqual (2, res.Length, "#A1");
+
+			res = coll.Find ("Beta", true);
+			Assert.AreEqual (1, res.Length, "#B1");
+
+			res = coll.Find ("DoesntExist", true);
+			Assert.AreEqual (0, res.Length, "#C1");
+
+			try {
+				coll.Find (null, true);
+				Assert.Fail ("#D1");
+			} catch (ArgumentNullException) {
+			}
+
+			try {
+				coll.Find (String.Empty, true);
+				Assert.Fail ("#E1");
+			} catch (ArgumentNullException) {
+			}
+		}
+
+		[Test]
 		public void Insert_Owned ()
 		{
 			ToolStrip toolStrip = CreateToolStrip ();
diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
index e3f0850..c9be2be 100644
--- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
+++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ToolStripMenuItemTest.cs
@@ -162,7 +162,76 @@ namespace MonoTests.System.Windows.Forms
 			tsmi.ShortcutKeyDisplayString = null;
 			Assert.AreEqual (null, tsmi.ShortcutKeyDisplayString, "A5");
 		}
+		
+		[Test]
+		[NUnit.Framework.Category ("NotWorking")]
+		public void GetCurrentParent ()
+		{
+			ToolStripMenuItem tsmiFile = new ToolStripMenuItem ("File");
+			ToolStripMenuItem tsmiHelp = new ToolStripMenuItem ("Help");
+			ToolStripMenuItem tsmiQuit = new ToolStripMenuItem ("Quit");
+			ToolStripMenuItem tsmiAbout = new ToolStripMenuItem ("About");
+			tsmiFile.DropDownItems.Add (tsmiQuit);
+			tsmiHelp.DropDownItems.Add (tsmiAbout);
+			MenuStrip menu = new MenuStrip ();
+			menu.Items.Add (tsmiFile);
+			menu.Items.Add (tsmiHelp);
+			
+			ToolStrip parent = tsmiFile.GetCurrentParent ();
+			Assert.IsNotNull (parent, "A1");
+			Assert.AreEqual (parent.GetType ().Name, typeof (MenuStrip).Name, "A2");
+			Assert.AreEqual (parent, menu, "A3");
+			
+			//because it's not visible?:
+			Assert.IsNull (tsmiQuit.GetCurrentParent (), "A4");
+		}
+		
+		[Test]
+		public void Owner ()
+		{
+			ToolStripMenuItem tsmiFile = new ToolStripMenuItem ("File");
+			ToolStripMenuItem tsmiHelp = new ToolStripMenuItem ("Help");
+			ToolStripMenuItem tsmiQuit = new ToolStripMenuItem ("Quit");
+			ToolStripMenuItem tsmiNew = new ToolStripMenuItem ("New");
+			ToolStripMenuItem tsmiAbout = new ToolStripMenuItem ("About");
+			tsmiQuit.DropDownItems.Add (tsmiNew);
+			tsmiFile.DropDownItems.Add (tsmiQuit);
+			tsmiHelp.DropDownItems.Add (tsmiAbout);
+			MenuStrip menu = new MenuStrip ();
+			menu.Items.Add (tsmiFile);
+			menu.Items.Add (tsmiHelp);
+			
+			Assert.IsNotNull (tsmiFile.Owner);
+			Assert.AreEqual (tsmiFile.Owner.GetType().Name, typeof (MenuStrip).Name);
+			Assert.AreEqual (tsmiFile.Owner, menu);
 
+			Assert.IsNotNull (tsmiQuit.Owner);
+			Assert.AreEqual (tsmiQuit.Owner.GetType().Name, typeof (ToolStripDropDownMenu).Name);
+			Assert.AreEqual (tsmiQuit.Owner, tsmiFile.DropDown);
+		}
+		
+		[Test]
+		public void OwnerItem ()
+		{
+			ToolStripMenuItem tsmiFile = new ToolStripMenuItem ("File");
+			ToolStripMenuItem tsmiHelp = new ToolStripMenuItem ("Help");
+			ToolStripMenuItem tsmiQuit = new ToolStripMenuItem ("Quit");
+			ToolStripMenuItem tsmiNew = new ToolStripMenuItem ("New");
+			ToolStripMenuItem tsmiAbout = new ToolStripMenuItem ("About");
+			tsmiQuit.DropDownItems.Add (tsmiNew);
+			tsmiFile.DropDownItems.Add (tsmiQuit);
+			tsmiHelp.DropDownItems.Add (tsmiAbout);
+			MenuStrip menu = new MenuStrip ();
+			menu.Items.Add (tsmiFile);
+			menu.Items.Add (tsmiHelp);
+
+			Assert.IsNull (tsmiFile.OwnerItem);
+
+			Assert.IsNotNull (tsmiQuit.OwnerItem);
+			Assert.AreEqual (tsmiQuit.OwnerItem.GetType ().Name, typeof (ToolStripMenuItem).Name);
+			Assert.AreEqual (tsmiQuit.OwnerItem, tsmiFile);
+		}
+		
 		[Test]
 		public void ToolStripDropDownButton_SelectChild ()
 		{
diff --git a/mcs/class/Microsoft.Build.Engine/ChangeLog b/mcs/class/Microsoft.Build.Engine/ChangeLog
index 3e8f199..8b1448e 100644
--- a/mcs/class/Microsoft.Build.Engine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-20  Ankit Jain  <jankit at novell.com>
+
+	* Microsoft.Build.Engine.dll.sources: Add tools/xbuild/SolutionParser.cs
+
 2009-02-21  Ankit Jain  <jankit at novell.com>
 
 	* Import.cs (GetFullPath): Use Utilities.FromMSBuildPath .
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs
index 293c524..c30fd7f 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BatchingImplBase.cs
@@ -62,7 +62,7 @@ namespace Microsoft.Build.BuildEngine {
 		protected void Init ()
 		{
 			// all referenced item lists
-			consumedItemsByName = new Dictionary<string, BuildItemGroup> ();
+			consumedItemsByName = new Dictionary<string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
 
 			// all referenced metadata
 			consumedMetadataReferences = new List<MetadataReference> ();
@@ -72,10 +72,10 @@ namespace Microsoft.Build.BuildEngine {
 
 		protected void BatchAndPrepareBuckets ()
 		{
-			batchedItemsByName = new Dictionary<string, BuildItemGroup> ();
+			batchedItemsByName = new Dictionary<string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
 
 			// These will passed as is for every batch
-			commonItemsByName = new Dictionary<string, BuildItemGroup> ();
+			commonItemsByName = new Dictionary<string, BuildItemGroup> (StringComparer.InvariantCultureIgnoreCase);
 
 			ValidateUnqualifiedMetadataReferences ();
 
@@ -106,7 +106,7 @@ namespace Microsoft.Build.BuildEngine {
 		protected void ParseAttribute (string value)
 		{
 			Expression expr = new Expression ();
-			expr.Parse (value, true);
+			expr.Parse (value, ParseOptions.AllowItemsMetadataAndSplit);
 
 			foreach (object o in expr.Collection) {
 				MetadataReference mr = o as MetadataReference;
@@ -158,8 +158,8 @@ namespace Microsoft.Build.BuildEngine {
 
 		ICollection<Dictionary<string, BuildItemGroup>> Bucketize ()
 		{
-			Dictionary<string, Dictionary<string, BuildItemGroup>> buckets =
-				new Dictionary<string, Dictionary<string, BuildItemGroup>> ();
+			var buckets = new Dictionary<string, Dictionary<string, BuildItemGroup>> (
+					StringComparer.InvariantCultureIgnoreCase);
 
 			// For each item list represented in "BatchedItemNames", and then for each item
 			// within that list, get the values for that item for each of the metadata in
@@ -198,7 +198,8 @@ namespace Microsoft.Build.BuildEngine {
 					Dictionary<string, BuildItemGroup> bucket;
 					if (!buckets.TryGetValue (bucket_key, out bucket))
 						// new bucket
-						buckets [bucket_key] = bucket = new Dictionary<string, BuildItemGroup> ();
+						buckets [bucket_key] = bucket = new Dictionary<string, BuildItemGroup> (
+								StringComparer.InvariantCultureIgnoreCase);
 
 					string itemGroup_key = item.Name;
 					BuildItemGroup itemGroup;
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
index 7b31986..530685e 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildEngine.cs
@@ -39,8 +39,9 @@ namespace Microsoft.Build.BuildEngine {
 		bool	continueOnError;
 		int	lineNumberOfTaskNode;
 		Project project;
+		string taskfile;
 		
-		public BuildEngine (Engine engine, Project project, int column, int line,
+		public BuildEngine (Engine engine, Project project, string taskfile, int column, int line,
 				    bool continueOnError)
 		{
 			this.engine = engine;
@@ -48,6 +49,7 @@ namespace Microsoft.Build.BuildEngine {
 			this.columnNumberOfTaskNode = column;
 			this.continueOnError = continueOnError;
 			this.lineNumberOfTaskNode = line;
+			this.taskfile = taskfile;
 		}
 	
 		// Initiates a build of a project file. If the build is
@@ -110,7 +112,7 @@ namespace Microsoft.Build.BuildEngine {
 		}
 
 		public string ProjectFileOfTaskNode {
-			get { return project.FullFileName; }
+			get { return taskfile; }
 		}
 		
 	}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
index 08b300c..efdbc26 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItem.cs
@@ -227,8 +227,9 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			if (parent_item_group != null) {
 				Expression e = new Expression ();
-				e.Parse (value, true);
-				evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject, typeof (string));
+				e.Parse (value, ParseOptions.AllowItemsNoMetadataAndSplit);
+				evaluatedMetadata [name] = (string) e.ConvertTo (parent_item_group.ParentProject,
+						typeof (string), ExpressionOptions.ExpandItemRefs);
 			} else
 				evaluatedMetadata [name] = Utilities.Unescape (value);
 				
@@ -260,18 +261,21 @@ namespace Microsoft.Build.BuildEngine {
 
 			DirectoryScanner directoryScanner;
 			Expression includeExpr, excludeExpr;
-			string includes, excludes;
+			ITaskItem[] includes;
+			string excludes;
 
 			includeExpr = new Expression ();
-			includeExpr.Parse (Include, true);
+			includeExpr.Parse (Include, ParseOptions.AllowItemsNoMetadataAndSplit);
 			excludeExpr = new Expression ();
-			excludeExpr.Parse (Exclude, true);
+			excludeExpr.Parse (Exclude, ParseOptions.AllowItemsNoMetadataAndSplit);
 			
-			includes = (string) includeExpr.ConvertTo (project, typeof (string));
-			excludes = (string) excludeExpr.ConvertTo (project, typeof (string));
+			includes = (ITaskItem[]) includeExpr.ConvertTo (project, typeof (ITaskItem[]),
+								ExpressionOptions.ExpandItemRefs);
+			excludes = (string) excludeExpr.ConvertTo (project, typeof (string), ExpressionOptions.ExpandItemRefs);
+
+			this.finalItemSpec = (string) includeExpr.ConvertTo (project, typeof (string),
+							ExpressionOptions.ExpandItemRefs);
 
-			this.finalItemSpec = includes;
-			
 			directoryScanner = new DirectoryScanner ();
 			
 			directoryScanner.Includes = includes;
@@ -284,15 +288,20 @@ namespace Microsoft.Build.BuildEngine {
 			
 			directoryScanner.Scan ();
 			
-			foreach (string matchedFile in directoryScanner.MatchedFilenames)
-				AddEvaluatedItem (project, evaluatedTo, matchedFile);
+			foreach (ITaskItem matchedItem in directoryScanner.MatchedItems)
+				AddEvaluatedItem (project, evaluatedTo, matchedItem);
 		}
 		
-		void AddEvaluatedItem (Project project, bool evaluatedTo, string itemSpec)
+		void AddEvaluatedItem (Project project, bool evaluatedTo, ITaskItem taskitem)
 		{
 			BuildItemGroup big;			
 			BuildItem bi = new BuildItem (this);
-			bi.finalItemSpec = itemSpec;
+			bi.finalItemSpec = taskitem.ItemSpec;
+
+			foreach (DictionaryEntry de in taskitem.CloneCustomMetadata ()) {
+				bi.unevaluatedMetadata.Add ((string) de.Key, (string) de.Value);
+				bi.evaluatedMetadata.Add ((string) de.Key, (string) de.Value);
+			}
 
 			project.EvaluatedItemsIgnoringCondition.AddItem (bi);
 
@@ -319,15 +328,22 @@ namespace Microsoft.Build.BuildEngine {
 			big.AddItem (bi);
 		}
 		
-		internal string ConvertToString (Expression transform)
+		// during item's eval phase, any item refs in this item, have either
+		// already been expanded or are non-existant, so expand can be _false_
+		//
+		// during prop's eval phase, this isn't reached, as it parses expressions
+		// with allowItems=false, so no ItemReferences are created at all
+		//
+		// at other times, item refs have already been expanded, so expand: false
+		internal string ConvertToString (Expression transform, ExpressionOptions options)
 		{
-			return GetItemSpecFromTransform (transform);
+			return GetItemSpecFromTransform (transform, options);
 		}
 		
-		internal ITaskItem ConvertToITaskItem (Expression transform)
+		internal ITaskItem ConvertToITaskItem (Expression transform, ExpressionOptions options)
 		{
 			TaskItem taskItem;
-			taskItem = new TaskItem (GetItemSpecFromTransform (transform), evaluatedMetadata);
+			taskItem = new TaskItem (GetItemSpecFromTransform (transform, options), evaluatedMetadata);
 			return taskItem;
 		}
 
@@ -342,21 +358,37 @@ namespace Microsoft.Build.BuildEngine {
 			}
 		}
 
-		string GetItemSpecFromTransform (Expression transform)
+		string GetItemSpecFromTransform (Expression transform, ExpressionOptions options)
 		{
 			StringBuilder sb;
 		
-			if (transform == null)
-				return finalItemSpec;
-			else {
+			if (transform == null) {
+				if (options == ExpressionOptions.ExpandItemRefs) {
+					// With usual code paths, this will never execute,
+					// but letting this be here, incase BI.ConvertTo*
+					// is called directly
+					Expression expr = new Expression ();
+					expr.Parse (finalItemSpec, ParseOptions.AllowItemsNoMetadataAndSplit);
+
+					return (string) expr.ConvertTo (parent_item_group.ParentProject,
+							typeof (string), ExpressionOptions.ExpandItemRefs);
+				} else {
+					return finalItemSpec;
+				}
+			} else {
+				// Transform, _DONT_ expand itemrefs
 				sb = new StringBuilder ();
 				foreach (object o in transform.Collection) {
 					if (o is string) {
 						sb.Append ((string)o);
 					} else if (o is PropertyReference) {
-						sb.Append (((PropertyReference)o).ConvertToString (parent_item_group.ParentProject));
+						sb.Append (((PropertyReference)o).ConvertToString (
+									parent_item_group.ParentProject,
+									ExpressionOptions.DoNotExpandItemRefs));
 					} else if (o is ItemReference) {
-						sb.Append (((ItemReference)o).ConvertToString (parent_item_group.ParentProject));
+						sb.Append (((ItemReference)o).ConvertToString (
+									parent_item_group.ParentProject,
+									ExpressionOptions.DoNotExpandItemRefs));
 					} else if (o is MetadataReference) {
 						sb.Append (GetMetadata (((MetadataReference)o).MetadataName));
 					}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
index c3ce123..fe3113b 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildItemGroup.cs
@@ -44,6 +44,7 @@ namespace Microsoft.Build.BuildEngine {
 		GroupingCollection	parentCollection;
 		Project			parentProject;
 		bool			read_only;
+		bool evaluated;
 
 		public BuildItemGroup ()
 			: this (null, null, null, false)
@@ -185,29 +186,45 @@ namespace Microsoft.Build.BuildEngine {
 			buildItems.Add (buildItem);
 		}
 
+		// In eval phase, any ref'ed item would've already been expanded
+		// or it doesnt exist, so dont expand again
+		// In non-eval, items have _already_ been expanded, so dont expand again
+		// So, ignore @options
 		internal string ConvertToString (Expression transform,
-						 Expression separator)
+						 Expression separator, ExpressionOptions options)
 		{
 			string separatorString;
 			
+			// Item refs are not expanded for separator or transform
 			if (separator == null)
 				separatorString = ";";
 			else
-				separatorString = (string) separator.ConvertTo (parentProject, typeof (string));
+				separatorString = (string) separator.ConvertTo (parentProject, typeof (string),
+								ExpressionOptions.DoNotExpandItemRefs);
 		
 			string[] items = new string [buildItems.Count];
 			int i = 0;
 			foreach (BuildItem bi in  buildItems)
-				items [i++] = bi.ConvertToString (transform);
+				items [i++] = bi.ConvertToString (transform, ExpressionOptions.DoNotExpandItemRefs);
 			return String.Join (separatorString, items);
 		}
 
-		internal ITaskItem[] ConvertToITaskItemArray (Expression transform)
+		// In eval phase, any ref'ed item would've already been expanded
+		// or it doesnt exist, so dont expand again
+		// In non-eval, items have _already_ been expanded, so dont expand again
+		// So, ignore @options
+		internal ITaskItem[] ConvertToITaskItemArray (Expression transform, Expression separator, ExpressionOptions options)
 		{
+			if (separator != null)
+				// separator present, so return as a single "join'ed" string
+				return new ITaskItem [] {
+					new TaskItem (ConvertToString (transform, separator, options))
+				};
+
 			ITaskItem[] array = new ITaskItem [buildItems.Count];
 			int i = 0;
 			foreach (BuildItem item in buildItems)
-				array [i++] = item.ConvertToITaskItem (transform);
+				array [i++] = item.ConvertToITaskItem (transform, ExpressionOptions.DoNotExpandItemRefs);
 			return array;
 		}
 
@@ -221,6 +238,8 @@ namespace Microsoft.Build.BuildEngine {
 
 		internal void Evaluate ()
 		{
+			if (evaluated)
+				return;
 			foreach (BuildItem bi in buildItems) {
 				if (bi.Condition == String.Empty)
 					bi.Evaluate (parentProject, true);
@@ -229,6 +248,7 @@ namespace Microsoft.Build.BuildEngine {
 					bi.Evaluate (parentProject, ce.BoolEvaluate (parentProject));
 				}
 			}
+			evaluated = true;
 		}		
 
 		internal void ReplaceWith (BuildItem item, List <BuildItem> list)
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
index f870118..3256311 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildProperty.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 // 
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -31,6 +33,9 @@ using System;
 using System.Text;
 using System.Xml;
 
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
 namespace Microsoft.Build.BuildEngine {
 	public class BuildProperty {
 	
@@ -41,6 +46,7 @@ namespace Microsoft.Build.BuildEngine {
 		string		name;
 		Project		parentProject;
 		PropertyType	propertyType;
+		bool		converting;
 
 		BuildProperty ()
 		{
@@ -74,7 +80,7 @@ namespace Microsoft.Build.BuildEngine {
 			this.propertyType = PropertyType.Normal;
 			this.parentProject = parentProject;
 			this.name = propertyElement.Name;
-			this.value = propertyElement.InnerXml;
+			this.value = Utilities.UnescapeFromXml (propertyElement.InnerXml);
 			this.isImported = false;
 		}
 
@@ -114,13 +120,67 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			BuildProperty evaluated = new BuildProperty (Name, Value);
 
+			// In evaluate phase, properties are not expanded
 			Expression exp = new Expression ();
-			exp.Parse (Value, false, false);
-			evaluated.finalValue = (string) exp.ConvertTo (parentProject, typeof (string));
+			exp.Parse (Value, ParseOptions.None);
+			evaluated.finalValue = (string) exp.ConvertTo (parentProject, typeof (string),
+					ExpressionOptions.DoNotExpandItemRefs);
 
 			parentProject.EvaluatedProperties.AddProperty (evaluated);
 		}
 
+		// during property's eval phase, this is never reached, as PropertyReference
+		// handles the eval case
+		//
+		// during item's eval phase, we have expand: true, that's what we
+		// do here..
+		//
+		// during non-eval, expand: true
+		// So, its always true here
+		internal string ConvertToString (Project project, ExpressionOptions options)
+		{
+			if (converting) {
+				// found ref to @this while trying to ConvertToString
+				// for @this!
+				return FinalValue;
+			}
+
+			converting = true;
+			try {
+				Expression exp = new Expression ();
+
+				// in non-evaluation phase, properties are always expanded
+				exp.Parse (FinalValue, options == ExpressionOptions.ExpandItemRefs ?
+							ParseOptions.AllowItems : ParseOptions.None);
+				return (string) exp.ConvertTo (project, typeof (string), options);
+			} finally {
+				converting = false;
+			}
+		}
+
+		internal ITaskItem[] ConvertToITaskItemArray (Project project, ExpressionOptions options)
+		{
+			if (converting) {
+				// found ref to @this while trying to ConvertToITaskItemArray
+				// for @this!
+				ITaskItem []items = new ITaskItem [1];
+				items [0] = new TaskItem (FinalValue);
+				return items;
+			}
+
+			converting = true;
+			try {
+				Expression exp = new Expression ();
+
+				// in non-evaluation phase, properties are always expanded
+				exp.Parse (FinalValue, ParseOptions.Split | (options == ExpressionOptions.ExpandItemRefs ?
+							ParseOptions.AllowItems : ParseOptions.None));
+				return (ITaskItem[]) exp.ConvertTo (project, typeof (ITaskItem[]), options);
+			} finally {
+				converting = false;
+			}
+		}
+
 		internal bool FromXml {
 			get {
 				return propertyElement != null;
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
index defc261..dd32596 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildPropertyGroup.cs
@@ -44,6 +44,7 @@ namespace Microsoft.Build.BuildEngine {
 		Project			parentProject;
 		List <BuildProperty>	properties;
 		Dictionary <string, BuildProperty>	propertiesByName;
+		bool evaluated;
 
 		public BuildPropertyGroup ()
 			: this (null, null, null, false)
@@ -221,9 +222,14 @@ namespace Microsoft.Build.BuildEngine {
 		
 		internal void Evaluate ()
 		{
+			if (evaluated)
+				return;
+
 			foreach (BuildProperty bp in properties)
 				if (ConditionParser.ParseAndEvaluate (bp.Condition, parentProject))
 					bp.Evaluate ();
+
+			evaluated = true;
 		}
 		
 		public string Condition {
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
index c865494..9edeeb5 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/BuildTask.cs
@@ -42,6 +42,7 @@ namespace Microsoft.Build.BuildEngine {
 		ITaskHost		hostObject;
 		Target			parentTarget;
 		XmlElement		taskElement;
+		TaskLoggingHelper	task_logger;
 	
 		internal BuildTask (XmlElement taskElement, Target parentTarget)
 		{
@@ -87,16 +88,27 @@ namespace Microsoft.Build.BuildEngine {
 			TaskEngine	taskEngine;
 
 			LogTaskStarted ();
+			ITask task = null;
+
+			try {
+				task = InitializeTask ();
+			} catch (Exception e) {
+				LogError ("Error initializing task {0}: {1}", taskElement.LocalName, e.Message);
+				LogMessage (MessageImportance.Low, "Error initializing task {0}: {1}",
+						taskElement.LocalName, e.ToString ());
+				return false;
+			}
 
 			try {
 				taskEngine = new TaskEngine (parentTarget.Project);		
-				taskEngine.Prepare (InitializeTask (), this.taskElement, GetParameters (), this.Type);
+				taskEngine.Prepare (task, this.taskElement, GetParameters (), this.Type);
 				result = taskEngine.Execute ();
 				if (result)
 					taskEngine.PublishOutput ();
-			// FIXME: it should be logged (exception)
 			} catch (Exception e) {
-				Console.Error.WriteLine (e);
+				task_logger.LogError ("Error executing task {0}: {1}", taskElement.LocalName, e.Message);
+				task_logger.LogMessage (MessageImportance.Low,
+						"Error executing task {0}: {1}", taskElement.LocalName, e.ToString ());
 				result = false;
 			}
 
@@ -147,24 +159,47 @@ namespace Microsoft.Build.BuildEngine {
 		
 		void LogTaskStarted ()
 		{
-			TaskStartedEventArgs tsea = new TaskStartedEventArgs ("Task started.", null, parentTarget.Project.FullFileName,
-				parentTarget.Project.FullFileName, taskElement.Name);
+			TaskStartedEventArgs tsea = new TaskStartedEventArgs ("Task started.", null,
+					parentTarget.Project.FullFileName,
+					parentTarget.TargetFile, taskElement.Name);
 			parentTarget.Project.ParentEngine.EventSource.FireTaskStarted (this, tsea);
 		}
 		
 		void LogTaskFinished (bool succeeded)
 		{
-			TaskFinishedEventArgs tfea = new TaskFinishedEventArgs ("Task finished.", null, parentTarget.Project.FullFileName,
-				parentTarget.Project.FullFileName, taskElement.Name, succeeded);
+			TaskFinishedEventArgs tfea = new TaskFinishedEventArgs ("Task finished.", null,
+					parentTarget.Project.FullFileName,
+					parentTarget.TargetFile, taskElement.Name, succeeded);
 			parentTarget.Project.ParentEngine.EventSource.FireTaskFinished (this, tfea);
 		}
+
+		void LogError (string message,
+				     params object[] messageArgs)
+		{
+			BuildErrorEventArgs beea = new BuildErrorEventArgs (
+				null, null, null, 0, 0, 0, 0, String.Format (message, messageArgs),
+				null, null);
+			parentTarget.Project.ParentEngine.EventSource.FireErrorRaised (this, beea);
+		}
 		
+		void LogMessage (MessageImportance importance,
+					string message,
+					params object[] messageArgs)
+		{
+			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
+				String.Format (message, messageArgs), null,
+				null, importance);
+			parentTarget.Project.ParentEngine.EventSource.FireMessageRaised (this, bmea);
+		}
+
 		ITask InitializeTask ()
 		{
 			ITask task;
 			
 			task = (ITask)Activator.CreateInstance (this.Type);
-			task.BuildEngine = new BuildEngine (parentTarget.Project.ParentEngine, parentTarget.Project, 0, 0, ContinueOnError);
+			task.BuildEngine = new BuildEngine (parentTarget.Project.ParentEngine, parentTarget.Project,
+						parentTarget.TargetFile, 0, 0, ContinueOnError);
+			task_logger = new TaskLoggingHelper (task);
 			
 			return task;
 		}
@@ -198,8 +233,9 @@ namespace Microsoft.Build.BuildEngine {
 					return false;
 				else {
 					Expression exp = new Expression ();
-					exp.Parse (str, true);
-					return (bool) exp.ConvertTo (parentTarget.Project, typeof (bool));
+					exp.Parse (str, ParseOptions.AllowItemsNoMetadataAndSplit);
+					return (bool) exp.ConvertTo (parentTarget.Project, typeof (bool),
+							ExpressionOptions.ExpandItemRefs);
 				}
 			}
 			set {
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
index 3d1e6dd..2b0a1d9 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
@@ -1,3 +1,339 @@
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* Target.cs (TargetFile): New. Gives the name of the file
+	containing the target definition.
+	* BuildEngine.cs (.ctor): Add a 'taskfile' parameters, and
+	return this for ProjectFileOfTaskNode.
+	* BuildTask.cs (LogTaskStarted):
+	(LogTaskFinished): Use parentTarget.ProjectFileOfTaskNode for
+	the event.
+	(InitializeTask): Set BuildEngine's task file to parent target's
+	TargetFile.
+	* Engine.cs (LogProjectStarted): Incase of default targets, set
+	TargetNames to String.Empty .
+	* TargetBatchingImpl.cs (LogTargetStarted):
+	(LogTargetFinished): Use target.TargetFile for the event.
+
+	* ConsoleLogger.cs: Keep a stack of project/target/task being
+	executed. And corresponding list of errors and warnings.
+	(EventsToString): Stringifies the current "stack", to be used
+	as key to the table of errors/warnings and for show messages
+	at the end of the build.
+
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (Load): Add argument checks.
+
+2009-10-11  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs (no_colors): Rename to ..
+	(use_colors): .. this. Fix the case when XBUILD_COLORS
+	is not set.
+
+2009-10-11  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs: Use ColorSetter and ColorResetter .
+	Support 'XBUILD_COLORS' to set colors for errors, warnings,
+	events and messages.
+
+2009-10-10  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs (ProjectFinishedHandler): Once projectFailed
+	becomes true, don't reset it. We are looking for "atleast one
+	project failed".
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* DirectoryScanner.cs: Use Path.GetPathRoot, instead of
+	directly using DirectoryInfo ("z:"), that doesn't return
+	a dir info for "z:".
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* DirectoryScanner.cs: Handle absolute paths. Fix to work
+	correctly on windows. Change order of adding paths to match
+	msbuild, useful to have.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* TaskBatchingImpl.cs (ParseTaskAttributes): Parse attributes
+	of the 'Output' element also.
+	* TaskEngine.cs (PublishOutput): Honor condition on 'Output' also.
+
+2009-10-07  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs: Mark build as failed, if any project failed.
+
+2009-10-06  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger: Improve error reporting. Don't count failed task,
+	target or project as another error. Show "errors" after "warnings",
+	more useful to the user.
+	* Project.cs (BuildTarget): Log error instead of using CWL.
+
+2009-10-03  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (OS): New.
+	(InitializeProperties): Set 'OS' as a pre-defined property, set to
+	'Windows_NT', 'Unix' or 'OSX' depending on the platform.
+
+2009-10-02  Ankit Jain  <jankit at novell.com>
+
+	* Expression.cs (Parse): Don't change '/' to '\\', not required.
+
+2009-10-01  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (AddImport): Show the correct source file name, when
+	the import is in the main project file.
+
+2009-10-01  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #543299.
+	* Import.cs (.ctor): Evaluate and set EvaluatedProjectPath to
+	the full path of the imported project here itself, instead of ..
+	(Evaluate): .. here.
+	* ImportCollection.cs (Add): Use import.EvaluatedProjectPath .
+	(Contains): New.
+	* Project.cs (AddImport): Don't process if condition is false.
+	Warn if a circular reference is detected, and ignore the import.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* GroupingCollection.cs (Evaluate): Mark internal.
+	* Project.cs (AddImport): Only evaluate the properties,
+	till before the import.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (DoLoad): Don't use XmlReader.Create, for loading
+	the project xml, as returned Xml*Reader normalizes the newlines.
+	Instead directly use the TextReader with XmlDocument.Load ().
+
+2009-09-27  Ankit Jain  <jankit at novell.com>
+
+	* ConditionParser.cs: Show the condition being parsed in the
+	exception message.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* Expression.cs: Allow '-' in item, property and metadata names.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (Evaluate): Split into this and ..
+	(PrepareForEvaluate): .. this.
+	(AddImport): Evaluate the current set of properties/items etc,
+	before processing the imported project. Honor the Condition
+	for the Import.
+	(ProcessProjectAttributes): Update MSBuildProjectDefaultTargets
+	property.
+	* GroupingCollection.cs (Evaluate): Don't evaluate Imports here.
+	* BuildItemGroup.cs (Evaluate): Evaluate only once.
+	* BuildPropertyGroup.cs (Evaluate): Evaluate only once.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs: Get InitialTargets from the imported projects also.
+	The combined list of targets are executed, in the order they were
+	found.
+	DefaultTargets are also read in from imported projects, and the first
+	non-empty DefaultTargets found is used.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (BuildTarget): Handle skipped targets.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (DoLoad): If a VS2003 project is detected, then throw
+	InvalidProjectFileException with useful error.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (Load): Emit the .sln.proj file only if env var
+	XBUILD_EMIT_SOLUTION is set.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (GetKeyForTarget): Make target name, case insensitive.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (InitializeProperties): Set 'MSBuildProjectDefaultTargets'
+	reserved property.
+
+2009-09-10  Ankit Jain  <jankit at novell.com>
+
+	* BuildItem.cs (Evaluate): Metadata from "Include" should be,
+	preserved, so use ConvertTo ITaskItem, rather than string.
+	Ensure that the new items have the metadata from references _in_
+	Include, and the metadata of _this_ builditem.
+	* DirectoryScanner.cs (Includes): Change to a array of ITaskItem.
+	(MatchedFilenames): Rename to ..
+	(MatchedItems): .. this, and change type of array of ITaskItem.
+	Ensure that metadata of items in Includes are retained in the
+	final matched items.
+
+	* BuildItemGroup.cs (ConvertoToITaskItemArray): Add 'separator'
+	param. If separator is present, then just return a "Join'ed"
+	string as the single task item.
+	* ItemReference.cs: Track api changes.
+
+	* BuildProperty.cs (ConvertToITaskItemArray): Split the value,
+	as we need separate task items.
+
+2009-09-01  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #534965.
+	* Project.cs (BuildTarget): Move caching of target outputs to ..
+	* Target.cs: .. here. Move LogTargetSkipped also here.
+	Ensure that caching happens for target dependencies also.
+
+2009-09-01  Ankit Jain  <jankit at novell.com>
+
+	* DirectoryScanner.cs (Scan): Ignore empty entries in includes and
+	excludes.
+
+2009-09-01  Ankit Jain  <jankit at novell.com>
+
+	* Expression.cs (ParseOptions): New enum. Replace the bool params
+	of exression.Parse with this. Add option to control expansion of
+	metadata references.
+	(CopyToExpressionCollection): Track api changes.
+	
+	Update all expr.Parse calls to use the new enum.
+	* BuildItem.cs, BuildProperty.cs, BuildTask.cs, Import.cs,
+	Target.cs, TargetBatchingImpl.cs, UsingTask.cs: Track api changes.
+
+	* BatchingImplBase.cs: Track api changes. Allow metadata refs
+	in task attributes.
+	* ConditionFactorExpression.cs: Allow metadata refs in conditions.
+	* ItemReference.cs: Allow metadata in transforms.
+	* TaskEngine.cs: Allow metadata refs.
+
+	* MetadataReference.cs (.ctor): Add a 'original string' param.
+
+2009-08-29  Ankit Jain  <jankit at novell.com>
+
+	* Expression.cs (ExpressionOptions): New.
+
+	Introduce a ExpressionOptions argument to all ConvertTo*
+	methods. Implement the rule: in evaluation phase, expand
+	all items completely, but dont expand item refs in properties.
+	At other times, expand the item refs in the properties.
+	See comments in Expression.cs, for a full explanation.
+	* BuildItem.cs: Track api changes.
+	* BuildItemGroup.cs: Likewise.
+	* BuildProperty.cs: Track api changes. Handle self-references.
+	* BuildTask.cs: Track api changes.
+	* IReference.cs: Add ExpressionOptions param.
+	* ItemReference.cs: Track api changes.
+	* PropertyReference.cs: Likewise.
+	* MetadataReference.cs: Likewise.
+	* ExpressionCollection.cs: Track api changes. Add support for
+	converting all primitive types and DateTime, instead of a fixed
+	few.
+	* Project.cs (GetMetadataBatched): Use the evaluated metadata.
+	* TaskBatchingImpl.cs: Handle the case when batching is required,
+	but no items are available.
+
+	* TaskEngine.cs: Throw on unsupported types. Correctly handle
+	properties in case of empty values.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* Expression.cs: Correctly handle a item reference with transform
+	when allowItems is false. If item ref is ignored, then the transform
+	will get incorrectly matched as a metadata ref.
+	* ItemReference.cs (.ctor): Add a @original_string param.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* Utilities.cs (UnescapeFromXml): New. From md.
+	* BuildProperty.cs (.ctor): Unescape xml codes from the InnerXml
+	of the property element.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* BuildProperty.cs (ConvertToString): New.
+	(ConvertoToITaskItemArray): New. Parse the property value.
+	* PropertyReference.cs (ConvertToString): Use BuildProperty's
+	ConvertToString.
+	(ConvertoToITaskItemArray): Likewise.	
+
+2009-08-21  Ankit Jain  <jankit at novell.com>
+
+	* Engine.cs (EndProjectBuild): Use the @succeeded argument
+	instead of hardcoding 'true'.
+	* Target.cs (Build): Add an overload to return executeOnErrors
+	value for the target executed. If building dependencies fails,
+	and executeOnErrors is true, then execute OnError tasks.
+	Add the new param to ..
+	(BuildDependencies): this, ..
+	(DoBuild): and this.
+	(GetDependencies): Improve error message and variable name.
+	(ExecuteOnErrors): Honor OnError tag's Condition also.
+	* TaskBatchingImpl.cs (Run): Correctly set executeOnErrors param.
+
+2009-08-20  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #532264
+	* Project.cs (Load): Add support for loading .sln files.
+
+2009-08-20  Ankit Jain  <jankit at novell.com>
+
+	* BuildTask.cs (Execute): Use task_logger only after the task
+	has been initialized. Catch and report task loading errors.
+	* Target.cs (DoBuild): Dont rethrow the exception, and emit
+	the stacktrace as a low importance message.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* BatchingImplBase.cs: Make the item name lookups and metadata be case
+	insensitive.
+	* TaskDatabase.cs: Likewise.
+	* TaskEngine.cs: Make property name looks, case insensitive.
+
+2009-08-09  Miguel de Icaza  <miguel at novell.com>
+
+	* ConsoleLogger.cs: Change the format of the error and warnings
+	strings to work when invoked inside Emacs by not rendering the
+	column if available, by using lowercase "error"/"warning" strings
+	instead of camelcased versions and to not have unnecessary padding.
+
+2009-07-31  Ankit Jain  <jankit at novell.com>
+
+	* ConsoleLogger.cs: Keep track of all the errors and warnings
+	and show them at the end.
+
+2009-07-31  Ankit Jain  <jankit at novell.com>
+
+	* Target.cs (Build): Log a message if a target is skipped.
+	(LogMessage): New.
+	* BuildTask.cs (Execute): Log error if task execution fails.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* Engine.cs (.ctor): Set default BinPath. Currently this assumes
+	v2.0, this will change when multi-targeting lands.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* Project.cs (InitializeProperties) Set 'MSBuildProjectFile' and
+	'MSBuildProjectName' properties.
+
+2009-07-28  Ankit Jain  <jankit at novell.com>
+
+	* TaskEngine.cs (Prepare): Fix formatting mistake.
+	* ConsoleLogger.cs: Emit "-- FAILED" also when project/target building
+	fails. Also, emit result of project at Normal verbosity level.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #511370.
+	* Project.cs (ExtensionsPath): New.
+	(InitializeProperties): Set "MSBuildExtensionsPath" property.
+
 2009-06-12  Ankit Jain  <jankit at novell.com>
 
 	Fix bug #512535.
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs
index bb24a71..616b003 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionFactorExpresion.cs
@@ -122,7 +122,7 @@ namespace Microsoft.Build.BuildEngine {
 		static Token EvaluateToken (Token token, Project context)
 		{
 			Expression oe = new Expression ();
-			oe.Parse (token.Value, true);
+			oe.Parse (token.Value, ParseOptions.AllowItemsMetadataAndSplit);
 			return new Token ((string) oe.ConvertTo (context, typeof (string)), token.Type);
 		}
 	}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
index ab5013f..728529c 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConditionParser.cs
@@ -39,11 +39,13 @@ namespace Microsoft.Build.BuildEngine {
 	internal class ConditionParser {
 	
 		ConditionTokenizer tokenizer;
+		string conditionStr;
 		
 		ConditionParser (string condition)
 		{
 			tokenizer = new ConditionTokenizer ();
 			tokenizer.Tokenize (condition);
+			conditionStr = condition;
 		}
 		
 		public static bool ParseAndEvaluate (string condition, Project context)
@@ -171,7 +173,7 @@ namespace Microsoft.Build.BuildEngine {
 			} else if (token.Type == TokenType.Not) {
 				e = ParseNotExpression ();
 			} else
-				throw new ExpressionParseException (String.Format ("Unexpected token type {0}.", token.Type));
+				throw new ExpressionParseException (String.Format ("Unexpected token type {0}, while parsing {1}", token.Type, conditionStr));
 			
 			return e;
 		}
@@ -244,7 +246,7 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			if (tokenizer.Token.Type != type)
 				throw new ExpressionParseException ("Expected token type of type: " + type + ", got " +
-						tokenizer.Token.Type + " (" + tokenizer.Token.Value + ") .");
+						tokenizer.Token.Type + " (" + tokenizer.Token.Value + "), while parsing " + conditionStr);
 		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
index e049156..8114c79 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
@@ -29,8 +29,10 @@
 
 using System;
 using System.Runtime.InteropServices;
+using System.Collections.Generic;
 using System.IO;
 using System.Security;
+using System.Text;
 using Microsoft.Build.Framework;
 
 namespace Microsoft.Build.BuildEngine {
@@ -46,6 +48,17 @@ namespace Microsoft.Build.BuildEngine {
 		bool		performanceSummary;
 		bool		showSummary;
 		bool		skipProjectStartedText;
+		List<string> errors, warnings;
+		bool		projectFailed;
+		ConsoleColor errorColor, warningColor, eventColor, messageColor, highMessageColor;
+		ColorSetter colorSet;
+		ColorResetter colorReset;
+		bool no_message_color, use_colors;
+
+		List<BuildStatusEventArgs> events;
+		Dictionary<string, List<string>> errorsTable;
+		Dictionary<string, List<string>> warningsTable;
+		string current_events_string;
 		
 		public ConsoleLogger ()
 			: this (LoggerVerbosity.Normal, null, null, null)
@@ -57,7 +70,6 @@ namespace Microsoft.Build.BuildEngine {
 		{
 		}
 		
-		// FIXME: what about colorSet and colorReset?
 		public ConsoleLogger (LoggerVerbosity verbosity,
 				      WriteHandler write,
 				      ColorSetter colorSet,
@@ -74,6 +86,105 @@ namespace Microsoft.Build.BuildEngine {
 			this.performanceSummary = false;
 			this.showSummary = true;
 			this.skipProjectStartedText = false;
+			errors = new List<string> ();
+			warnings = new List<string> ();
+			this.colorSet = colorSet;
+			this.colorReset = colorReset;
+
+			events = new List<BuildStatusEventArgs> ();
+			errorsTable = new Dictionary<string, List<string>> ();
+			warningsTable = new Dictionary<string, List<string>> ();
+
+			//defaults
+			errorColor = ConsoleColor.DarkRed;
+			warningColor = ConsoleColor.DarkYellow;
+			eventColor = ConsoleColor.DarkCyan;
+			messageColor = ConsoleColor.DarkGray;
+			highMessageColor = ConsoleColor.White;
+
+			// if message color is not set via the env var,
+			// then don't use any color for it.
+			no_message_color = true;
+
+			use_colors = false;
+			if (colorSet == null || colorReset == null)
+				return;
+
+			// color support
+			string config = Environment.GetEnvironmentVariable ("XBUILD_COLORS");
+			if (config == null) {
+				use_colors = true;
+				return;
+			}
+
+			if (config == "disable")
+				return;
+
+			use_colors = true;
+			string [] pairs = config.Split (new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
+			foreach (string pair in pairs) {
+				string [] parts = pair.Split (new char[] {'='}, StringSplitOptions.RemoveEmptyEntries);
+				if (parts.Length != 2)
+					continue;
+
+				if (parts [0] == "errors")
+					TryParseConsoleColor (parts [1], ref errorColor);
+				else if (parts [0] == "warnings")
+					TryParseConsoleColor (parts [1], ref warningColor);
+				else if (parts [0] == "events")
+					TryParseConsoleColor (parts [1], ref eventColor);
+				else if (parts [0] == "messages") {
+					if (TryParseConsoleColor (parts [1], ref messageColor)) {
+						highMessageColor = GetBrightColorFor (messageColor);
+						no_message_color = false;
+					}
+				}
+			}
+		}
+
+		bool TryParseConsoleColor (string color_str, ref ConsoleColor color)
+		{
+			switch (color_str.ToLower ()) {
+			case "black": color = ConsoleColor.Black; break;
+
+			case "blue": color = ConsoleColor.DarkBlue; break;
+			case "green": color = ConsoleColor.DarkGreen; break;
+			case "cyan": color = ConsoleColor.DarkCyan; break;
+			case "red": color = ConsoleColor.DarkRed; break;
+			case "magenta": color = ConsoleColor.DarkMagenta; break;
+			case "yellow": color = ConsoleColor.DarkYellow; break;
+			case "grey": color = ConsoleColor.DarkGray; break;
+
+			case "brightgrey": color = ConsoleColor.Gray; break;
+			case "brightblue": color = ConsoleColor.Blue; break;
+			case "brightgreen": color = ConsoleColor.Green; break;
+			case "brightcyan": color = ConsoleColor.Cyan; break;
+			case "brightred": color = ConsoleColor.Red; break;
+			case "brightmagenta": color = ConsoleColor.Magenta; break;
+			case "brightyellow": color = ConsoleColor.Yellow; break;
+
+			case "white":
+			case "brightwhite": color = ConsoleColor.White; break;
+			default: return false;
+			}
+
+			return true;
+		}
+
+		ConsoleColor GetBrightColorFor (ConsoleColor color)
+		{
+			switch (color) {
+			case ConsoleColor.DarkBlue: return ConsoleColor.Blue;
+			case ConsoleColor.DarkGreen: return ConsoleColor.Green;
+			case ConsoleColor.DarkCyan: return ConsoleColor.Cyan;
+			case ConsoleColor.DarkRed: return ConsoleColor.Red;
+			case ConsoleColor.DarkMagenta: return ConsoleColor.Magenta;
+			case ConsoleColor.DarkYellow: return ConsoleColor.Yellow;
+			case ConsoleColor.DarkGray: return ConsoleColor.Gray;
+			case ConsoleColor.Gray: return ConsoleColor.White;
+
+			default: return color;
+			}
 		}
 		
 		public void ApplyParameter (string parameterName,
@@ -104,17 +215,57 @@ namespace Microsoft.Build.BuildEngine {
 			WriteLine (String.Format ("Build started {0}.", args.Timestamp));
 			WriteLine ("__________________________________________________");
 			buildStart = args.Timestamp;
+
+			PushEvent (args);
 		}
 		
 		public void BuildFinishedHandler (object sender, BuildFinishedEventArgs args)
 		{
-			if (args.Succeeded == true) {
+			if (args.Succeeded == true && !projectFailed) {
 				WriteLine ("Build succeeded.");
 			} else {
-				WriteLine ("Build failed.");
+				WriteLine ("Build FAILED.");
 			}
 			if (performanceSummary == true) {
 			}
+
+			if (warnings.Count > 0) {
+				WriteLine (Environment.NewLine + "Warnings:");
+				SetColor (warningColor);
+
+				WriteLine (String.Empty);
+				foreach (KeyValuePair<string, List<string>> pair in warningsTable) {
+					if (!String.IsNullOrEmpty (pair.Key))
+						WriteLine (pair.Key);
+
+					string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t";
+					foreach (string msg in pair.Value)
+						WriteLine (String.Format ("{0}{1}", indent_str, msg));
+
+					WriteLine (String.Empty);
+				}
+
+				ResetColor ();
+			}
+
+			if (errors.Count > 0) {
+				WriteLine ("Errors:");
+				SetColor (errorColor);
+
+				WriteLine (String.Empty);
+				foreach (KeyValuePair<string, List<string>> pair in errorsTable) {
+					if (!String.IsNullOrEmpty (pair.Key))
+						WriteLine (pair.Key);
+
+					string indent_str = String.IsNullOrEmpty (pair.Key) ? String.Empty : "\t";
+					foreach (string msg in pair.Value)
+						WriteLine (String.Format ("{0}{1}", indent_str, msg));
+
+					WriteLine (String.Empty);
+				}
+				ResetColor ();
+			}
+
 			if (showSummary == true){
 				TimeSpan timeElapsed = args.Timestamp - buildStart;
 				WriteLine (String.Format ("\t {0} Warning(s)", warningCount));
@@ -122,77 +273,131 @@ namespace Microsoft.Build.BuildEngine {
 				WriteLine (String.Empty);
 				WriteLine (String.Format ("Time Elapsed {0}", timeElapsed));
 			} 
+			PopEvent ();
 		}
 
 		public void ProjectStartedHandler (object sender, ProjectStartedEventArgs args)
 		{
-			WriteLine (String.Format ("Project \"{0}\" ({1} target(s)):", args.ProjectFile, args.TargetNames));
+			SetColor (eventColor);
+			WriteLine (String.Format ("Project \"{0}\" ({1} target(s)):", args.ProjectFile,
+						String.IsNullOrEmpty (args.TargetNames) ? "default" : args.TargetNames));
+			ResetColor ();
 			WriteLine (String.Empty);
+			PushEvent (args);
 		}
 		
 		public void ProjectFinishedHandler (object sender, ProjectFinishedEventArgs args)
 		{
-			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic)) {
-				WriteLine (String.Format ("Done building project \"{0}\".", args.ProjectFile));
+			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) {
+				if (indent == 1)
+					indent --;
+				SetColor (eventColor);
+				WriteLine (String.Format ("Done building project \"{0}\".{1}", args.ProjectFile,
+							args.Succeeded ? String.Empty : "-- FAILED"));
+				ResetColor ();
 				WriteLine (String.Empty);
 			}
+			if (!projectFailed)
+				// no project has failed yet, so update the flag
+				projectFailed = !args.Succeeded;
+
+			PopEvent ();
 		}
 		
 		public void TargetStartedHandler (object sender, TargetStartedEventArgs args)
 		{
-			WriteLine (String.Format ("Target {0}:",args.TargetName));
 			indent++;
+			SetColor (eventColor);
+			WriteLine (String.Format ("Target {0}:",args.TargetName));
+			ResetColor ();
+			PushEvent (args);
 		}
 		
 		public void TargetFinishedHandler (object sender, TargetFinishedEventArgs args)
 		{
+			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Detailed) || !args.Succeeded) {
+				SetColor (eventColor);
+				WriteLine (String.Format ("Done building target \"{0}\" in project \"{1}\".{2}",
+					args.TargetName, args.ProjectFile,
+					args.Succeeded ? String.Empty : "-- FAILED"));
+				ResetColor ();
+			}
 			indent--;
-			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Diagnostic))
-				WriteLine (String.Format ("Done building target \"{0}\" in project \"{1}\".",
-					args.TargetName, args.ProjectFile));
-			if (!args.Succeeded)
-				errorCount++;
+
 			WriteLine (String.Empty);
+			PopEvent ();
 		}
 		
 		public void TaskStartedHandler (object sender, TaskStartedEventArgs args)
 		{
-			if (this.verbosity == LoggerVerbosity.Diagnostic)
+			if (this.verbosity == LoggerVerbosity.Detailed) {
+				SetColor (eventColor);
 				WriteLine (String.Format ("Task \"{0}\"",args.TaskName));
+				ResetColor ();
+			}
 			indent++;
+			PushEvent (args);
 		}
 		
 		public void TaskFinishedHandler (object sender, TaskFinishedEventArgs args)
 		{
 			indent--;
-			if (this.verbosity == LoggerVerbosity.Diagnostic) {
+			if (this.verbosity == LoggerVerbosity.Detailed || !args.Succeeded) {
+				SetColor (eventColor);
 				if (args.Succeeded)
 					WriteLine (String.Format ("Done executing task \"{0}\"", args.TaskName));
-				else {
-					WriteLine (String.Format ("Task \"{0}\" execution failed", args.TaskName));
-					errorCount++;
-				}
+				else
+					WriteLine (String.Format ("Task \"{0}\" execution -- FAILED", args.TaskName));
+				ResetColor ();
 			}
+			PopEvent ();
 		}
 		
 		public void MessageHandler (object sender, BuildMessageEventArgs args)
 		{
 			if (IsMessageOk (args)) {
-				WriteLine (args.Message);
+				if (no_message_color) {
+					WriteLine (args.Message);
+				} else {
+					SetColor (args.Importance == MessageImportance.High ? highMessageColor : messageColor);
+					WriteLine (args.Message);
+					ResetColor ();
+				}
 			}
 		}
 		
 		public void WarningHandler (object sender, BuildWarningEventArgs args)
 		{
-			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) 
-				WriteLineWithoutIndent (FormatWarningEvent (args));
+			string msg = FormatWarningEvent (args);
+			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Normal)) {
+				SetColor (warningColor);
+				WriteLineWithoutIndent (msg);
+				ResetColor ();
+			}
+			warnings.Add (msg);
+
+			List<string> list = null;
+			if (!warningsTable.TryGetValue (EventsAsString, out list))
+				warningsTable [EventsAsString] = list = new List<string> ();
+			list.Add (msg);
+
 			warningCount++;
 		}
 		
 		public void ErrorHandler (object sender, BuildErrorEventArgs args)
 		{
-			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Minimal)) 
-				WriteLineWithoutIndent (FormatErrorEvent (args));
+			string msg = FormatErrorEvent (args);
+			if (IsVerbosityGreaterOrEqual (LoggerVerbosity.Minimal)) {
+				SetColor (errorColor);
+				WriteLineWithoutIndent (msg);
+				ResetColor ();
+			}
+			errors.Add (msg);
+
+			List<string> list = null;
+			if (!errorsTable.TryGetValue (EventsAsString, out list))
+				errorsTable [EventsAsString] = list = new List<string> ();
+			list.Add (msg);
 			errorCount++;
 		}
 		
@@ -203,9 +408,51 @@ namespace Microsoft.Build.BuildEngine {
 		
 		private void WriteLine (string message)
 		{
-			for (int i = 0; i < indent; i++)
-				Console.Write ('\t');
-			writeHandler (message);
+			if (indent > 0) {
+				StringBuilder sb = new StringBuilder ();
+				for (int i = 0; i < indent; i++)
+					sb.Append ('\t');
+				sb.Append (message);
+
+				writeHandler (sb.ToString ());
+			} else {
+				writeHandler (message);
+			}
+		}
+
+		void PushEvent (BuildStatusEventArgs args)
+		{
+			events.Add (args);
+			current_events_string = null;
+		}
+
+		void PopEvent ()
+		{
+			events.RemoveAt (events.Count - 1);
+			current_events_string = null;
+		}
+
+		string EventsToString ()
+		{
+			StringBuilder sb = new StringBuilder ();
+
+			for (int i = 0; i < events.Count; i ++) {
+				BuildStatusEventArgs args = events [i];
+				ProjectStartedEventArgs pargs = args as ProjectStartedEventArgs;
+				if (pargs != null) {
+					sb.AppendFormat ("{0} ({1}) ->\n", pargs.ProjectFile,
+							String.IsNullOrEmpty (pargs.TargetNames) ?
+								"default targets" :
+								pargs.TargetNames);
+					continue;
+				}
+
+				TargetStartedEventArgs targs = args as TargetStartedEventArgs;
+				if (targs != null)
+					sb.AppendFormat ("({0} target) ->\n", targs.TargetName);
+			}
+
+			return sb.ToString ();
 		}
 		
 		private void WriteLineWithoutIndent (string message)
@@ -217,6 +464,18 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			Console.WriteLine (message);
 		}
+
+		void SetColor (ConsoleColor color)
+		{
+			if (use_colors)
+				colorSet (color);
+		}
+
+		void ResetColor ()
+		{
+			if (use_colors)
+				colorReset ();
+		}
 		
 		private void ParseParameters ()
 		{
@@ -238,25 +497,47 @@ namespace Microsoft.Build.BuildEngine {
 		public virtual void Shutdown ()
 		{
 		}
+
+		static bool InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
 		
 		private string FormatErrorEvent (BuildErrorEventArgs args)
 		{
-			// FIXME: show more complicated args
-			if (args.LineNumber != 0 && args.ColumnNumber != 0) {
-				return String.Format ("{0}({1},{2}): {3} error {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
-					args.Subcategory, args.Code, args.Message);
+			// For some reason we get an 1-char empty string as Subcategory somtimes.
+			string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " ";
+			string subcat = subprefix == "" ? "" : args.Subcategory;
+				
+			if (args.LineNumber != 0){
+				if (args.ColumnNumber != 0 && !InEmacs) 
+					return String.Format ("{0}({1},{2}): {3}{4}error {5}: {6}",
+							      args.File, args.LineNumber, args.ColumnNumber,
+							      subprefix, subcat, args.Code, args.Message);
+
+				return String.Format ("{0}({1}): {2}{3}error {4}: {5}",
+						      args.File, args.LineNumber,
+						      subprefix, subcat, args.Code, args.Message);
 			} else {
-				return String.Format ("{0}: {1} error {2}: {3}", args.File, args.Subcategory, args.Code,
+				return String.Format ("{0}: {1}{2}error {3}: {4}", args.File, subprefix, subcat, args.Code,
 					args.Message);
 			}
 		}
 
 		private string FormatWarningEvent (BuildWarningEventArgs args)
 		{
+			// For some reason we get an 1-char empty string as Subcategory somtimes.
+			string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " ";
+			string subcat = subprefix == "" ? "" : args.Subcategory;
+
 			// FIXME: show more complicated args
-			if (args.LineNumber != 0 && args.ColumnNumber != 0) {
-				return String.Format ("{0}({1},{2}): {3} warning {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
-					args.Subcategory, args.Code, args.Message);
+			if (args.LineNumber != 0){
+
+				if (args.ColumnNumber != 0 && !InEmacs) {
+					return String.Format ("{0}({1},{2}): {3}{4}warning {5}: {6}",
+							      args.File, args.LineNumber, args.ColumnNumber,
+							      subprefix, subcat, args.Code, args.Message);
+				}
+				return String.Format ("{0}({1}): {2}{3}warning {4}: {5}",
+						      args.File, args.LineNumber,
+						      subprefix, subcat, args.Code, args.Message);
 			} else {
 				return String.Format ("{0}: {1} warning {2}: {3}", args.File, args.Subcategory, args.Code,
 					args.Message);
@@ -303,6 +584,14 @@ namespace Microsoft.Build.BuildEngine {
 					ParseParameters ();
 			}
 		}
+
+		string EventsAsString {
+			get {
+				if (current_events_string == null)
+					current_events_string = EventsToString ();
+				return current_events_string;
+			}
+		}
 		
 		public bool ShowSummary {
 			get { return showSummary; }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
index ccb0dfd..c838eff 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/DirectoryScanner.cs
@@ -31,14 +31,25 @@ using System;
 using System.Collections.Generic;
 using System.IO;
 
+using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
+
 namespace Microsoft.Build.BuildEngine {
 	internal class DirectoryScanner {
 		
 		DirectoryInfo	baseDirectory;
-		string		includes;
+		ITaskItem[]	includes;
 		string		excludes;
-		string[]	matchedFilenames;
+		ITaskItem[]	matchedItems;
+
+		static bool _runningOnWindows;
 		
+		static DirectoryScanner ()
+		{
+			PlatformID pid = Environment.OSVersion.Platform;
+			_runningOnWindows =((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
+		}
+
 		public DirectoryScanner ()
 		{
 		}
@@ -46,7 +57,7 @@ namespace Microsoft.Build.BuildEngine {
 		public void Scan ()
 		{
 			Dictionary <string, bool> excludedItems;
-			List <string> includedItems;
+			List <ITaskItem> includedItems;
 			string[] splitInclude, splitExclude;
 			
 			if (includes == null)
@@ -57,45 +68,60 @@ namespace Microsoft.Build.BuildEngine {
 				throw new ArgumentNullException ("BaseDirectory");
 			
 			excludedItems = new Dictionary <string, bool> ();
-			includedItems = new List <string> ();
+			includedItems = new List <ITaskItem> ();
 			
-			splitInclude = includes.Split (';');
-			splitExclude = excludes.Split (';');
+			splitExclude = excludes.Split (new char[] {';'}, StringSplitOptions.RemoveEmptyEntries);
 			
 			if (excludes != String.Empty) {
 				foreach (string si in splitExclude) {
 					ProcessExclude (si, excludedItems);
 				}
 			}
-			if (includes != String.Empty) {
-				foreach (string si in splitInclude) {
-					ProcessInclude (si, excludedItems, includedItems);
-				}
-			}
 
-			matchedFilenames = includedItems.ToArray ();
+			foreach (ITaskItem include_item in includes)
+				ProcessInclude (include_item, excludedItems, includedItems);
+
+			matchedItems = includedItems.ToArray ();
 		}
 		
-		private void ProcessInclude (string name, Dictionary <string, bool> excludedItems, List <string> includedItems)
+		private void ProcessInclude (ITaskItem include_item, Dictionary <string, bool> excludedItems,
+				List <ITaskItem> includedItems)
 		{
 			string[] separatedPath;
 			FileInfo[] fileInfo;
 
+			string name = include_item.ItemSpec;
 			if (name.IndexOf ('?') == -1 && name.IndexOf ('*') == -1) {
 				if (!excludedItems.ContainsKey (Path.GetFullPath(name)))
-					includedItems.Add (name);
+					includedItems.Add (include_item);
 			} else {
 				if (name.Split (Path.DirectorySeparatorChar).Length > name.Split (Path.AltDirectorySeparatorChar).Length) {
-					separatedPath = name.Split (Path.DirectorySeparatorChar);
+					separatedPath = name.Split (new char [] {Path.DirectorySeparatorChar},
+							StringSplitOptions.RemoveEmptyEntries);
 				} else {
-					separatedPath = name.Split (Path.AltDirectorySeparatorChar);
+					separatedPath = name.Split (new char [] {Path.AltDirectorySeparatorChar},
+							StringSplitOptions.RemoveEmptyEntries);
 				}
 				if (separatedPath.Length == 1 && separatedPath [0] == String.Empty)
 					return;
-				fileInfo = ParseIncludeExclude (separatedPath, 0, baseDirectory);
-				foreach (FileInfo fi in fileInfo)
-					if (!excludedItems.ContainsKey (fi.FullName))
-						includedItems.Add (fi.FullName);
+
+				int offset = 0;
+				if (Path.IsPathRooted (name)) {
+					baseDirectory = new DirectoryInfo (Path.GetPathRoot (name));
+					if (IsRunningOnWindows)
+						// skip the "drive:"
+						offset = 1;
+				}
+
+				fileInfo = ParseIncludeExclude (separatedPath, offset, baseDirectory);
+
+				foreach (FileInfo fi in fileInfo) {
+					if (!excludedItems.ContainsKey (fi.FullName)) {
+						TaskItem item = new TaskItem (include_item);
+						item.ItemSpec = fi.FullName;
+						includedItems.Add (item);
+					}
+				}
 			}
 		}
 		
@@ -109,13 +135,23 @@ namespace Microsoft.Build.BuildEngine {
 					excludedItems.Add (Path.GetFullPath (name), true);
 			} else {
 				if (name.Split (Path.DirectorySeparatorChar).Length > name.Split (Path.AltDirectorySeparatorChar).Length) {
-					separatedPath = name.Split (Path.DirectorySeparatorChar);
+					separatedPath = name.Split (new char [] {Path.DirectorySeparatorChar},
+									StringSplitOptions.RemoveEmptyEntries);
 				} else {
-					separatedPath = name.Split (Path.AltDirectorySeparatorChar);
+					separatedPath = name.Split (new char [] {Path.AltDirectorySeparatorChar},
+									StringSplitOptions.RemoveEmptyEntries);
 				}
 				if (separatedPath.Length == 1 && separatedPath [0] == String.Empty)
 					return;
-				fileInfo = ParseIncludeExclude (separatedPath, 0, baseDirectory);
+
+				int offset = 0;
+				if (Path.IsPathRooted (name)) {
+					baseDirectory = new DirectoryInfo (Path.GetPathRoot (name));
+					if (IsRunningOnWindows)
+						// skip the "drive:"
+						offset = 1;
+				}
+				fileInfo = ParseIncludeExclude (separatedPath, offset, baseDirectory);
 				foreach (FileInfo fi in fileInfo)
 					if (!excludedItems.ContainsKey (fi.FullName))
 						excludedItems.Add (fi.FullName, true);
@@ -150,7 +186,7 @@ namespace Microsoft.Build.BuildEngine {
 					while (currentDirectories.Count > 0)
 					{
 						DirectoryInfo current = currentDirectories.Pop();
-						allDirectories.Add (current);
+						allDirectories.Insert (0, current);
 						foreach (DirectoryInfo dir in current.GetDirectories())
 						{
 							currentDirectories.Push(dir);
@@ -159,8 +195,9 @@ namespace Microsoft.Build.BuildEngine {
 					
 					// No further directories shall be read
 					di = allDirectories.ToArray();					
-				} else
+				} else {
 					di = directory.GetDirectories (input [ptr]);
+				}
 				foreach (DirectoryInfo info in di) {
 					fi = ParseIncludeExclude (input, ptr + 1, info);
 					foreach (FileInfo file in fi)
@@ -179,7 +216,7 @@ namespace Microsoft.Build.BuildEngine {
 			set { baseDirectory = value; }
 		}
 		
-		public string Includes {
+		public ITaskItem[] Includes {
 			get { return includes; }
 			set { includes = value; }
 		}
@@ -189,10 +226,13 @@ namespace Microsoft.Build.BuildEngine {
 			set { excludes = value; }
 		}
 		
-		public string[] MatchedFilenames {
-			get { return matchedFilenames; }
+		public ITaskItem[] MatchedItems {
+			get { return matchedItems; }
 		}
 		
+		static bool IsRunningOnWindows {
+			get { return _runningOnWindows; }
+		}
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
index 1363a73..8244892 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
 using Mono.XBuild.Utilities;
 
 namespace Microsoft.Build.BuildEngine {
@@ -63,7 +64,7 @@ namespace Microsoft.Build.BuildEngine {
 		}
 		
 		public Engine ()
-			: this (null)
+			: this (ToolLocationHelper.GetPathToDotNetFramework (TargetDotNetFrameworkVersion.Version20))
 		{
 		}
 
@@ -319,8 +320,7 @@ namespace Microsoft.Build.BuildEngine {
 				LogProjectFinished (top_project, succeeded);
 
 			if (currentlyBuildingProjectsStack.Count == 0) {
-				//FIXME: build result
-				LogBuildFinished (true);
+				LogBuildFinished (succeeded);
 				buildStarted = false;
 			}
 		}
@@ -328,15 +328,12 @@ namespace Microsoft.Build.BuildEngine {
 		void LogProjectStarted (Project project, string [] target_names)
 		{
 			ProjectStartedEventArgs psea;
-			if (target_names == null || target_names.Length == 0) {
-				if (project.DefaultTargets != String.Empty)
-					psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
-						project.DefaultTargets, null, null);
-				else
-					psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName, "default", null, null);
-			} else
-			psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName, String.Join (";",
-				target_names), null, null);
+			if (target_names == null || target_names.Length == 0)
+				psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
+						String.Empty, null, null);
+			else
+				psea = new ProjectStartedEventArgs ("Project started.", null, project.FullFileName,
+						String.Join (";", target_names), null, null);
 			eventSource.FireProjectStarted (this, psea);
 		}
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs
index 69d3f21..7d4efa5 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Expression.cs
@@ -35,6 +35,23 @@ using System.Text;
 using System.Text.RegularExpressions;
 
 namespace Microsoft.Build.BuildEngine {
+
+	// Properties and items are processed in two ways
+	// 1. Evaluate, Project calls evaluate on all the item and property groups.
+	//    At this time, the items are fully expanded, all item and property
+	//    references are expanded to get the item's value.
+	//    Properties on the other hand, expand property refs, but _not_
+	//    item references.
+	//
+	// 2. After the 'evaluation' phase, this could be when executing a target/task,
+	//    - Items : no expansion required, as they are already at final value
+	//    - Properties: Item references get expanded now, in the context of the
+	//      batching
+	//
+	// The enum ExpressionOptions is for specifying this expansion of item references.
+	//
+	// GroupingCollection.Evaluate, evaluates all properties and then items
+
 	internal class Expression {
 	
 		ExpressionCollection expressionCollection;
@@ -48,16 +65,19 @@ namespace Microsoft.Build.BuildEngine {
 			this.expressionCollection = new ExpressionCollection ();
 		}
 
-		public void Parse (string expression, bool allowItems)
-		{
-			Parse (expression, allowItems, true);
-		}
-
-		// @split: Split on ';'
+		// Split: Split on ';'
 		//	   Eg. Property values don't need to be split
-		public void Parse (string expression, bool allowItems, bool split)
+		//
+		// AllowItems: if false, item refs should not be treated as item refs!
+		//	        it converts them to strings in the final expressionCollection
+		//
+		// AllowMetadata: same as AllowItems, for metadata
+		public void Parse (string expression, ParseOptions options)
 		{
-			expression = expression.Replace ('/', Path.DirectorySeparatorChar);
+			bool split = (options & ParseOptions.Split) == ParseOptions.Split;
+			bool allowItems = (options & ParseOptions.AllowItems) == ParseOptions.AllowItems;
+			bool allowMd = (options & ParseOptions.AllowMetadata) == ParseOptions.AllowMetadata;
+
 			expression = expression.Replace ('\\', Path.DirectorySeparatorChar);
 		
 			string [] parts;
@@ -97,7 +117,7 @@ namespace Microsoft.Build.BuildEngine {
 				}
 			}
 
-			CopyToExpressionCollection (p3);
+			CopyToExpressionCollection (p3, allowItems, allowMd);
 		}
 
 		void Prepare (List <ArrayList> l, int length)
@@ -106,12 +126,17 @@ namespace Microsoft.Build.BuildEngine {
 				l.Add (null);
 		}
 		
-		void CopyToExpressionCollection (List <ArrayList> lists)
+		void CopyToExpressionCollection (List <ArrayList> lists, bool allowItems, bool allowMd)
 		{
 			for (int i = 0; i < lists.Count; i++) {
 				foreach (object o in lists [i]) {
 					if (o is string)
 						expressionCollection.Add (Utilities.Unescape ((string) o));
+					else if (!allowItems && o is ItemReference)
+						expressionCollection.Add (((ItemReference) o).OriginalString);
+					else if (!allowMd && o is MetadataReference) {
+						expressionCollection.Add (((MetadataReference) o).OriginalString);
+					}
 					else if (o is IReference)
 						expressionCollection.Add ((IReference) o);
 				}
@@ -122,13 +147,6 @@ namespace Microsoft.Build.BuildEngine {
 
 		ArrayList SplitItems (string text, bool allowItems)
 		{
-			if (!allowItems) {
-				// FIXME: it's probably larger than 1
-				ArrayList l = new ArrayList ();
-				l.Add (text);
-				return l;
-			}
-
 			ArrayList phase1 = new ArrayList ();
 			Match m;
 			m = ItemRegex.Match (text);
@@ -145,7 +163,8 @@ namespace Microsoft.Build.BuildEngine {
 				if (m.Groups [ItemRegex.GroupNumberFromName ("has_separator")].Success)
 					separator = m.Groups [ItemRegex.GroupNumberFromName ("separator")].Value;
 
-				ir = new ItemReference (name, transform, separator, m.Groups [0].Index, m.Groups [0].Length);
+				ir = new ItemReference (text.Substring (m.Groups [0].Index, m.Groups [0].Length),
+						name, transform, separator, m.Groups [0].Index, m.Groups [0].Length);
 				phase1.Add (ir);
 				m = m.NextMatch ();
 			}
@@ -230,7 +249,8 @@ namespace Microsoft.Build.BuildEngine {
 				
 				meta = m.Groups [MetadataRegex.GroupNumberFromName ("meta")].Value;
 				
-				mr = new MetadataReference (name, meta, m.Groups [0].Index, m.Groups [0].Length);
+				mr = new MetadataReference (text.Substring (m.Groups [0].Index, m.Groups [0].Length),
+								name, meta, m.Groups [0].Index, m.Groups [0].Length);
 				phase1.Add (mr);
 				m = m.NextMatch ();
 			}
@@ -258,10 +278,15 @@ namespace Microsoft.Build.BuildEngine {
 
 			return phase2;
 		}
-		
+
 		public object ConvertTo (Project project, Type type)
 		{
-			return expressionCollection.ConvertTo (project, type);
+			return ConvertTo (project, type, ExpressionOptions.ExpandItemRefs);
+		}
+
+		public object ConvertTo (Project project, Type type, ExpressionOptions options)
+		{
+			return expressionCollection.ConvertTo (project, type, options);
 		}
 
 		public ExpressionCollection Collection {
@@ -273,7 +298,7 @@ namespace Microsoft.Build.BuildEngine {
 				if (item_regex == null)
 					item_regex = new Regex (
 						@"@\(\s*"
-						+ @"(?<itemname>[_A-Za-z][_0-9a-zA-Z]*)"
+						+ @"(?<itemname>[_A-Za-z][_\-0-9a-zA-Z]*)"
 						+ @"(?<has_transform>\s*->\s*'(?<transform>[^']*)')?"
 						+ @"(?<has_separator>\s*,\s*'(?<separator>[^']*)')?"
 						+ @"\s*\)");
@@ -286,7 +311,7 @@ namespace Microsoft.Build.BuildEngine {
 				if (property_regex == null)
 					property_regex = new Regex (
 						@"\$\(\s*"
-						+ @"(?<name>[_a-zA-Z][_0-9a-zA-Z]*)"
+						+ @"(?<name>[_a-zA-Z][_\-0-9a-zA-Z]*)"
 						+ @"\s*\)");
 				return property_regex;
 			}
@@ -297,13 +322,33 @@ namespace Microsoft.Build.BuildEngine {
 				if (metadata_regex == null)
 					metadata_regex = new Regex (
 						@"%\(\s*"
-						+ @"((?<name>[_a-zA-Z][_0-9a-zA-Z]*)\.)?"
-						+ @"(?<meta>[_a-zA-Z][_0-9a-zA-Z]*)"
+						+ @"((?<name>[_a-zA-Z][_\-0-9a-zA-Z]*)\.)?"
+						+ @"(?<meta>[_a-zA-Z][_\-0-9a-zA-Z]*)"
 						+ @"\s*\)");
 				return metadata_regex;
 			}
 		}
 	}
+
+	[Flags]
+	enum ParseOptions {
+		// absence of one of these flags, means
+		// false for that option
+		AllowItems = 0x1,
+		Split = 0x2,
+		AllowMetadata = 0x4,
+
+		None = 0x8, // == no items, no metadata, and no split
+
+		// commonly used options
+		AllowItemsMetadataAndSplit = AllowItems | Split | AllowMetadata,
+		AllowItemsNoMetadataAndSplit = AllowItems | Split
+	}
+
+	enum ExpressionOptions {
+		ExpandItemRefs,
+		DoNotExpandItemRefs
+	}
 }
 
 #endif
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
index eb29295..dd314ae 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ExpressionCollection.cs
@@ -74,18 +74,18 @@ namespace Microsoft.Build.BuildEngine {
 			objects.Add (s);
 		}
 		
-		public object ConvertTo (Project project, Type type)
+		public object ConvertTo (Project project, Type type, ExpressionOptions options)
 		{
 			if (type.IsArray) {
 				if (type == typeof (ITaskItem[]))
-					return ConvertToITaskItemArray (project);
+					return ConvertToITaskItemArray (project, options);
 				else
-					return ConvertToArray (project, type);
+					return ConvertToArray (project, type, options);
 			} else {
 				if (type == typeof (ITaskItem))
-					return ConvertToITaskItem (project);
+					return ConvertToITaskItem (project, options);
 				else
-					return ConvertToNonArray (project, type);
+					return ConvertToNonArray (project, type, options);
 			}
 		}
 		
@@ -95,23 +95,23 @@ namespace Microsoft.Build.BuildEngine {
 				yield return o;
 		}
 		
-		object ConvertToNonArray (Project project, Type type)
+		object ConvertToNonArray (Project project, Type type, ExpressionOptions options)
 		{
-			return ConvertToObject (ConvertToString (project), type);
+			return ConvertToObject (ConvertToString (project, options), type, options);
 		}
 
-		object ConvertToArray (Project project, Type type)
+		object ConvertToArray (Project project, Type type, ExpressionOptions options)
 		{
-			ITaskItem[] items = ConvertToITaskItemArray (project);
+			ITaskItem[] items = ConvertToITaskItemArray (project, options);
 
 			Type element_type = type.GetElementType ();
 			Array arr = Array.CreateInstance (element_type, items.Length);
 			for (int i = 0; i < arr.Length; i ++)
-				arr.SetValue (ConvertToObject (items [i].ItemSpec, element_type), i);
+				arr.SetValue (ConvertToObject (items [i].ItemSpec, element_type, options), i);
 			return arr;
 		}
 
-		object ConvertToObject (string raw, Type type)
+		object ConvertToObject (string raw, Type type, ExpressionOptions options)
 		{
 			if (type == typeof (bool)) {
 				bool value;
@@ -123,17 +123,17 @@ namespace Microsoft.Build.BuildEngine {
 
 			if (type == typeof (string))
 				return raw;
-			else if (type == typeof (int))
-				return Int32.Parse (raw);
-			else if (type == typeof (uint))
-				return UInt32.Parse (raw);
-			else if (type == typeof (DateTime))
+
+			if (type.IsPrimitive)
+				return Convert.ChangeType (raw, type);
+
+			if (type == typeof (DateTime))
 				return DateTime.Parse (raw);
-			else
-				throw new Exception (String.Format ("Unknown type: {0}", type.ToString ()));
+
+			throw new Exception (String.Format ("Unsupported type: {0}", type));
 		}
 
-		string ConvertToString (Project project)
+		string ConvertToString (Project project, ExpressionOptions options)
 		{
 			StringBuilder sb = new StringBuilder ();
 			
@@ -146,25 +146,26 @@ namespace Microsoft.Build.BuildEngine {
 
 				IReference br = o as IReference;
 				if (br != null)
-					sb.Append (br.ConvertToString (project));
+					sb.Append (br.ConvertToString (project, options));
 				else
 					throw new Exception ("BUG: Invalid type in objects collection.");
 			}
 			return sb.ToString ();
 		}
 
-		ITaskItem ConvertToITaskItem (Project project)
+		ITaskItem ConvertToITaskItem (Project project, ExpressionOptions options)
 		{
 			ITaskItem item;
 			
 			if (objects == null)
 				throw new Exception ("Cannot cast empty expression to ITaskItem.");
 
-			ITaskItem[] items = ConvertToITaskItemArray (project);
-			if (items.Length != 1)
+			ITaskItem[] items = ConvertToITaskItemArray (project, options);
+			if (items.Length > 1)
 				//FIXME: msbuild gives better errors
-				throw new Exception (String.Format ("Too many items: {0}", items.Length));
+				throw new Exception (String.Format ("Exactly one item required, but got: {0}", items.Length));
 
+			if (items.Length == 0) return null;
 			return items [0];
 		}
 		
@@ -175,7 +176,7 @@ namespace Microsoft.Build.BuildEngine {
 		//   PropertyRef concats if it doesn't end in ';'
 		// - string cannot concat with ItemRef unless it is ';'.
 		//   string concats if it ends in ';'
-		ITaskItem[] ConvertToITaskItemArray (Project project)
+		ITaskItem[] ConvertToITaskItemArray (Project project, ExpressionOptions options)
 		{
 			List <ITaskItem> finalItems = new List <ITaskItem> ();
 			
@@ -228,7 +229,7 @@ namespace Microsoft.Build.BuildEngine {
 					prev_can_concat = !(value.Length > 0 && value [value.Length - 1] == ';');
 				}
 
-				AddItemsToArray (finalItems, br.ConvertToITaskItemArray (project), can_concat);
+				AddItemsToArray (finalItems, br.ConvertToITaskItemArray (project, options), can_concat);
 
 				prev = o;
 			}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
index c8c143e..5565b93 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/GroupingCollection.cs
@@ -167,7 +167,7 @@ namespace Microsoft.Build.BuildEngine {
 			Evaluate (EvaluationType.Choose);
 		}
 
-		void Evaluate (EvaluationType type)
+		internal void Evaluate (EvaluationType type)
 		{
 			BuildItemGroup big;
 			BuildPropertyGroup bpg;
@@ -183,10 +183,6 @@ namespace Microsoft.Build.BuildEngine {
 						bpg = (BuildPropertyGroup) evaluate_iterator.Value;
 						if (ConditionParser.ParseAndEvaluate (bpg.Condition, project))
 							bpg.Evaluate ();
-					} else if (evaluate_iterator.Value is Import) {
-						import = (Import) evaluate_iterator.Value;
-						if (ConditionParser.ParseAndEvaluate (import.Condition, project))
-							import.Evaluate ();
 					}
 
 					// if it wasn't moved by adding anything because of evaluating a Import shift it
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IReference.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IReference.cs
index a501ec7..30104ed 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IReference.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/IReference.cs
@@ -31,8 +31,8 @@ using Microsoft.Build.Framework;
 
 namespace Microsoft.Build.BuildEngine {
 	internal interface IReference {
-		string ConvertToString (Project project);
-		ITaskItem[] ConvertToITaskItemArray (Project project);
+		string ConvertToString (Project project, ExpressionOptions options);
+		ITaskItem[] ConvertToITaskItemArray (Project project, ExpressionOptions options);
 
 		int Start { get; }
 		int End { get; }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
index afabae2..8af0798 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Import.cs
@@ -51,17 +51,16 @@ namespace Microsoft.Build.BuildEngine {
 
 			if (ProjectPath == String.Empty)
 				throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
+			evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
+			evaluatedProjectPath = GetFullPath ();
+			if (EvaluatedProjectPath == String.Empty)
+				throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
 		}
 
 		// FIXME: condition
 		internal void Evaluate ()
 		{
-			evaluatedProjectPath = EvaluateProjectPath (ProjectPath);
-			string filename = GetFullPath ();
-
-			if (EvaluatedProjectPath == String.Empty)
-				throw new InvalidProjectFileException ("The required attribute \"Project\" is missing from element <Import>.");
-
+			string filename = evaluatedProjectPath;
 			// NOTE: it's a hack to transform Microsoft.CSharp.Targets to Microsoft.CSharp.targets
 			if (Path.HasExtension (filename))
 				filename = Path.ChangeExtension (filename, Path.GetExtension (filename));
@@ -81,7 +80,7 @@ namespace Microsoft.Build.BuildEngine {
 			Expression exp;
 
 			exp = new Expression ();
-			exp.Parse (file, false);
+			exp.Parse (file, ParseOptions.Split);
 			return (string) exp.ConvertTo (project, typeof (string));
 		}
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ImportCollection.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ImportCollection.cs
index 988ac50..3851aa6 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ImportCollection.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ImportCollection.cs
@@ -47,9 +47,9 @@ namespace Microsoft.Build.BuildEngine {
 		
 		internal void Add (Import import)
 		{
-			if (!filenames.ContainsKey (import.ProjectPath)) {
+			if (!filenames.ContainsKey (import.EvaluatedProjectPath)) {
 				groupingCollection.Add (import);
-				filenames.Add (import.ProjectPath, null);
+				filenames.Add (import.EvaluatedProjectPath, null);
 			}
 		}
 		
@@ -72,6 +72,11 @@ namespace Microsoft.Build.BuildEngine {
 				array.SetValue(it.Current, i++);
 			}
 		}
+
+		internal bool Contains (Import import)
+		{
+			return filenames.ContainsKey (import.EvaluatedProjectPath);
+		}
 		
 		public void CopyTo (Import[] array, int index)
 		{
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs
index d89d3a7..b70b63d 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ItemReference.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 // 
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -39,41 +41,47 @@ namespace Microsoft.Build.BuildEngine {
 		Expression	separator;
 		int		start;
 		int		length;
+		string		original_string;
 		
-		public ItemReference (string itemName, string transform, string separator, int start, int length)
+		public ItemReference (string original_string, string itemName, string transform, string separator, int start, int length)
 		{
 			this.itemName = itemName;
 			this.start = start;
 			this.length = length;
+			this.original_string = original_string;
 
+			// Transform and separator are never expanded for item refs
 			if (transform != null) {
 				this.transform = new Expression ();
-				this.transform.Parse (transform, false);
+				this.transform.Parse (transform, ParseOptions.AllowMetadata | ParseOptions.Split);
 			}
 
 			if (separator != null) {
 				this.separator = new Expression ();
-				this.separator.Parse (separator, false);
+				this.separator.Parse (separator, ParseOptions.Split);
 			}
 		}
 		
-		public string ConvertToString (Project project)
+		// when evaluating property, allowItems=false, so,
+		// ItemRef will _not_ get created, so this wont get hit
+		// when evaluating items, expand: true
+		// other cases, expand: true
+		public string ConvertToString (Project project, ExpressionOptions options)
 		{
 			BuildItemGroup group;
 			if (project.TryGetEvaluatedItemByNameBatched (itemName, out group))
-				return group.ConvertToString (transform, separator);
+				return group.ConvertToString (transform, separator, options);
 			else
 				return String.Empty;
 		}
 		
-		public ITaskItem [] ConvertToITaskItemArray (Project project)
+		public ITaskItem [] ConvertToITaskItemArray (Project project, ExpressionOptions options)
 		{
 			BuildItemGroup group;
 			if (project.TryGetEvaluatedItemByNameBatched (itemName, out group))
-				return group.ConvertToITaskItemArray (transform);
+				return group.ConvertToITaskItemArray (transform, separator, options);
 			else
 				return null;
-
 		}
 
 		public string ItemName {
@@ -88,6 +96,10 @@ namespace Microsoft.Build.BuildEngine {
 			get { return separator; }
 		}
 
+		public string OriginalString {
+			get { return original_string; }
+		}
+
 		public int Start {
 			get { return start; }
 		}
@@ -98,8 +110,7 @@ namespace Microsoft.Build.BuildEngine {
 
 		public override string ToString ()
 		{
-			//FIXME: transform
-			return "@" + itemName;
+			return original_string;
 		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs
index 3e245ab..7c9513b 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/MetadataReference.cs
@@ -40,9 +40,11 @@ namespace Microsoft.Build.BuildEngine {
 		string		metadataName;
 		int start;
 		int length;
+		string original;
 	
-		public MetadataReference (string itemName, string metadataName, int start, int length)
+		public MetadataReference (string original, string itemName, string metadataName, int start, int length)
 		{
+			this.original = original;
 			this.itemName = itemName;
 			this.metadataName = metadataName;
 			this.start = start;
@@ -69,12 +71,12 @@ namespace Microsoft.Build.BuildEngine {
 			get { return start + length - 1; }
 		}
 
-		public string ConvertToString (Project project)
+		public string ConvertToString (Project project, ExpressionOptions options)
 		{
 			return project.GetMetadataBatched (itemName, metadataName);
 		}
 
-		public ITaskItem [] ConvertToITaskItemArray (Project project)
+		public ITaskItem [] ConvertToITaskItemArray (Project project, ExpressionOptions options)
 		{
 			List<ITaskItem> items = new List<ITaskItem> ();
 			if (IsQualified) {
@@ -128,6 +130,10 @@ namespace Microsoft.Build.BuildEngine {
 			else
 				return String.Format ("%({0})", metadataName);
 		}
+
+		public string OriginalString {
+			get { return original; }
+		}
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
index 339a2b4..7677fc5 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Project.cs
@@ -32,11 +32,13 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.IO;
+using System.Reflection;
 using System.Text;
 using System.Xml;
 using System.Xml.Schema;
 using Microsoft.Build.Framework;
 using Mono.XBuild.Framework;
+using Mono.XBuild.CommandLine;
 
 namespace Microsoft.Build.BuildEngine {
 	public class Project {
@@ -58,7 +60,7 @@ namespace Microsoft.Build.BuildEngine {
 		bool				isValidated;
 		BuildItemGroupCollection	itemGroups;
 		ImportCollection		imports;
-		string[]			initialTargets;
+		List<string>			initialTargets;
 		Dictionary <string, BuildItemGroup> last_item_group_containing;
 		bool				needToReevaluate;
 		Engine				parentEngine;
@@ -75,6 +77,7 @@ namespace Microsoft.Build.BuildEngine {
 		bool				building;
 		BuildSettings			current_settings;
 
+		static string extensions_path;
 		static XmlNamespaceManager	manager;
 		static string ns = "http://schemas.microsoft.com/developer/msbuild/2003";
 
@@ -98,6 +101,8 @@ namespace Microsoft.Build.BuildEngine {
 			current_settings = BuildSettings.None;
 
 			builtTargetKeys = new List<string> ();
+			initialTargets = new List<string> ();
+			defaultTargets = new string [0];
 
 			globalProperties = new BuildPropertyGroup (null, this, null, false);
 			foreach (BuildProperty bp in parentEngine.GlobalProperties)
@@ -295,7 +300,7 @@ namespace Microsoft.Build.BuildEngine {
 					return false;
 			}
 
-			if (!initialTargetsBuilt && initialTargets != null && initialTargets.Length > 0) {
+			if (!initialTargetsBuilt) {
 				foreach (string target in initialTargets) {
 					if (!BuildTarget (target.Trim (), targetOutputs))
 						return false;
@@ -310,40 +315,34 @@ namespace Microsoft.Build.BuildEngine {
 			return true;
 		}
 
-		bool BuildTarget (string target, IDictionary targetOutputs)
+		bool BuildTarget (string target_name, IDictionary targetOutputs)
 		{
-			if (target == null)
+			if (target_name == null)
 				throw new ArgumentException ("targetNames cannot contain null strings");
 
-			if (!targets.Exists (target)) {
-				//FIXME: Log this!
-				Console.WriteLine ("Target named '{0}' not found in the project.", target);
+			if (!targets.Exists (target_name)) {
+				LogError (fullFileName, "Target named '{0}' not found in the project.", target_name);
 				return false;
 			}
 
-			// built targets are keyed by the particular set of global
-			// properties. So, a different set could allow a target
-			// to run again
-			string key = fullFileName + ":" + target + ":" + GlobalPropertiesToString (GlobalProperties);
+			string key = GetKeyForTarget (target_name);
+			if (!targets [target_name].Build (key))
+				return false;
+
 			ITaskItem[] outputs;
 			if (ParentEngine.BuiltTargetsOutputByName.TryGetValue (key, out outputs)) {
 				if (targetOutputs != null)
-					targetOutputs.Add (target, outputs);
-				LogTargetSkipped (target);
-				return true;
+					targetOutputs.Add (target_name, outputs);
 			}
-
-			if (!targets [target].Build ())
-				return false;
-
-			ParentEngine.BuiltTargetsOutputByName [key] = (ITaskItem[]) targets [target].Outputs.Clone ();
-			builtTargetKeys.Add (key);
-			if (targetOutputs != null)
-				targetOutputs.Add (target, targets [target].Outputs);
-
 			return true;
 		}
 
+		internal string GetKeyForTarget (string target_name)
+		{
+			// target name is case insensitive
+			return fullFileName + ":" + target_name.ToLower () + ":" + GlobalPropertiesToString (GlobalProperties);
+		}
+
 		string GlobalPropertiesToString (BuildPropertyGroup bgp)
 		{
 			StringBuilder sb = new StringBuilder ();
@@ -419,8 +418,34 @@ namespace Microsoft.Build.BuildEngine {
 
 		public void Load (string projectFileName)
 		{
+			if (String.IsNullOrEmpty (projectFileName))
+				throw new ArgumentNullException ("projectFileName");
+
+			if (!File.Exists (projectFileName))
+				throw new ArgumentException (String.Format ("Project file {0} not found", projectFileName),
+						"projectFileName");
+
 			this.fullFileName = Utilities.FromMSBuildPath (Path.GetFullPath (projectFileName));
-			DoLoad (new StreamReader (fullFileName));
+
+			string filename = fullFileName;
+			if (String.Compare (Path.GetExtension (fullFileName), ".sln", true) == 0) {
+				Project tmp_project = ParentEngine.CreateNewProject ();
+				SolutionParser sln_parser = new SolutionParser ();
+				sln_parser.ParseSolution (fullFileName, tmp_project, delegate (int errorNumber, string message) {
+						LogWarning (filename, message);
+					});
+				filename = fullFileName + ".proj";
+				try {
+					tmp_project.Save (filename);
+					ParentEngine.RemoveLoadedProject (tmp_project);
+					DoLoad (new StreamReader (filename));
+				} finally {
+					if (Environment.GetEnvironmentVariable ("XBUILD_EMIT_SOLUTION") == null)
+						File.Delete (filename);
+				}
+			} else {
+				DoLoad (new StreamReader (filename));
+			}
 		}
 		
 		[MonoTODO ("Not tested")]
@@ -690,16 +715,19 @@ namespace Microsoft.Build.BuildEngine {
 			try {
 				ParentEngine.RemoveLoadedProject (this);
 	
-				XmlReaderSettings settings = new XmlReaderSettings ();
-	
+				xmlDocument.Load (textReader);
+
+				if (xmlDocument.DocumentElement.Name == "VisualStudioProject")
+					throw new InvalidProjectFileException (String.Format (
+							"Project file '{0}' is a VS2003 project, which is not " +
+							"supported by xbuild. You need to convert it to msbuild " +
+							"format to build with xbuild.", fullFileName));
+
 				if (SchemaFile != null) {
-					settings.Schemas.Add (null, SchemaFile);
-					settings.ValidationType = ValidationType.Schema;
-					settings.ValidationEventHandler += new ValidationEventHandler (ValidationCallBack);
+					xmlDocument.Schemas.Add (XmlSchema.Read (
+								new StreamReader (SchemaFile), ValidationCallBack));
+					xmlDocument.Validate (ValidationCallBack);
 				}
-	
-				XmlReader xmlReader = XmlReader.Create (textReader, settings);
-				xmlDocument.Load (xmlReader);
 
 				if (xmlDocument.DocumentElement.Name != "Project") {
 					throw new InvalidProjectFileException (String.Format (
@@ -743,12 +771,9 @@ namespace Microsoft.Build.BuildEngine {
 			if (ParentEngine.DefaultTasksRegistered)
 				taskDatabase.CopyTasks (ParentEngine.DefaultTasks);	
 
-			if (xmlDocument.DocumentElement.GetAttributeNode ("DefaultTargets") != null)
-				defaultTargets = xmlDocument.DocumentElement.GetAttribute ("DefaultTargets").Split (';');
-			else
-				defaultTargets = new string [0];
-			
-			ProcessProjectAttributes (xmlDocument.DocumentElement.Attributes);
+			initialTargets = new List<string> ();
+			defaultTargets = new string [0];
+			PrepareForEvaluate ();
 			ProcessElements (xmlDocument.DocumentElement, null);
 			
 			isDirty = false;
@@ -760,12 +785,17 @@ namespace Microsoft.Build.BuildEngine {
 			foreach (XmlAttribute attr in attributes) {
 				switch (attr.Name) {
 				case "InitialTargets":
-					initialTargets = attr.Value.Split (new char [] {';'},
-							StringSplitOptions.RemoveEmptyEntries);
+					initialTargets.AddRange (attr.Value.Split (
+									new char [] {';', ' '},
+									StringSplitOptions.RemoveEmptyEntries));
 					break;
 				case "DefaultTargets":
-					defaultTargets = attr.Value.Split (new char [] {';'},
+					// first non-empty DefaultTargets found is used
+					if (defaultTargets == null || defaultTargets.Length == 0)
+						defaultTargets = attr.Value.Split (new char [] {';', ' '},
 							StringSplitOptions.RemoveEmptyEntries);
+					EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets",
+								DefaultTargets, PropertyType.Reserved));
 					break;
 				}
 			}
@@ -773,6 +803,7 @@ namespace Microsoft.Build.BuildEngine {
 
 		internal void ProcessElements (XmlElement rootElement, ImportedProject ip)
 		{
+			ProcessProjectAttributes (rootElement.Attributes);
 			foreach (XmlNode xn in rootElement.ChildNodes) {
 				if (xn is XmlElement) {
 					XmlElement xe = (XmlElement) xn;
@@ -810,7 +841,7 @@ namespace Microsoft.Build.BuildEngine {
 			}
 		}
 		
-		void Evaluate ()
+		void PrepareForEvaluate ()
 		{
 			evaluatedItems = new BuildItemGroup (null, this, null, true);
 			evaluatedItemsIgnoringCondition = new BuildItemGroup (null, this, null, true);
@@ -820,7 +851,10 @@ namespace Microsoft.Build.BuildEngine {
 				RemoveBuiltTargets ();
 
 			InitializeProperties ();
+		}
 
+		void Evaluate ()
+		{
 			groupingCollection.Evaluate ();
 
 			//FIXME: UsingTasks aren't really evaluated. (shouldn't use expressions or anything)
@@ -863,8 +897,16 @@ namespace Microsoft.Build.BuildEngine {
 				EvaluatedProperties.AddProperty (bp);
 			}
 
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectFile", Path.GetFileName (fullFileName),
+						PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectName",
+						Path.GetFileNameWithoutExtension (fullFileName),
+						PropertyType.Reserved));
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildBinPath", parentEngine.BinPath, PropertyType.Reserved));
 			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildToolsPath", parentEngine.BinPath, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildExtensionsPath", ExtensionsPath, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("MSBuildProjectDefaultTargets", DefaultTargets, PropertyType.Reserved));
+			EvaluatedProperties.AddProperty (new BuildProperty ("OS", OS, PropertyType.Environment));
 
 			// FIXME: make some internal method that will work like GetDirectoryName but output String.Empty on null/String.Empty
 			string projectDir;
@@ -903,10 +945,32 @@ namespace Microsoft.Build.BuildEngine {
 		
 		void AddImport (XmlElement xmlElement, ImportedProject importingProject)
 		{
-			Import import;
-			
-			import = new Import (xmlElement, this, importingProject);
+			// eval all the properties etc till the import
+			groupingCollection.Evaluate (EvaluationType.Property);
+
+			Import import = new Import (xmlElement, this, importingProject);
+			if (!ConditionParser.ParseAndEvaluate (import.Condition, this))
+				return;
+
+			if (Imports.Contains (import)) {
+				LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
+						"A circular reference was found involving the import of {0}. Only" +
+						" the first import of this file will be used, ignoring others.",
+						import.ProjectPath);
+
+				return;
+			}
+
+			if (String.Compare (fullFileName, import.EvaluatedProjectPath) == 0) {
+				LogWarning (importingProject != null ? importingProject.FullFileName : fullFileName,
+						"The main project file was imported here, which creates a circular " +
+						"reference. Ignoring this import.");
+
+				return;
+			}
+
 			Imports.Add (import);
+			import.Evaluate ();
 		}
 		
 		void AddItemGroup (XmlElement xmlElement, ImportedProject importedProject)
@@ -948,11 +1012,13 @@ namespace Microsoft.Build.BuildEngine {
 
 		public string DefaultTargets {
 			get {
-				return xmlDocument.DocumentElement.GetAttribute ("DefaultTargets");
+				return String.Join ("; ", defaultTargets);
 			}
 			set {
 				xmlDocument.DocumentElement.SetAttribute ("DefaultTargets", value);
-				defaultTargets = value.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
+				if (value != null)
+					defaultTargets = value.Split (new char [] {';', ' '},
+							StringSplitOptions.RemoveEmptyEntries);
 			}
 		}
 
@@ -1041,7 +1107,7 @@ namespace Microsoft.Build.BuildEngine {
 			if (group != null) {
 				foreach (BuildItem item in group) {
 					if (item.HasMetadata (metadataName))
-						return item.GetMetadata (metadataName);
+						return item.GetEvaluatedMetadata (metadataName);
 				}
 			}
 			return String.Empty;
@@ -1073,14 +1139,39 @@ namespace Microsoft.Build.BuildEngine {
 			return default (T);
 		}
 
-		void LogTargetSkipped (string targetName)
+		void LogWarning (string filename, string message, params object[] messageArgs)
+		{
+			BuildWarningEventArgs bwea = new BuildWarningEventArgs (
+				null, null, filename, 0, 0, 0, 0, String.Format (message, messageArgs),
+				null, null);
+			ParentEngine.EventSource.FireWarningRaised (this, bwea);
+		}
+
+		void LogError (string filename, string message,
+				     params object[] messageArgs)
 		{
-			BuildMessageEventArgs bmea;
-			bmea = new BuildMessageEventArgs (String.Format (
-						"Target {0} skipped, as it has already been built.", targetName),
-					null, null, MessageImportance.Low);
+			BuildErrorEventArgs beea = new BuildErrorEventArgs (
+				null, null, filename, 0, 0, 0, 0, String.Format (message, messageArgs),
+				null, null);
+			ParentEngine.EventSource.FireErrorRaised (this, beea);
+		}
 
-			ParentEngine.EventSource.FireMessageRaised (this, bmea);
+		static string ExtensionsPath {
+			get {
+				if (extensions_path == null) {
+					// NOTE: code from mcs/tools/gacutil/driver.cs
+					PropertyInfo gac = typeof (System.Environment).GetProperty (
+							"GacPath", BindingFlags.Static | BindingFlags.NonPublic);
+
+					if (gac != null) {
+						MethodInfo get_gac = gac.GetGetMethod (true);
+						string gac_path = (string) get_gac.Invoke (null, null);
+						extensions_path = Path.GetFullPath (Path.Combine (
+									gac_path, Path.Combine ("..", "xbuild")));
+					}
+				}
+				return extensions_path;
+			}
 		}
 
 		public BuildPropertyGroup EvaluatedProperties {
@@ -1131,11 +1222,14 @@ namespace Microsoft.Build.BuildEngine {
 		
 		public string InitialTargets {
 			get {
-				return xmlDocument.DocumentElement.GetAttribute ("InitialTargets");
+				return String.Join ("; ", initialTargets.ToArray ());
 			}
 			set {
+				initialTargets.Clear ();
 				xmlDocument.DocumentElement.SetAttribute ("InitialTargets", value);
-				initialTargets = value.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
+				if (value != null)
+					initialTargets.AddRange (value.Split (
+								new char [] {';', ' '}, StringSplitOptions.RemoveEmptyEntries));
 			}
 		}
 
@@ -1169,6 +1263,10 @@ namespace Microsoft.Build.BuildEngine {
 			get { return xmlDocument.InnerXml; }
 		}
 
+		internal List<string> BuiltTargetKeys {
+			get { return builtTargetKeys; }
+		}
+
 		internal Dictionary <string, BuildItemGroup> LastItemGroupContaining {
 			get { return last_item_group_containing; }
 		}
@@ -1195,6 +1293,22 @@ namespace Microsoft.Build.BuildEngine {
 		internal static string XmlNamespace {
 			get { return ns; }
 		}
+
+		static string OS {
+			get {
+				PlatformID pid = Environment.OSVersion.Platform;
+				switch ((int)pid) {
+				case 128:
+				case 4:
+					return "Unix";
+				case 6:
+					return "OSX";
+				default:
+					return "Windows_NT";
+				}
+			}
+		}
+
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/PropertyReference.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/PropertyReference.cs
index 48f88ef..285808e 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/PropertyReference.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/PropertyReference.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 // 
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -47,23 +49,39 @@ namespace Microsoft.Build.BuildEngine {
 			this.length = length;
 		}
 		
-		public string ConvertToString (Project project)
+
+		// when evaluating items: expand: true
+		// all other times, expand: true
+		// so, always true, ignore @options
+		public string ConvertToString (Project project, ExpressionOptions options)
 		{
 			BuildProperty bp = project.EvaluatedProperties [name];
-			return bp != null ? bp.FinalValue : String.Empty;
+			if (bp == null)
+				return String.Empty;
+
+			if (options == ExpressionOptions.DoNotExpandItemRefs)
+				return bp.FinalValue;
+
+			return bp.ConvertToString (project, ExpressionOptions.ExpandItemRefs);
 		}
 
-		public ITaskItem[] ConvertToITaskItemArray (Project project)
+		// when evaluating items: expand: true
+		// all other times, expand: true
+		// so, always true, ignore @options
+		public ITaskItem[] ConvertToITaskItemArray (Project project, ExpressionOptions options)
 		{
 			BuildProperty bp = project.EvaluatedProperties [name];
-			if (bp != null) {
+			if (bp == null)
+				return null;
+
+			if (options == ExpressionOptions.DoNotExpandItemRefs) {
 				List<ITaskItem> list = new List<ITaskItem> ();
 				foreach (string s in bp.FinalValue.Split (new char[] {';'}, StringSplitOptions.RemoveEmptyEntries))
 					list.Add (new TaskItem (s));
 				return list.ToArray ();
 			}
-			else
-				return null;
+
+			return bp.ConvertToITaskItemArray (project, ExpressionOptions.ExpandItemRefs);
 		}
 		
 		public string Name {
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs
index b039112..bfdd276 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Target.cs
@@ -109,30 +109,60 @@ namespace Microsoft.Build.BuildEngine {
 				throw new ArgumentNullException ("buildTask");
 			buildTasks.Remove (buildTask);
 		}
-		
-		// FIXME: log errors instead of throwing exceptions
-		internal bool Build ()
+
+		bool Build ()
+		{
+			return Build (null);
+		}
+
+		internal bool Build (string built_targets_key)
+		{
+			bool executeOnErrors;
+			return Build (built_targets_key, out executeOnErrors);
+		}
+
+		bool Build (string built_targets_key, out bool executeOnErrors)
 		{
-			bool deps;
-			bool result;
+			bool result = false;
+			executeOnErrors = false;
 
-			// log that target is being skipped
-			if (!ConditionParser.ParseAndEvaluate (Condition, Project))
+			// built targets are keyed by the particular set of global
+			// properties. So, a different set could allow a target
+			// to run again
+			built_targets_key = project.GetKeyForTarget (Name);
+			ITaskItem[] outputs;
+			if (project.ParentEngine.BuiltTargetsOutputByName.ContainsKey (built_targets_key)) {
+				LogTargetSkipped ();
 				return true;
+			}
+
+			if (!ConditionParser.ParseAndEvaluate (Condition, Project)) {
+				LogMessage (MessageImportance.Low,
+						"Target {0} skipped due to false condition: {1}",
+						Name, Condition);
+				return true;
+			}
 
 			try {
 				buildState = BuildState.Started;
-				deps = BuildDependencies (GetDependencies ());
+				result = BuildDependencies (GetDependencies (), out executeOnErrors);
 
-				result = deps ? DoBuild () : false;
+				if (!result && executeOnErrors)
+					ExecuteOnErrors ();
+
+				if (result)
+					// deps built fine, do main build
+					result = DoBuild (out executeOnErrors);
 
 				buildState = BuildState.Finished;
-			// FIXME: log it 
 			} catch (Exception e) {
 				LogError ("Error building target {0}: {1}", Name, e.ToString ());
 				return false;
 			}
 
+			project.ParentEngine.BuiltTargetsOutputByName [built_targets_key] = (ITaskItem[]) Outputs.Clone ();
+			project.BuiltTargetKeys.Add (built_targets_key);
+
 			return result;
 		}
 
@@ -145,23 +175,26 @@ namespace Microsoft.Build.BuildEngine {
 
 			if (DependsOnTargets != String.Empty) {
 				deps = new Expression ();
-				deps.Parse (DependsOnTargets, true);
+				deps.Parse (DependsOnTargets, ParseOptions.AllowItemsNoMetadataAndSplit);
 				targetNames = (string []) deps.ConvertTo (Project, typeof (string []));
-				foreach (string name in targetNames) {
-					t = project.Targets [name.Trim ()];
+				foreach (string dep_name in targetNames) {
+					t = project.Targets [dep_name.Trim ()];
 					if (t == null)
-						throw new InvalidProjectFileException (String.Format ("Target '{0}' not found.", name.Trim ()));
+						throw new InvalidProjectFileException (String.Format (
+								"Target '{0}', a dependency of target '{1}', not found.",
+								dep_name.Trim (), Name));
 					list.Add (t);
 				}
 			}
 			return list;
 		}
 
-		bool BuildDependencies (List <Target> deps)
+		bool BuildDependencies (List <Target> deps, out bool executeOnErrors)
 		{
+			executeOnErrors = false;
 			foreach (Target t in deps) {
 				if (t.BuildState == BuildState.NotStarted)
-					if (!t.Build ())
+					if (!t.Build (null, out executeOnErrors))
 						return false;
 				if (t.BuildState == BuildState.Started)
 					throw new InvalidProjectFileException ("Cycle in target dependencies detected");
@@ -170,9 +203,9 @@ namespace Microsoft.Build.BuildEngine {
 			return true;
 		}
 		
-		bool DoBuild ()
+		bool DoBuild (out bool executeOnErrors)
 		{
-			bool executeOnErrors;
+			executeOnErrors = false;
 			bool result = true;
 
 			if (BuildTasks.Count == 0)
@@ -182,8 +215,9 @@ namespace Microsoft.Build.BuildEngine {
 			try {
 				result = batchingImpl.Build (this, out executeOnErrors);
 			} catch (Exception e) {
-				LogError ("Error building target {0}: {1}", Name, e.ToString ());
-				throw;
+				LogError ("Error building target {0}: {1}", Name, e.Message);
+				LogMessage (MessageImportance.Low, "Error building target {0}: {1}", Name, e.ToString ());
+				return false;
 			}
 
 			if (executeOnErrors == true)
@@ -195,15 +229,33 @@ namespace Microsoft.Build.BuildEngine {
 		void ExecuteOnErrors ()
 		{
 			foreach (XmlElement onError in onErrorElements) {
-				// FIXME: add condition
 				if (onError.GetAttribute ("ExecuteTargets") == String.Empty)
 					throw new InvalidProjectFileException ("ExecuteTargets attribute is required in OnError element.");
+
+				string on_error_condition = onError.GetAttribute ("Condition");
+				if (!ConditionParser.ParseAndEvaluate (on_error_condition, Project)) {
+					LogMessage (MessageImportance.Low,
+						"OnError for target {0} skipped due to false condition: {1}",
+						Name, on_error_condition);
+					continue;
+				}
+
 				string[] targetsToExecute = onError.GetAttribute ("ExecuteTargets").Split (';');
 				foreach (string t in targetsToExecute)
 					this.project.Targets [t].Build ();
 			}
 		}
 
+		void LogTargetSkipped ()
+		{
+			BuildMessageEventArgs bmea;
+			bmea = new BuildMessageEventArgs (String.Format (
+						"Target {0} skipped, as it has already been built.", Name),
+					null, null, MessageImportance.Low);
+
+			project.ParentEngine.EventSource.FireMessageRaised (this, bmea);
+		}
+
 		void LogError (string message, params object [] messageArgs)
 		{
 			if (message == null)
@@ -214,6 +266,17 @@ namespace Microsoft.Build.BuildEngine {
 				null, null);
 			engine.EventSource.FireErrorRaised (this, beea);
 		}
+
+		void LogMessage (MessageImportance importance, string message, params object [] messageArgs)
+		{
+			if (message == null)
+				throw new ArgumentNullException ("message");
+
+			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
+				String.Format (message, messageArgs), null,
+				null, importance);
+			engine.EventSource.FireMessageRaised (this, bmea);
+		}
 	
 		public string Condition {
 			get { return targetElement.GetAttribute ("Condition"); }
@@ -237,6 +300,14 @@ namespace Microsoft.Build.BuildEngine {
 			get { return project; }
 		}
 
+		internal string TargetFile {
+			get {
+				if (importedProject != null)
+					return importedProject.FullFileName;
+				return project != null ? project.FullFileName : String.Empty;
+			}
+		}
+
 		internal List<BuildTask> BuildTasks {
 			get { return buildTasks; }
 		}
@@ -256,7 +327,7 @@ namespace Microsoft.Build.BuildEngine {
 					return new ITaskItem [0];
 
 				Expression e = new Expression ();
-				e.Parse (outputs, true);
+				e.Parse (outputs, ParseOptions.AllowItemsNoMetadataAndSplit);
 
 				return (ITaskItem []) e.ConvertTo (project, typeof (ITaskItem []));
 			}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
index fb394bf..70d785f 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
@@ -176,12 +176,12 @@ namespace Microsoft.Build.BuildEngine {
 				return true;
 
 			Expression e = new Expression ();
-			e.Parse (inputs, true);
-			inputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]));
+			e.Parse (inputs, ParseOptions.AllowItemsNoMetadataAndSplit);
+			inputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]), ExpressionOptions.ExpandItemRefs);
 
 			e = new Expression ();
-			e.Parse (outputs, true);
-			outputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]));
+			e.Parse (outputs, ParseOptions.AllowItemsNoMetadataAndSplit);
+			outputFiles = (ITaskItem[]) e.ConvertTo (project, typeof (ITaskItem[]), ExpressionOptions.ExpandItemRefs);
 
 			if (inputFiles == null || inputFiles.Length == 0)
 				return false;
@@ -244,7 +244,8 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			TargetStartedEventArgs tsea;
 			string projectFile = project.FullFileName;
-			tsea = new TargetStartedEventArgs (String.Format ("Target {0} started.", target.Name), null, target.Name, projectFile, null);
+			tsea = new TargetStartedEventArgs (String.Format ("Target {0} started.", target.Name), null,
+					target.Name, projectFile, target.TargetFile);
 			target.Engine.EventSource.FireTargetStarted (this, tsea);
 		}
 
@@ -252,7 +253,8 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			TargetFinishedEventArgs tfea;
 			string projectFile = project.FullFileName;
-			tfea = new TargetFinishedEventArgs (String.Format ("Target {0} finished.", target.Name), null, target.Name, projectFile, null, succeeded);
+			tfea = new TargetFinishedEventArgs (String.Format ("Target {0} finished.", target.Name), null,
+					target.Name, projectFile, target.TargetFile, succeeded);
 			target.Engine.EventSource.FireTargetFinished (this, tfea);
 		}
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
index e359f63..1b69d37 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
@@ -76,14 +76,26 @@ namespace Microsoft.Build.BuildEngine {
 
 			// Run the task in batches
 			bool retval = true;
-			foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
-				project.SetBatchedItems (bucket, commonItemsByName);
+			if (buckets.Count > 0) {
+				foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
+					project.SetBatchedItems (bucket, commonItemsByName);
+					if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
+						 retval = buildTask.Execute ();
+						 if (!retval && !buildTask.ContinueOnError) {
+							 executeOnErrors = true;
+							 break;
+						 }
+					}
+				}
+				project.SetBatchedItems (null, null);
+			} else {
+				// batched mode, but no values in the corresponding items!
 				if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
-					 if (! (retval = buildTask.Execute ()))
-						 break;
+					retval = buildTask.Execute ();
+					if (!retval && !buildTask.ContinueOnError)
+						executeOnErrors = true;
 				}
 			}
-			project.SetBatchedItems (null, null);
 
 			return retval;
 		}
@@ -96,6 +108,18 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			foreach (XmlAttribute attrib in buildTask.TaskElement.Attributes)
 				ParseAttribute (attrib.Value);
+
+			foreach (XmlNode xn in buildTask.TaskElement.ChildNodes) {
+				XmlElement xe = xn as XmlElement;
+				if (xe == null)
+					continue;
+
+				//FIXME: error on any other child
+				if (String.Compare (xe.LocalName, "Output", StringComparison.Ordinal) == 0) {
+					foreach (XmlAttribute attrib in xe.Attributes)
+						ParseAttribute (attrib.Value);
+				}
+			}
 		}
 	}
 
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskDatabase.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskDatabase.cs
index 33c2add..f40f4f9 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskDatabase.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskDatabase.cs
@@ -47,9 +47,9 @@ namespace Microsoft.Build.BuildEngine {
 		public TaskDatabase ()
 		{
 			assemblyInformation = new Dictionary <string, AssemblyLoadInfo> ();
-			typesByFullName = new Dictionary <string, Type> ();
-			typesByShortName = new Dictionary <string, Type> ();
-			usingTasksByFullName = new Dictionary <string, UsingTaskInfo> ();
+			typesByFullName = new Dictionary <string, Type> (StringComparer.InvariantCultureIgnoreCase);
+			typesByShortName = new Dictionary <string, Type> (StringComparer.InvariantCultureIgnoreCase);
+			usingTasksByFullName = new Dictionary <string, UsingTaskInfo> (StringComparer.InvariantCultureIgnoreCase);
 		}
 		
 		public void RegisterTask (string classname, AssemblyLoadInfo assemblyLoadInfo)
@@ -94,7 +94,7 @@ namespace Microsoft.Build.BuildEngine {
 				if (is_shortname) {
 					// Linear search UsingTaskInfo objects for short name match
 					foreach (UsingTaskInfo ut_info in usingTasksByFullName.Values) {
-						if (String.Compare (ut_info.ShortName, classname) == 0) {
+						if (String.Compare (ut_info.ShortName, classname, true) == 0) {
 							info = ut_info;
 							break;
 						}
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
index 5126eba..485771d 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/TaskEngine.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 // 
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -56,6 +58,18 @@ namespace Microsoft.Build.BuildEngine {
 		{
 			parentProject = project;
 		}
+
+		// Rules (inferred) for property values incase of empty data
+		//
+		// Prop Type         Argument         Final Value     Required
+		// string	     empty string	null	       Yes/no
+		// string	     only whitespace    @arg	       Yes/no
+		//
+		// string/
+		//   ITaskItem[]     empty/whitespace   empty array     Yes
+		//
+		// string/
+		//   ITaskItem[]     empty/whitespace   null	        No
 		
 		public void Prepare (ITask task, XmlElement taskElement,
 				     IDictionary <string, string> parameters, Type taskType)
@@ -68,33 +82,55 @@ namespace Microsoft.Build.BuildEngine {
 			this.task = task;
 			this.taskElement = taskElement;
 			this.taskType = taskType;
-			values = new Dictionary <string, object> ();
+			values = new Dictionary <string, object> (StringComparer.InvariantCultureIgnoreCase);
 			
 			foreach (KeyValuePair <string, string> de in parameters) {
-				currentProperty = taskType.GetProperty (de.Key);
+				currentProperty = taskType.GetProperty (de.Key, BindingFlags.Public | BindingFlags.Instance
+						| BindingFlags.IgnoreCase);
 				if (currentProperty == null)
 					throw new InvalidProjectFileException (String.Format ("Task does not have property \"{0}\" defined",
 						de.Key));
 				
 				try {
-					value = GetObjectFromString (de.Value, currentProperty.PropertyType);
+					if (TryGetObjectFromString (de.Value, currentProperty.PropertyType, out value))
+						values.Add (de.Key, value);
 				} catch (Exception e) {
 					throw new Exception (String.Format (
 							"Error converting Property named '{0}' with value '{1}' to type {2}: {3}",
 							de.Key, de.Value, currentProperty.PropertyType, e.Message), e);
 				}
-				
-				if (value != null)
-					values.Add (de.Key, value);
 			}
 			
 			properties = taskType.GetProperties ();
 			foreach (PropertyInfo pi in properties) {
-				if (pi.IsDefined (requiredAttribute, false) && values.ContainsKey (pi.Name) == false)
-					throw new InvalidProjectFileException (String.Format ("Required property '{0}'not set.", pi.Name));
-				
-				if (values.ContainsKey (pi.Name))
-					InitializeParameter (pi, values [pi.Name]);
+				bool is_required = pi.IsDefined (requiredAttribute, false);
+
+				if (is_required && values.ContainsKey (pi.Name) == false)
+					throw new InvalidProjectFileException (String.Format ("Required property '{0}' not set.",
+						pi.Name));
+
+				if (!values.ContainsKey (pi.Name))
+					continue;
+
+				Type prop_type = pi.PropertyType;
+				if (prop_type.IsArray)
+					prop_type = prop_type.GetElementType ();
+
+				// Valid data types: primitive types, DateTime, string and ITaskItem, and their arrays
+				if (!prop_type.IsPrimitive && prop_type != typeof (string) && prop_type != typeof (ITaskItem))
+					throw new InvalidProjectFileException (String.Format (
+							"{0} is not a supported type for properties for msbuild tasks.",
+							pi.PropertyType));
+
+				object val = values [pi.Name];
+				if (val == null && pi.PropertyType.IsArray && is_required) {
+					if (pi.PropertyType == typeof (ITaskItem[]))
+						val = new ITaskItem [0];
+					else if (pi.PropertyType == typeof (string[]))
+						val = new string [0];
+				}
+
+				InitializeParameter (pi, val);
 			}
 		}
 		
@@ -124,12 +160,16 @@ namespace Microsoft.Build.BuildEngine {
 					throw new InvalidProjectFileException ("Only one of ItemName and PropertyName attributes can be specified.");
 				if (xmlElement.GetAttribute ("TaskParameter") == String.Empty)
 					throw new InvalidProjectFileException ("TaskParameter attribute must be specified.");
+
+				if (!ConditionParser.ParseAndEvaluate (xmlElement.GetAttribute ("Condition"), parentProject))
+					continue;
 					
 				taskParameter = xmlElement.GetAttribute ("TaskParameter");
 				itemName = xmlElement.GetAttribute ("ItemName");
 				propertyName = xmlElement.GetAttribute ("PropertyName");
 				
-				propertyInfo = taskType.GetProperty (taskParameter);
+				propertyInfo = taskType.GetProperty (taskParameter, BindingFlags.Public | BindingFlags.Instance |
+							BindingFlags.IgnoreCase);
 				if (propertyInfo == null)
 					throw new Exception (String.Format (
 						"The parameter '{0}' was not found for the '{1}' task.", taskParameter, taskElement.Name));
@@ -180,24 +220,28 @@ namespace Microsoft.Build.BuildEngine {
 			foreach (BuildItem bi in newItems)
 				parentProject.EvaluatedItems.AddItem (bi);
 		}
-				
-		object GetObjectFromString (string raw, Type type)
+
+		// returns true, if the @result should be included in the values list
+		bool TryGetObjectFromString (string raw, Type type, out object result)
 		{
 			Expression e;
-			object result;
+			result = null;
 			
 			e = new Expression ();
-			e.Parse (raw, true);
+			e.Parse (raw, ParseOptions.AllowItemsMetadataAndSplit);
 
-			// Empty contents allowed only for arrays
-			// See TestRequiredTask_*
-			if (!type.IsArray &&
-				(string) e.ConvertTo (parentProject, typeof (string)) == String.Empty)
-				return null;
-			
-			result = e.ConvertTo (parentProject, type);
+			// See rules in comment for 'Prepare'
+			string str = (string) e.ConvertTo (parentProject, typeof (string));
+			if (!type.IsArray && str == String.Empty)
+				return false;
+
+			if (str.Trim ().Length == 0 && type.IsArray &&
+				(type.GetElementType () == typeof (string) || type.GetElementType () == typeof (ITaskItem)))
+				return true;
+
+			result = e.ConvertTo (parentProject, type, ExpressionOptions.ExpandItemRefs);
 			
-			return result;
+			return true;
 		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs
index ffffd22..c6ef54f 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/UsingTask.cs
@@ -73,7 +73,7 @@ namespace Microsoft.Build.BuildEngine {
 			} else if (AssemblyFile != null) {
 				Expression exp = new Expression ();
 				// FIXME: test it
-				exp.Parse (AssemblyFile, false);
+				exp.Parse (AssemblyFile, ParseOptions.Split);
 				string filename = (string) exp.ConvertTo (project, typeof (string));
 
 				if (Path.IsPathRooted (filename) == false) {
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Utilities.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Utilities.cs
index 579785d..7fa30bc 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Utilities.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Utilities.cs
@@ -4,6 +4,7 @@
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
 //   Lluis Sanchez Gual <lluis at novell.com>
+//   Michael Hutchinson <mhutchinson at novell.com>
 //
 // (C) 2005 Marek Sieradzki
 // Copyright (c) 2008 Novell, Inc (http://www.novell.com)
@@ -81,6 +82,43 @@ namespace Microsoft.Build.BuildEngine {
 			return sb.ToString ();
 		}
 
+		internal static string UnescapeFromXml (string text)
+		{
+			StringBuilder sb = new StringBuilder ();
+			for (int i = 0; i < text.Length; i++) {
+				char c1 = text[i];
+				if (c1 == '&') {
+					int end = text.IndexOf (';', i);
+					if (end == -1)
+						throw new FormatException ("Unterminated XML entity.");
+					string entity = text.Substring (i+1, end - i - 1);
+					switch (entity) {
+					case "lt":
+						sb.Append ('<');
+						break;
+					case "gt":
+						sb.Append ('>');
+						break;
+					case "amp":
+						sb.Append ('&');
+						break;
+					case "apos":
+						sb.Append ('\'');
+						break;
+					case "quot":
+						sb.Append ('"');
+						break;
+					default:
+						throw new FormatException ("Unrecogised XML entity '&" + entity + ";'.");
+					}
+					i = end;
+				} else
+					sb.Append (c1);
+			}
+			return sb.ToString ();
+		}
+
+
 		internal static string FromMSBuildPath (string relPath)
 		{
 			if (relPath == null || relPath.Length == 0)
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
index 5219997..33c88db 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine.dll.sources
@@ -3,6 +3,7 @@
 Assembly/AssemblyInfo.cs
 ../Microsoft.Build.Framework/Mono.XBuild.Framework/AssemblyLoadInfo.cs
 ../Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
+../../tools/xbuild/SolutionParser.cs
 Microsoft.Build.BuildEngine/BatchingImplBase.cs
 Microsoft.Build.BuildEngine/TargetBatchingImpl.cs
 Microsoft.Build.BuildEngine/TaskBatchingImpl.cs
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
index 696e7f4..57467ad 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/BuildItemTest.cs
@@ -717,6 +717,83 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		}
 
 		[Test]
+		public void TestSetMetadata5a () {
+			Engine engine;
+			Project project;
+			BuildItemGroup[] groups = new BuildItemGroup[1];
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<PropertyGroup>
+						<A>A</A>
+						<C>@(D)</C>
+					</PropertyGroup>
+					<ItemGroup>
+						<D Include='D'/>
+						<C Include='$(C)'/>
+						<A Include='a;b'>
+							<Md>@(C)</Md>
+						</A>
+						<B Include='$(A)'/>
+					</ItemGroup>
+					<Target Name='main'>
+						<Message Text=""a.md: %(A.Md)""/>
+						<Message Text=""a.md: %(A.Meta)""/>
+					</Target>
+				</Project>
+			";
+
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger = new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+			project.LoadXml (documentString);
+
+			CheckMetadata (project, "A", "Md", new string [] {"@(C)", "@(C)"}, "G1");
+			CheckEvaluatedMetadata (project, "A", "Md", new string[] { "D", "D" }, "G2");
+
+			//@(B)
+			Assert.AreEqual ("A", project.GetEvaluatedItemsByName ("B")[0].FinalItemSpec, "B2");
+
+			project.ItemGroups.CopyTo (groups, 0);
+			/*Broken right now:
+			  CheckBuildItemGroup (groups[0], new string[] {
+				"D", "D",
+				"C", "$(C)",
+				"A", "a;b",
+				"B", "$(A)"
+			}, "H1");*/
+
+			CheckBuildItemGroup (project.GetEvaluatedItemsByName ("C"), new string[] {
+				"C", "D"
+			}, "H2");
+
+			CheckBuildItemGroup (project.GetEvaluatedItemsByName ("C"), new string[] {
+				"C", "D"
+			}, "I");
+
+			project.GetEvaluatedItemsByName ("A")[0].SetMetadata ("Meta", "@(B)");
+
+			Assert.AreEqual (5, project.EvaluatedItems.Count, "A0");
+			Assert.AreEqual (2, project.GetEvaluatedItemsByName ("A").Count, "A7");
+
+			CheckMetadata (project, "A", "Meta", new string[] { "@(B)", "" }, "J");
+
+			if (!project.Build ()) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+			logger.DumpMessages ();
+
+			CheckMetadata (project, "A", "Meta", new string[] { "@(B)", "" }, "K1");
+			CheckEvaluatedMetadata (project, "A", "Meta", new string[] { "", "" }, "K2");
+
+			logger.CheckLoggedMessageHead ("a.md: D", "E10");
+			logger.CheckLoggedMessageHead ("a.md: ", "E11");
+			Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages left");
+		}
+
+		[Test]
 		public void TestSetMetadata6 ()
 		{
 			Engine engine;
@@ -848,5 +925,44 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			Assert.AreEqual ("PropValue/abc.txt", grp [0].FinalItemSpec, "A2");
 			Assert.AreEqual ("PropValue/def.txt", grp [1].FinalItemSpec, "A3");
 		}
+
+		void CheckMetadata (Project p, string itemname, string metadataname, string[] values, string prefix)
+		{
+			BuildItemGroup group = p.GetEvaluatedItemsByName (itemname);
+
+			Assert.AreEqual (values.Length, group.Count, "Number of items for itemname " + itemname);
+
+			for (int i = 0; i < values.Length; i++) {
+				Assert.AreEqual (values[i], group [i].GetMetadata (metadataname), prefix + "#" + i.ToString ());
+			}
+		}
+
+		void CheckEvaluatedMetadata (Project p, string itemname, string metadataname, string[] values, string prefix)
+		{
+			BuildItemGroup group = p.GetEvaluatedItemsByName (itemname);
+
+			Assert.AreEqual (values.Length, group.Count, "Number of items for itemname " + itemname);
+
+			for (int i = 0; i < values.Length; i++) {
+				Assert.AreEqual (values[i], group [i].GetEvaluatedMetadata (metadataname), prefix + "#" + i.ToString ());
+			}
+		}
+
+		void CheckBuildItemGroup (BuildItemGroup group, string[] names, string prefix)
+		{
+			try {
+				Assert.AreEqual (group.Count, names.Length / 2, "Number of items in group");
+				for (int i = 0; i < group.Count; i++) {
+					Assert.AreEqual (names[i * 2], group[i].Name, String.Format ("{0}#{1} : item name", prefix, i));
+					Assert.AreEqual (names[(i * 2) + 1], group[i].FinalItemSpec, String.Format ("{0}#{1} : FinalItemSpec", prefix, i));
+				}
+			} catch (AssertionException) {
+				for (int i = 0; i < group.Count; i++) {
+					Console.WriteLine ("group[{0}] = {1}", i, group[i].Name);
+					Console.WriteLine ("group[{0}] = {1}", i, group[i].FinalItemSpec);
+				}
+				throw;
+			}
+		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
index 3ab5da2..5d2f27d 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog
@@ -1,3 +1,44 @@
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* ProjectTest.cs (TestBatchedMetadataRefInOutput): New.
+
+2009-10-01  Ankit Jain  <jankit at novell.com>
+
+	* ImportTest.cs (TestAdd1): Add tests for multiple imports.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* ProjectTest.cs (TestPropertiesFromImportedProjects): New.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* TargetTest.cs (TestOverridingTargets): New.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* ProjectTest.cs (TestInitialTargetsWithImports):
+	(TestDefaultTargets):
+	(TestDefaultTargetsWithImports):
+	(TestNoDefaultTargetsWithImports):
+	(TestNoDefaultTargets): New tests.
+
+2009-08-29  Ankit Jain  <jankit at novell.com>
+
+	* BuildItemTest.cs (TestSetMetadata5a): New.
+	* ProjectTest.cs: Add tests for different property types
+	with required attribute. Also, check the values - null or
+	empty array.
+	* TestTasks.cs: Add new tasks for above.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* ProjectTest.cs (TestCaseSensitivityOfProjectElements): New.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* EngineTest.cs (TestNewProject): Disable. Invalid for
+	v3.5 profile.
+
 2009-06-09  Ankit Jain  <jankit at novell.com>
 
 	* EngineTest.cs (TestMSBuildOutputs): New.
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
index deff748..e18e464 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs
@@ -100,6 +100,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 
 		// Before a project can be instantiated, Engine.BinPath must be set to the location on disk where MSBuild is installed.
 		// This is used to evaluate $(MSBuildBinPath).
+		/* This isn't valid for 3.5
+
 		[Test]
 		[ExpectedException (typeof (InvalidOperationException))]
 		public void TestNewProject ()
@@ -107,7 +109,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			engine = new Engine ();
 
 			engine.CreateNewProject ();
-		}
+		}*/
 
 		[Test]
 		public void TestBinPath ()
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportTest.cs
index f225764..1c91d04 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ImportTest.cs
@@ -31,6 +31,7 @@ using Microsoft.Build.BuildEngine;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 using NUnit.Framework;
+using System.IO;
 
 namespace MonoTests.Microsoft.Build.BuildEngine {
 	[TestFixture]
@@ -42,9 +43,27 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		[Test]
 		public void TestAdd1 ()
 		{
+			string first = @"
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<Import Project='second.proj'/>
+                                </Project>
+";
+			using (StreamWriter sw = new StreamWriter ("Test/resources/first.proj")) {
+				sw.Write (first);
+			}
+
+			string second = @"
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+                                </Project>
+";
+			using (StreamWriter sw = new StreamWriter ("Test/resources/second.proj")) {
+				sw.Write (second);
+			}
+
                         string documentString = @"
                                 <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
-					<Import Project='Test/resources/Import.csproj'/>
+						<Import Project='Test/resources/first.proj'/>
+						<Import Project='Test/resources/Import.csproj' Condition='false'/>
                                 </Project>
                         ";
 
@@ -53,15 +72,21 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
                         project = engine.CreateNewProject ();
                         project.LoadXml (documentString);
 
-			Import[] t = new Import [1];
+			Import[] t = new Import [2];
+			Assert.AreEqual (2, project.Imports.Count, "Number of imports");
 			project.Imports.CopyTo (t, 0);
 
+			string base_dir = Path.Combine (Environment.CurrentDirectory, Path.Combine ("Test", "resources"));
+
 			Assert.IsNull (t [0].Condition, "A1");
-			Assert.AreEqual (false, t [0].IsImported, "A2");
-			Assert.AreEqual ("Test/resources/Import.csproj", t [0].ProjectPath, "A3");
-			Assert.IsNotNull (t [0].EvaluatedProjectPath, "A4");
-			// FIXME: why there is no IsNotEmpty () in Mono NUnit?
-			Assert.IsTrue (String.Empty != t [0].EvaluatedProjectPath, "A5");
+
+			Assert.AreEqual (false, t[0].IsImported, "A5");
+			Assert.AreEqual ("Test/resources/first.proj", t[0].ProjectPath, "A6");
+			Assert.AreEqual (Path.Combine (base_dir, "first.proj"), t[0].EvaluatedProjectPath, "A7");
+
+			Assert.AreEqual (true, t[1].IsImported, "A2");
+			Assert.AreEqual ("second.proj", t[1].ProjectPath, "A3");
+			Assert.AreEqual (Path.Combine (base_dir, "second.proj"), t[1].EvaluatedProjectPath, "A4");
 		}
 
 		[Test]
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
index b84cff7..cce13c6 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 //
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -97,6 +99,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 				"<Project></Project>";
 			
 			engine = new Engine (Consts.BinPath);
+
 			DateTime time = DateTime.Now;
 			project = engine.CreateNewProject ();
 			try {
@@ -1490,6 +1493,48 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		}
 
 		[Test]
+		public void TestBatchedMetadataRefInOutput () {
+			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+			<UsingTask TaskName=""BatchingTestTask"" AssemblyFile=""Test/resources/TestTasks.dll"" />
+			<ItemGroup>
+				<Coll1 Include=""A1""><Name>Abc</Name></Coll1>
+				<Coll1 Include=""A2""><Name>Def</Name></Coll1>
+				<Coll1 Include=""A3""><Name>Abc</Name></Coll1>
+				<Coll1 Include=""B1""><Name>Bar</Name></Coll1>
+			</ItemGroup>
+				<Target Name=""ShowMessage"">
+					<BatchingTestTask Sources=""@(Coll1)"" >
+						<Output TaskParameter=""Output"" ItemName=""AbcItems"" Condition=""'%(Coll1.Name)' == 'Abc'""/>
+						<Output TaskParameter=""Output"" ItemName=""NonAbcItems"" Condition=""'%(Coll1.Name)' != 'Abc'""/>
+					</BatchingTestTask>
+					<Message Text='AbcItems: @(AbcItems)' />
+					<Message Text='NonAbcItems: @(NonAbcItems)' />
+				</Target>
+		 </Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			project.LoadXml (projectString);
+			bool result = project.Build ("ShowMessage");
+			if (!result) {
+				logger.DumpMessages ();
+				Assert.Fail ("A1: Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("AbcItems: A1;A3", "A2");
+			logger.CheckLoggedMessageHead ("NonAbcItems: A2;B1", "A2");
+
+			if (logger.NormalMessageCount != 0) {
+				logger.DumpMessages ();
+				Assert.Fail ("Unexpected extra messages found");
+			}
+		}
+
+		[Test]
 		public void TestInitialTargets ()
 		{
 			Engine engine = new Engine (Consts.BinPath);
@@ -1511,9 +1556,186 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			try {
 				Assert.IsTrue (project.Build (), "Build failed");
 
-				Assert.AreEqual (0, logger.CheckHead ("Executing pre target", MessageImportance.Normal), "A1");
-				Assert.AreEqual (0, logger.CheckHead ("Executing boo target", MessageImportance.Normal), "A2");
-				Assert.AreEqual (0, logger.Count, "A3");
+				logger.CheckLoggedMessageHead ("Executing pre target", "A1");
+				logger.CheckLoggedMessageHead ("Executing boo target", "A2");
+
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+		[Test]
+		public void TestInitialTargetsWithImports () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""One  "">
+				<Target Name=""One"">
+					<Message Text='Executing Second::One target'/>
+				</Target>
+				<Import Project='third.proj'/>
+			</Project>
+";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
+				sw.Write (second);
+			}
+
+			string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""Two"">
+				<Target Name=""Two"">
+					<Message Text='Executing Third::Two target'/>
+				</Target>
+			</Project>
+";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "third.proj")))) {
+				sw.Write (third);
+			}
+
+			project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" InitialTargets=""pre"">
+				<Target Name=""boo"">
+					<Message Text=""Executing boo target""/>
+				</Target>
+				<Target Name=""pre"">
+					<Message Text=""Executing pre target""/>
+				</Target>
+				<Import Project='Test/resources/second.proj'/>
+			</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Executing pre target", "A1");
+				logger.CheckLoggedMessageHead ("Executing Second::One target", "A2");
+				logger.CheckLoggedMessageHead ("Executing Third::Two target", "A3");
+				logger.CheckLoggedMessageHead ("Executing boo target", "A4");
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+				Assert.AreEqual ("pre; One; Two", project.InitialTargets, "List of initial targets");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+		[Test]
+		public void TestDefaultTargets () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			project.LoadXml (@"<Project DefaultTargets='pre' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
+				<Target Name=""boo"">
+					<Message Text=""Executing boo target""/>
+				</Target>
+				<Target Name=""pre"">
+					<Message Text=""Executing pre target""/>
+				</Target>
+			</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Executing pre target", "A1");
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+				Assert.AreEqual ("pre", project.DefaultTargets, "Default targets");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+
+		[Test]
+		public void TestDefaultTargetsWithImports () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			string second = @"<Project DefaultTargets='One' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<Target Name=""One"">
+					<Message Text='Executing Second::One target'/>
+				</Target>
+			</Project>";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
+				sw.Write (second);
+			}
+
+			project.LoadXml (@"<Project DefaultTargets='pre' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
+				<Target Name=""boo"">
+					<Message Text=""Executing boo target""/>
+				</Target>
+				<Target Name=""pre"">
+					<Message Text=""Executing pre target""/>
+				</Target>
+				<Import Project='Test/resources/second.proj'/>
+			</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Executing pre target", "A1");
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+				Assert.AreEqual ("pre", project.DefaultTargets, "Default targets");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+		[Test]
+		public void TestNoDefaultTargetsWithImports () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+
+			string second = @"<Project DefaultTargets='; One  ; Two' xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<Target Name=""One"">
+					<Message Text='Executing Second::One target'/>
+				</Target>
+				<Target Name=""Two"">
+					<Message Text='Executing Second::Two target'/>
+				</Target>
+
+			</Project>";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
+				sw.Write (second);
+			}
+
+			project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
+				<Target Name=""boo"">
+					<Message Text=""Executing boo target""/>
+				</Target>
+				<Target Name=""pre"">
+					<Message Text=""Executing pre target""/>
+				</Target>
+				<Import Project='Test/resources/second.proj'/>
+			</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Executing Second::One target", "A1");
+				logger.CheckLoggedMessageHead ("Executing Second::Two target", "A2");
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+				Assert.AreEqual ("One; Two", project.DefaultTargets, "Default targets");
 			} catch {
 				logger.DumpMessages ();
 				throw;
@@ -1521,38 +1743,182 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		}
 
 		[Test]
+		public void TestNoDefaultTargets () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			project.LoadXml (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" >
+				<Target Name=""boo"">
+					<Message Text=""Executing boo target""/>
+				</Target>
+				<Target Name=""pre"">
+					<Message Text=""Executing pre target""/>
+				</Target>
+			</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Executing boo target", "A1");
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+				Assert.AreEqual ("", project.DefaultTargets, "Default targets");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+		[Test]
+		public void TestPropertiesFromImportedProjects ()
+		{
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+	<PropertyGroup>
+	  <Prop1>InitialVal</Prop1>
+	</PropertyGroup>
+	<ItemGroup>
+		<Second Include=""$(ThirdProp):Third""/>
+	</ItemGroup>
+
+	<Target Name=""Main"">
+		<Message Text=""Prop1: $(Prop1) FooItem: @(FooItem)""/>
+		<Message Text=""Second: @(Second) ThirdProp: $(ThirdProp)""/>
+	</Target>
+	<Import Project=""third.proj""/>
+</Project>";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
+				sw.Write (second);
+			}
+
+			string third = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+	<PropertyGroup>
+	  <ThirdProp>Third Value</ThirdProp>
+	</PropertyGroup>
+</Project>";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "third.proj")))) {
+				sw.Write (third);
+			}
+
+			project.LoadXml (@"<Project InitialTargets=""Main"" xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<ItemGroup>
+		<FooItem Include=""$(Prop1):Something""/>
+	</ItemGroup>
+
+	<Import Project=""Test/resources/second.proj""/>
+</Project>");
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			try {
+				Assert.IsTrue (project.Build (), "Build failed");
+
+				logger.CheckLoggedMessageHead ("Prop1: InitialVal FooItem: InitialVal:Something", "A1");
+				logger.CheckLoggedMessageHead ("Second: Third Value:Third ThirdProp: Third Value", "A2");
+
+				Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+			} catch {
+				logger.DumpMessages ();
+				throw;
+			}
+		}
+
+
+		[Test]
 		public void TestRequiredTask_String1 ()
 		{
 			CheckProjectForRequiredTests ("RequiredTestTask_String", "@(NonExistant)",
-				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String");
+				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String", null);
 		}
 
 		[Test]
 		public void TestRequiredTask_String2 ()
 		{
 			CheckProjectForRequiredTests ("RequiredTestTask_String", "$(NonExistant)",
-				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String");
+				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_String", null);
+		}
+
+		[Test]
+		public void TestRequiredTask_Strings1 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_Strings", "@(NonExistant)",
+				true, "Build failed", "0");
+		}
+
+		[Test]
+		public void TestRequiredTask_Strings2 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_Strings", "$(NonExistant)",
+				true, "Build failed", "0");
+		}
+
+		[Test]
+		public void TestRequiredTask_Strings3 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_Strings", "%(NonExistant.Md)",
+				true, "Build failed", "0");
+		}
+
+		[Test]
+		public void TestRequiredTask_Strings4 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_Strings", "  %(NonExistant.Md)",
+				true, "Build failed", "0");
+		}
+
+		[Test]
+		public void TestRequiredTask_Ints1 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "@(NonExistant)",
+				true, "Build failed", "count: 0");
+		}
+
+		[Test]
+		public void TestRequiredTask_Ints2 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "$(NonExistant)",
+				true, "Build failed", "count: 0");
+		}
+
+		[Test]
+		public void TestRequiredTask_OtherObjectsArray () {
+			CheckProjectForRequiredTests ("RequiredTestTask_OtherObjectArray", "@(NonExistant)",
+				false, "Should've failed: ObjectArray type not supported as a property type", null);
+		}
+
+		[Test]
+		public void TestRequiredTask_OtherObject () {
+			CheckProjectForRequiredTests ("RequiredTestTask_OtherObjectArray", "@(NonExistant)",
+				false, "Should've failed: ObjectArray type not supported as a property type", null);
+		}
+
+		[Test]
+		public void TestRequiredTask_MyTaskItems1 () {
+			CheckProjectForRequiredTests ("RequiredTestTask_MyTaskItemArray", "@(NonExistant)",
+				false, "Should've failed: ObjectArray type not supported as a property type", null);
 		}
 
 		[Test]
 		public void TestRequiredTask_TaskItem1 ()
 		{
 			Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItem", "@(NonExistant)",
-				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem");
+				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem", null);
 		}
 
 		[Test]
 		public void TestRequiredTask_TaskItem2 ()
 		{
 			Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItem", "$(NonExistant)",
-				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem");
+				false, "Should've failed: No value specified for required field - 'Property' of RequiredTestTask_TaskItem", null);
 		}
 
 		[Test]
 		public void TestRequiredTask_TaskItemArray1 ()
 		{
 			Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItems", "@(NonExistant)",
-				true, "Build failed");
+				true, "Build failed", "count: 0");
 
 			BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
 			Assert.AreEqual (1, group.Count, "A2");
@@ -1563,7 +1929,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		public void TestRequiredTask_TaskItemArray2 ()
 		{
 			Project p = CheckProjectForRequiredTests ("RequiredTestTask_TaskItems", "$(NonExistant)",
-				true, "Build failed");
+				true, "Build failed", "count: 0");
 
 			BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
 			Assert.AreEqual (1, group.Count, "A2");
@@ -1574,13 +1940,97 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 		public void TestRequiredTask_TaskItemArray3 ()
 		{
 			Project p = CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "$(NonExistant)",
-				true, "Build failed");
+				true, "Build failed", "count: 0");
 
 			BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
 			Assert.AreEqual (1, group.Count, "A2");
 			Assert.AreEqual ("count: 0", group [0].FinalItemSpec, "A3");
 		}
 
+		[Test]
+		public void TestRequiredTask_TaskItemArray4 () {
+			Project p = CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "%(NonExistant.Md)",
+				true, "Build failed", "count: 0");
+
+			BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
+			Assert.AreEqual (1, group.Count, "A2");
+			Assert.AreEqual ("count: 0", group[0].FinalItemSpec, "A3");
+		}
+
+		[Test]
+		public void TestRequiredTask_TaskItemArray5 () {
+			// with extra space in prop value
+			Project p = CheckProjectForRequiredTests ("RequiredTestTask_IntArray", "  %(NonExistant.Md)",
+				true, "Build failed", "count: 0");
+
+			BuildItemGroup group = p.GetEvaluatedItemsByName ("OutItem");
+			Assert.AreEqual (1, group.Count, "A2");
+			Assert.AreEqual ("count: 0", group[0].FinalItemSpec, "A3");
+		}
+
+
+		[Test]
+		public void TestCaseSensitivityOfProjectElements ()
+		{
+			string projectXml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+        <ItemGroup>
+                <Abc Include=""foo"">
+                        <MetaDaTA1>md1</MetaDaTA1>
+                        <METadata2>md2</METadata2>
+                </Abc>
+                <Abc Include=""FOO"">
+                        <MetaDaTA1>MD1 caps</MetaDaTA1>
+                        <METadata2>MD2 caps</METadata2>
+                </Abc>
+                <Abc Include=""hmm"">
+                        <MetaDaTA1>Md1 CAPS</MetaDaTA1>
+                        <METadata2>MD2 CAPS</METadata2>
+                </Abc>
+                <Abc Include=""bar"">
+                        <MeTAdata1>md3</MeTAdata1>
+                        <Metadata2>md4</Metadata2>
+                </Abc>
+        </ItemGroup> 
+        <PropertyGroup><ProP1>ValueProp</ProP1></PropertyGroup>
+	<Target Name=""Main"">
+		<MesSAGE Text=""Full item: @(ABC)""/>
+		<MEssaGE Text=""metadata1 :%(AbC.MetaDATA1) metadata2: %(ABC.MetaDaTa2)""/>
+		<MEssaGE Text=""metadata2 : %(AbC.MetaDAta2)""/>
+		<MEssaGE Text=""Abc identity: %(ABC.IDENTitY)""/>
+		<MEssaGE Text=""prop1 : $(pROp1)""/>
+	</Target>
+</Project>
+";
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			project.LoadXml (projectXml);
+			bool result = project.Build ("Main");
+			if (!result) {
+				logger.DumpMessages ();
+				Assert.Fail ("A1: Build failed");
+			}
+			logger.DumpMessages ();
+
+			logger.CheckLoggedMessageHead ("Full item: foo;FOO;hmm;bar", "#A2");
+			logger.CheckLoggedMessageHead ("metadata1 :md1 metadata2: md2", "#A3");
+			logger.CheckLoggedMessageHead ("metadata1 :MD1 caps metadata2: MD2 caps", "#A4");
+			logger.CheckLoggedMessageHead ("metadata1 :md3 metadata2: md4", "#A5");
+			logger.CheckLoggedMessageHead ("metadata2 : md2", "#A6");
+			logger.CheckLoggedMessageHead ("metadata2 : MD2 caps", "#A7");
+			logger.CheckLoggedMessageHead ("metadata2 : md4", "#A8");
+			logger.CheckLoggedMessageHead ("Abc identity: foo", "#A9");
+			logger.CheckLoggedMessageHead ("Abc identity: hmm", "#A10");
+			logger.CheckLoggedMessageHead ("Abc identity: bar", "#A11");
+			logger.CheckLoggedMessageHead ("prop1 : ValueProp", "#A12");
+
+			Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+
+		}
+
 		// full solution test
 		//[Test]
 		public void TestBuildSolutionProject ()
@@ -1699,7 +2149,8 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			}
 		}
 
-		Project CheckProjectForRequiredTests (string taskname, string property_arg, bool expected_result, string error_msg)
+		Project CheckProjectForRequiredTests (string taskname, string property_arg, bool expected_result, string error_msg,
+			string expected_output_msg)
 		{
 			string projectString = String.Format (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
 				<UsingTask TaskName=""{0}"" AssemblyFile=""Test/resources/TestTasks.dll"" />
@@ -1707,6 +2158,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 					<{0} Property=""{1}"">
 						<Output TaskParameter=""Output"" ItemName=""OutItem""/>
 					</{0}>
+					<Message Text='@(OutItem)'/>
 				</Target>
 			</Project>", taskname, property_arg);
 
@@ -1716,9 +2168,12 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			engine.RegisterLogger (logger);
 			Project project = engine.CreateNewProject ();
 			project.LoadXml (projectString);
-
 			try {
 				Assert.AreEqual (expected_result, project.Build (), error_msg);
+				if (expected_result) {
+					logger.CheckLoggedMessageHead (expected_output_msg, "A");
+					Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected messages found");
+				}
 			} finally {
 				logger.DumpMessages ();
 			}
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs
index db6dd40..65b01a8 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/TargetTest.cs
@@ -31,6 +31,7 @@ using Microsoft.Build.BuildEngine;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 using NUnit.Framework;
+using System.IO;
 
 namespace MonoTests.Microsoft.Build.BuildEngine {
 	[TestFixture]
@@ -370,5 +371,54 @@ namespace MonoTests.Microsoft.Build.BuildEngine {
 			}
 		}
 
+		[Test]
+		public void TestOverridingTargets ()
+		{
+			Engine engine;
+			Project project;
+
+			string second = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<Target Name='BeforeBuild'/>
+				<Target Name='AfterBuild'/>
+				<Target Name='Build' DependsOnTargets='BeforeBuild'>
+					<Message Text='Build executing'/>
+					<CallTarget Targets='AfterBuild'/>
+				</Target>
+		</Project>";
+			using (StreamWriter sw = new StreamWriter (Path.Combine ("Test", Path.Combine ("resources", "second.proj")))) {
+				sw.Write (second);
+			}
+
+			string documentString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<Target Name='AfterBuild'>
+					<Message Text='Overriding AfterBuild'/>
+				</Target>
+
+				<Import Project='Test/resources/second.proj'/>
+				<Target Name='BeforeBuild'>
+					<Message Text='Overriding BeforeBuild'/>
+				</Target>
+		</Project>";
+
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			bool result = project.Build ("Build");
+			if (!result) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("Overriding BeforeBuild", "A1");
+			logger.CheckLoggedMessageHead ("Build executing", "A1");
+
+			Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Engine/Test/resources/TestTasks.cs b/mcs/class/Microsoft.Build.Engine/Test/resources/TestTasks.cs
index 46b032f..ac87e56 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/resources/TestTasks.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/resources/TestTasks.cs
@@ -28,6 +28,7 @@
 using System;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
+using System.Text;
 
 namespace Foo
 {
@@ -58,6 +59,45 @@ public class OutputTestTask : Task {
 	}
 }
 
+public class TestTask_TaskItems : Task
+{
+	string output;
+	public override bool Execute () {
+		output = items == null ? "null" : "count: " + items.Length.ToString ();
+		return true;
+	}
+
+	ITaskItem[] items;
+	public ITaskItem[] Property {
+		set { items = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+public class TestTask_TaskItem : Task
+{
+	string output;
+	public override bool Execute () {
+		output = item == null ? "null" : "not null: " + item.ItemSpec;
+		return true;
+	}
+
+	ITaskItem item;
+	public ITaskItem Property {
+		set { item = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+
 public class RequiredTestTask_TaskItems : Task {
 	string output;
 	public override bool Execute ()
@@ -125,6 +165,134 @@ public class RequiredTestTask_String : Task
 	}
 }
 
+public class RequiredTestTask_Strings : Task
+{
+	string output;
+	public override bool Execute () {
+		output = property == null ? "null" : property.Length.ToString ();
+		return true;
+	}
+
+	string []property;
+	[Required]
+	public string[] Property {
+		set { property = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+public class RequiredTestTask_OtherObjectArray : Task
+{
+	string output;
+	public override bool Execute () {
+		output = property == null ? "null" : property.Length.ToString ();
+		return true;
+	}
+
+	OtherClass[] property;
+	[Required]
+	public OtherClass[] Property {
+		set { property = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+public class RequiredTestTask_OtherObject : Task
+{
+	string output;
+	public override bool Execute () {
+		output = property == null ? "null" : "not null";
+		return true;
+	}
+
+	OtherClass property;
+	[Required]
+	public OtherClass Property {
+		set { property = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+public class RequiredTestTask_MyTaskItemArray : Task
+{
+	string output;
+	public override bool Execute () {
+		output = property == null ? "null" : property.Length.ToString ();
+		return true;
+	}
+
+	MyTaskItem[] property;
+	[Required]
+	public MyTaskItem[] Property {
+		set { property = value; }
+	}
+
+	[Output]
+	public string Output {
+		get { return output; }
+	}
+}
+
+public class OtherClass
+{
+}
+
+public class MyTaskItem : ITaskItem
+{
+	#region ITaskItem Members
+
+	public System.Collections.IDictionary CloneCustomMetadata () {
+		throw new NotImplementedException ();
+	}
+
+	public void CopyMetadataTo (ITaskItem destinationItem) {
+		throw new NotImplementedException ();
+	}
+
+	public string GetMetadata (string metadataName) {
+		throw new NotImplementedException ();
+	}
+
+	public string ItemSpec {
+		get {
+			throw new NotImplementedException ();
+		}
+		set {
+			throw new NotImplementedException ();
+		}
+	}
+
+	public int MetadataCount {
+		get { throw new NotImplementedException (); }
+	}
+
+	public System.Collections.ICollection MetadataNames {
+		get { throw new NotImplementedException (); }
+	}
+
+	public void RemoveMetadata (string metadataName) {
+		throw new NotImplementedException ();
+	}
+
+	public void SetMetadata (string metadataName, string metadataValue) {
+		throw new NotImplementedException ();
+	}
+
+	#endregion
+}
+
 public class RequiredTestTask_IntArray: Task
 {
 	string output;
@@ -164,8 +332,15 @@ public class FalseTestTask : Task {
 }
 
 public class StringTestTask : Task {
+	string output;
+
 	public override bool Execute ()
 	{
+		StringBuilder sb = new StringBuilder ();
+		sb.AppendFormat ("property: {0} ## ", property == null ? "null" : property);
+		sb.AppendFormat ("array: {0}", array == null ? "null" : array.Length.ToString ());
+
+		output = sb.ToString ();
 		return true;
 	}
 
@@ -182,7 +357,12 @@ public class StringTestTask : Task {
 	public string[] Array {
 		get { return array; }
 		set { array = value; }
-	}	
+	}
+
+	[Output]
+	public string OutputString {
+		get { return output; }
+	}
 }
 
 public class PublishTestTask : Task {
diff --git a/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
index 0a2badb..96c7f96 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Test/various/ChangeLog
@@ -1,3 +1,29 @@
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* Items.cs (TestItemsWithWildcards): New.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* Items.cs (TestItems5): Fix to work correctly on windows
+	and unix.
+	(TestReservedMetadata): New.
+
+2009-09-10  Ankit Jain  <jankit at novell.com>
+
+	* Items.cs (TestItems2a):
+	(TestInheritedMetadataFromItemRefs):
+	(TestInheritedMetadataFromItemRefs2):
+	(TestMetadataFromItemReferences): New.
+
+2009-09-08  Ankit Jain  <jankit at novell.com>
+
+	* Items.cs (TestItems5):
+	(TestItems6): Remove 'NotWorking' attribute.
+
+2009-08-29  Ankit Jain  <jankit at novell.com>
+
+	* Items.cs: Add tests for property/item evaluation.
+
 2009-06-12  Ankit Jain  <jankit at novell.com>
 
 	* Items.cs (TestItemsInTarget3a): Add another case for valid whitespace
diff --git a/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs b/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
index 1531142..e50d203 100644
--- a/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
+++ b/mcs/class/Microsoft.Build.Engine/Test/various/Items.cs
@@ -32,6 +32,8 @@ using System.Text;
 using System.Xml;
 using Microsoft.Build.BuildEngine;
 using NUnit.Framework;
+using System.IO;
+using Microsoft.Build.Framework;
 
 namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 	[TestFixture]
@@ -132,6 +134,120 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 		}
 
 		[Test]
+		// item with 1. item ref with a separator and 2. another item ref
+		public void TestItems2a () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<ItemGroup>
+						<Item0 Include='D'/>
+						<Item1 Include='A;B;C' />
+						<Item2 Include=""@(Item1,'-');@(Item0)"" />
+						<Item3 Include=""@(Item1,'xx')"" />
+					</ItemGroup>
+				</Project>
+			";
+
+			proj.LoadXml (documentString);
+
+			CheckItems (proj, "Item2", "A1", "A-B-C", "D");
+			CheckItems (proj, "Item3", "A2", "AxxBxxC");
+		}
+
+		[Test]
+		public void TestInheritedMetadataFromItemRefs () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<ItemGroup>
+						<Item0 Include='D'>
+							<MD0>Val0</MD0>
+						</Item0>
+						<Item1 Include='A;@(Item0)' >
+							<MD1>Val1</MD1>
+						</Item1>
+						<Item2 Include=""@(Item1,'-')"" />
+						<Item3 Include=""@(Item1);Z"" />
+					</ItemGroup>
+
+						<Target Name=""Main"">
+		<Message Text=""Item2: %(Item2.Identity) MD0: %(Item2.MD0) MD1: %(Item2.MD1)""/>
+		<Message Text=""Item3: %(Item3.Identity) MD0: %(Item3.MD0) MD1: %(Item3.MD1)""/>
+	</Target>
+				</Project>
+			";
+
+			proj.LoadXml (documentString);
+
+			CheckItems (proj, "Item2", "A1", "A-D");
+			CheckItems (proj, "Item3", "A2", "A", "D", "Z");
+
+			if (!proj.Build ("Main")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("Item2: A-D MD0:  MD1: ", "A4");
+
+			logger.CheckLoggedMessageHead ("Item3: A MD0:  MD1: Val1", "A5");
+			logger.CheckLoggedMessageHead ("Item3: D MD0: Val0 MD1: Val1", "A6");
+			logger.CheckLoggedMessageHead ("Item3: Z MD0:  MD1: ", "A7");
+
+			Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
+		[Test]
+		public void TestInheritedMetadataFromItemRefs2 () {
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			string documentString = @"
+				<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
+					<ItemGroup>
+						<Item5 Include='ZZ'>
+							<MD5>Val5</MD5>
+						</Item5>
+
+						<Item0 Include='D'>
+							<MD0>Val0</MD0>
+						</Item0>
+						<Item1 Include='A;@(Item0)' >
+							<MD1>Val1</MD1>
+						</Item1>
+						<Item2 Include=""@(Item1,'-');@(Item5)"" />
+					</ItemGroup>
+
+						<Target Name=""Main"">
+		<Message Text=""Item2: %(Item2.Identity) MD0: %(Item2.MD0) MD1: %(Item2.MD1) MD5: %(Item2.MD5)""/>
+	</Target>
+				</Project>
+			";
+
+			proj.LoadXml (documentString);
+
+			CheckItems (proj, "Item2", "A1", "A-D", "ZZ");
+
+			if (!proj.Build ("Main")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("Item2: A-D MD0:  MD1:  MD5: ", "A4");
+			logger.CheckLoggedMessageHead ("Item2: ZZ MD0:  MD1:  MD5: Val5", "A5");
+			Assert.AreEqual (0, logger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
+		[Test]
 		public void TestItems3 ()
 		{
 			Engine engine = new Engine (Consts.BinPath);
@@ -160,29 +276,41 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 
 			string documentString = @"
 				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<PropertyGroup>
+						<Prop1>@(Item0)</Prop1>
+					</PropertyGroup>
 					<ItemGroup>
+						<Item0 Include=""Foo""/>
 						<Item1 Include='A;B;C' />
 						<Item2 Include=""A\B.txt;A\C.txt;B\B.zip;B\C.zip"" />
+						<ItemT0 Include=""@(Item1)"" />
 						<ItemT1 Include=""@(Item1->'%(Identity)')"" />
 						<ItemT2 Include=""@(Item1->'%(Identity)%(Identity)')"" />
 						<ItemT3 Include=""@(Item1->'(-%(Identity)-)')"" />
 						<ItemT4 Include=""@(Item2->'%(Extension)')"" />
 						<ItemT5 Include=""@(Item2->'%(Filename)/%(Extension)')"" />
+						<ItemT6 Include=""@(Item2->'%(Extension)/$(Prop1)')"" />
 					</ItemGroup>
 				</Project>
 			";
 
 			proj.LoadXml (documentString);
 
+			//Assert.IsTrue (proj.Build (), "Build failed");
+
+			Assert.AreEqual ("@(Item0)", proj.EvaluatedProperties["Prop1"].FinalValue, "A0");
+			//Assert.AreEqual ("@(Item2->'%(Extension)/$(Prop1)')", proj.EvaluatedItems [7].FinalItemSpec, "B0");
+
+			CheckItems (proj, "ItemT0", "A1", "A", "B", "C");
 			CheckItems (proj, "ItemT1", "A1", "A", "B", "C");
 			CheckItems (proj, "ItemT2", "A2", "AA", "BB", "CC");
 			CheckItems (proj, "ItemT3", "A3", "(-A-)", "(-B-)", "(-C-)");
 			CheckItems (proj, "ItemT4", "A4", ".txt", ".txt", ".zip", ".zip");
 			CheckItems (proj, "ItemT5", "A5", "B/.txt", "C/.txt", "B/.zip", "C/.zip");
+			CheckItems (proj, "ItemT6", "A6", ".txt/@(Item0)", ".txt/@(Item0)", ".zip/@(Item0)", ".zip/@(Item0)");
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void TestItems5 ()
 		{
 			Engine engine = new Engine (Consts.BinPath);
@@ -192,18 +320,20 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
 					<ItemGroup>
 						<Item Include=""A\B.txt;A\C.txt;B\B.zip;B\C.zip"" />
-						<ItemT Include=""@(Item->'%(RelativeDir)X/%(Filename)')"" />
+						<ItemT Include=""@(Item->'%(RelativeDir)X\%(Filename)')"" />
 					</ItemGroup>
 				</Project>
 			";
 
 			proj.LoadXml (documentString);
 
-			CheckItems (proj, "ItemT", "A1", @"A\X/B", @"A\X/C", @"B\X/B", @"B\X/C");
+			string dir_a = Path.Combine ("A", "X");
+			string dir_b = Path.Combine ("B", "X");
+			CheckItems (proj, "ItemT", "A1", Path.Combine (dir_a, "B"), Path.Combine (dir_a, "C"),
+								Path.Combine (dir_b, "B"), Path.Combine (dir_b, "C"));
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void TestItems6 ()
 		{
 			Engine engine = new Engine (Consts.BinPath);
@@ -307,6 +437,371 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 		}
 
 		[Test]
+		// test item metadata
+		public void TestItems10 ()
+		{
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<PropertyGroup>
+		<Prop1>@(Item0)</Prop1>
+		<Prop2>@(Ref1)</Prop2>
+	</PropertyGroup>
+	<ItemGroup>
+		<Item0 Include=""Foo""/>
+		<Ref1 Include=""File1"" />
+		<IWithM Include=""A"">
+			<Md>@(Item0)</Md>
+			<Md2>$(Prop2)</Md2>
+		</IWithM>
+	</ItemGroup>
+
+	<Target Name=""1"">
+		<Message Text=""IWithM.md: %(IWithM.Md)""/>
+		<Message Text=""IWithM.md2: %(IWithM.Md2)""/>
+
+		<CreateItem Include=""Bar;Xyz"">
+			<Output TaskParameter=""Include"" ItemName=""Item0""/>
+		</CreateItem>
+		
+		<Message Text=""IWithM.md: %(IWithM.Md)""/>
+		<Message Text=""IWithM.md2: %(IWithM.Md2)""/>
+	</Target>
+</Project>
+";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("IWithM.md: Foo", "A1");
+			logger.CheckLoggedMessageHead ("IWithM.md2: File1", "A2");
+
+			logger.CheckLoggedMessageHead ("IWithM.md: Foo", "A3");
+			logger.CheckLoggedMessageHead ("IWithM.md2: File1", "A4");
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		// Test Item/prop references in conditions
+		public void TestItems11 () {
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<PropertyGroup>
+		<Prop1>@(Item0)</Prop1>
+	</PropertyGroup>
+	<ItemGroup>
+		<Item0 Include=""Foo""/>
+		<Item1 Include=""@(Item0)""/>
+
+		<CondItem Condition=""'@(Item1)' == '@(Item0)'"" Include=""Equal to item0""/>
+		<CondItem Condition=""'@(Item1)' == 'Foo'"" Include=""Equal to item0's value""/>
+
+		<CondItem1 Condition=""'$(Prop1)' == '@(Item0)'"" Include=""Equal to item0""/>
+		<CondItem1 Condition=""'$(Prop1)' == 'Foo'"" Include=""Equal to item0's value""/>
+	</ItemGroup>
+
+	<Target Name=""1"">
+		<Message Text = ""CondItem: %(CondItem.Identity)""/>
+		<Message Text = ""CondItem1: %(CondItem1.Identity)""/>
+	</Target>
+</Project>
+";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("CondItem: Equal to item0", "A1");
+			logger.CheckLoggedMessageHead ("CondItem: Equal to item0's value", "A2");
+			logger.CheckLoggedMessageHead ("CondItem1: Equal to item0", "A3");
+			logger.CheckLoggedMessageHead ("CondItem1: Equal to item0's value", "A4");
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		// test properties and item refs, with dynamic properties/items
+		public void TestItems12 ()
+		{
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<PropertyGroup>
+		<Prop2>@(Ref1)</Prop2>
+	</PropertyGroup>
+	<ItemGroup>
+		<Ref1 Include=""File1"" />
+		<Files Include=""@(Ref1)""/>
+	</ItemGroup>
+
+	<Target Name=""1"">
+		<Message Text=""Prop2: $(Prop2)""/>
+		
+		<Message Text=""Files: @(Files)""/>
+		<CreateItem Include=""foobar"">
+			<Output TaskParameter=""Include"" ItemName=""Ref1""/>
+		</CreateItem>
+		<Message Text=""Files: @(Files)""/>
+
+		<Message Text=""Prop2: $(Prop2)""/>
+		<CreateProperty Value=""NewValue"">
+			<Output TaskParameter=""Value"" PropertyName=""Prop2""/>
+		</CreateProperty>
+		<Message Text=""Prop2: $(Prop2)""/>
+	</Target>
+</Project>
+";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.DumpMessages ();
+			logger.CheckLoggedMessageHead ("Prop2: File1", "A1");
+			logger.CheckLoggedMessageHead ("Files: File1", "A1");
+			logger.CheckLoggedMessageHead ("Files: File1", "A1");
+			logger.CheckLoggedMessageHead ("Prop2: File1;foobar", "A1");
+			logger.CheckLoggedMessageHead ("Prop2: NewValue", "A1");
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		// test item refs in properties
+		public void TestItems13 () {
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<PropertyGroup>
+		<Prop1>@(Item0)</Prop1>
+	</PropertyGroup>
+	<ItemGroup>
+		<Item0 Include=""Foo""/>
+		<Item1 Include=""A\B.txt;A\C.txt;B\B.zip;B\C.zip"" />
+		<Item2 Include=""@(Item1->'%(Extension)/$(Prop1)')"" />
+	</ItemGroup>
+
+	<Target Name='1'>
+		<Message Text=""Item2: @(Item2)""/>
+	</Target>
+</Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.CheckLoggedMessageHead ("Item2: .txt/@(Item0);.txt/@(Item0);.zip/@(Item0);.zip/@(Item0)", "A1");
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		public void TestMetadataFromItemReferences () {
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<ItemGroup>
+		<Item1 Include=""Item1Val1;Item1Val2"">
+			<Item1Md>False</Item1Md>
+		</Item1>
+		<Item2 Include=""Val1;Val2;@(Item1);Val3"">
+			<Name>Random name</Name>
+		</Item2>
+		<Item3 Include=""foo;bar;@(Item2);Last""/>
+	</ItemGroup>
+
+	<Target Name=""Main"">
+		<CreateItem Include=""@(Item3)"">
+			<Output TaskParameter=""Include""  ItemName=""Final""/>
+		</CreateItem>
+
+		<Message Text=""Final: %(Final.Identity) Item1Md: %(Final.Item1Md) Name: %(Final.Name)""/>
+	</Target>
+</Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("Main")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			CheckItems (proj, "Final", "Z", "foo", "bar", "Val1", "Val2", "Item1Val1", "Item1Val2", "Val3", "Last");
+
+			logger.CheckLoggedMessageHead ("Final: foo Item1Md:  Name: ", "A1");
+			logger.CheckLoggedMessageHead ("Final: bar Item1Md:  Name: ", "A2");
+			logger.CheckLoggedMessageHead ("Final: Val1 Item1Md:  Name: Random name", "A3");
+			logger.CheckLoggedMessageHead ("Final: Val2 Item1Md:  Name: Random name", "A4");
+			logger.CheckLoggedMessageHead ("Final: Item1Val1 Item1Md: False Name: Random name", "A5");
+			logger.CheckLoggedMessageHead ("Final: Item1Val2 Item1Md: False Name: Random name", "A6");
+			logger.CheckLoggedMessageHead ("Final: Val3 Item1Md:  Name: Random name", "A7");
+			logger.CheckLoggedMessageHead ("Final: Last Item1Md:  Name: ", "A8");
+
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		public void TestSelfRefrentialItems ()
+		{
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<PropertyGroup>
+		<Prop1>@(Item1);Val</Prop1>
+		<Prop2>@(Item2)</Prop2>
+		<Prop3>@(Item3)</Prop3>
+	</PropertyGroup>
+	<ItemGroup>
+		<Item1 Include=""Item1OldVal""/>
+		<Item1 Include=""@(Item1);$(Prop1)""/>
+
+		<Item2 Include=""Item2OldVal""/>
+		<Item2 Include=""@(Item2->'%(Identity)');$(Prop2)""/>
+
+		<Item3 Include=""Item3OldVal""/>
+		<Item3 Include=""@(Item3, '_');$(Prop3)""/>
+
+		<Item4 Include=""@(Item4)""/>
+	</ItemGroup>
+
+	<Target Name=""1"">
+		<Message Text=""Item1: %(Item1.Identity)""/>
+		<Message Text=""Item2: %(Item2.Identity)""/>
+		<Message Text=""Item3: %(Item3.Identity)""/>
+		<Message Text=""%(Item4.Identity)""/>
+		<Message Text=""Item4: %(Item4.Identity)""/>
+	</Target>
+</Project>
+";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.DumpMessages ();
+			logger.CheckLoggedMessageHead ("Item1: Item1OldVal", "A1");
+			logger.CheckLoggedMessageHead ("Item1: Val", "A2");
+			logger.CheckLoggedMessageHead ("Item2: Item2OldVal", "A3");
+			logger.CheckLoggedMessageHead ("Item3: Item3OldVal", "A4");
+			logger.CheckLoggedMessageHead ("Item4: ", "A5");
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
+		public void TestEmptyItemsWithBatching ()
+		{
+			string project_xml = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+			<UsingTask TaskName='StringTestTask' AssemblyFile='Test\resources\TestTasks.dll' />
+			<UsingTask TaskName='TestTask_TaskItem' AssemblyFile='Test\resources\TestTasks.dll' />
+			<UsingTask TaskName='TestTask_TaskItems' AssemblyFile='Test\resources\TestTasks.dll' />
+	<Target Name=""1"">
+		<StringTestTask Property=""%(Item4.Identity)"">
+			<Output TaskParameter=""OutputString"" PropertyName=""OutputString""/>
+		</StringTestTask>
+		<Message Text='output1: $(OutputString)'/>
+
+		<StringTestTask Property=""  %(Item4.Identity)"">
+			<Output TaskParameter=""OutputString"" PropertyName=""OutputString""/>
+		</StringTestTask>
+		<Message Text='output2: $(OutputString)'/>
+
+		<StringTestTask Array=""%(Item4.Identity)"">
+			<Output TaskParameter=""OutputString"" PropertyName=""OutputString""/>
+		</StringTestTask>
+		<Message Text='output3: $(OutputString)'/>
+
+		<StringTestTask Array=""  %(Item4.Identity)"">
+			<Output TaskParameter=""OutputString"" PropertyName=""OutputString""/>
+		</StringTestTask>
+		<Message Text='output4: $(OutputString)'/>
+
+
+		<TestTask_TaskItem Property=""%(Item4.Identity)"">
+			<Output TaskParameter=""Output"" PropertyName=""OutputString""/>
+		</TestTask_TaskItem>
+		<Message Text='output5: $(OutputString)'/>
+
+		<TestTask_TaskItem Property=""  %(Item4.Identity)"">
+			<Output TaskParameter=""Output"" PropertyName=""OutputString""/>
+		</TestTask_TaskItem>
+		<Message Text='output6: $(OutputString)'/>
+
+
+		<TestTask_TaskItems Property=""  %(Item4.Identity)"">
+			<Output TaskParameter=""Output"" PropertyName=""OutputString""/>
+		</TestTask_TaskItems>
+		<Message Text='output7: $(OutputString)'/>
+	
+
+		<!-- no space in property -->
+		<TestTask_TaskItems Property=""%(Item4.Identity)"">
+			<Output TaskParameter=""Output"" PropertyName=""OutputString""/>
+		</TestTask_TaskItems>
+		<Message Text='output8: $(OutputString)'/>
+
+	</Target>
+</Project>
+";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			proj.LoadXml (project_xml);
+			engine.RegisterLogger (logger);
+
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			logger.DumpMessages ();
+			logger.CheckLoggedMessageHead ("output1: property: null ## array: null", "A1");
+			logger.CheckLoggedMessageHead ("output2: property:    ## array: null", "A2");
+			logger.CheckLoggedMessageHead ("output3: property: null ## array: null", "A3");
+			logger.CheckLoggedMessageHead ("output4: property: null ## array: null", "A4");
+
+			logger.CheckLoggedMessageHead ("output5: null", "A5");
+			logger.CheckLoggedMessageHead ("output6: null", "A6");
+			logger.CheckLoggedMessageHead ("output7: null", "A7");
+			logger.CheckLoggedMessageHead ("output8: null", "A8");
+
+			Assert.AreEqual (0, logger.NormalMessageCount, "unexpected messages found");
+		}
+
+		[Test]
 		public void TestItemsInTarget1 ()
 		{
 			Engine engine = new Engine (Consts.BinPath);
@@ -317,6 +812,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 					<UsingTask TaskName='StringTestTask' AssemblyFile='Test\resources\TestTasks.dll' />
 					<PropertyGroup>
 						<A>A</A>
+						<B>@(A)g</B>
 					</PropertyGroup>
 					<ItemGroup>
 						<A Include='A;B;C' />
@@ -338,6 +834,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 						<StringTestTask Property=""@(A,'@(A,'')')"">
 							<Output TaskParameter='Property' PropertyName='P5' />
 						</StringTestTask>
+						<StringTestTask Property=""@(A,'$(B)')"">
+							<Output TaskParameter='Property' PropertyName='P6' />
+						</StringTestTask>
 						<StringTestTask Property=""%(A.Filename)"">
 							<Output TaskParameter='Property' ItemName='I1' />
 						</StringTestTask>
@@ -348,14 +847,20 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 				</Project>
 			";
 
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger = new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
 			proj.LoadXml (documentString);
-			Assert.IsTrue (proj.Build ("1"), "A0, Build failed");
+			if (!proj.Build ("1")) {
+				logger.DumpMessages ();
+				Assert.Fail ("build failed");
+			}
 
 			Assert.AreEqual ("A;B;C", proj.GetEvaluatedProperty ("P1"), "A1");
 			Assert.AreEqual ("ABC", proj.GetEvaluatedProperty ("P2"), "A2");
 			Assert.AreEqual ("A@(A)B@(A)C", proj.GetEvaluatedProperty ("P3"), "A3");
 			Assert.AreEqual ("AABAC", proj.GetEvaluatedProperty ("P4"), "A4");
 			Assert.AreEqual ("@(A,'ABC')", proj.GetEvaluatedProperty ("P5"), "A5");
+			Assert.AreEqual ("A@(A)gB@(A)gC", proj.GetEvaluatedProperty ("P6"), "A6");
 			CheckItems (proj, "I1", "A6", "A", "B", "C");
 			CheckItems (proj, "I2", "A7", "A A", "B B", "C C");
 		}
@@ -474,7 +979,7 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 			CheckItems (proj, "I5", "A5", "A", "Foo    A", "Bar", "A", "B");
 			CheckItems (proj, "I6", "A6", "A", "B", "C", "A");
 			CheckItems (proj, "I7", "A7", "A", "B", "C", "A", "B", "C");
-			CheckItems (proj, "I8", "A8", "abc", "A", "B", "C", "A", "foo");
+			CheckItems(proj, "I8", "A8", "abc", "A", "B", "C", "A", "foo");
 		}
 
 		[Test]
@@ -525,6 +1030,9 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 		{
 			Engine engine = new Engine (Consts.BinPath);
 			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger();
+			engine.RegisterLogger(logger);
 
 			string documentString = @"
 				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
@@ -548,11 +1056,14 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 						"$(C) $(C)",
 						"@(A);$(C)",
 						"@(A);A;B;C",
-						"@(A) $(C) @(A)"
+						"@(A) $(C) @(A)",
 					}) + "</Project>";
 
 			proj.LoadXml (documentString);
-			Assert.IsTrue (proj.Build ("1"), "Build failed");
+			if (!proj.Build("1")) {
+				logger.DumpMessages();
+				Assert.Fail("Build failed");
+			}
 
 			BuildProperty bp = proj.EvaluatedProperties ["D"];
 			Assert.AreEqual ("$(C);Foo", bp.Value, "B0");
@@ -880,5 +1391,129 @@ namespace MonoTests.Microsoft.Build.BuildEngine.Various {
 			Assert.AreEqual ("True", bi.GetMetadata ("M"), "A10");
 			Assert.AreEqual ("True", bi.GetEvaluatedMetadata ("M"), "A11");*/
 		}
+
+		[Test]
+		public void TestItemsWithWildcards ()
+		{
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			// Setup
+
+			string basedir = PathCombine ("Test", "resources", "dir");
+			string aaa = PathCombine ("a", "aa", "aaa");
+			string bb = Path.Combine ("b", "bb");
+
+			string[] dirs = { aaa, bb, "c" };
+			string [] files = {
+								PathCombine (basedir, aaa, "foo.dll"),
+								PathCombine (basedir, bb, "bar.dll"),
+								PathCombine (basedir, bb, "sample.txt"),
+								Path.Combine (basedir, "xyz.dll")
+							  };
+
+			string documentString = @"
+				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<ItemGroup>
+						<ItemsRel Include='dir\**\*.dll' />
+						<ItemsRelExpanded Include=""@(ItemsRel->'%(FullPath)')"" />
+						<ItemsAbs Include='$(MSBuildProjectDirectory)\dir\**\*.dll' />
+					</ItemGroup>
+
+					<Target Name='Main'>
+						<Message Text=""ItemsRelExpanded: %(ItemsRelExpanded.Identity)""/>
+						<Message Text='ItemsAbs: %(ItemsAbs.Identity)'/>
+					</Target>
+				</Project>";
+
+			try {
+				CreateDirectoriesAndFiles (basedir, dirs, files);
+				string projectdir = Path.Combine ("Test", "resources");
+				File.WriteAllText (Path.Combine (projectdir, "wild1.proj"), documentString);
+				proj.Load (Path.Combine (projectdir, "wild1.proj"));
+				if (!proj.Build ("Main"))
+					Assert.Fail ("Build failed");
+
+				string full_base_dir = Path.GetFullPath (basedir);
+
+				foreach (string prefix in new string[] { "ItemsRelExpanded: ", "ItemsAbs: " }) {
+					logger.CheckLoggedAny (prefix + PathCombine (full_base_dir, aaa, "foo.dll"),
+										MessageImportance.Normal,  "A1");
+					logger.CheckLoggedAny (prefix + PathCombine (full_base_dir, bb, "bar.dll"), MessageImportance.Normal, "A2");
+					logger.CheckLoggedAny (prefix + PathCombine (full_base_dir, "xyz.dll"), MessageImportance.Normal, "A3");
+				}
+			} catch (AssertionException) {
+				logger.DumpMessages ();
+				throw;
+			} finally {
+				Directory.Delete (basedir, true);
+			}
+		}
+
+		[Test]
+		public void TestReservedMetadata ()
+		{
+			Engine engine = new Engine (Consts.BinPath);
+			Project proj = engine.CreateNewProject ();
+			MonoTests.Microsoft.Build.Tasks.TestMessageLogger logger =
+				new MonoTests.Microsoft.Build.Tasks.TestMessageLogger ();
+			engine.RegisterLogger (logger);
+
+			string documentString = @"
+				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<ItemGroup><File1 Include=""bar\foo.dll""/></ItemGroup>
+					<Target Name='Main'>
+						<Message Text='file1: @(File1)'/>
+						<Message Text='file1: RootDir: %(File1.RootDir)'/>
+						<Message Text='file1: Directory: %(File1.Directory)'/>
+					</Target>
+				</Project>";
+
+			string projectdir = Path.Combine ("Test", "resources");
+			File.WriteAllText (Path.Combine (projectdir, "test1.proj"), documentString);
+			proj.Load (Path.Combine (projectdir, "test1.proj"));
+			if (!proj.Build ("Main")) {
+				logger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+			logger.DumpMessages ();
+
+			logger.CheckLoggedMessageHead ("file1: " + Path.Combine ("bar", "foo.dll"), "A1");
+
+			string path_root = Path.GetPathRoot (Path.GetFullPath (projectdir));
+			logger.CheckLoggedMessageHead ("file1: RootDir: " + path_root, "A2");
+
+			string fullpath = Path.GetFullPath (Path.Combine (projectdir, "bar"));
+			logger.CheckLoggedMessageHead ("file1: Directory: " + fullpath.Substring (path_root.Length) + Path.DirectorySeparatorChar, "A3");
+
+			if (logger.NormalMessageCount != 0) {
+				logger.DumpMessages ();
+				Assert.Fail ("Unexpected extra messages found");
+			}
+		}
+
+		void CreateDirectoriesAndFiles (string basedir, string[] dirs, string[] files)
+		{
+			foreach (string dir in dirs)
+				Directory.CreateDirectory (Path.Combine (basedir, dir));
+
+			foreach (string file in files)
+				File.WriteAllText (file, String.Empty);
+		}
+
+		string PathCombine (string path1, params string[] parts)
+		{
+			if (parts == null || parts.Length == 0)
+				return path1;
+
+			string final_path = path1;
+			foreach (string part in parts)
+				final_path = Path.Combine (final_path, part);
+
+			return final_path;
+		}
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/ChangeLog
index 7f4876d..f725e9f 100644
--- a/mcs/class/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/ChangeLog
@@ -1,6 +1,36 @@
-2009-06-08  Ankit Jain  <jankit at novell.com>
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Add reference to Microsoft.Build.Engine .
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* Microsoft.Build.Tasks_test.dll.sources: Added
+	RemoveDuplicatesTest.cs
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* Microsoft.Build.Tasks.dll.sources: Added
+	FindAppConfigFile.cs
+	* Microsoft.Build.Tasks_test.dll.sources: Added
+	FindAppConfigFileTest.cs
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
 
 	* Microsoft.Build.Tasks_test.dll.sources: Added
+	PcFileCache.cs from md.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* Microsoft.Build.Tasks_test.dll.sources: Added
+	AssignProjectConfigurationTest.cs .
+
+2009-07-22  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Add System.Core .
+
+2009-06-08  Ankit Jain  <jankit at novell.com>
+
+	* Microsoft.Build.Tasks.dll.sources: Added
 	ResolvedReference.cs
 
 2009-05-14  Ankit Jain  <jankit at novell.com>
diff --git a/mcs/class/Microsoft.Build.Tasks/Makefile b/mcs/class/Microsoft.Build.Tasks/Makefile
index 52daa81..540f1f6 100644
--- a/mcs/class/Microsoft.Build.Tasks/Makefile
+++ b/mcs/class/Microsoft.Build.Tasks/Makefile
@@ -23,10 +23,12 @@ endif
 LIB_MCS_FLAGS = \
 	/r:$(corlib)				\
 	/r:System.dll				\
+	/r:System.Core.dll			\
 	/r:System.Xml.dll			\
 	/r:System.Windows.Forms.dll		\
 	/r:Microsoft.Build.Utilities.dll	\
-	/r:Microsoft.Build.Framework.dll
+	/r:Microsoft.Build.Framework.dll	\
+	/r:Microsoft.Build.Engine.dll
 
 TEST_MCS_FLAGS = \
 	/r:Microsoft.Build.Engine.dll		\
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources
index 904e29b..9aed037 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks.dll.sources
@@ -66,6 +66,7 @@ Microsoft.Build.Tasks.Deployment.ManifestUtilities/WindowClass.cs
 Microsoft.Build.Tasks/Error.cs
 Microsoft.Build.Tasks/Exec.cs
 Microsoft.Build.Tasks/ExtractedClassName.cs
+Microsoft.Build.Tasks/FindAppConfigFile.cs
 Microsoft.Build.Tasks/FindUnderPath.cs
 Microsoft.Build.Tasks/FormatUrl.cs
 Microsoft.Build.Tasks/FormatVersion.cs
@@ -84,6 +85,8 @@ Microsoft.Build.Tasks/MakeDir.cs
 Microsoft.Build.Tasks/ManagedCompiler.cs
 Microsoft.Build.Tasks/Message.cs
 Microsoft.Build.Tasks/MSBuild.cs
+Microsoft.Build.Tasks/PcFileCache.cs
+Microsoft.Build.Tasks/LibraryPcFileCache.cs
 Microsoft.Build.Tasks/ReadLinesFromFile.cs
 Microsoft.Build.Tasks/RegisterAssembly.cs
 Microsoft.Build.Tasks/RemoveDir.cs
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
index 5c52877..1bea692 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs
@@ -32,10 +32,12 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Linq;
 using System.Reflection;
 using System.Security;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
+using Mono.PkgConfig;
 
 namespace Microsoft.Build.Tasks {
 	internal class AssemblyResolver {
@@ -45,6 +47,9 @@ namespace Microsoft.Build.Tasks {
 		Dictionary<string, Dictionary<Version, string>> gac;
 		TaskLoggingHelper log;
 		StringWriter sw;
+		List<string> search_log;
+
+		static LibraryPcFileCache cache;
 
 		public AssemblyResolver ()
 		{
@@ -54,13 +59,12 @@ namespace Microsoft.Build.Tasks {
 			GatherGacAssemblies ();
 		}
 
-		public StringWriter SearchLogger {
-			get { return sw; }
-		}
-
 		public void ResetSearchLogger ()
 		{
-			sw = new StringWriter ();
+			if (search_log == null)
+				search_log = new List<string> ();
+			else
+				search_log.Clear ();
 		}
 
 		string GetGacPath ()
@@ -123,17 +127,17 @@ namespace Microsoft.Build.Tasks {
 
 			KeyValuePair<AssemblyName, string> pair;
 			if (gac_asm.NameToAssemblyNameCache.TryGetValue (key_aname.Name, out pair)) {
-				if (AssemblyNamesCompatible (key_aname, pair.Key, specific_version)) {
+				if (AssemblyNamesCompatible (key_aname, pair.Key, specific_version, true)) {
 					// gac and tgt frmwk refs are not copied private
-					return GetResolvedReference (reference, pair.Value, false,
+					return GetResolvedReference (reference, pair.Value, pair.Key, false,
 							SearchPath.TargetFrameworkDirectory);
 				}
 
-				SearchLogger.WriteLine ("Considered target framework dir {0}, assembly name '{1}' did not " +
+				LogSearchMessage ("Considered target framework dir {0}, assembly name '{1}' did not " +
 						"match the expected '{2}' (SpecificVersion={3})",
 						framework_dir, pair.Key, key_aname, specific_version);
 			} else {
-				SearchLogger.WriteLine ("Considered target framework dir {0}, assembly named '{1}' not found.",
+				LogSearchMessage ("Considered target framework dir {0}, assembly named '{1}' not found.",
 						framework_dir, key_aname.Name);
 			}
 			return null;
@@ -141,25 +145,38 @@ namespace Microsoft.Build.Tasks {
 
 		public ResolvedReference FindInDirectory (ITaskItem reference, string directory, string [] file_extensions)
 		{
-			if (reference.ItemSpec.IndexOf (',') > 0) {
-				// Probably an assembly name
-				AssemblyName key_aname = new AssemblyName (reference.ItemSpec);
-				foreach (string extn in file_extensions) {
-					foreach (string file in Directory.GetFiles (directory, "*" + extn)) {
-						AssemblyName found = AssemblyName.GetAssemblyName (file);
+			if (reference.ItemSpec.IndexOf (',') < 0) {
+				// Try as a filename
+				string path = Path.Combine (directory, reference.ItemSpec);
+				AssemblyName aname = GetAssemblyNameFromFile (path);
+				if (aname != null)
+					return GetResolvedReference (reference, path, aname, true, SearchPath.Directory);
 
-						//FIXME: Extract 'name' and look only for name.dll name.exe ?
-						if (AssemblyNamesCompatible (key_aname, found, false))
-							return GetResolvedReference (reference, file, true, SearchPath.Directory);
+				foreach (string extn in file_extensions) {
+					string path_with_extn = path + extn;
+					aname = GetAssemblyNameFromFile (path_with_extn);
+					if (aname != null)
+						return GetResolvedReference (reference, path_with_extn, aname, true,
+								SearchPath.Directory);
+				}
+			}
 
-						SearchLogger.WriteLine ("Considered {0}, but assembly name wasn't compatible.", file);
-					}
+			// Probably an assembly name
+			AssemblyName key_aname = new AssemblyName (reference.ItemSpec);
+			foreach (string extn in file_extensions) {
+				foreach (string file in Directory.GetFiles (directory, "*" + extn)) {
+					AssemblyName found_aname = GetAssemblyNameFromFile (file);
+					if (found_aname == null)
+						// error already logged
+						continue;
+
+					//FIXME: Extract 'name' and look only for name.dll name.exe ?
+					if (AssemblyNamesCompatible (key_aname, found_aname, false))
+						return GetResolvedReference (reference, file, found_aname, true,
+								SearchPath.Directory);
+
+					LogSearchMessage ("Considered {0}, but assembly name wasn't compatible.", file);
 				}
-			} else {
-				// Try as a filename
-				string path = Path.Combine (directory, reference.ItemSpec);
-				if (GetAssemblyNameFromFile (path) != null)
-					return GetResolvedReference (reference, path, true, SearchPath.Directory);
 			}
 
 			return null;
@@ -169,7 +186,7 @@ namespace Microsoft.Build.Tasks {
 		{
 			TargetFrameworkAssemblies gac_asm = new TargetFrameworkAssemblies (directory);
 			foreach (string file in Directory.GetFiles (directory, "*.dll")) {
-				AssemblyName aname = AssemblyName.GetAssemblyName (file);
+				AssemblyName aname = GetAssemblyNameFromFile (file);
 				gac_asm.NameToAssemblyNameCache [aname.Name] =
 					new KeyValuePair<AssemblyName, string> (aname, file);
 			}
@@ -181,7 +198,7 @@ namespace Microsoft.Build.Tasks {
 		{
 			AssemblyName name = new AssemblyName (reference.ItemSpec);
 			if (!gac.ContainsKey (name.Name)) {
-				SearchLogger.WriteLine ("Considered {0}, but could not find in the GAC.",
+				LogSearchMessage ("Considered {0}, but could not find in the GAC.",
 						reference.ItemSpec);
 				return null;
 			}
@@ -189,11 +206,11 @@ namespace Microsoft.Build.Tasks {
 			if (name.Version != null) {
 				string ret;
 				if (gac [name.Name].TryGetValue (name.Version, out ret))
-					return GetResolvedReference (reference, ret, false, SearchPath.Gac);
+					return GetResolvedReference (reference, ret, name, false, SearchPath.Gac);
 
 				// not found
 				if (specific_version) {
-					SearchLogger.WriteLine ("Considered '{0}', but an assembly with the specific version not found.",
+					LogSearchMessage ("Considered '{0}', but an assembly with the specific version not found.",
 							reference.ItemSpec);
 					return null;
 				}
@@ -203,7 +220,37 @@ namespace Microsoft.Build.Tasks {
 			gac [name.Name].Keys.CopyTo (versions, 0);
 			Array.Sort (versions, (IComparer <Version>) null);
 			Version highest = versions [versions.Length - 1];
-			return GetResolvedReference (reference, gac [name.Name] [highest], false, SearchPath.Gac);
+			//FIXME: the aname being used here isn't correct, its version should
+			//	 actually match "highest"
+			return GetResolvedReference (reference, gac [name.Name] [highest], name, false, SearchPath.Gac);
+		}
+
+		public ResolvedReference ResolvePkgConfigReference (ITaskItem reference, bool specific_version)
+		{
+			PackageAssemblyInfo pkg = null;
+
+			if (specific_version) {
+				pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
+			} else {
+				// if not specific version, then just match simple name
+				string name = reference.ItemSpec;
+				if (name.IndexOf (',') > 0)
+					name = name.Substring (0, name.IndexOf (','));
+				pkg = PcCache.ResolveAssemblyName (name).FirstOrDefault ();
+			}
+
+			if (pkg == null) {
+				LogSearchMessage ("Considered {0}, but could not find in any pkg-config files.",
+						reference.ItemSpec);
+				return null;
+			}
+
+			ResolvedReference rr = GetResolvedReference (reference, pkg.File, new AssemblyName (pkg.FullName),
+						false, SearchPath.PkgConfig);
+			rr.FoundInSearchPathAsString = String.Format ("{{PkgConfig}} provided by package named {0}",
+							pkg.ParentPackage.Name);
+
+			return rr;
 		}
 
 		public ResolvedReference ResolveHintPathReference (ITaskItem reference, bool specific_version)
@@ -213,13 +260,13 @@ namespace Microsoft.Build.Tasks {
 
 			string hintpath = reference.GetMetadata ("HintPath");
 			if (String.IsNullOrEmpty (hintpath)) {
-				SearchLogger.WriteLine ("HintPath attribute not found");
+				LogSearchMessage ("HintPath attribute not found");
 				return null;
 			}
 
 			if (!File.Exists (hintpath)) {
 				log.LogMessage (MessageImportance.Low, "HintPath {0} does not exist.", hintpath);
-				SearchLogger.WriteLine ("Considered {0}, but it does not exist.", hintpath);
+				LogSearchMessage ("Considered {0}, but it does not exist.", hintpath);
 				return null;
 			}
 
@@ -230,9 +277,9 @@ namespace Microsoft.Build.Tasks {
 			}
 
 			if (AssemblyNamesCompatible (name, found, specific_version)) {
-				resolved = GetResolvedReference (reference, hintpath, true, SearchPath.HintPath);
+				resolved = GetResolvedReference (reference, hintpath, found, true, SearchPath.HintPath);
 			} else {
-				SearchLogger.WriteLine ("Considered {0}, but assembly name '{1}' did not match the " +
+				LogSearchMessage ("Considered {0}, but assembly name '{1}' did not match the " +
 						"expected '{2}' (SpecificVersion={3})", hintpath, found, name, specific_version);
 				log.LogMessage (MessageImportance.Low, "Assembly names are not compatible.");
 			}
@@ -243,44 +290,57 @@ namespace Microsoft.Build.Tasks {
 		public AssemblyName GetAssemblyNameFromFile (string filename)
 		{
 			AssemblyName aname = null;
+			filename = Path.GetFullPath (filename);
 			try {
 				aname = AssemblyName.GetAssemblyName (filename);
 			} catch (FileNotFoundException) {
+				LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
+						filename);
 			} catch (BadImageFormatException) {
+				LogSearchMessage ("Considered '{0}' as a file, but it is an invalid assembly",
+						filename);
 			}
 
-			if (aname != null)
-				return aname;
+			return aname;
+		}
 
-			SearchLogger.WriteLine ("Considered '{0}' as a file, but it is either an invalid assembly " +
-					"or file does not exist.", Path.GetFullPath (filename));
-			return null;
+		internal static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion)
+		{
+			return AssemblyNamesCompatible (a, b, specificVersion, false);
 		}
 
-		static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion)
+		// if @specificVersion is true then match full name, else just the simple name
+		internal static bool AssemblyNamesCompatible (AssemblyName a, AssemblyName b, bool specificVersion,
+				bool ignoreCase)
 		{
-			if (a.Name != b.Name)
+			if (String.Compare (a.Name, b.Name, ignoreCase) != 0)
 				return false;
 
+			if (!specificVersion)
+				// ..and simple names match
+				return true;
+
 			if (a.CultureInfo != null && !a.CultureInfo.Equals (b.CultureInfo))
 				return false;
 
-			if (specificVersion && a.Version != null && a.Version != b.Version)
+			if (a.Version != null && a.Version != b.Version)
 				return false;
 
 			byte [] a_bytes = a.GetPublicKeyToken ();
 			byte [] b_bytes = b.GetPublicKeyToken ();
 
-			if (specificVersion) {
-				if (a_bytes == null || a_bytes.Length == 0)
-					return false;
-				if (b_bytes == null || b_bytes.Length == 0)
-					return false;
+			bool a_is_empty = (a_bytes == null || a_bytes.Length == 0);
+			bool b_is_empty = (b_bytes == null || b_bytes.Length == 0);
 
-				for (int i = 0; i < a_bytes.Length; i++)
-					if (a_bytes [i] != b_bytes [i])
-						return false;
-			}
+			if (a_is_empty && b_is_empty)
+				return true;
+
+			if (a_is_empty || b_is_empty)
+				return false;
+
+			for (int i = 0; i < a_bytes.Length; i++)
+				if (a_bytes [i] != b_bytes [i])
+					return false;
 
 			return true;
 		}
@@ -294,23 +354,51 @@ namespace Microsoft.Build.Tasks {
 
 		// FIXME: to get default values of CopyLocal, compare with TargetFrameworkDirectories
 
-		// If metadata 'Private' is present then use that or use @default_value
+		// If metadata 'Private' is present then use that or use @default_copy_local_value
 		// as the value for CopyLocal
 		internal ResolvedReference GetResolvedReference (ITaskItem reference, string filename,
-				bool default_value, SearchPath search_path)
+				AssemblyName aname, bool default_copy_local_value, SearchPath search_path)
 		{
 			string pvt = reference.GetMetadata ("Private");
 
-			bool copy_local = default_value;
+			bool copy_local = default_copy_local_value;
 			if (!String.IsNullOrEmpty (pvt))
 				//FIXME: log a warning for invalid value
 				Boolean.TryParse (pvt, out copy_local);
 
-			return new ResolvedReference (filename, copy_local, search_path);
+			ITaskItem new_item = new TaskItem (reference);
+			new_item.ItemSpec = filename;
+			return new ResolvedReference (new_item, aname, copy_local, search_path, reference.ItemSpec);
+		}
+
+		public void LogSearchMessage (string msg, params object [] args)
+		{
+			search_log.Add (String.Format (msg, args));
+		}
+
+		public void LogSearchLoggerMessages ()
+		{
+			foreach (string msg in search_log)
+				log.LogMessage (msg);
 		}
 
 		public TaskLoggingHelper Log {
-			set { log = value; }
+			set {
+				log = value;
+				PcFileCacheContext.Log = value;
+			}
+		}
+
+		static LibraryPcFileCache PcCache  {
+			get {
+				if (cache == null) {
+					var context = new PcFileCacheContext ();
+					cache = new LibraryPcFileCache (context);
+					cache.Update ();
+				}
+
+				return cache;
+			}
 		}
 	}
 
@@ -323,7 +411,33 @@ namespace Microsoft.Build.Tasks {
 		public TargetFrameworkAssemblies (string path)
 		{
 			this.Path = path;
-			NameToAssemblyNameCache = new Dictionary<string, KeyValuePair<AssemblyName, string>> ();
+			NameToAssemblyNameCache = new Dictionary<string, KeyValuePair<AssemblyName, string>> (
+					StringComparer.InvariantCultureIgnoreCase);
+		}
+	}
+
+	class PcFileCacheContext : IPcFileCacheContext<LibraryPackageInfo>
+	{
+		public static TaskLoggingHelper Log;
+
+		// In the implementation of this method, the host application can extract
+		// information from the pc file and store it in the PackageInfo object
+		public void StoreCustomData (PcFile pcfile, LibraryPackageInfo pkg)
+		{
+		}
+
+		// Should return false if the provided package does not have required
+		// custom data
+		public bool IsCustomDataComplete (string pcfile, LibraryPackageInfo pkg)
+		{
+			return true;
+		}
+
+		// Called to report errors
+		public void ReportError (string message, Exception ex)
+		{
+			Log.LogMessage (MessageImportance.Low, "Error loading pkg-config files: {0} : {1}",
+					message, ex.ToString ());
 		}
 	}
 
@@ -334,7 +448,8 @@ namespace Microsoft.Build.Tasks {
 		CandidateAssemblies,
 		HintPath,
 		Directory,
-		RawFileName
+		RawFileName,
+		PkgConfig
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignCulture.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignCulture.cs
index 2291b3c..2621bf9 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignCulture.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignCulture.cs
@@ -51,6 +51,9 @@ namespace Microsoft.Build.Tasks {
 		
 		public override bool Execute ()
 		{
+			if (files.Length == 0)
+				return true;
+
 			List<ITaskItem> all_files = new List<ITaskItem> ();
 			List<ITaskItem> with_culture = new List<ITaskItem> ();
 			List<ITaskItem> no_culture = new List<ITaskItem> ();
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs
index 5f762c6..e81fb1e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignProjectConfiguration.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 //
 // (C) 2006 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -29,7 +31,10 @@
 
 using System;
 using System.IO;
+using System.Collections.Generic;
+using System.Xml;
 using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
 
 namespace Microsoft.Build.Tasks {
 	public class AssignProjectConfiguration : ResolveProjectBase {
@@ -45,9 +50,91 @@ namespace Microsoft.Build.Tasks {
 		[MonoTODO]
 		public override bool Execute ()
 		{
-			return false;
+			if (String.IsNullOrEmpty (solutionConfigurationContents))
+				return true;
+
+			XmlReader xr = null;
+			Dictionary<Guid, string> guidToConfigPlatform = null;
+			try {
+				xr = XmlReader.Create (new StringReader (solutionConfigurationContents));
+				guidToConfigPlatform = new Dictionary<Guid, string> ();
+
+				xr.Read ();
+				while (!xr.EOF) {
+					xr.Read ();
+					if (xr.NodeType != XmlNodeType.Element)
+						continue;
+
+					string guid_str = xr.GetAttribute ("Project");
+					string config_str = xr.ReadString ();
+
+					Guid guid;
+					if (!String.IsNullOrEmpty (guid_str) && !String.IsNullOrEmpty (config_str) &&
+						TryParseGuid (guid_str, out guid))
+						guidToConfigPlatform [guid] = config_str;
+				}
+			} catch (XmlException xe) {
+				Log.LogError ("XmlException while parsing SolutionConfigurationContents: {0}",
+						xe.ToString ());
+
+				return false;
+			} finally {
+				((IDisposable)xr).Dispose ();
+			}
+
+			List<ITaskItem> tempAssignedProjects = new List<ITaskItem> ();
+			List<ITaskItem> tempUnassignedProjects = new List<ITaskItem> ();
+			foreach (ITaskItem item in ProjectReferences) {
+				string config;
+
+				string guid_str = item.GetMetadata ("Project");
+				Guid guid;
+				if (!TryParseGuid (guid_str, out guid)) {
+					Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.",
+							item.ItemSpec);
+					return false;
+				}
+
+				if (guidToConfigPlatform.TryGetValue (guid, out config)) {
+					string [] parts = config.Split (new char [] {'|'}, 2);
+
+					ITaskItem new_item = new TaskItem (item);
+
+					new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
+					new_item.SetMetadata ("SetPlatform", "Platform=" +
+							((parts.Length > 1) ? parts [1] : String.Empty));
+
+					tempAssignedProjects.Add (new_item);
+				} else {
+					Log.LogWarning ("Project reference '{0}' could not be resolved.",
+							item.ItemSpec);
+					tempUnassignedProjects.Add (item);
+				}
+			}
+
+			assignedProjects = tempAssignedProjects.ToArray ();
+			unassignedProjects = tempUnassignedProjects.ToArray ();
+
+			return true;
 		}
-		
+
+		bool TryParseGuid (string guid_str, out Guid guid)
+		{
+			guid = Guid.Empty;
+			try {
+				guid = new Guid (guid_str);
+			} catch (ArgumentNullException) {
+				return false;
+			} catch (FormatException) {
+				return false;
+			} catch (OverflowException) {
+				return false;
+			}
+
+			return true;
+		}
+
+
 		[Output]
 		public ITaskItem[] AssignedProjects {
 			get { return assignedProjects; }
@@ -67,4 +154,4 @@ namespace Microsoft.Build.Tasks {
 	}
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignTargetPath.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignTargetPath.cs
index 29b24e6..4b71e08 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignTargetPath.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssignTargetPath.cs
@@ -47,6 +47,10 @@ namespace Microsoft.Build.Tasks {
 		
 		public override bool Execute ()
 		{
+			if (files == null || files.Length == 0)
+				//nothing to do
+				return true;
+
 			assignedFiles = new ITaskItem [files.Length];
 			for (int i = 0; i < files.Length; i ++) {
 				string file = files [i].ItemSpec;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CallTarget.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CallTarget.cs
index 874f1c0..08a973d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CallTarget.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CallTarget.cs
@@ -46,9 +46,11 @@ namespace Microsoft.Build.Tasks {
 			targetOutputs_list = new List<ITaskItem> ();
 		}
 		
-		[MonoTODO]
 		public override bool Execute ()
 		{
+			if (targets == null || targets.Length == 0)
+				return true;
+
 			Hashtable targets_table = new Hashtable ();
 
 			if (!RunEachTargetSeparately) {
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
index f21a4fe..8fe1425 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ChangeLog
@@ -1,3 +1,225 @@
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* ResolveAssemblyReference.cs: Remove unnecessary tab in the warning
+	messages.
+
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* MSBuild.cs (Execute): Handle build errors.
+
+2009-10-09  Ankit Jain  <jankit at novell.com>
+
+	* Exec.cs (AddCommandLineCommands): Add '/q' for cmd.exe, to
+	turn 'echo off'. And make sure the script file on windows, has
+	a '.bat' extension, otherwise cmd.exe opens it in a text editor.
+
+2009-10-09  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #545703.
+	* Exec.cs (Command): On unix, change CRLF to CR.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* ResolveAssemblyReference.cs: Don't resolve any dependencies for
+	assemblies resolved from {PkgConfig}. Honor parent's CopyLocal for
+	dependencies.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* MSBuild.cs (Execute): Don't share target output items,
+	always create a copy.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* RemoveDuplicates.cs: Use item's ItemSpec as the key.
+
+2009-10-07  Ankit Jain  <jankit at novell.com>
+
+	* ManagedCompiler.cs (HandleTaskExecutionErrors): Log error if
+	required.
+
+2009-10-06  Ankit Jain  <jankit at novell.com>
+
+	* Exec.cs (ExecuteTool): Use DeleteTempFile instead of File.Delete
+	(HandleTaskExecutionErrors): Log error, if required.
+	* MSBuild.cs: Don't log error.
+	* Warning.cs: Don't log if @text is empty.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* Exec.cs: Write the commands, which can be multiline,
+	to a temporary file, and execute that with "cmd.exe /c"
+	on windows and "sh" on non-windows.
+	(LogToolCommand): Override, and emit the commands instead
+	of the actual args passed to the shell.
+
+2009-09-28  Ankit Jain  <jankit at novell.com>
+
+	* WriteLinesToFiles.cs (Execute): Handle empty list of
+	lines.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* FindAppConfigFile.cs: New.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* ReadLinesFromFile.cs (Execute): Don't do anything, if
+	file is non-existant.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* ToolTaskExtension.cs (HasLoggedErrors): Override.
+
+2009-09-23  Ankit Jain  <jankit at novell.com>
+
+	* MSBuild.cs (BuildInParallel): Add missing property.
+
+2009-09-10  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs: Move the SearchLogger to be a list of
+	strings, so that it can be emitted with correct indentation.
+	(SearchLogger): Remove.
+	(LogSearchMessage): New.
+	(LogSearchLoggerMessages): New.
+	* ResolveAssemblyReference.cs: Track api changes.
+
+2009-09-01  Ankit Jain  <jankit at novell.com>
+
+	* ResolveAssemblyReference.cs (ResolveReference): targetFrameworkDirectories
+	can be null.
+
+2009-08-28  Ankit Jain  <jankit at novell.com>
+
+	* AssignCulture.cs, AssignTargetPath.cs,
+	CallTarget.cs, CombinePath.cs, Copy.cs,
+	CreateItem.cs, CreateManifestResourceName.cs,
+	Delete.cs, Error.cs, FindUnderPath.cs,
+	GenerateResource.cs, MSBuild.cs, MakeDir.cs,
+	Message.cs, RemoveDir.cs, RemoveDuplicates.cs,
+	ResolveAssemblyReference.cs, Touch.cs,
+	WriteLinesToFiles.cs: Add null checks and array
+	length checks.
+
+2009-08-24  Ankit Jain  <jankit at novell.com>
+
+	* LibraryPcFileCache.cs: New. From monodevelop.
+	* PcFileCache.cs: Update from monodevelop, see r140528.
+	* AssemblyResolver.cs: Track api changes.
+
+2009-08-24  Ankit Jain  <jankit at novell.com>
+
+	* CreateManifestResourceName.cs (GetResourceIdFromFileName): Spaces
+	in folder names should be converted to '_'.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* TaskLoggingHelperExtensios.cs (.ctor): Mark internal.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* PcFileCache.cs (PackageInfo): Mark internal.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs (FindInTargetFramework): Perform case insensitive
+	assembly name comparison. Use the new AssemblyNamesCompatible api.
+	(AssemblyNamesCompatible): Add new overload with a 'ignoreCase' param.
+
+2009-08-17  Ankit Jain  <jankit at novell.com>
+
+	* AssemblyResolver.cs (TargetFrameworkAssemblies..ctor): Make assembly
+	name lookups for target framework assemblies, case insensitive. Helps
+	with cases like "System.configuration", which vs.net is known to emit.
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
+
+	* PcFileCache.cs: New. From monodevelop.
+	* AssemblyResolver.cs (ResolvePkgConfigReference): New. Use PcFileCache
+	to resolve assembly references.
+	(AssemblyNamesCompatible): If SpecificVersion is false, then compare
+	only simple names.
+	(GetResolvedReference): Rename default_value to default_copy_local_value.
+	(Cache): New.
+	(PcFileCacheContext): New.
+	(SearchPath): Add 'PkgConfig' to the enum.
+	* ResolveAssemblyReference.cs: Add support for '{PkgConfig}'. Update
+	messages.
+	* ResolvedReference.cs (FoundInSearchPathToString): Create from ..
+	(FoundInSearchPathAsString): .. this. Change this to a property to
+	allow custom "found in .. " messages.
+
+2009-07-31  Ankit Jain  <jankit at novell.com>
+
+	* MSBuild.cs (Execute): Log error if the file doesn't exist.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* ResolvedReference.cs (.ctor): Set 'OriginalItemSpec' and 'ResolvedFrom',
+	required for IDE integration.
+	* AssemblyResolver.cs (GetResolvedReference): All the original metadata
+	should be retained. Track api changes.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* ReadLinesFromFile.cs (Execute): Log a warning instead of an error
+	if unable to read from the file. Fix a null check. Always return
+	true.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* Delete.cs (Execute): Log a message when deleting a file.
+
+2009-07-28  Ankit Jain  <jankit at novell.com>
+
+	* Exec.cs (AddCommandLineCommands): First word from @command is treated
+	as exec name, and rest as arguments. Extract arguments here.
+	(ExecuteTool): Don't ignore params.
+	(GenerateFullPathToTool): Extract first word as tool name.
+	(HandleTaskExecutionErrors): Honor IgnoreExitCode property.
+	(LogEventsFromTextOutput): Log as messages.
+	* ManagedCompiler.cs (HandleTaskExecutionErrors): Implement.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* AssignProjectConfiguration.cs (Execute): Implement.
+
+2009-07-22  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #517974.
+	* ResolvedReference.cs (AssemblyName): New.
+	(IsPrimary): New. Primary (eg. specified in the project file) or
+	dependent reference.
+	(FoundInSearchPathAsString): New.
+	* AssemblyResolver.cs (GetResolvedReference): Add a 'assembly name'
+	param for the new field in ResolvedReference.
+	(AssemblyNamesCompatible): Fix the check for public key token.
+	Track api changes.
+
+	* ResolveAssemblyReference.cs: Keep track of resolved assemblies,
+	prevent duplicate references and other files.
+	Process dependencies after resolving all the primary references.
+	Search for dependencies in parent assembly's dir first and then
+	the specified search paths.
+	Detect assembly version conflicts and try to resolve.
+	Improve logged messages.
+	(PrimaryReference): New.
+	(ResolveAssemblyReferenceHelper.AddUniqueFile): New extension method.
+
+2009-07-16  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #519922.
+
+	* AssemblyResolver.cs (FindInDirectory): Try the @reference as a
+	filename as it is, or with different @file_extensions.
+	If @reference is a assembly name, then look for *. at file_extensions
+	for target assembly.
+	(GetAssemblyNameFromFile): Log FileNotFoundException and BadImageFormatException
+	separately, instead of a single unclear message.
+
+	Change all uses of Assembly.GetAssemblyName with GetAssemblyNameFromFile
+	which does the required error checking and logging.
+
 2009-06-12  Ankit Jain  <jankit at novell.com>
 
 	* Utilities.cs: New.
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CombinePath.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CombinePath.cs
index 5e4aab8..b63259e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CombinePath.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CombinePath.cs
@@ -47,6 +47,9 @@ namespace Microsoft.Build.Tasks {
 		
 		public override bool Execute ()
 		{
+			if (paths.Length == 0)
+				return true;
+
 			List <ITaskItem> combined = new List <ITaskItem> ();
 
 			foreach (ITaskItem path in paths)
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
index 81f6737..f704bce 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Copy.cs
@@ -49,6 +49,10 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (sourceFiles.Length == 0)
+				// nothing to copy!
+				return true;
+
 			try {
 				List <ITaskItem> temporaryCopiedFiles = new List <ITaskItem> ();
 			
@@ -57,7 +61,7 @@ namespace Microsoft.Build.Tasks {
 					throw new Exception ("Number of source files is different than number of destination files.");
 				if (destinationFiles != null && destinationFolder != null)
 					throw new Exception ("You must specify only one attribute from DestinationFiles and DestinationFolder");
-				if (destinationFiles != null) {
+				if (destinationFiles != null && destinationFiles.Length > 0) {
 					for (int i = 0; i < sourceFiles.Length; i ++) {
 						ITaskItem sourceItem = sourceFiles [i];
 						ITaskItem destinationItem = destinationFiles [i];
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateItem.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateItem.cs
index 09262c7..06ebd5f 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateItem.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateItem.cs
@@ -44,6 +44,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (include == null || include.Length == 0)
+				return true;
+
 			List<ITaskItem> output = new List<ITaskItem> ();
 			foreach (ITaskItem item in include) {
 				if (IsExcluded (item))
@@ -63,7 +66,6 @@ namespace Microsoft.Build.Tasks {
 
 			include = output.ToArray ();
 
-			//FIXME: when does this return false?
 			return true;
 		}
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
index 59cb075..dd3eaca 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/CreateManifestResourceName.cs
@@ -45,6 +45,9 @@ namespace Microsoft.Build.Tasks {
 		
 		public override bool Execute ()
 		{
+			if (resourceFiles.Length == 0)
+				return true;
+
 			manifestResourceNames = new ITaskItem [resourceFiles.Length];
 			for (int i = 0; i < resourceFiles.Length; i ++) {
 				ITaskItem item = resourceFiles [i];
@@ -103,7 +106,10 @@ namespace Microsoft.Build.Tasks {
 				}
 			}
 
-			//FIXME: path char!
+			// spaces in folder name are changed to _, those in filename remain
+			string dirname = Path.GetDirectoryName (fileName) ?? String.Empty;
+			dirname = dirname.Replace (' ', '_');
+			fileName = Path.Combine (dirname, Path.GetFileName (fileName));
 			string rname = fileName.Replace ('/', '.').Replace ('\\', '.');
 
 			if (!String.IsNullOrEmpty (rootNamespace))
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Delete.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Delete.cs
index 4b6ad28..0497fd8 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Delete.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Delete.cs
@@ -47,6 +47,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (files.Length == 0)
+				return true;
+
 			List <ITaskItem> temporaryDeletedFiles = new List <ITaskItem> ();
 		
 			foreach (ITaskItem file in files) {
@@ -57,6 +60,7 @@ namespace Microsoft.Build.Tasks {
 
 				try {
 					File.Delete (path);
+					Log.LogMessage (MessageImportance.Normal, "Deleting file '{0}'", path);
 					temporaryDeletedFiles.Add (file);
 				}
 				catch (ArgumentException ex) {
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Error.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Error.cs
index d270f18..c3e0d3e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Error.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Error.cs
@@ -27,6 +27,8 @@
 
 #if NET_2_0
 
+using System;
+
 namespace Microsoft.Build.Tasks {
 	public sealed class Error : TaskExtension {
 	
@@ -44,7 +46,7 @@ namespace Microsoft.Build.Tasks {
 				Log.LogError (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
 					BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
 					BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
-					text, null);
+					text ?? String.Empty, null);
 			return false;
 		}
 
@@ -65,4 +67,4 @@ namespace Microsoft.Build.Tasks {
 	}
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
index 9122b3e..53ff89c 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Exec.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 //
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -46,90 +48,59 @@ namespace Microsoft.Build.Tasks {
 		string		stdErrEncoding;
 		string		stdOutEncoding;
 		string		workingDirectory;
-		
-		//Process		process;
-		//int		executionTime;
+		string scriptFile;
 		
 		public Exec ()
 		{
 			ignoreExitCode = false;
 		}
 		
-		// FIXME: what does that method do?
-		[MonoTODO]
 		protected internal override void AddCommandLineCommands (CommandLineBuilderExtension commandLine)
 		{
+			if (IsRunningOnWindows)
+				commandLine.AppendSwitch ("/q /c");
+
+			if (!String.IsNullOrEmpty (command)) {
+				scriptFile = Path.GetTempFileName ();
+				if (IsRunningOnWindows)
+					scriptFile = scriptFile + ".bat";
+				using (StreamWriter sw = new StreamWriter (scriptFile)) {
+					sw.Write (command);
+				}
+				commandLine.AppendFileNameIfNotNull (scriptFile);
+			}
 			base.AddCommandLineCommands (commandLine);
 		}
-		
-		/*public override bool Execute ()
-		{
-			StringCollection temporaryOutputs = new StringCollection ();
-			string line = null;
-			string[] commandTable = command.Split (null, 2);
-			string filename = commandTable [0];
-			string arguments = "";
-			if (commandTable.Length == 2)
-				arguments = commandTable [1];
-		
-			if (workingDirectory != null)
-				process.StartInfo.WorkingDirectory = workingDirectory;
-			process.StartInfo.FileName = filename;
-			process.StartInfo.Arguments = arguments;
-			process.StartInfo.RedirectStandardOutput = true;
-			process.StartInfo.RedirectStandardError = true;
-			process.StartInfo.UseShellExecute = false;
-			
-			try {
-				process.Start ();
-				process.WaitForExit ();
-
-				//exitCode = process.ExitCode;
-				while ((line = process.StandardOutput.ReadLine ()) != null)
-					temporaryOutputs.Add (line);
-				outputs = new ITaskItem [temporaryOutputs.Count];
-				int i  = 0;
-				foreach (string s in temporaryOutputs)
-					outputs [i++] = new TaskItem (s);
-			}
-			catch (Exception ex) {
-				Log.LogErrorFromException (ex);
-				return false;
-			}
-			
-			if (exitCode != 0 && ignoreExitCode == false)
-				return false;
-			else
-				return true;
-		}*/
-		
-		// FIXME: we need to write another ExecuteTool and RealExecute that will collect std output and
-		// make it available through Outputs property
-		
-		[MonoTODO]
+
 		protected override int ExecuteTool (string pathToTool,
 						    string responseFileCommands,
 						    string commandLineCommands)
 		{
-			return base.ExecuteTool (GenerateFullPathToTool (), String.Empty, String.Empty);
+			try {
+				return base.ExecuteTool (pathToTool, responseFileCommands, commandLineCommands);
+			} finally {
+				if (scriptFile != null)
+					DeleteTempFile (scriptFile);
+			}
 		}
-		
+
 		[MonoTODO]
 		protected override string GenerateFullPathToTool ()
 		{
-			return command;
+			return IsRunningOnWindows ? "cmd.exe" : "sh";
 		}
 		
-		[MonoTODO]
 		protected override string GetWorkingDirectory ()
 		{
 			return workingDirectory;
 		}
 		
-		[MonoTODO]
 		protected override bool HandleTaskExecutionErrors ()
 		{
-			return true;
+			if (ExitCode != 0)
+				Log.LogError ("Command '{0}' exited with code: {1}.", Command, ExitCode);
+
+			return ExitCode == 0 || ignoreExitCode;
 		}
 		
 		[MonoTODO]
@@ -141,8 +112,14 @@ namespace Microsoft.Build.Tasks {
 		[MonoTODO]
 		protected override void LogToolCommand (string message)
 		{
+			Log.LogMessage (MessageImportance.Normal, "Executing: " + command);
 		}
 		
+		protected override void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
+		{
+			Log.LogMessage (importance, singleLine);
+		}
+
 		[MonoTODO]
 		protected override bool ValidateParameters ()
 		{
@@ -152,7 +129,11 @@ namespace Microsoft.Build.Tasks {
 		[Required]
 		public string Command {
 			get { return command; }
-			set { command = value; }
+			set {
+				command = value;
+				if (Path.DirectorySeparatorChar == '/')
+					command = command.Replace ("\r\n", "\n");
+			}
 		}
 
 		public bool IgnoreExitCode {
@@ -205,6 +186,14 @@ namespace Microsoft.Build.Tasks {
 			get { return workingDirectory; }
 			set { workingDirectory = value; }
 		}
+
+		static bool IsRunningOnWindows {
+			get {
+				PlatformID pid = Environment.OSVersion.Platform;
+				return ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
+			}
+		}
+
 	}
 }
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs
new file mode 100644
index 0000000..5630482
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindAppConfigFile.cs
@@ -0,0 +1,112 @@
+//
+// FindAppConfigFile.cs: Finds a app.config in a list of files
+//
+// Author:
+//   Ankit Jain (jankit at novell.com)
+//
+// Copyright 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#if NET_2_0
+
+using System;
+using System.IO;
+
+using Microsoft.Build.Framework; 
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+
+namespace Microsoft.Build.Tasks {
+	//FIXME: This should be in v3.5 only
+	public sealed class FindAppConfigFile : TaskExtension {
+
+		public FindAppConfigFile ()
+		{
+		}
+
+		// rules: (see FindAppConfigFileTest)
+		// 1. Check PrimaryList, app.config in top dir
+		// 2. Check SecondaryList, app.conf in top dir
+		// 3. Check PrimaryList, app.config in subdir
+		// 4. Check SecondaryList, app.conf in subdir
+		public override bool Execute ()
+		{
+			AppConfigFile = FindAppConfig ();
+			if (AppConfigFile != null)
+				AppConfigFile.SetMetadata ("TargetPath", TargetPath);
+
+			return true;
+		}
+
+		ITaskItem FindAppConfig ()
+		{
+			foreach (ITaskItem item in PrimaryList)
+				if (IsAppConfig (item, false))
+					return new TaskItem (item);
+
+			foreach (ITaskItem item in SecondaryList)
+				if (IsAppConfig (item, false))
+					return new TaskItem (item);
+
+			foreach (ITaskItem item in PrimaryList)
+				if (IsAppConfig (item, true))
+					return new TaskItem (item);
+
+			foreach (ITaskItem item in SecondaryList)
+				if (IsAppConfig (item, true))
+					return new TaskItem (item);
+
+			return null;
+		}
+
+		bool IsAppConfig (ITaskItem item, bool require_subdir)
+		{
+			if (String.Compare (Path.GetFileName (item.ItemSpec), "app.config", true) != 0)
+				return false;
+
+			bool has_dir = Path.GetDirectoryName (item.ItemSpec).Length > 0;
+
+			return require_subdir == has_dir;
+		}
+
+		[Output]
+		public ITaskItem AppConfigFile {
+			get; set;
+		}
+
+		[Required]
+		public ITaskItem[] PrimaryList {
+			get; set;
+		}
+
+		[Required]
+		public ITaskItem[] SecondaryList {
+			get; set;
+		}
+
+		[Required]
+		public string TargetPath {
+			get; set;
+		}
+	}
+}
+
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindUnderPath.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindUnderPath.cs
index 2d1de22..19372ff 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindUnderPath.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/FindUnderPath.cs
@@ -46,17 +46,12 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (files == null || files.Length == 0)
+				return true;
+
 			List <ITaskItem> temporaryInPath = new List <ITaskItem> ();
 			List <ITaskItem> temporaryOutOfPath = new List <ITaskItem> ();
 			
-			if (path == null) {
-				Log.LogError (null, null, null, BuildEngine.ProjectFileOfTaskNode,
-					BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
-					BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
-					"Path attribute must be specified", null);
-				return false;
-			}
-			
 			foreach (ITaskItem file in files) {
 				try {
 					string fullPath = path.GetMetadata ("FullPath");;
@@ -129,4 +124,4 @@ namespace Microsoft.Build.Tasks {
 	}
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs
index 1a70b1d..ca3738e 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GenerateResource.cs
@@ -62,12 +62,10 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (sources.Length == 0)
+				return true;
+
 			List  <ITaskItem> temporaryFilesWritten = new List <ITaskItem> ();
-			if (sources.Length != outputResources.Length) {
-				Log.LogErrorFromException (new Exception ("Sources count is different than OutputResources count."));
-				return false;
-			}
-			
 			if (outputResources == null) {
 				foreach (ITaskItem source in sources) {
 					string sourceFile = source.ItemSpec;
@@ -75,6 +73,11 @@ namespace Microsoft.Build.Tasks {
 					CompileResourceFile (sourceFile, outputFile);
 				}
 			} else {
+				if (sources.Length != outputResources.Length) {
+					Log.LogErrorFromException (new Exception ("Sources count is different than OutputResources count."));
+					return false;
+				}
+
 				for (int i = 0; i < sources.Length; i ++) {
 					string sourceFile = sources [i].ItemSpec;
 					string outputFile = outputResources [i].ItemSpec;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs
new file mode 100644
index 0000000..3eaa214
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/LibraryPcFileCache.cs
@@ -0,0 +1,309 @@
+// 
+// PcFileCacheAssembly.cs
+//  
+// Author:
+//       Lluis Sanchez Gual <lluis at novell.com>
+// 
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Text;
+using System.Xml;
+using System.IO;
+using System.Collections.Generic;
+
+namespace Mono.PkgConfig
+{
+	internal class LibraryPcFileCache: PcFileCache<LibraryPackageInfo>
+	{
+		Dictionary<string, PackageAssemblyInfo> assemblyLocations;
+		
+		public LibraryPcFileCache (IPcFileCacheContext<LibraryPackageInfo> ctx): base (ctx)
+		{
+		}
+		
+		protected override string CacheDirectory {
+			get {
+				string path = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
+				path = Path.Combine (path, "xbuild");
+				return path;
+			}
+		}
+		
+		// Returns the location of an assembly, given the full name
+		public PackageAssemblyInfo GetAssemblyLocation (string fullName)
+		{
+			return GetAssemblyLocation (fullName, null);
+		}
+		
+		public PackageAssemblyInfo GetAssemblyLocation (string fullName, IEnumerable<string> searchPaths)
+		{
+			lock (SyncRoot) {
+				if (assemblyLocations == null) {
+					// Populate on demand
+					assemblyLocations = new Dictionary<string, PackageAssemblyInfo> ();
+					foreach (LibraryPackageInfo info in GetPackages (searchPaths)) {
+						if (info.IsValidPackage) {
+							foreach (PackageAssemblyInfo asm in info.Assemblies)
+								assemblyLocations [NormalizeAsmName (asm.FullName)] = asm;
+						}
+					}
+				}
+			}
+			// This collection is read-only once built, so there is no need for a lock
+			PackageAssemblyInfo pasm;
+			assemblyLocations.TryGetValue (NormalizeAsmName (fullName), out pasm);
+			return pasm;
+		}
+		
+		public IEnumerable<PackageAssemblyInfo> ResolveAssemblyName (string name)
+		{
+			return ResolveAssemblyName (name, null);
+		}
+		
+		public IEnumerable<PackageAssemblyInfo> ResolveAssemblyName (string name, IEnumerable<string> searchPaths)
+		{
+			foreach (LibraryPackageInfo pinfo in GetPackages (searchPaths)) {
+				if (pinfo.IsValidPackage) {
+					foreach (PackageAssemblyInfo asm in pinfo.Assemblies) {
+						if (asm.Name == name)
+							yield return asm;
+					}
+				}
+			}
+		}
+		
+		protected override void WritePackageContent (XmlTextWriter tw, string file, LibraryPackageInfo pinfo)
+		{
+			foreach (PackageAssemblyInfo asm in pinfo.Assemblies) {
+				tw.WriteStartElement ("Assembly");
+				tw.WriteAttributeString ("name", asm.Name);
+				tw.WriteAttributeString ("version", asm.Version);
+				tw.WriteAttributeString ("culture", asm.Culture);
+				tw.WriteAttributeString ("publicKeyToken", asm.PublicKeyToken);
+				tw.WriteAttributeString ("file", asm.File);
+				tw.WriteEndElement (); // Assembly
+			}
+		}
+		
+		protected override void ReadPackageContent (XmlReader tr, LibraryPackageInfo pinfo)
+		{
+			while (tr.NodeType == XmlNodeType.Element) {
+				PackageAssemblyInfo asm = new PackageAssemblyInfo ();
+				asm.Name = tr.GetAttribute ("name");
+				asm.Version = tr.GetAttribute ("version");
+				asm.Culture = tr.GetAttribute ("culture");
+				asm.PublicKeyToken = tr.GetAttribute ("publicKeyToken");
+				asm.File = tr.GetAttribute ("file");
+				if (pinfo.Assemblies == null)
+					pinfo.Assemblies = new List<PackageAssemblyInfo> ();
+				asm.ParentPackage = pinfo;
+				pinfo.Assemblies.Add (asm);
+				tr.Read ();
+				tr.MoveToContent ();
+			}
+		}
+		
+		protected override void ParsePackageInfo (PcFile file, LibraryPackageInfo pinfo)
+		{
+			List<string> fullassemblies = null;
+			bool gacPackageSet = false;
+			
+			if (file.Libs != null && file.Libs.IndexOf (".dll") != -1) {
+				if (file.Libs.IndexOf ("-lib:") != -1 || file.Libs.IndexOf ("/lib:") != -1) {
+					fullassemblies = GetAssembliesWithLibInfo (file.Libs);
+				} else {
+					fullassemblies = GetAssembliesWithoutLibInfo (file.Libs);
+				}
+			}
+			
+			string value = file.GetVariable ("Libraries");
+			if (!string.IsNullOrEmpty (value))
+				fullassemblies = GetAssembliesFromLibrariesVar (value);
+			
+			value = file.GetVariable ("GacPackage");
+			if (value != null) {
+				value = value.ToLower ();
+				pinfo.IsGacPackage = value == "yes" || value == "true";
+				gacPackageSet = true;
+			}
+	
+			if (fullassemblies == null)
+				return;
+			
+			string pcDir = Path.GetDirectoryName (file.FilePath);
+			string monoPrefix = Path.GetDirectoryName (Path.GetDirectoryName (pcDir));
+			monoPrefix = Path.GetFullPath (monoPrefix + Path.DirectorySeparatorChar + "lib" + Path.DirectorySeparatorChar + "mono" + Path.DirectorySeparatorChar);
+
+			List<PackageAssemblyInfo> list = new List<PackageAssemblyInfo> ();
+			foreach (string assembly in fullassemblies) {
+				string asm;
+				if (Path.IsPathRooted (assembly))
+					asm = Path.GetFullPath (assembly);
+				else {
+					if (Path.GetDirectoryName (assembly).Length == 0) {
+						asm = assembly;
+					} else {
+						asm = Path.GetFullPath (Path.Combine (pcDir, assembly));
+					}
+				}
+				if (File.Exists (asm)) {
+					PackageAssemblyInfo pi = new PackageAssemblyInfo ();
+					pi.File = asm;
+					pi.ParentPackage = pinfo;
+					pi.UpdateFromFile (pi.File);
+					list.Add (pi);
+					if (!gacPackageSet && !asm.StartsWith (monoPrefix) && Path.IsPathRooted (asm)) {
+						// Assembly installed outside $(prefix)/lib/mono. It is most likely not a gac package.
+						gacPackageSet = true;
+						pinfo.IsGacPackage = false;
+					}
+				}
+			}
+			pinfo.Assemblies = list;
+		}
+		
+		private List<string> GetAssembliesWithLibInfo (string line)
+		{
+			List<string> references = new List<string> ();
+			List<string> libdirs = new List<string> ();
+			List<string> retval = new List<string> ();
+			foreach (string piece in line.Split (' ')) {
+				if (piece.ToLower ().Trim ().StartsWith ("/r:") || piece.ToLower ().Trim ().StartsWith ("-r:")) {
+					references.Add (piece.Substring (3).Trim ());
+				} else if (piece.ToLower ().Trim ().StartsWith ("/lib:") || piece.ToLower ().Trim ().StartsWith ("-lib:")) {
+					libdirs.Add (piece.Substring (5).Trim ());
+				}
+			}
+	
+			foreach (string refrnc in references) {
+				foreach (string libdir in libdirs) {
+					if (File.Exists (libdir + Path.DirectorySeparatorChar + refrnc)) {
+						retval.Add (libdir + Path.DirectorySeparatorChar + refrnc);
+					}
+				}
+			}
+	
+			return retval;
+		}
+		
+		List<string> GetAssembliesFromLibrariesVar (string line)
+		{
+			List<string> references = new List<string> ();
+			foreach (string reference in line.Split (' ')) {
+				if (!string.IsNullOrEmpty (reference))
+					references.Add (reference);
+			}
+			return references;
+		}
+	
+		private List<string> GetAssembliesWithoutLibInfo (string line)
+		{
+			List<string> references = new List<string> ();
+			foreach (string reference in line.Split (' ')) {
+				if (reference.ToLower ().Trim ().StartsWith ("/r:") || reference.ToLower ().Trim ().StartsWith ("-r:")) {
+					string final_ref = reference.Substring (3).Trim ();
+					references.Add (final_ref);
+				}
+			}
+			return references;
+		}
+		
+		public static string NormalizeAsmName (string name)
+		{
+			int i = name.ToLower ().IndexOf (", publickeytoken=null");
+			if (i != -1)
+				name = name.Substring (0, i).Trim ();
+			i = name.ToLower ().IndexOf (", processorarchitecture=");
+			if (i != -1)
+				name = name.Substring (0, i).Trim ();
+			return name;
+		}
+	}
+	
+	internal class LibraryPackageInfo: PackageInfo
+	{
+		public bool IsGacPackage {
+			get { return GetData ("gacPackage") != "false"; }
+			set {
+				if (value)
+					RemoveData ("gacPackage");
+				else
+					SetData ("gacPackage", "false");
+			}
+		}
+		
+		internal List<PackageAssemblyInfo> Assemblies { get; set; }
+		
+		internal protected override bool IsValidPackage {
+			get { return Assemblies != null && Assemblies.Count > 0; }
+		}
+	}
+	
+	internal class PackageAssemblyInfo
+	{
+		public string File { get; set; }
+		
+		public string Name;
+		
+		public string Version;
+		
+		public string Culture;
+		
+		public string PublicKeyToken;
+		
+		public string FullName {
+			get {
+				string fn = Name + ", Version=" + Version;
+				if (!string.IsNullOrEmpty (Culture))
+					fn += ", Culture=" + Culture;
+				if (!string.IsNullOrEmpty (PublicKeyToken))
+					fn += ", PublicKeyToken=" + PublicKeyToken;
+				return fn;
+			}
+		}
+		
+		public LibraryPackageInfo ParentPackage { get; set; }
+		
+		public void UpdateFromFile (string file)
+		{
+			Update (System.Reflection.AssemblyName.GetAssemblyName (file));
+		}
+		
+		public void Update (System.Reflection.AssemblyName aname)
+		{
+			Name = aname.Name;
+			Version = aname.Version.ToString ();
+			if (aname.CultureInfo != null) {
+				if (aname.CultureInfo.LCID == System.Globalization.CultureInfo.InvariantCulture.LCID)
+					Culture = "neutral";
+				else
+					Culture = aname.CultureInfo.Name;
+			}
+			string fn = aname.ToString ();
+			string key = "publickeytoken=";
+			int i = fn.ToLower().IndexOf (key) + key.Length;
+			int j = fn.IndexOf (',', i);
+			if (j == -1) j = fn.Length;
+			PublicKeyToken = fn.Substring (i, j - i);
+		}
+	}
+}
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
index 3f8ed19..592a412 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MSBuild.cs
@@ -31,6 +31,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
+using Microsoft.Build.BuildEngine;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 
@@ -44,6 +45,7 @@ namespace Microsoft.Build.Tasks {
 		bool		rebaseOutputs;
 		bool		runEachTargetSeparately;
 		bool		stopOnFirstFailure;
+		bool		buildInParallel;
 		ITaskItem []	targetOutputs;
 		string []	targets;
 	
@@ -53,6 +55,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (projects.Length == 0)
+				return true;
+
 			string filename;
 			bool result = true;
 			stopOnFirstFailure = false;
@@ -65,11 +70,23 @@ namespace Microsoft.Build.Tasks {
 
 			foreach (ITaskItem project in projects) {
 				filename = project.GetMetadata ("FullPath");
+				if (!File.Exists (filename)) {
+					Log.LogError ("Could not find the project file '{0}'", filename);
+					if (stopOnFirstFailure)
+						break;
+
+					continue;
+				}
 
 				Directory.SetCurrentDirectory (Path.GetDirectoryName (filename));
 				outputs = new Hashtable ();
 
-				result = BuildEngine.BuildProjectFile (filename, targets, global_properties, outputs);
+				try {
+					result = BuildEngine.BuildProjectFile (filename, targets, global_properties, outputs);
+				} catch (InvalidProjectFileException e) {
+					Log.LogError ("Error building project {0}: {1}", filename, e.Message);
+					result = false;
+				}
 
 				if (result) {
 					// Metadata from the first item for the project file is copied
@@ -80,11 +97,14 @@ namespace Microsoft.Build.Tasks {
 					foreach (DictionaryEntry de in outputs) {
 						ITaskItem [] array = (ITaskItem []) de.Value;
 						foreach (ITaskItem item in array) {
+							// DONT share items!
+							ITaskItem new_item = new TaskItem (item);
+
 							// copy the metadata from original @project to here
 							// CopyMetadataTo does _not_ overwrite
-							first_item.CopyMetadataTo (item);
+							first_item.CopyMetadataTo (new_item);
 
-							outputItems.Add (item);
+							outputItems.Add (new_item);
 
 							//FIXME: Correctly rebase output paths to be relative to the
 							//	 calling project
@@ -93,7 +113,6 @@ namespace Microsoft.Build.Tasks {
 						}
 					}
 				} else {
-					Log.LogError ("Error while building {0}", filename);
 					if (stopOnFirstFailure)
 						break;
 				}
@@ -146,6 +165,11 @@ namespace Microsoft.Build.Tasks {
 			set { targets = value; }
 		}
 
+		public bool BuildInParallel {
+			get { return buildInParallel; }
+			set { buildInParallel = value; }
+		}
+
 		Dictionary<string, string> SplitPropertiesToDictionary ()
 		{
 			if (properties == null)
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MakeDir.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MakeDir.cs
index 5252882..5306079 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MakeDir.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/MakeDir.cs
@@ -44,6 +44,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (directories.Length == 0)
+				return true;
+
 			bool result = true;
 
 			List <ITaskItem> temporaryDirectoriesCreated = new List  <ITaskItem> ();
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ManagedCompiler.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ManagedCompiler.cs
index 4770191..e625d92 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ManagedCompiler.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ManagedCompiler.cs
@@ -134,7 +134,10 @@ namespace Microsoft.Build.Tasks {
 		[MonoTODO]
 		protected override bool HandleTaskExecutionErrors ()
 		{
-			return true;
+			if (!Log.HasLoggedErrors && ExitCode != 0)
+				Log.LogError ("Compiler crashed with code: {0}.", ExitCode);
+
+			return ExitCode == 0 && !Log.HasLoggedErrors;
 		}
 		
 		[MonoTODO]
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Message.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Message.cs
index c47e8d4..8f0783b 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Message.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Message.cs
@@ -42,6 +42,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (text == null)
+				return true;
+
 			MessageImportance	messageImportance;
 			
 			if (importance == null)
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs
new file mode 100644
index 0000000..f77a5ae
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/PcFileCache.cs
@@ -0,0 +1,572 @@
+// 
+// PcFileCache.cs
+//  
+// Author:
+//       Lluis Sanchez Gual <lluis at novell.com>
+// 
+// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Text;
+using System.Xml;
+using System.IO;
+using System.Collections.Generic;
+
+namespace Mono.PkgConfig
+{
+	internal interface IPcFileCacheContext<TP> where TP:PackageInfo, new()
+	{
+		// In the implementation of this method, the host application can extract
+		// information from the pc file and store it in the PackageInfo object
+		void StoreCustomData (PcFile pcfile, TP pkg);
+		
+		// Should return false if the provided package does not have required
+		// custom data
+		bool IsCustomDataComplete (string pcfile, TP pkg);
+		
+		// Called to report errors
+		void ReportError (string message, Exception ex);
+	}
+	
+	internal interface IPcFileCacheContext: IPcFileCacheContext<PackageInfo>
+	{
+	}
+	
+	internal abstract class PcFileCache: PcFileCache<PackageInfo>
+	{
+		public PcFileCache (IPcFileCacheContext ctx): base (ctx)
+		{
+		}
+	}
+	
+	internal abstract class PcFileCache<TP> where TP:PackageInfo, new()
+	{
+		const string CACHE_VERSION = "2";
+		
+		Dictionary<string, TP> infos = new Dictionary<string, TP> ();
+		Dictionary<string, List<TP>> filesByFolder = new Dictionary<string, List<TP>> ();
+		
+		string cacheFile;
+		bool hasChanges;
+		IPcFileCacheContext<TP> ctx;
+		IEnumerable<string> defaultPaths;
+		
+		public PcFileCache (IPcFileCacheContext<TP> ctx)
+		{
+			this.ctx = ctx;
+			try {
+				string path = CacheDirectory;
+				if (!Directory.Exists (path))
+					Directory.CreateDirectory (path);
+				cacheFile = Path.Combine (path, "pkgconfig-cache-" + CACHE_VERSION + ".xml");
+				
+				if (File.Exists (cacheFile))
+					Load ();
+				
+			} catch (Exception ex) {
+				ctx.ReportError ("pc file cache could not be loaded.", ex);
+			}
+		}
+		
+		protected abstract string CacheDirectory { get; }
+		
+		// Updates the pkg-config index, using the default search directories
+		public void Update ()
+		{
+			Update (GetDefaultPaths ());
+		}
+
+		// Updates the pkg-config index, looking for .pc files in the provided directories
+		public void Update (IEnumerable<string> pkgConfigDirs)
+		{
+			foreach (string pcdir in pkgConfigDirs) {
+				foreach (string pcfile in Directory.GetFiles (pcdir, "*.pc"))
+					GetPackageInfo (pcfile);
+			}
+			Save ();
+		}
+		
+		public IEnumerable<TP> GetPackages ()
+		{
+			return GetPackages (null);
+		}
+		
+		public IEnumerable<TP> GetPackages (IEnumerable<string> pkgConfigDirs)
+		{
+			if (pkgConfigDirs == null)
+				pkgConfigDirs = GetDefaultPaths ();
+
+			foreach (string sp in pkgConfigDirs) {
+				List<TP> list;
+				if (filesByFolder.TryGetValue (Path.GetFullPath (sp), out list)) {
+					foreach (TP p in list)
+						yield return p;
+				}
+			}
+		}
+		
+		public TP GetPackageInfoByName (string name)
+		{
+			return GetPackageInfoByName (name, null);
+		}
+		
+		public TP GetPackageInfoByName (string name, IEnumerable<string> pkgConfigDirs)
+		{
+			foreach (TP p in GetPackages (pkgConfigDirs))
+				if (p.Name == name)
+					return p;
+			return null;
+		}
+		
+		// Returns information about a .pc file
+		public TP GetPackageInfo (string file)
+		{
+			TP info, oldInfo = null;
+			file = Path.GetFullPath (file);
+			
+			DateTime wtime = File.GetLastWriteTime (file);
+			
+			lock (infos) {
+				if (infos.TryGetValue (file, out info)) {
+					if (info.LastWriteTime == wtime)
+						return info;
+					oldInfo = info;
+				}
+			}
+
+			try {
+				info = ParsePackageInfo (file);
+			} catch (Exception ex) {
+				ctx.ReportError ("Error while parsing .pc file", ex);
+				info = new TP ();
+			}
+			
+			lock (infos) {
+				if (!info.IsValidPackage)
+					info = new TP (); // Create a default empty instance
+				info.LastWriteTime = wtime;
+				Add (file, info, oldInfo);
+				hasChanges = true;
+			}
+			
+			return info;
+		}
+		
+		void Add (string file, TP info, TP replacedInfo)
+		{
+			infos [file] = info;
+			string dir = Path.GetFullPath (Path.GetDirectoryName (file));
+			List<TP> list;
+			if (!filesByFolder.TryGetValue (dir, out list)) {
+				list = new List<TP> ();
+				filesByFolder [dir] = list;
+			}
+			if (replacedInfo != null) {
+				int i = list.IndexOf (replacedInfo);
+				if (i != -1) {
+					list [i] = info;
+					return;
+				}
+			}
+			list.Add (info);
+		}
+		
+		FileStream OpenFile (FileAccess access)
+		{
+			int retries = 6;
+			FileMode mode = access == FileAccess.Read ? FileMode.Open : FileMode.Create;
+			Exception lastException = null;
+			
+			while (retries > 0) {
+				try {
+					return new FileStream (cacheFile, mode, access, FileShare.None);
+				} catch (Exception ex) {
+					// the file may be locked by another app. Wait a bit and try again
+					lastException = ex;
+					System.Threading.Thread.Sleep (200);
+					retries--;
+				}
+			}
+			ctx.ReportError ("File could not be opened: " + cacheFile, lastException);
+			return null;
+		}
+		
+		void Load ()
+		{
+			// The serializer can't be used because this file is reused in xbuild
+			using (FileStream fs = OpenFile (FileAccess.Read)) {
+				if (fs == null)
+					return;
+				XmlTextReader xr = new XmlTextReader (fs);
+				xr.MoveToContent ();
+				xr.ReadStartElement ();
+				xr.MoveToContent ();
+				
+				while (xr.NodeType == XmlNodeType.Element)
+					ReadPackage (xr);
+			}
+		}
+		
+		public void Save ()
+		{
+			// The serializer can't be used because this file is reused in xbuild
+			lock (infos) {
+				if (!hasChanges)
+					return;
+				
+				using (FileStream fs = OpenFile (FileAccess.Write)) {
+					if (fs == null)
+						return;
+					XmlTextWriter tw = new XmlTextWriter (new StreamWriter (fs));
+					tw.Formatting = Formatting.Indented;
+					
+					tw.WriteStartElement ("PcFileCache");
+					foreach (KeyValuePair<string,TP> file in infos) {
+						WritePackage (tw, file.Key, file.Value);
+					}
+					tw.WriteEndElement (); // PcFileCache
+					tw.Flush ();
+					
+					hasChanges = false;
+				}
+			}
+		}
+		
+		void WritePackage (XmlTextWriter tw, string file, TP pinfo)
+		{
+			tw.WriteStartElement ("File");
+			tw.WriteAttributeString ("path", file);
+			tw.WriteAttributeString ("lastWriteTime", XmlConvert.ToString (pinfo.LastWriteTime, XmlDateTimeSerializationMode.Local));
+			
+			if (pinfo.IsValidPackage) {
+				if (pinfo.Name != null)
+					tw.WriteAttributeString ("name", pinfo.Name);
+				if (pinfo.Version != null)
+					tw.WriteAttributeString ("version", pinfo.Version);
+				if (!string.IsNullOrEmpty (pinfo.Description))
+					tw.WriteAttributeString ("description", pinfo.Description);
+				if (pinfo.CustomData != null) {
+					foreach (KeyValuePair<string,string> cd in pinfo.CustomData)
+						tw.WriteAttributeString (cd.Key, cd.Value);
+				}
+				WritePackageContent (tw, file, pinfo);
+			}
+			tw.WriteEndElement (); // File
+		}
+		
+		protected virtual void WritePackageContent (XmlTextWriter tw, string file, TP pinfo)
+		{
+		}
+		
+		void ReadPackage (XmlReader tr)
+		{
+			TP pinfo = new TP ();
+			string file = null;
+			
+			tr.MoveToFirstAttribute ();
+			do {
+				switch (tr.LocalName) {
+					case "path": file = tr.Value; break;
+					case "lastWriteTime": pinfo.LastWriteTime = XmlConvert.ToDateTime (tr.Value, XmlDateTimeSerializationMode.Local); break;
+					case "name": pinfo.Name = tr.Value; break;
+					case "version": pinfo.Version = tr.Value; break;
+					case "description": pinfo.Description = tr.Value; break;
+					default: pinfo.SetData (tr.LocalName, tr.Value); break;
+				}
+			} while (tr.MoveToNextAttribute ());
+			
+			tr.MoveToElement ();
+			
+			if (!tr.IsEmptyElement) {
+				tr.ReadStartElement ();
+				tr.MoveToContent ();
+				ReadPackageContent (tr, pinfo);
+				tr.MoveToContent ();
+				tr.ReadEndElement ();
+			} else
+				tr.Read ();
+			tr.MoveToContent ();
+			
+			if (!pinfo.IsValidPackage || ctx.IsCustomDataComplete (file, pinfo))
+				Add (file, pinfo, null);
+		}
+		
+		protected virtual void ReadPackageContent (XmlReader tr, TP pinfo)
+		{
+		}
+		
+		public object SyncRoot {
+			get { return infos; }
+		}
+		
+		
+		TP ParsePackageInfo (string pcfile)
+		{
+			PcFile file = new PcFile ();
+			file.Load (pcfile);
+			
+			TP pinfo = new TP ();
+			pinfo.Name = Path.GetFileNameWithoutExtension (file.FilePath);
+			
+			if (!file.HasErrors) {
+				pinfo.Version = file.Version;
+				pinfo.Description = file.Description;
+				ParsePackageInfo (file, pinfo);
+				ctx.StoreCustomData (file, pinfo);
+			}
+			return pinfo;
+		}
+		
+		protected virtual void ParsePackageInfo (PcFile file, TP pinfo)
+		{
+		}
+		
+		IEnumerable<string> GetDefaultPaths ()
+		{
+			if (defaultPaths == null) {
+				string pkgConfigPath = Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH");
+				string pkgConfigDir = Environment.GetEnvironmentVariable ("PKG_CONFIG_LIBDIR");
+				defaultPaths = GetPkgconfigPaths (null, pkgConfigPath, pkgConfigDir);
+			}
+			return defaultPaths;
+		}
+		
+		public IEnumerable<string> GetPkgconfigPaths (string prefix, string pkgConfigPath, string pkgConfigLibdir)
+		{
+			char[] sep = new char[] { Path.PathSeparator };
+			
+			string[] pkgConfigPaths = null;
+			if (!String.IsNullOrEmpty (pkgConfigPath)) {
+				pkgConfigPaths = pkgConfigPath.Split (sep, StringSplitOptions.RemoveEmptyEntries);
+				if (pkgConfigPaths.Length == 0)
+					pkgConfigPaths = null;
+			}
+			
+			string[] pkgConfigLibdirs = null;
+			if (!String.IsNullOrEmpty (pkgConfigLibdir)) {
+				pkgConfigLibdirs = pkgConfigLibdir.Split (sep, StringSplitOptions.RemoveEmptyEntries);
+				if (pkgConfigLibdirs.Length == 0)
+					pkgConfigLibdirs = null;
+			}
+			
+			if (prefix == null)
+				prefix = PathUp (typeof (int).Assembly.Location, 4);
+			
+			IEnumerable<string> paths = GetUnfilteredPkgConfigDirs (pkgConfigPaths, pkgConfigLibdirs, new string [] { prefix });
+			return NormaliseAndFilterPaths (paths, Environment.CurrentDirectory);
+		}
+		
+		IEnumerable<string> GetUnfilteredPkgConfigDirs (IEnumerable<string> pkgConfigPaths, IEnumerable<string> pkgConfigLibdirs, IEnumerable<string> systemPrefixes)
+		{
+			if (pkgConfigPaths != null) {
+				foreach (string dir in pkgConfigPaths)
+					yield return dir;
+			}
+			
+			if (pkgConfigLibdirs != null) {
+				foreach (string dir in pkgConfigLibdirs)
+					yield return dir;
+			} else if (systemPrefixes != null) {
+				string[] suffixes = new string [] {
+					Path.Combine ("lib", "pkgconfig"),
+					Path.Combine ("lib64", "pkgconfig"),
+					Path.Combine ("libdata", "pkgconfig"),
+					Path.Combine ("share", "pkgconfig"),
+				};
+				foreach (string prefix in systemPrefixes)
+					foreach (string suffix in suffixes)
+						yield return Path.Combine (prefix, suffix);
+			}
+		}
+		
+		IEnumerable<string> NormaliseAndFilterPaths (IEnumerable<string> paths, string workingDirectory)
+		{
+			Dictionary<string,string> filtered = new Dictionary<string,string> ();
+			foreach (string p in paths) {
+				string path = p;
+				if (!Path.IsPathRooted (path))
+					path = Path.Combine (workingDirectory, path);
+				path = Path.GetFullPath (path);
+				if (filtered.ContainsKey (path))
+					continue;
+				filtered.Add (path,path);
+				try {
+					if (!Directory.Exists (path))
+						continue;
+				} catch (IOException ex) {
+					ctx.ReportError ("Error checking for directory '" + path + "'.", ex);
+				}
+				yield return path;
+			}
+		}
+		
+		static string PathUp (string path, int up)
+		{
+			if (up == 0)
+				return path;
+			for (int i = path.Length -1; i >= 0; i--) {
+				if (path[i] == Path.DirectorySeparatorChar) {
+					up--;
+					if (up == 0)
+						return path.Substring (0, i);
+				}
+			}
+			return null;
+		}
+	}
+
+	internal class PcFile
+	{
+		Dictionary<string,string> variables = new Dictionary<string, string> ();
+		
+		public string FilePath { get; set; }
+		public string Name { get; set; }
+		public string Description { get; set; }
+		public string Version { get; set; }
+		public string Libs { get; set; }
+		public bool HasErrors { get; set; }
+		
+		public string GetVariable (string varName)
+		{
+			string val;
+			variables.TryGetValue (varName, out val);
+			return val;
+		}
+		
+		public void Load (string pcfile)
+		{
+			FilePath = pcfile;
+			variables.Add ("pcfiledir", Path.GetDirectoryName (pcfile));
+			using (StreamReader reader = new StreamReader (pcfile)) {
+				string line;
+				while ((line = reader.ReadLine ()) != null) {
+					int i = line.IndexOf (':');
+					int j = line.IndexOf ('=');
+					int k = System.Math.Min (i != -1 ? i : int.MaxValue, j != -1 ? j : int.MaxValue);
+					if (k == int.MaxValue)
+						continue;
+					string var = line.Substring (0, k).Trim ();
+					string value = line.Substring (k + 1).Trim ();
+					value = Evaluate (value);
+					
+					if (k == j) {
+						// Is variable
+						variables [var] = value;
+					}
+					else {
+						switch (var) {
+							case "Name": Name = value; break;
+							case "Description": Description = value; break;
+							case "Version": Version = value; break;
+							case "Libs": Libs = value; break;
+						}
+					}
+				}
+			}
+		}
+		
+		string Evaluate (string value)
+		{
+			int i = value.IndexOf ("${");
+			if (i == -1)
+				return value;
+
+			StringBuilder sb = new StringBuilder ();
+			int last = 0;
+			while (i != -1 && i < value.Length) {
+				sb.Append (value.Substring (last, i - last));
+				if (i == 0 || value [i - 1] != '$') {
+					// Evaluate if var is not escaped
+					i += 2;
+					int n = value.IndexOf ('}', i);
+					if (n == -1 || n == i) {
+						// Closing bracket not found or empty name
+						HasErrors = true;
+						return value;
+					}
+					string rname = value.Substring (i, n - i);
+					string rval;
+					if (variables.TryGetValue (rname, out rval))
+						sb.Append (rval);
+					else {
+						HasErrors = true;
+						return value;
+					}
+					i = n + 1;
+					last = i;
+				} else
+					last = i++;
+				
+				if (i < value.Length - 1)
+					i = value.IndexOf ("${", i);
+			}
+			sb.Append (value.Substring (last, value.Length - last));
+			return sb.ToString ();
+		}
+	}
+	
+	internal class PackageInfo
+	{
+		Dictionary<string,string> customData;
+
+		public string Name { get; set; }
+		
+		public string Version { get; set; }
+		
+		public string Description { get; set; }
+		
+		public string GetData (string name)
+		{
+			if (customData == null)
+				return null;
+			string res;
+			customData.TryGetValue (name, out res);
+			return res;
+		}
+		
+		public void SetData (string name, string value)
+		{
+			if (customData == null)
+				customData = new Dictionary<string, string> ();
+			customData [name] = value;
+		}
+		
+		public void RemoveData (string name)
+		{
+			if (customData != null)
+				customData.Remove (name);
+		}
+		
+		internal Dictionary<string,string> CustomData {
+			get { return customData; }
+		}
+		
+		internal DateTime LastWriteTime { get; set; }
+		
+		internal bool HasCustomData {
+			get { return customData != null && customData.Count > 0; }
+		}
+		
+		internal protected virtual bool IsValidPackage {
+			get { return HasCustomData; }
+		}
+	}
+}
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ReadLinesFromFile.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ReadLinesFromFile.cs
index f4e8be3..44862b2 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ReadLinesFromFile.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ReadLinesFromFile.cs
@@ -39,7 +39,6 @@ namespace Microsoft.Build.Tasks {
 	
 		ITaskItem	file;
 		ITaskItem[]	lines;
-		StreamReader	streamReader;
 	
 		public ReadLinesFromFile ()
 		{
@@ -47,29 +46,28 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			string full_filename = file.GetMetadata ("FullPath");
+			if (!System.IO.File.Exists (full_filename))
+				return true;
+
+			StreamReader streamReader = null;
 			try {
-				if ( file == null)
-					throw new ArgumentNullException ("File", "File property must be set.");
+				streamReader = new StreamReader (full_filename);
+				List <ITaskItem> temporaryLines = new List <ITaskItem> ();
 
-				streamReader = new StreamReader (file.GetMetadata ("FullPath"));
 				string line;
-				List <ITaskItem> temporaryLines = new List <ITaskItem> ();
-				while ((line = streamReader.ReadLine ()) != null) {
+				while ((line = streamReader.ReadLine ()) != null)
 					temporaryLines.Add (new TaskItem (line));
-				}
 				
 				lines = temporaryLines.ToArray ();
-
-				return true;
-			}
-			catch (Exception ex) {
-				Log.LogErrorFromException (ex);
-				return false;
+			} catch (IOException ex) {
+				Log.LogWarningFromException (ex);
+			} finally {
+				if (streamReader != null)
+					streamReader.Dispose ();
 			}
-			finally {
-				streamReader.Close ();
-			}
-			
+
+			return true;
 		}
 
 		[Required]
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDir.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDir.cs
index 9731694..54ab566 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDir.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDir.cs
@@ -45,6 +45,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (directories.Length == 0)
+				return true;
+
 			List <ITaskItem> temporaryRemovedDirectories = new List <ITaskItem> ();
 			
 			foreach (ITaskItem directory in directories) {
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDuplicates.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDuplicates.cs
index 199ea2c..3646413 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDuplicates.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/RemoveDuplicates.cs
@@ -47,12 +47,12 @@ namespace Microsoft.Build.Tasks {
 			if (inputs == null || inputs.Length == 0)
 				return true;
 
-			Dictionary <ITaskItem, object> items = new Dictionary <ITaskItem, object> ();
+			Dictionary <string, ITaskItem> items = new Dictionary <string, ITaskItem> ();
 			List <ITaskItem> list = new List <ITaskItem> ();
 
 			foreach (ITaskItem item in inputs) {
-				if (!items.ContainsKey (item)) {
-					items.Add (item, null);
+				if (!items.ContainsKey (item.ItemSpec)) {
+					items.Add (item.ItemSpec, item);
 					list.Add (item);
 				}
 			}
@@ -62,6 +62,7 @@ namespace Microsoft.Build.Tasks {
 			return true;
 		}
 		
+		[Output]
 		public ITaskItem [] Filtered {
 			get { return filtered; }
 			set { filtered = value; }
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
index 4e6ff11..4a334d4 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolveAssemblyReference.cs
@@ -33,6 +33,7 @@ using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Linq;
 using System.Reflection;
 using System.Security;
 using Microsoft.Build.Framework;
@@ -67,17 +68,21 @@ namespace Microsoft.Build.Tasks {
 		ITaskItem[]	suggestedRedirects;
 		string[]	targetFrameworkDirectories;
 		string		targetProcessorArchitecture;
-		static string []	assembly_file_search_paths;
 		static string []	default_assembly_extensions;
 
 		AssemblyResolver	assembly_resolver;
-		List<ITaskItem>	tempSatelliteFiles, tempRelatedFiles, tempResolvedDepFiles;
-		List<ITaskItem> tempResolvedFiles, tempCopyLocalFiles;
+		List<string> dependency_search_paths;
+		Dictionary<string, ResolvedReference> assemblyNameToResolvedRef;
+		Dictionary<string, ITaskItem>	tempSatelliteFiles, tempRelatedFiles,
+			tempResolvedDepFiles, tempCopyLocalFiles;
+		List<ITaskItem> tempResolvedFiles;
+		List<PrimaryReference> primaryReferences;
+		Dictionary<string, string> alreadyScannedAssemblyNames;
+
+		//FIXME: construct and use a graph of the dependencies, useful across projects
 
 		static ResolveAssemblyReference ()
 		{
-			assembly_file_search_paths = new string [] {
-				"{TargetFrameworkDirectory}", "{GAC}", String.Empty };
 			default_assembly_extensions = new string [] { ".dll", ".exe" };
 		}
 
@@ -87,15 +92,58 @@ namespace Microsoft.Build.Tasks {
 		}
 
 		//FIXME: make this reusable
-		//FIXME: make sure finals refs are not repeated
 		public override bool Execute ()
 		{
+			if (assemblies == null && assemblyFiles == null)
+				// nothing to resolve
+				return true;
+
 			assembly_resolver.Log = Log;
-			tempResolvedFiles = new List <ITaskItem> ();
-			tempCopyLocalFiles = new List <ITaskItem> ();
-			tempSatelliteFiles = new List<ITaskItem> ();
-			tempRelatedFiles = new List<ITaskItem> ();
-			tempResolvedDepFiles = new List<ITaskItem> ();
+			tempResolvedFiles = new List<ITaskItem> ();
+			tempCopyLocalFiles = new Dictionary<string, ITaskItem> ();
+			tempSatelliteFiles = new Dictionary<string, ITaskItem> ();
+			tempRelatedFiles = new Dictionary<string, ITaskItem> ();
+			tempResolvedDepFiles = new Dictionary<string, ITaskItem> ();
+
+			primaryReferences = new List<PrimaryReference> ();
+			assemblyNameToResolvedRef = new Dictionary<string, ResolvedReference> ();
+
+			ResolveAssemblies ();
+			ResolveAssemblyFiles ();
+
+			alreadyScannedAssemblyNames = new Dictionary<string, string> ();
+
+			// the first element is place holder for parent assembly's dir
+			dependency_search_paths = new List<string> () { String.Empty };
+			dependency_search_paths.AddRange (searchPaths);
+
+			// resolve dependencies
+			foreach (PrimaryReference pref in primaryReferences)
+				ResolveAssemblyFileDependencies (pref.TaskItem, pref.ParentCopyLocal);
+
+			resolvedFiles = tempResolvedFiles.ToArray ();
+			copyLocalFiles = tempCopyLocalFiles.Values.ToArray ();
+			satelliteFiles = tempSatelliteFiles.Values.ToArray ();
+			relatedFiles = tempRelatedFiles.Values.ToArray ();
+			resolvedDependencyFiles = tempResolvedDepFiles.Values.ToArray ();
+
+			tempResolvedFiles.Clear ();
+			tempCopyLocalFiles.Clear ();
+			tempSatelliteFiles.Clear ();
+			tempRelatedFiles.Clear ();
+			tempResolvedDepFiles.Clear ();
+			alreadyScannedAssemblyNames.Clear ();
+			primaryReferences.Clear ();
+			assemblyNameToResolvedRef.Clear ();
+			dependency_search_paths = null;
+
+			return true;
+		}
+
+		void ResolveAssemblies ()
+		{
+			if (assemblies == null || assemblies.Length == 0)
+				return;
 
 			foreach (ITaskItem item in assemblies) {
 				if (!String.IsNullOrEmpty (item.GetMetadata ("SubType"))) {
@@ -104,57 +152,50 @@ namespace Microsoft.Build.Tasks {
 				}
 
 				Log.LogMessage (MessageImportance.Low, "Primary Reference {0}", item.ItemSpec);
-				ResolvedReference resolved_ref = ResolveReference (item, searchPaths);
+				ResolvedReference resolved_ref = ResolveReference (item, searchPaths, true);
 				if (resolved_ref == null) {
-					Log.LogWarning ("\tReference '{0}' not resolved", item.ItemSpec);
-					Log.LogMessage ("{0}", assembly_resolver.SearchLogger.ToString ());
+					Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
+					assembly_resolver.LogSearchLoggerMessages ();
 				} else {
 					Log.LogMessage (MessageImportance.Low,
 							"\tReference {0} resolved to {1}. CopyLocal = {2}",
 							item.ItemSpec, resolved_ref.TaskItem,
 							resolved_ref.TaskItem.GetMetadata ("CopyLocal"));
 
-					tempResolvedFiles.Add (resolved_ref.TaskItem);
-
-					if (!IsFromGacOrTargetFramework (resolved_ref))
-						ResolveAssemblyFileDependencies (resolved_ref.TaskItem,
-								resolved_ref.TaskItem.GetMetadata ("CopyLocal"));
+					Log.LogMessage (MessageImportance.Low,
+							"\tReference found at search path {0}",
+							resolved_ref.FoundInSearchPathAsString);
+
+					if (TryAddNewReference (tempResolvedFiles, resolved_ref) &&
+						!IsFromGacOrTargetFramework (resolved_ref) &&
+						resolved_ref.FoundInSearchPath != SearchPath.PkgConfig) {
+						primaryReferences.Add (new PrimaryReference (
+								resolved_ref.TaskItem,
+								resolved_ref.TaskItem.GetMetadata ("CopyLocal")));
+					}
 				}
 			}
-
-			ResolveAssemblyFiles ();
-			
-			resolvedFiles = tempResolvedFiles.ToArray ();
-			copyLocalFiles = tempCopyLocalFiles.ToArray ();
-			satelliteFiles = tempSatelliteFiles.ToArray ();
-			relatedFiles = tempRelatedFiles.ToArray ();
-			resolvedDependencyFiles = tempResolvedDepFiles.ToArray ();
-
-			tempResolvedFiles.Clear ();
-			tempCopyLocalFiles.Clear ();
-			tempSatelliteFiles.Clear ();
-			tempRelatedFiles.Clear ();
-			tempResolvedDepFiles.Clear ();
-
-			return true;
 		}
 
 		// Use @search_paths to resolve the reference
-		ResolvedReference ResolveReference (ITaskItem item, string [] search_paths)
+		ResolvedReference ResolveReference (ITaskItem item, IEnumerable<string> search_paths, bool set_copy_local)
 		{
+			ResolvedReference resolved = null;
+			bool specific_version;
+
 			assembly_resolver.ResetSearchLogger ();
 
-			ResolvedReference resolved = null;
-			foreach (string spath in search_paths) {
-				bool specific_version;
-				if (!TryGetSpecificVersionValue (item, out specific_version))
-					return null;
+			if (!TryGetSpecificVersionValue (item, out specific_version))
+				return null;
 
-				assembly_resolver.SearchLogger.WriteLine ("For searchpath {0}", spath);
+			foreach (string spath in search_paths) {
+				assembly_resolver.LogSearchMessage ("For searchpath {0}", spath);
 
 				if (String.Compare (spath, "{HintPathFromItem}") == 0) {
 					resolved = assembly_resolver.ResolveHintPathReference (item, specific_version);
 				} else if (String.Compare (spath, "{TargetFrameworkDirectory}") == 0) {
+					if (targetFrameworkDirectories == null)
+						continue;
 					foreach (string fpath in targetFrameworkDirectories) {
 						resolved = assembly_resolver.FindInTargetFramework (item,
 								fpath, specific_version);
@@ -165,12 +206,15 @@ namespace Microsoft.Build.Tasks {
 					resolved = assembly_resolver.ResolveGacReference (item, specific_version);
 				} else if (String.Compare (spath, "{RawFileName}") == 0) {
 					//FIXME: identify assembly names, as extract the name, and try with that?
-					if (assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec) != null)
-						resolved = assembly_resolver.GetResolvedReference (item, item.ItemSpec, true,
+					AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
+					if (aname != null)
+						resolved = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true,
 								SearchPath.RawFileName);
 				} else if (String.Compare (spath, "{CandidateAssemblyFiles}") == 0) {
-					assembly_resolver.SearchLogger.WriteLine (
-							"Warning: {CandidateAssemblyFiles} not supported currently");
+					assembly_resolver.LogSearchMessage (
+							"Warning: {{CandidateAssemblyFiles}} not supported currently");
+				} else if (String.Compare (spath, "{PkgConfig}") == 0) {
+					resolved = assembly_resolver.ResolvePkgConfigReference (item, specific_version);
 				} else {
 					resolved = assembly_resolver.FindInDirectory (
 							item, spath,
@@ -181,7 +225,7 @@ namespace Microsoft.Build.Tasks {
 					break;
 			}
 
-			if (resolved != null)
+			if (resolved != null && set_copy_local)
 				SetCopyLocal (resolved.TaskItem, resolved.CopyLocal.ToString ());
 
 			return resolved;
@@ -210,7 +254,12 @@ namespace Microsoft.Build.Tasks {
 		//FIXME: Consider CandidateAssemblyFiles also here
 		void ResolveAssemblyFiles ()
 		{
+			if (assemblyFiles == null)
+				return;
+
 			foreach (ITaskItem item in assemblyFiles) {
+				assembly_resolver.ResetSearchLogger ();
+
 				if (!File.Exists (item.ItemSpec)) {
 					Log.LogMessage (MessageImportance.Low,
 							"Primary Reference from AssemblyFiles {0}, file not found. Ignoring",
@@ -221,102 +270,114 @@ namespace Microsoft.Build.Tasks {
 				Log.LogMessage (MessageImportance.Low, "Primary Reference from AssemblyFiles {0}", item.ItemSpec);
 				string copy_local;
 
-				ResolvedReference rr = assembly_resolver.GetResolvedReference (item, item.ItemSpec, true,
+				AssemblyName aname = assembly_resolver.GetAssemblyNameFromFile (item.ItemSpec);
+				if (aname == null) {
+					Log.LogWarning ("Reference '{0}' not resolved", item.ItemSpec);
+					assembly_resolver.LogSearchLoggerMessages ();
+					continue;
+				}
+
+				ResolvedReference rr = assembly_resolver.GetResolvedReference (item, item.ItemSpec, aname, true,
 						SearchPath.RawFileName);
 				copy_local = rr.CopyLocal.ToString ();
 
-				tempResolvedFiles.Add (rr.TaskItem);
+				if (!TryAddNewReference (tempResolvedFiles, rr))
+					// already resolved
+					continue;
+
 				SetCopyLocal (rr.TaskItem, copy_local);
 
 				FindAndAddRelatedFiles (item.ItemSpec, copy_local);
 				FindAndAddSatellites (item.ItemSpec, copy_local);
 
-				if (FindDependencies && !IsFromGacOrTargetFramework (rr))
-					ResolveAssemblyFileDependencies (item, copy_local);
+				if (FindDependencies && !IsFromGacOrTargetFramework (rr) &&
+						rr.FoundInSearchPath != SearchPath.PkgConfig)
+					primaryReferences.Add (new PrimaryReference (item, copy_local));
 			}
 		}
 
-		//FIXME: caching
-
 		// Tries to resolve assemblies referenced by @item
 		// Skips gac references
 		// @item : filename
 		void ResolveAssemblyFileDependencies (ITaskItem item, string parent_copy_local)
 		{
-			string basepath = Path.GetDirectoryName (item.ItemSpec);
-
-			// set the 3rd search path to this ref's base path
-			// Will be used for resolving the dependencies
-			assembly_file_search_paths [2] = basepath;
-
-			Dictionary<string, string> alreadyResolvedAssemblies = new Dictionary<string, string> ();
-
 			Queue<string> dependencies = new Queue<string> ();
 			dependencies.Enqueue (item.ItemSpec);
 
 			while (dependencies.Count > 0) {
-				Assembly asm = Assembly.ReflectionOnlyLoadFrom (dependencies.Dequeue ());
-				if (alreadyResolvedAssemblies.ContainsKey (asm.FullName))
+				string filename = Path.GetFullPath (dependencies.Dequeue ());
+				Assembly asm = Assembly.ReflectionOnlyLoadFrom (filename);
+				if (alreadyScannedAssemblyNames.ContainsKey (asm.FullName))
 					continue;
 
+				// set the 1st search path to this ref's base path
+				// Will be used for resolving the dependencies
+				dependency_search_paths [0] = Path.GetDirectoryName (filename);
+
 				foreach (AssemblyName aname in asm.GetReferencedAssemblies ()) {
-					if (alreadyResolvedAssemblies.ContainsKey (aname.FullName))
+					if (alreadyScannedAssemblyNames.ContainsKey (aname.FullName))
 						continue;
 
-					Log.LogMessage (MessageImportance.Low, "Dependency {0}", aname);
-					Log.LogMessage (MessageImportance.Low, "\tRequired by {0}", asm.FullName);
-
 					ResolvedReference resolved_ref = ResolveDependencyByAssemblyName (
-							aname, parent_copy_local);
+							aname, asm.FullName, parent_copy_local);
 
-					if (resolved_ref != null && !IsFromGacOrTargetFramework (resolved_ref)) {
+					if (resolved_ref != null && !IsFromGacOrTargetFramework (resolved_ref)
+							&& resolved_ref.FoundInSearchPath != SearchPath.PkgConfig)
 						dependencies.Enqueue (resolved_ref.TaskItem.ItemSpec);
-						FindAndAddSatellites (resolved_ref.TaskItem.ItemSpec, parent_copy_local);
-					}
 				}
-				alreadyResolvedAssemblies.Add (asm.FullName, String.Empty);
+				alreadyScannedAssemblyNames.Add (asm.FullName, String.Empty);
 			}
 		}
 
-		// Resolves by looking assembly_file_search_paths
-		// which has - gac, tgtfmwk, and base dir of the parent
-		// reference
-		ResolvedReference ResolveDependencyByAssemblyName (AssemblyName aname, string parent_copy_local)
+		// Resolves by looking dependency_search_paths
+		// which is dir of parent reference file, and
+		// SearchPaths
+		ResolvedReference ResolveDependencyByAssemblyName (AssemblyName aname, string parent_asm_name,
+				string parent_copy_local)
 		{
-			// Look in TargetFrameworkDirectory, Gac
+			// This will check for compatible assembly name/version
+			ResolvedReference resolved_ref;
+			if (TryGetResolvedReferenceByAssemblyName (aname, false, out resolved_ref))
+				return resolved_ref;
+
+			Log.LogMessage (MessageImportance.Low, "Dependency {0}", aname);
+			Log.LogMessage (MessageImportance.Low, "\tRequired by {0}", parent_asm_name);
+
 			ITaskItem item = new TaskItem (aname.FullName);
 			item.SetMetadata ("SpecificVersion", "false");
-			ResolvedReference resolved_ref = ResolveReference (
-							item,
-							assembly_file_search_paths);
+			resolved_ref = ResolveReference (item, dependency_search_paths, false);
 
-			string copy_local = "false";
 			if (resolved_ref != null) {
 				Log.LogMessage (MessageImportance.Low, "\tReference {0} resolved to {1}.",
 					aname, resolved_ref.TaskItem.ItemSpec);
 
+				Log.LogMessage (MessageImportance.Low,
+						"\tReference found at search path {0}",
+						resolved_ref.FoundInSearchPathAsString);
+
 				if (resolved_ref.FoundInSearchPath == SearchPath.Directory) {
 					// override CopyLocal with parent's val
-					resolved_ref.TaskItem.SetMetadata ("CopyLocal", parent_copy_local);
+					SetCopyLocal (resolved_ref.TaskItem, parent_copy_local);
 
 					Log.LogMessage (MessageImportance.Low,
 							"\tThis is CopyLocal {0} as parent item has this value",
-							copy_local);
+							parent_copy_local);
 
-					FindAndAddRelatedFiles (resolved_ref.TaskItem.ItemSpec, parent_copy_local);
+					if (TryAddNewReference (tempResolvedFiles, resolved_ref)) {
+						FindAndAddRelatedFiles (resolved_ref.TaskItem.ItemSpec, parent_copy_local);
+						FindAndAddSatellites (resolved_ref.TaskItem.ItemSpec, parent_copy_local);
+					}
 				} else {
 					//gac or tgtfmwk
 					Log.LogMessage (MessageImportance.Low,
-							"\tThis is CopyLocal {0} as it is in the gac or one " +
-							"of the target framework directories",
-							copy_local);
+							"\tThis is CopyLocal false as it is in the gac," +
+							"target framework directory or provided by a package.");
 
+					TryAddNewReference (tempResolvedFiles, resolved_ref);
 				}
-
-				tempResolvedFiles.Add (resolved_ref.TaskItem);
 			} else {
-				Log.LogWarning ("\tReference '{0}' not resolved", aname);
-				Log.LogMessage ("{0}", assembly_resolver.SearchLogger.ToString ());
+				Log.LogWarning ("Reference '{0}' not resolved", aname);
+				assembly_resolver.LogSearchLoggerMessages ();
 			}
 
 			return resolved_ref;
@@ -333,7 +394,7 @@ namespace Microsoft.Build.Tasks {
 					ITaskItem item = new TaskItem (rfile);
 					SetCopyLocal (item, parent_copy_local);
 
-					tempRelatedFiles.Add (item);
+					tempRelatedFiles.AddUniqueFile (item);
 				}
 			}
 		}
@@ -360,18 +421,69 @@ namespace Microsoft.Build.Tasks {
 					ITaskItem item = new TaskItem (res_path);
 					SetCopyLocal (item, parent_copy_local);
 					item.SetMetadata ("DestinationSubdirectory", culture + dir_sep);
-					tempSatelliteFiles.Add (item);
+					tempSatelliteFiles.AddUniqueFile (item);
 				}
 			}
 		}
 
+		// returns true is it was new
+		bool TryAddNewReference (List<ITaskItem> file_list, ResolvedReference key_ref)
+		{
+			ResolvedReference found_ref;
+			if (!TryGetResolvedReferenceByAssemblyName (key_ref.AssemblyName, key_ref.IsPrimary, out found_ref)) {
+				assemblyNameToResolvedRef [key_ref.AssemblyName.Name] = key_ref;
+				file_list.Add (key_ref.TaskItem);
+
+				return true;
+			}
+			return false;
+		}
+
 		void SetCopyLocal (ITaskItem item, string copy_local)
 		{
 			item.SetMetadata ("CopyLocal", copy_local);
 
 			// Assumed to be valid value
 			if (Boolean.Parse (copy_local))
-				tempCopyLocalFiles.Add (item);
+				tempCopyLocalFiles.AddUniqueFile (item);
+		}
+
+		bool TryGetResolvedReferenceByAssemblyName (AssemblyName key_aname, bool is_primary, out ResolvedReference found_ref)
+		{
+			found_ref = null;
+			// Match by just name
+			if (!assemblyNameToResolvedRef.TryGetValue (key_aname.Name, out found_ref))
+				// not there
+				return false;
+
+			// match for full name
+			if (AssemblyResolver.AssemblyNamesCompatible (key_aname, found_ref.AssemblyName, true))
+				// exact match, so its already there, dont add anything
+				return true;
+
+			// we have a name match, but version mismatch!
+			assembly_resolver.LogSearchMessage ("A conflict was detected between '{0}' and '{1}'",
+					key_aname.FullName, found_ref.AssemblyName.FullName);
+
+			if (is_primary == found_ref.IsPrimary) {
+				assembly_resolver.LogSearchMessage ("Unable to choose between the two. " +
+						"Choosing '{0}' arbitrarily.", found_ref.AssemblyName.FullName);
+				return true;
+			}
+
+			// since all dependencies are processed after
+			// all primary refererences, the one in the cache
+			// has to be a primary
+			// Prefer a primary reference over a dependency
+
+			assembly_resolver.LogSearchMessage ("Choosing '{0}' as it is a primary reference.",
+					found_ref.AssemblyName.FullName);
+
+			Log.LogWarning ("Found a conflict between : '{0}' and '{1}'. Using '{0}' reference.",
+					found_ref.AssemblyName.FullName,
+					key_aname.FullName);
+
+			return true;
 		}
 
 		bool IsCopyLocal (ITaskItem item)
@@ -539,6 +651,32 @@ namespace Microsoft.Build.Tasks {
                         }
                 }
 	}
+
+	static class ResolveAssemblyReferenceHelper {
+		public static void AddUniqueFile (this Dictionary<string, ITaskItem> dic, ITaskItem item)
+		{
+			if (dic == null)
+				throw new ArgumentNullException ("dic");
+			if (item == null)
+				throw new ArgumentNullException ("item");
+
+			string fullpath = Path.GetFullPath (item.ItemSpec);
+			if (!dic.ContainsKey (fullpath))
+				dic [fullpath] = item;
+		}
+	}
+
+	struct PrimaryReference {
+		public ITaskItem TaskItem;
+		public string ParentCopyLocal;
+
+		public PrimaryReference (ITaskItem item, string parent_copy_local)
+		{
+			TaskItem = item;
+			ParentCopyLocal = parent_copy_local;
+		}
+	}
+
 }
 
 #endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolvedReference.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolvedReference.cs
index 67ff1e2..1fa6214 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolvedReference.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ResolvedReference.cs
@@ -27,6 +27,8 @@
 
 #if NET_2_0
 
+using System;
+using System.Reflection;
 using Microsoft.Build.Framework;
 using Microsoft.Build.Utilities;
 
@@ -34,14 +36,57 @@ namespace Microsoft.Build.Tasks {
 	
 	class ResolvedReference {
 		public ITaskItem TaskItem;
+		public AssemblyName AssemblyName;
 		public SearchPath FoundInSearchPath;
 		public bool CopyLocal;
+		public bool IsPrimary; //default: true
 
-		public ResolvedReference (string filename, bool copy_local, SearchPath search_path)
+		string found_search_path_string;
+
+		public ResolvedReference (ITaskItem item, AssemblyName asm_name, bool copy_local, SearchPath search_path,
+				string original_item_spec)
 		{
-			this.TaskItem = new TaskItem (filename);
+			this.TaskItem = item;
+			AssemblyName = asm_name;
 			CopyLocal = copy_local;
-			this.FoundInSearchPath = search_path;
+			IsPrimary = true;
+			FoundInSearchPath = search_path;
+
+			TaskItem.SetMetadata ("OriginalItemSpec", original_item_spec);
+			TaskItem.SetMetadata ("ResolvedFrom", FoundInSearchPathToString ());
+		}
+
+		public string FoundInSearchPathAsString {
+			get {
+				if (found_search_path_string == null)
+					return FoundInSearchPathToString ();
+				else
+					return found_search_path_string;
+			}
+			set { found_search_path_string = value; }
+		}
+
+		string FoundInSearchPathToString ()
+		{
+			switch (FoundInSearchPath) {
+			case SearchPath.Gac:
+				return "{GAC}";
+			case SearchPath.TargetFrameworkDirectory:
+				return "{TargetFrameworkDirectory}";
+			case SearchPath.CandidateAssemblies:
+				return "{CandidateAssemblies}";
+			case SearchPath.HintPath:
+				return "{HintPathFromItem}";
+			case SearchPath.RawFileName:
+				return "{RawFileName}";
+			case SearchPath.Directory:
+				return TaskItem.ItemSpec;
+			case SearchPath.PkgConfig:
+				return "{PkgConfig}";
+			default:
+				throw new NotImplementedException (String.Format (
+						"Implement me for SearchPath: {0}", FoundInSearchPath));
+			}
 		}
 	}
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/TaskLoggingHelperExtension.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/TaskLoggingHelperExtension.cs
index 14e85e4..2d1da01 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/TaskLoggingHelperExtension.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/TaskLoggingHelperExtension.cs
@@ -35,7 +35,7 @@ using Microsoft.Build.Utilities;
 namespace Microsoft.Build.Tasks {
 	public class TaskLoggingHelperExtension : TaskLoggingHelper {
 		
-		public TaskLoggingHelperExtension ()
+		internal TaskLoggingHelperExtension ()
 			: base (null)
 		{
 		}
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ToolTaskExtension.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ToolTaskExtension.cs
index 7291291..1cfbb16 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ToolTaskExtension.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/ToolTaskExtension.cs
@@ -81,6 +81,10 @@ namespace Microsoft.Build.Tasks {
 				return defaultValue;
 		}
 
+		protected override bool HasLoggedErrors {
+			get { return Log.HasLoggedErrors; }
+		}
+
 		protected internal Hashtable Bag {
 			get {
 				if (bag == null)
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Touch.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Touch.cs
index 46f36ba..18f6ffa 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Touch.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Touch.cs
@@ -49,6 +49,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
+			if (files.Length == 0)
+				return true;
+
 			bool returnBoolean = false;
 			List <ITaskItem> successfulFiles = new List <ITaskItem> ();
 			Stream stream = null;
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Warning.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Warning.cs
index 74279dd..ebe1b2d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Warning.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Warning.cs
@@ -44,8 +44,9 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
-			if (text == null)
-				text = String.Empty;
+			if (String.IsNullOrEmpty (text))
+				return true;
+
 			Log.LogWarning (null, code, helpKeyword, BuildEngine.ProjectFileOfTaskNode,
 				BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
 				BuildEngine.LineNumberOfTaskNode, BuildEngine.ColumnNumberOfTaskNode,
@@ -70,4 +71,4 @@ namespace Microsoft.Build.Tasks {
 	}
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/WriteLinesToFile.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/WriteLinesToFile.cs
index adf6418..84c140a 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/WriteLinesToFile.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/WriteLinesToFile.cs
@@ -48,15 +48,11 @@ namespace Microsoft.Build.Tasks {
 
 		public override bool Execute ()
 		{
-			if (file == null)
-				throw new ArgumentNullException  ("file", "File TaskItem must be set.");
-			if (file.ItemSpec == String.Empty)
-				throw new ArgumentException ("File must be specified in ItemSpec.");
 			try {
 				streamWriter = new StreamWriter (file.GetMetadata ("FullPath"), !overwrite);
-				foreach (ITaskItem line in lines) {
-					streamWriter.WriteLine (line);
-				}
+				if (lines != null)
+					foreach (ITaskItem line in lines)
+						streamWriter.WriteLine (line);
 				return true;
 			}
 			catch (Exception ex) {
@@ -87,4 +83,4 @@ namespace Microsoft.Build.Tasks {
 	}
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
index 4f5e22b..ec52a76 100644
--- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
+++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
@@ -1,5 +1,6 @@
 Microsoft.Build.Tasks/ALTest.cs
 Microsoft.Build.Tasks/AssignCultureTest.cs
+Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
 Microsoft.Build.Tasks/AssignTargetPathTest.cs
 Microsoft.Build.Tasks/CombinePathTest.cs
 Microsoft.Build.Tasks/CopyTest.cs
@@ -11,11 +12,13 @@ Microsoft.Build.Tasks/CreatePropertyTest.cs
 Microsoft.Build.Tasks/CscTest.cs
 Microsoft.Build.Tasks/DeleteTest.cs
 Microsoft.Build.Tasks/ErrorTest.cs
+Microsoft.Build.Tasks/FindAppConfigFileTest.cs
 Microsoft.Build.Tasks/GetFrameworkPathTest.cs
 Microsoft.Build.Tasks/GetFrameworkSdkPathTest.cs
 Microsoft.Build.Tasks/MakeDirTest.cs
 Microsoft.Build.Tasks/ManagedCompilerTest.cs
 Microsoft.Build.Tasks/MessageTest.cs
+Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
 Microsoft.Build.Tasks/RemoveDirTest.cs
 Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
 Microsoft.Build.Tasks/TestEngine.cs
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
new file mode 100644
index 0000000..1458c99
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
@@ -0,0 +1,183 @@
+//
+// AssignProjectConfigurationTest.cs
+//
+// Author:
+//   Ankit Jain (jankit at novell.com)
+//
+// Copyright 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using Microsoft.Build.BuildEngine;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+using NUnit.Framework;
+using System.Text;
+
+namespace MonoTests.Microsoft.Build.Tasks
+{
+	[TestFixture]
+	public class AssignProjectConfigurationTest
+	{
+		[Test]
+		public void TestValidCase () {
+			string[] guids = new string[] {
+				"{88932AF5-A0AF-44F3-A202-5C88152F25CA}",
+				"{88932AF5-A0AF-44F3-A202-5C88152FABC1}",
+				"{3653C4D3-60C0-4657-8289-3922D0DFB933}",
+				"{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+				"{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+				"asd"
+			};
+
+			string[] project_ref_guids = new string[] {
+				"{88932AF5-A0AF-44F3-A202-5C88152F25CA}",
+				"{88932AF5-A0AF-44F3-A202-5C88152faBC1}",
+				"{3653C4D3-60C0-4657-8289-3922D0DFB933}",
+				"{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+				"{DAE34193-B5C7-4488-A911-29EE15C84CBE}"
+			};
+
+			CreateAndCheckProject (guids, project_ref_guids, new string[] {
+					"AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj: SetConfig: Configuration=Release",
+					"AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
+					"AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
+					"AssignedProjects : foo2.csproj: SetPlatform: Platform=AnyCPU2",
+					"AssignedProjects : foo3.csproj: SetPlatform: Platform=AnyCPU3",
+					"UnassignedProjects : foo4.csproj"},
+					true,
+					 "A1#");
+		}
+
+		[Test]
+		public void TestInvalidProjectGuid ()
+		{
+			string[] guids = new string[] {
+				"{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+			};
+
+			string[] project_ref_guids = new string[] {
+				"{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+				"{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+				"invalid guid"
+			};
+
+			CreateAndCheckProject (guids, project_ref_guids, null, false, "A1#");
+		}
+
+		[Test]
+		public void TestInvalidProjectGuidInSolutionConfigContents () {
+			string[] guids = new string[] {
+				"{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+				"invalid guid"
+			};
+
+			string[] project_ref_guids = new string[] {
+				"{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+				"{23F291D9-78DF-4133-8CF2-78CE104DDE63}"
+			};
+
+			CreateAndCheckProject (guids, project_ref_guids,
+				new string [] {
+					"AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
+					"AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU0",
+					"UnassignedProjects : foo0.csproj"
+				}, true, "A1#");
+		}
+
+
+		void CreateAndCheckProject (string[] guids, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
+		{
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			string projectString = CreateProject (guids, project_ref_guids);
+			project.LoadXml (projectString);
+
+			try {
+				Assert.AreEqual (build_result, project.Build (), "Build " + (build_result ? "failed" : "should've failed"));
+				testLogger.DumpMessages ();
+				if (!build_result || messages == null)
+					// build failed as expected, don't check outputs
+					return;
+				for (int i = 0; i < messages.Length; i++)
+					testLogger.CheckLoggedMessageHead (messages [i], prefix + i.ToString ());
+				Assert.AreEqual (0, testLogger.NormalMessageCount);
+			} catch (AssertionException) {
+				Console.WriteLine (projectString);
+				testLogger.DumpMessages ();
+				throw;
+			}
+		}
+
+		string CreateProject (string[] guids, string[] project_ref_guids)
+		{
+			StringBuilder sb = new StringBuilder ();
+			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">");
+			sb.Append ("\n<UsingTask TaskName=\"Microsoft.Build.Tasks.AssignProjectConfiguration\" AssemblyName=\"Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n");
+			sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, "Release|AnyCPU"));
+			sb.Append (CreateProjectReferencesItemGroup (project_ref_guids));
+
+			sb.Append ("\n\t<Target Name=\"1\">\n");
+			sb.Append ("\t\t<AssignProjectConfiguration ProjectReferences=\"@(ProjectReference)\" " +
+					" SolutionConfigurationContents=\"$(CurrentSolutionConfigurationContents)\">\n");
+			sb.Append ("\t\t\t<Output TaskParameter=\"AssignedProjects\" ItemName = \"AssignedProjects\" />\n");
+			sb.Append ("\t\t\t<Output TaskParameter=\"UnassignedProjects\" ItemName = \"UnassignedProjects\" />\n");
+			sb.Append ("\t\t</AssignProjectConfiguration>\n");
+			sb.Append ("<Message Text=\"AssignedProjects : @(AssignedProjects): SetConfig: %(AssignedProjects.SetConfiguration)\"/>\n");
+			sb.Append ("<Message Text=\"AssignedProjects : @(AssignedProjects): SetPlatform: %(AssignedProjects.SetPlatform)\"/>\n");
+			sb.Append ("<Message Text=\"UnassignedProjects : @(UnassignedProjects)\"/>\n");
+			sb.Append ("</Target>\n");
+			sb.Append ("</Project>");
+
+			return sb.ToString ();
+		}
+
+		string CreateSolutionConfigurationProperty (string[] guids, string config_str)
+		{
+			StringBuilder sb = new StringBuilder ();
+			sb.Append ("\n<CurrentSolutionConfigurationContents>\n");
+				sb.Append ("\t<foo xmlns=\"\">\n");
+				for (int i = 0; i < guids.Length; i++) {
+					sb.AppendFormat ("\t\t<bar Project=\"{0}\">{1}{2}</bar>\n",
+						guids[i], config_str, i);
+				}
+				sb.Append ("\t</foo>\n");
+
+			sb.Append ("</CurrentSolutionConfigurationContents>\n");
+			return sb.ToString ();
+		}
+
+		string CreateProjectReferencesItemGroup (string[] guids)
+		{
+			StringBuilder sb = new StringBuilder ();
+			sb.Append ("\n<ItemGroup>\n");
+			for (int i = 0; i < guids.Length; i ++)
+				sb.AppendFormat ("\t<ProjectReference Include=\"foo{1}.csproj\"><Project>{0}</Project></ProjectReference>\n", guids [i], i);
+			sb.Append ("</ItemGroup>\n");
+			return sb.ToString ();
+		}
+	}
+}
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
index 7519432..d0aae77 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
@@ -1,3 +1,45 @@
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* TestMessageLogger.cs (CheckLoggedAny): New.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* RemoveDuplicatesTest.cs: New.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* FindAppConfigFileTest.cs: New.
+
+2009-09-01  Ankit Jain  <jankit at novell.com>
+
+	* TaskBatchingTest.cs: Add new tests for metadata refs found
+	in places other than task attributes.
+
+2009-08-28  Ankit Jain  <jankit at novell.com>
+
+	* CopyTest.cs (TestCopy_EmptySources): New.
+	(TestCopy_EmptyDestFolder): New.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* CreateItemTest.cs (TestVariableExpansion): Update test to
+	use a transform with a item reference in a property.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* CreateItemTest.cs (TestVariableExpansion): New.
+	* CreatePropertyTest.cs (TestExecution2): New.
+
+2009-08-24  Ankit Jain  <jankit at novell.com>
+
+	* CreateCSharpManifestResourceNameTest.cs:
+	* CreateVisualBasicManifestResourceNameTest.cs: Add tests for
+	folder name with spaces in it.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* AssignProjectConfigurationTest.cs: New.
+
 2009-06-08  Ankit Jain  <jankit at novell.com>
 
 	* CreateCSharpManifestResourceNameTest.cs (TestInvalidCulture): New.
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs
index c871503..0ef0c66 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs
@@ -182,6 +182,68 @@ namespace MonoTests.Microsoft.Build.Tasks {
 			CheckCopyBuildItems (project, file_paths, target_path, "A2");
 		}
 
+		[Test]
+		public void TestCopy_EmptySources () {
+			Engine engine;
+			Project project;
+
+			string documentString = @"
+				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<Target Name='1'>
+						<Copy SourceFiles='@(NonExistantSourceFiles)' DestinationFolder='$(TargetPath)' SkipUnchangedFiles='true' >
+							<Output TaskParameter='CopiedFiles' ItemName='I0'/>
+							<Output TaskParameter='DestinationFiles' ItemName='I1'/>
+						</Copy>
+					</Target>
+				</Project>
+			";
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project.LoadXml (documentString);
+
+			
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+			testLogger.DumpMessages ();
+		}
+
+		[Test]
+		public void TestCopy_EmptyDestFolder () {
+			Engine engine;
+			Project project;
+
+			string documentString = @"
+				<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+					<ItemGroup>
+						<SFiles Include='foo.txt'><Md>1</Md></SFiles>
+					</ItemGroup>
+					<Target Name='1'>
+						<Copy SourceFiles='@(SFiles)' DestinationFolder='@(NonExistant)' DestinationFiles='@(NonExistant)' SkipUnchangedFiles='true' >
+							<Output TaskParameter='CopiedFiles' ItemName='I0'/>
+							<Output TaskParameter='DestinationFiles' ItemName='I1'/>
+						</Copy>
+					</Target>
+				</Project>
+			";
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project.LoadXml (documentString);
+			if (project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build should have failed");
+			}
+		}
+
 		void CheckCopyBuildItems (Project project, string [] source_files, string destination_folder, string prefix)
 		{
 			int num = source_files.Length;
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
index 8d968f6..1a6bf8c 100755
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateCSharpManifestResourceNameTest.cs
@@ -20,50 +20,50 @@ namespace MonoTests.Microsoft.Build.Tasks
 			string sample_cs_path = Path.Combine ("Test", Path.Combine ("resources", "Sample.cs"));
 			resx_no_culture_files = new string [,] {
 				// With dependent file
-				{ "foo.resx", null, sample_cs_path },
-				{ "foo.resx", "RandomName", sample_cs_path },
+				{ "foo with space.resx", null, sample_cs_path },
+				{ "foo with space.resx", "RandomName", sample_cs_path },
 
-				{ "Test/resources/foo.resx", null, "Sample.cs" },
-				{ "Test/resources/foo.resx", "RandomName", "Sample.cs" },
+				{ "Test/resources/foo with space.resx", null, "Sample.cs" },
+				{ "Test/resources/foo with space.resx", "RandomName", "Sample.cs" },
 
 				// W/o dependent file
-				{ "foo.resx", null, null },
-				{ "foo.resx", "RandomName", null },
+				{ "foo with space.resx", null, null },
+				{ "foo with space.resx", "RandomName", null },
 
-				{ "Test/resources/foo.resx", null, null },
-				{ "Test/resources/foo.resx", "RandomName", null },
+				{ "Test/resources folder/foo with space.resx", null, null },
+				{ "Test/resources folder/foo with space.resx", "RandomName", null },
 			};
 
 			resx_with_culture_files = new string [,] {
 				// With dependent file
-				{ "foo.de.resx", null, sample_cs_path },
-				{ "foo.de.resx", "RandomName", sample_cs_path },
+				{ "foo with space.de.resx", null, sample_cs_path },
+				{ "foo with space.de.resx", "RandomName", sample_cs_path },
 
-				{ "Test/resources/foo.de.resx", null, "Sample.cs" },
-				{ "Test/resources/foo.de.resx", "RandomName", "Sample.cs" },
+				{ "Test/resources/foo with space.de.resx", null, "Sample.cs" },
+				{ "Test/resources/foo with space.de.resx", "RandomName", "Sample.cs" },
 
 				// W/o dependent file
-				{ "foo.de.resx", null, null },
-				{ "foo.de.resx", "RandomName", null },
+				{ "foo with space.de.resx", null, null },
+				{ "foo with space.de.resx", "RandomName", null },
 
-				{ "Test/resources/foo.de.resx", null, null },
-				{ "Test/resources/foo.de.resx", "RandomName", null }
+				{ "Test/resources folder/foo with space.de.resx", null, null },
+				{ "Test/resources folder/foo with space.de.resx", "RandomName", null }
 			};
 
 			non_resx_no_culture_files = new string [,] {
-				{ "foo.txt", null, null },
-				{ "foo.txt", "RandomName", null },
+				{ "foo with space.txt", null, null },
+				{ "foo with space.txt", "RandomName", null },
 
-				{ "Test/resources/foo.txt", null, null },
-				{ "Test/resources/foo.txt", "RandomName", null }
+				{ "Test/resources folder/foo with space.txt", null, null },
+				{ "Test/resources folder/foo with space.txt", "RandomName", null }
 			};
 
 			non_resx_with_culture_files = new string [,] {
-				{ "foo.de.txt", null, null },
-				{ "foo.de.txt", "RandomName", null },
+				{ "foo with space.de.txt", null, null },
+				{ "foo with space.de.txt", "RandomName", null },
 
-				{ "Test/resources/foo.de.txt", null, null },
-				{ "Test/resources/foo.de.txt", "RandomName", null }
+				{ "Test/resources folder/foo with space.de.txt", null, null },
+				{ "Test/resources folder/foo with space.de.txt", "RandomName", null }
 			};
 
 		}
@@ -77,8 +77,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				"Mono.Tests.Sample", "Mono.Tests.Sample",
 
 				// W/o dependent file
-				"foo", "foo" ,
-				"Test.resources.foo", "Test.resources.foo"}, null);
+				"foo with space", "foo with space" ,
+				"Test.resources_folder.foo with space", "Test.resources_folder.foo with space"}, null);
 		}
 
 		[Test]
@@ -90,8 +90,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				"Mono.Tests.Sample", "Mono.Tests.Sample",
 				"Mono.Tests.Sample", "Mono.Tests.Sample",
 				// W/o dependent file
-				"RN1.RN2.foo", "RN1.RN2.foo",
-				"RN1.RN2.Test.resources.foo", "RN1.RN2.Test.resources.foo"},
+				"RN1.RN2.foo with space", "RN1.RN2.foo with space",
+				"RN1.RN2.Test.resources_folder.foo with space", "RN1.RN2.Test.resources_folder.foo with space"},
 				"RN1.RN2");
 		}
 
@@ -103,8 +103,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				// W/o dependent file
-				 "foo.de", "foo.de",
-				 "Test.resources.foo.de", "Test.resources.foo.de" }, null);
+				 "foo with space.de", "foo with space.de",
+				 "Test.resources_folder.foo with space.de", "Test.resources_folder.foo with space.de" }, null);
 		}
 
 		[Test]
@@ -115,8 +115,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				// W/o dependent file
-				 "RN1.RN2.foo.de", "RN1.RN2.foo.de",
-				 "RN1.RN2.Test.resources.foo.de", "RN1.RN2.Test.resources.foo.de"},
+				 "RN1.RN2.foo with space.de", "RN1.RN2.foo with space.de",
+				 "RN1.RN2.Test.resources_folder.foo with space.de", "RN1.RN2.Test.resources_folder.foo with space.de"},
 				 "RN1.RN2");
 		}
 
@@ -124,16 +124,16 @@ namespace MonoTests.Microsoft.Build.Tasks
 		public void TestNonResxNoRootNamespaceWithCulture ()
 		{
 			CheckResourceNames (non_resx_with_culture_files, new string [] {
-				Path.Combine ("de", "foo.txt"), Path.Combine ("de", "foo.txt"),
-				Path.Combine ("de", "Test.resources.foo.txt"), Path.Combine ("de", "Test.resources.foo.txt")}, null);
+				Path.Combine ("de", "foo with space.txt"), Path.Combine ("de", "foo with space.txt"),
+				Path.Combine ("de", "Test.resources_folder.foo with space.txt"), Path.Combine ("de", "Test.resources_folder.foo with space.txt")}, null);
 		}
 
 		[Test]
 		public void TestNonResxWithRootNamespaceWithCulture ()
 		{
 			CheckResourceNames (non_resx_with_culture_files, new string [] {
-				Path.Combine ("de", "RN1.RN2.foo.txt"), Path.Combine ("de", "RN1.RN2.foo.txt"),
-				Path.Combine ("de", "RN1.RN2.Test.resources.foo.txt"), Path.Combine ("de", "RN1.RN2.Test.resources.foo.txt")},
+				Path.Combine ("de", "RN1.RN2.foo with space.txt"), Path.Combine ("de", "RN1.RN2.foo with space.txt"),
+				Path.Combine ("de", "RN1.RN2.Test.resources_folder.foo with space.txt"), Path.Combine ("de", "RN1.RN2.Test.resources_folder.foo with space.txt")},
 				"RN1.RN2");
 		}
 
@@ -141,8 +141,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 		public void TestNonResxNoRootNamespaceNoCulture ()
 		{
 			CheckResourceNames (non_resx_no_culture_files, new string [] {
-				"foo.txt", "foo.txt",
-				"Test.resources.foo.txt", "Test.resources.foo.txt"}, null);
+				"foo with space.txt", "foo with space.txt",
+				"Test.resources_folder.foo with space.txt", "Test.resources_folder.foo with space.txt"}, null);
 		}
 
 		[Test]
@@ -150,8 +150,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 		{
 			CheckResourceNames (non_resx_no_culture_files, new string [] {
 				// With dependent file
-				"RN1.RN2.foo.txt", "RN1.RN2.foo.txt",
-				"RN1.RN2.Test.resources.foo.txt", "RN1.RN2.Test.resources.foo.txt"},
+				"RN1.RN2.foo with space.txt", "RN1.RN2.foo with space.txt",
+				"RN1.RN2.Test.resources_folder.foo with space.txt", "RN1.RN2.Test.resources_folder.foo with space.txt"},
 				"RN1.RN2");
 		}
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
index cd004a9..3113c6d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateItemTest.cs
@@ -187,6 +187,71 @@ namespace MonoTests.Microsoft.Build.Tasks {
 		    CheckBuildItem (include [2], "NewItem", additional_metadata, "5", "C");
 		}
 
+		[Test]
+		public void TestVariableExpansion ()
+		{
+		    Engine engine;
+		    Project project;
+
+			string documentString = @"
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<PropertyGroup>
+					<P1>FooP1</P1>
+					<P2>FooP2</P2>
+					<C>@(IG)</C>
+					<P3>@(Nine->'%(Identity)')</P3>
+				</PropertyGroup>
+				<ItemGroup>
+					<Nine Include=""Nine""/>
+					<Eight Include=""Eight""/>
+					<Seven Include=""@(Eight)""/>
+					<Six Include=""@(Seven);$(P3)""/>
+					<Third Include=""Abc""/>
+					<Fourth Include=""$(P2)""/>
+					<Second Include=""@(Third);$(P1);@(Fourth);@(Six)""/>
+					<IG Include=""@(Second)""/>
+				</ItemGroup>
+
+					<Target Name='1'>
+						<CreateItem Include='$(C)' >
+							<Output
+								TaskParameter='Include'
+								ItemName='Items'
+							/>
+						</CreateItem>
+
+						<Message Text=""C: $(C)""/>
+						<Message Text=""items: @(items)""/>
+					</Target>
+				</Project>
+			";
+
+			engine = new Engine (Consts.BinPath);
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			BuildItemGroup include = project.GetEvaluatedItemsByName ("Items");
+			Assert.AreEqual (5, include.Count, "A2");
+
+			Assert.AreEqual ("Abc", include [0].FinalItemSpec, "A#3");
+			Assert.AreEqual ("FooP1", include[1].FinalItemSpec, "A#4");
+			Assert.AreEqual ("FooP2", include[2].FinalItemSpec, "A#5");
+			Assert.AreEqual ("Eight", include[3].FinalItemSpec, "A#6");
+			Assert.AreEqual ("Nine", include[4].FinalItemSpec, "A#7");
+
+			testLogger.CheckLoggedMessageHead ("C: Abc;FooP1;FooP2;Eight;Nine", "A#9");
+			testLogger.CheckLoggedMessageHead ("items: Abc;FooP1;FooP2;Eight;Nine", "A#10");
+
+		}
+
 		public static void CheckBuildItem (BuildItem item, string name, string [,] metadata, string finalItemSpec, string prefix)
 		{
 			Assert.AreEqual (name, item.Name, prefix + "#1");
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreatePropertyTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreatePropertyTest.cs
index b584222..8b68c7d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreatePropertyTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreatePropertyTest.cs
@@ -86,5 +86,46 @@ namespace MonoTests.Microsoft.Build.Tasks {
 			Assert.AreEqual ("12", project.EvaluatedProperties ["ValueSetByTask"].Value, "A4");
 			Assert.AreEqual ("12", project.EvaluatedProperties ["ValueSetByTask"].FinalValue, "A5");
 		}
+
+		[Test]
+		public void TestExecution2 () {
+			Engine engine;
+			Project project;
+
+			string documentString = @"
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+				<ItemGroup>
+					<Second Include=""Abc""/>
+					<IG Include=""@(Second)""/></ItemGroup>
+					<PropertyGroup>
+						<C>@(IG)</C>
+					</PropertyGroup>
+					<Target Name='1'>
+						<CreateProperty Value='$(C)' >
+							<Output
+								TaskParameter='Value'
+								PropertyName='Value'
+							/>
+							<Output
+								TaskParameter='ValueSetByTask'
+								PropertyName='ValueSetByTask'
+							/>
+						</CreateProperty>
+					</Target>
+				</Project>
+			";
+
+			engine = new Engine (Consts.BinPath);
+			project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+			Assert.IsTrue (project.Build ("1"), "A1");
+
+			Assert.AreEqual ("Abc", project.EvaluatedProperties["Value"].Value, "A2");
+			Assert.AreEqual ("Abc", project.EvaluatedProperties["Value"].FinalValue, "A3");
+			Assert.AreEqual ("Abc", project.EvaluatedProperties["ValueSetByTask"].Value, "A4");
+			Assert.AreEqual ("Abc", project.EvaluatedProperties["ValueSetByTask"].FinalValue, "A5");
+			Assert.AreEqual ("@(IG)", project.EvaluatedProperties["C"].FinalValue, "A6");
+		}
+
 	}
 }
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
index d980e56..599ac94 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CreateVisualBasicManifestResourceNameTest.cs
@@ -20,50 +20,50 @@ namespace MonoTests.Microsoft.Build.Tasks
 			string sample_vb_path = Path.Combine ("Test", Path.Combine ("resources", "Sample.vb"));
 			resx_no_culture_files = new string [,] {
 				// With dependent file
-				{ "foo.resx", null, sample_vb_path },
-				{ "foo.resx", "RandomName", sample_vb_path },
+				{ "foo with space.resx", null, sample_vb_path },
+				{ "foo with space.resx", "RandomName", sample_vb_path },
 
-				{ "Test/resources/foo.resx", null, "Sample.vb" },
-				{ "Test/resources/foo.resx", "RandomName", "Sample.vb" },
+				{ "Test/resources/foo with space.resx", null, "Sample.vb" },
+				{ "Test/resources/foo with space.resx", "RandomName", "Sample.vb" },
 
 				// W/o dependent file
-				{ "foo.resx", null, null },
-				{ "foo.resx", "RandomName", null },
+				{ "foo with space.resx", null, null },
+				{ "foo with space.resx", "RandomName", null },
 
-				{ "Test/resources/foo.resx", null, null },
-				{ "Test/resources/foo.resx", "RandomName", null },
+				{ "Test/resources/foo with space.resx", null, null },
+				{ "Test/resources/foo with space.resx", "RandomName", null },
 			};
 
 			resx_with_culture_files = new string [,] {
 				// With dependent file
-				{ "foo.de.resx", null, sample_vb_path },
-				{ "foo.de.resx", "RandomName", sample_vb_path },
+				{ "foo with space.de.resx", null, sample_vb_path },
+				{ "foo with space.de.resx", "RandomName", sample_vb_path },
 
-				{ "Test/resources/foo.de.resx", null, "Sample.vb" },
-				{ "Test/resources/foo.de.resx", "RandomName", "Sample.vb" },
+				{ "Test/resources/foo with space.de.resx", null, "Sample.vb" },
+				{ "Test/resources/foo with space.de.resx", "RandomName", "Sample.vb" },
 
 				// W/o dependent file
-				{ "foo.de.resx", null, null },
-				{ "foo.de.resx", "RandomName", null },
+				{ "foo with space.de.resx", null, null },
+				{ "foo with space.de.resx", "RandomName", null },
 
-				{ "Test/resources/foo.de.resx", null, null },
-				{ "Test/resources/foo.de.resx", "RandomName", null }
+				{ "Test/resources folder/foo with space.de.resx", null, null },
+				{ "Test/resources folder/foo with space.de.resx", "RandomName", null }
 			};
 
 			non_resx_no_culture_files = new string [,] {
-				{ "foo.txt", null, null },
-				{ "foo.txt", "RandomName", null },
+				{ "foo with space.txt", null, null },
+				{ "foo with space.txt", "RandomName", null },
 
-				{ "Test/resources/foo.txt", null, null },
-				{ "Test/resources/foo.txt", "RandomName", null }
+				{ "Test/resources folder/foo with space.txt", null, null },
+				{ "Test/resources folder/foo with space.txt", "RandomName", null }
 			};
 
 			non_resx_with_culture_files = new string [,] {
-				{ "foo.de.txt", null, null },
-				{ "foo.de.txt", "RandomName", null },
+				{ "foo with space.de.txt", null, null },
+				{ "foo with space.de.txt", "RandomName", null },
 
-				{ "Test/resources/foo.de.txt", null, null },
-				{ "Test/resources/foo.de.txt", "RandomName", null }
+				{ "Test/resources folder/foo with space.de.txt", null, null },
+				{ "Test/resources folder/foo with space.de.txt", "RandomName", null }
 			};
 
 		}
@@ -77,8 +77,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				"Mono.Tests.Sample", "Mono.Tests.Sample",
 
 				// W/o dependent file
-				"foo", "foo" ,
-				"foo", "foo"}, null);
+				"foo with space", "foo with space" ,
+				"foo with space", "foo with space"}, null);
 		}
 
 		[Test]
@@ -90,8 +90,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				"RN1.RN2.Mono.Tests.Sample", "RN1.RN2.Mono.Tests.Sample",
 				"RN1.RN2.Mono.Tests.Sample", "RN1.RN2.Mono.Tests.Sample",
 				// W/o dependent file
-				"RN1.RN2.foo", "RN1.RN2.foo",
-				"RN1.RN2.foo", "RN1.RN2.foo"},
+				"RN1.RN2.foo with space", "RN1.RN2.foo with space",
+				"RN1.RN2.foo with space", "RN1.RN2.foo with space"},
 				"RN1.RN2");
 		}
 
@@ -103,8 +103,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				 "Mono.Tests.Sample.de", "Mono.Tests.Sample.de",
 				// W/o dependent file
-				 "foo.de", "foo.de",
-				 "foo.de", "foo.de" }, null);
+				 "foo with space.de", "foo with space.de",
+				 "foo with space.de", "foo with space.de" }, null);
 		}
 
 		[Test]
@@ -115,8 +115,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 				 "RN1.RN2.Mono.Tests.Sample.de", "RN1.RN2.Mono.Tests.Sample.de",
 				 "RN1.RN2.Mono.Tests.Sample.de", "RN1.RN2.Mono.Tests.Sample.de",
 				// W/o dependent file
-				 "RN1.RN2.foo.de", "RN1.RN2.foo.de",
-				 "RN1.RN2.foo.de", "RN1.RN2.foo.de"},
+				 "RN1.RN2.foo with space.de", "RN1.RN2.foo with space.de",
+				 "RN1.RN2.foo with space.de", "RN1.RN2.foo with space.de"},
 				 "RN1.RN2");
 		}
 
@@ -124,16 +124,16 @@ namespace MonoTests.Microsoft.Build.Tasks
 		public void TestNonResxNoRootNamespaceWithCulture ()
 		{
 			CheckResourceNames (non_resx_with_culture_files, new string [] {
-				Path.Combine ("de", "foo.txt"), Path.Combine ("de", "foo.txt"),
-				Path.Combine ("de", "foo.txt"), Path.Combine ("de", "foo.txt")}, null);
+				Path.Combine ("de", "foo with space.txt"), Path.Combine ("de", "foo with space.txt"),
+				Path.Combine ("de", "foo with space.txt"), Path.Combine ("de", "foo with space.txt")}, null);
 		}
 
 		[Test]
 		public void TestNonResxWithRootNamespaceWithCulture ()
 		{
 			CheckResourceNames (non_resx_with_culture_files, new string [] {
-				Path.Combine ("de", "RN1.RN2.foo.txt"), Path.Combine ("de", "RN1.RN2.foo.txt"),
-				Path.Combine ("de", "RN1.RN2.foo.txt"), Path.Combine ("de", "RN1.RN2.foo.txt")},
+				Path.Combine ("de", "RN1.RN2.foo with space.txt"), Path.Combine ("de", "RN1.RN2.foo with space.txt"),
+				Path.Combine ("de", "RN1.RN2.foo with space.txt"), Path.Combine ("de", "RN1.RN2.foo with space.txt")},
 				"RN1.RN2");
 		}
 
@@ -141,8 +141,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 		public void TestNonResxNoRootNamespaceNoCulture ()
 		{
 			CheckResourceNames (non_resx_no_culture_files, new string [] {
-				"foo.txt", "foo.txt",
-				"foo.txt", "foo.txt"}, null);
+				"foo with space.txt", "foo with space.txt",
+				"foo with space.txt", "foo with space.txt"}, null);
 		}
 
 		[Test]
@@ -150,8 +150,8 @@ namespace MonoTests.Microsoft.Build.Tasks
 		{
 			CheckResourceNames (non_resx_no_culture_files, new string [] {
 				// With dependent file
-				"RN1.RN2.foo.txt", "RN1.RN2.foo.txt",
-				"RN1.RN2.foo.txt", "RN1.RN2.foo.txt"},
+				"RN1.RN2.foo with space.txt", "RN1.RN2.foo with space.txt",
+				"RN1.RN2.foo with space.txt", "RN1.RN2.foo with space.txt"},
 				"RN1.RN2");
 		}
 
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs
new file mode 100644
index 0000000..d6b9d0a
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/FindAppConfigFileTest.cs
@@ -0,0 +1,127 @@
+//
+// FindAppConfigFileTest.cs
+//
+// Author:
+//   Ankit Jain (jankit at novell.com)
+//
+// Copyright 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using Microsoft.Build.BuildEngine;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+using NUnit.Framework;
+using System.Text;
+
+namespace MonoTests.Microsoft.Build.Tasks {
+
+	[TestFixture]
+	public class FindAppConfigFileTest {
+
+		[Test]
+		public void TestExecution1 ()
+		{
+			CheckOutput (new string [] {"app.config"}, new string [] {"app.config"}, "AppConfigWithTargetPath: app.config List1 Foo.exe.config");
+		}
+
+		[Test]
+		public void TestExecution2 ()
+		{
+			CheckOutput (new string [] {"foobar"}, new string [] {"app.config"}, "AppConfigWithTargetPath: app.config List2 Foo.exe.config");
+		}
+
+		[Test]
+		public void TestExecution3 ()
+		{
+			CheckOutput (new string [] {"foo\\app.config"}, new string [] {"app.config"}, "AppConfigWithTargetPath: app.config List2 Foo.exe.config");
+		}
+
+		[Category ("NotWorking")]
+		[Test]
+		public void TestExecution4 ()
+		{
+			CheckOutput (new string[] { "foo\\app.config" }, new string[] { "bar\\app.config" }, "AppConfigWithTargetPath: foo\\app.config List1 Foo.exe.config");
+		}
+
+		[Category ("NotWorking")]
+		[Test]
+		public void TestExecution5 ()
+		{
+			CheckOutput (new string[] { "foobar" }, new string[] { "bar\\app.config" }, "AppConfigWithTargetPath: bar\\app.config List2 Foo.exe.config");
+		}
+
+		[Test]
+		public void TestExecution6 ()
+		{
+			CheckOutput (new string[] { "foobar" }, new string[] { "bar\\foo.config" }, "AppConfigWithTargetPath:   ");
+		}
+
+		[Test]
+		public void TestExecution7 () {
+			CheckOutput (new string[] { ".\\app.config" }, new string[] { "app.config" }, "AppConfigWithTargetPath: app.config List2 Foo.exe.config");
+		}
+
+		void CheckOutput (string[] primary_list, string[] secondary_list, string expected) {
+			StringBuilder sb = new StringBuilder ();
+
+			sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">");
+			sb.Append ("\t<ItemGroup>");
+			if (primary_list != null)
+				foreach (string s in primary_list)
+					sb.AppendFormat ("\t\t<List1 Include=\"{0}\"><Source>List1</Source></List1>", s);
+
+			if (secondary_list != null)
+				foreach (string s in secondary_list)
+					sb.AppendFormat ("\t\t<List2 Include=\"{0}\"><Source>List2</Source></List2>", s);
+			sb.Append ("\t</ItemGroup>");
+
+			sb.Append (@"
+					<Target Name='1'>
+						<FindAppConfigFile PrimaryList=""@(List1)"" SecondaryList=""@(List2)"" TargetPath=""Foo.exe.config"">
+							<Output TaskParameter=""AppConfigFile"" ItemName=""AppConfigWithTargetPath""/>
+						</FindAppConfigFile>
+
+						<Message Text=""AppConfigWithTargetPath: %(AppConfigWithTargetPath.Identity) %(AppConfigWithTargetPath.Source) %(AppConfigWithTargetPath.TargetPath)""/>
+					</Target>
+				</Project>");
+
+			string projectXml = sb.ToString ();
+			Engine engine = new Engine (Consts.BinPath);
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			Project project = engine.CreateNewProject ();
+			project.LoadXml (projectXml);
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+			testLogger.DumpMessages ();
+
+			Assert.AreEqual (1, testLogger.NormalMessageCount, "Expected number of messages");
+			testLogger.CheckLoggedMessageHead (expected, "A1");
+		}
+	}
+}	
+
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
new file mode 100644
index 0000000..b4c17a8
--- /dev/null
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/RemoveDuplicatesTest.cs
@@ -0,0 +1,104 @@
+//
+// RemoveDuplicatesTest.cs
+//
+// Author:
+//   Ankit Jain (jankit at novell.com)
+//
+// Copyright 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+
+using Microsoft.Build.BuildEngine;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+
+namespace MonoTests.Microsoft.Build.Tasks
+{
+	[TestFixture]
+	public class RemoveDuplicatesTest
+	{
+		[Test]
+		public void Test1 ()
+		{
+			string documentString = @"
+                                <Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion='3.5'>
+				
+				<ItemGroup>
+					<Items Include='A'>
+						<MD>Value1</MD>
+					</Items>
+					<Items Include='A'>
+						<MD>Value1</MD>
+					</Items>
+
+					<Items Include='A'>
+						<MD>Value2</MD>
+						<MD2>Value2</MD2>
+					</Items>
+
+					<Items Include='B'>
+						<MD>Value1</MD>
+					</Items>
+					<Items Include='B'>
+						<MD>Value1</MD>
+					</Items>
+					<Items Include='C'>
+						<MD>Value1</MD>
+					</Items>
+					<Items Include='A'>
+						<MD>Value3</MD>
+						<MD3>Value3</MD3>
+					</Items>
+				</ItemGroup>
+
+					<Target Name='Main'>
+						<RemoveDuplicates Inputs='@(Items)'>
+							<Output TaskParameter='Filtered' ItemName='Filtered'/>
+						</RemoveDuplicates>
+						<Message Text=""Filtered items: %(Filtered.Identity) MD: %(Filtered.MD) MD2: %(Filtered.MD2) MD3: %(Filtered.MD3)""/>
+					</Target>
+				</Project>
+			";
+
+			Engine engine = new Engine (Consts.BinPath);
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			Project project = engine.CreateNewProject ();
+			project.LoadXml (documentString);
+			if (!project.Build ("Main")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			testLogger.CheckLoggedMessageHead ("Filtered items: A MD: Value1 MD2:  MD3: ", "A1");
+			testLogger.CheckLoggedMessageHead ("Filtered items: B MD: Value1 MD2:  MD3: ", "A2");
+			testLogger.CheckLoggedMessageHead ("Filtered items: C MD: Value1 MD2:  MD3: ", "A3");
+			Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found");
+		}
+	}
+}
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
index fa1b481..eb8145d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TaskBatchingTest.cs
@@ -507,6 +507,110 @@ namespace MonoTests.Microsoft.Build.Tasks
 			CheckEngineEventCounts (testLogger, 1, 1, 2, 2);
 		}
 
+		[Test]
+		// test for metadata refs in properties or items
+		public void TestNoBatching () {
+			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+	<ItemGroup>
+		<item3 Include=""foo""/>
+		<item2 Include=""%(item3.Identity)""/>
+		<item0 Include=""@(item3)""/>
+	</ItemGroup>
+	<PropertyGroup>
+		<Prop1>%(item0.Identity)</Prop1>
+	</PropertyGroup>
+	<Target Name='1'>
+		<Message Text=""Prop1: $(Prop1)""/>
+		<Message Text=""Item2: @(item2)""/>
+	</Target>
+</Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project.LoadXml (projectString);
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			testLogger.CheckLoggedMessageHead ("Prop1: %(item0.Identity)", "A1");
+			testLogger.CheckLoggedMessageHead ("Item2: %(item3.Identity)", "A2");
+			Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
+		[Test]
+		// test for metadata refs via metadata refs
+		// batching should happen only on basis of the task attributes,
+		// and not the resolved expression values
+		public void TestBatching1 () {
+			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+	<ItemGroup>
+		<item3 Include=""foo""/>
+		<item2 Include=""%(item3.Identity)""/>
+
+		<item4 Include=""%(item2.Identity);@(item3);@(nonexistant)""/>
+		<item4 Include=""bar""/>
+	</ItemGroup>
+	<Target Name='1'>
+		<Message Text=""Item4: %(item4.Identity)""/>
+	</Target>
+</Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project.LoadXml (projectString);
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			testLogger.CheckLoggedMessageHead ("Item4: %(item2.Identity)", "A1");
+			testLogger.CheckLoggedMessageHead ("Item4: foo", "A2");
+			testLogger.CheckLoggedMessageHead ("Item4: bar", "A3");
+			Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
+		[Test]
+		// test for metadata refs via metadata refs
+		// batching should happen only on basis of the task attributes,
+		// and not the resolved expression values
+		public void TestConditionalBatching2 () {
+			string projectString = @"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"" ToolsVersion=""3.5"">
+	<ItemGroup>
+		<item2 Include=""%(item3.Identity)""/>
+		<item4 Include=""%(item2.Identity);@(item3)""/>
+	</ItemGroup>
+	<Target Name='1'>
+		<Message Text=""Item3: %(item2.Identity)"" Condition="" '%(item5.Identity)' == '' ""/>
+		<Message Text=""Item4: %(item4.Identity)""/>
+	</Target>
+</Project>";
+
+			Engine engine = new Engine (Consts.BinPath);
+			Project project = engine.CreateNewProject ();
+
+			TestMessageLogger testLogger = new TestMessageLogger ();
+			engine.RegisterLogger (testLogger);
+
+			project.LoadXml (projectString);
+			if (!project.Build ("1")) {
+				testLogger.DumpMessages ();
+				Assert.Fail ("Build failed");
+			}
+
+			testLogger.CheckLoggedMessageHead ("Item3: %(item3.Identity)", "A1");
+			testLogger.CheckLoggedMessageHead ("Item4: %(item2.Identity)", "A2");
+			Assert.AreEqual (0, testLogger.NormalMessageCount, "Unexpected extra messages found");
+		}
+
 		//Target batching
 
 		[Test]
diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs
index 29390e2..e05673d 100644
--- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs
+++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/TestMessageLogger.cs
@@ -192,6 +192,13 @@ namespace MonoTests.Microsoft.Build.Tasks
 				Assert.AreEqual (expected, actual, id);
 		}
 
+		public void CheckLoggedAny (string expected, MessageImportance importance, string id)
+		{
+			int res = CheckAny (expected, importance);
+			if (res != 0)
+				Assert.Fail ("{0}: Expected message '{1}' was not emitted.", id, expected);
+		}
+
 
 	}
 
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/AppDomainIsolatedTask.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/AppDomainIsolatedTask.cs
index f2d8a68..9999296 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/AppDomainIsolatedTask.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/AppDomainIsolatedTask.cs
@@ -73,6 +73,7 @@ namespace Microsoft.Build.Utilities
 			}
 			set {
 				buildEngine = value;
+				log = new TaskLoggingHelper (this);
 			}
 		}
 
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
index aa83579..aaff999 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ChangeLog
@@ -1,3 +1,74 @@
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* TaskLoggingHelper.cs: Use the buildEngine.ProjectFileOfTaskNode
+	in the event args.
+
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (ExecuteTool): Don't set toolOutput to null.
+	(HandleTaskExecutionErrors): toolOutput can be null.
+	Set toolOutput to null here.
+
+2009-10-06  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (Execute): HandleTaskExecutionErrors is called only
+	if exitCode != 0.
+	(ExecuteTool): Move logging of exitcode to HandleTaskExecutionErrors.
+	Remove MonoTODOs.
+	* TaskLoggingHelper.cs (LogMessageFromText): New.
+	(LogMessage): Refactor to use above.
+
+2009-10-02  Ankit Jain  <jankit at novell.com>
+
+	* AppDomainIsolatedTask.cs (BuildEngine): Init 'log'.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (ExecuteTool): Use LogToolCommand, instead of
+	directly logging.
+	(LogToolCommand): Implement.
+
+2009-09-28  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (ProcessOuputTool): Move logging of tool
+	output from here to ..
+	(ExecuteTool): .. here. As, ProcessOuputTool can be
+	overridden.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (HasLoggedErrors): Add missing property.
+
+2009-09-23  Ankit Jain  <jankit at novell.com>
+
+	* TaskLoggingHelper.cs (LogErrorFromException): Add missing overload.
+
+2009-09-10  Ankit Jain  <jankit at novell.com>
+
+	* TaskLoggingHelper.cs (FormatString): Use the unformatted string
+	even if the args array was empty.
+
+2009-09-08  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask.cs (LogEventsFromTextOutput): Log message even if its not
+	identified as an error or a warning.
+
+2009-07-28  Ankit Jain  <jankit at novell.com>
+
+	* ToolTask (.ctor): Initialize Timeout value.
+	(Execute): Use HandleTaskExecutionErrors to determine task result. Set
+	exitCode to the result of ExecuteTool and let HandleTaskExecutionErrors
+	determine final result of the task.
+	(RealExecute): Rename to ..
+	(ExecuteTool): .. this. @responseFileCommands could be empty.
+	Use specified timeout value for the executing tool.
+	Rename 'compilerOutput' to 'toolOutput'. Cleanup resources in the
+	finally block. Move processing of stdout/stderr output to ..
+	(ProcessOutputFile): .. here and ..
+	(LogEventsFromTextOutput): .. here.
+	(HandleTaskExecutionErrors): Implement.
+	(DeleteTempFile): Implement.
+
 2009-04-24  Ankit Jain  <jankit at novell.com>
 
 	* ToolTask.cs (RealExecute): Handle TypeLoadExceptions, compiler
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
index c65967b..82b9608 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/TaskLoggingHelper.cs
@@ -77,7 +77,7 @@ namespace Microsoft.Build.Utilities
 			if (unformatted == null)
 				throw new ArgumentNullException ("unformatted");
 		
-			if (args == null)
+			if (args == null || args.Length == 0)
 				return unformatted;
 			else
 				return String.Format (unformatted, args);
@@ -101,7 +101,7 @@ namespace Microsoft.Build.Utilities
 				throw new ArgumentNullException ("message");
 				
 			BuildErrorEventArgs beea = new BuildErrorEventArgs (
-				null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
+				null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, FormatString (message, messageArgs),
 				helpKeywordPrefix, null);
 			buildEngine.LogErrorEvent (beea);
 			hasLoggedErrors = true;
@@ -134,6 +134,13 @@ namespace Microsoft.Build.Utilities
 		public void LogErrorFromException (Exception e,
 						   bool showStackTrace)
 		{
+			LogErrorFromException (e, showStackTrace, true, String.Empty);
+		}
+
+		[MonoTODO ("Arguments @showDetail and @file are not honored")]
+		public void LogErrorFromException (Exception e,
+						   bool showStackTrace, bool showDetail, string file)
+		{
 			if (e == null)
 				throw new ArgumentNullException ("e");
 		
@@ -142,7 +149,7 @@ namespace Microsoft.Build.Utilities
 			if (showStackTrace == true)
 				sb.Append (e.StackTrace);
 			BuildErrorEventArgs beea = new BuildErrorEventArgs (
-				null, null, null, 0, 0, 0, 0, sb.ToString (),
+				null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, sb.ToString (),
 				e.HelpLink, e.Source);
 			buildEngine.LogErrorEvent (beea);
 			hasLoggedErrors = true;
@@ -213,10 +220,7 @@ namespace Microsoft.Build.Utilities
 			if (message == null)
 				throw new ArgumentNullException ("message");
 		
-			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
-				FormatString (message, messageArgs), helpKeywordPrefix,
-				null, importance);
-			buildEngine.LogMessageEvent (bmea);
+			LogMessageFromText (FormatString (message, messageArgs), importance);
 		}
 
 		public void LogMessageFromResources (string messageResourceName,
@@ -269,13 +273,18 @@ namespace Microsoft.Build.Utilities
 				stream.Close ();
 			}
 		}
-		
-		[MonoTODO]
+
 		public bool LogMessageFromText (string lineOfText,
 						MessageImportance importance)
 		{
 			if (lineOfText == null)
 				throw new ArgumentNullException ("lineOfText");
+
+			BuildMessageEventArgs bmea = new BuildMessageEventArgs (
+				lineOfText, helpKeywordPrefix,
+				null, importance);
+			buildEngine.LogMessageEvent (bmea);
+
 			return true;
 		}
 
@@ -284,7 +293,7 @@ namespace Microsoft.Build.Utilities
 		{
 			// FIXME: what about all the parameters?
 			BuildWarningEventArgs bwea = new BuildWarningEventArgs (
-				null, null, null, 0, 0, 0, 0, FormatString (message, messageArgs),
+				null, null, buildEngine.ProjectFileOfTaskNode, 0, 0, 0, 0, FormatString (message, messageArgs),
 				helpKeywordPrefix, null);
 			buildEngine.LogWarningEvent (bwea);
 		}
diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
index 032b76b..318ac83 100644
--- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities/ToolTask.cs
@@ -3,8 +3,10 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Ankit Jain (jankit at novell.com)
 //
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -50,7 +52,9 @@ namespace Microsoft.Build.Utilities
 		Encoding		responseFileEncoding;
 		MessageImportance	standardErrorLoggingImportance;
 		MessageImportance	standardOutputLoggingImportance;
-		
+		StringBuilder toolOutput;
+		bool typeLoadException;
+
 		static Regex		regex;
 		
 		protected ToolTask ()
@@ -72,6 +76,7 @@ namespace Microsoft.Build.Utilities
 			this.HelpKeywordPrefix = helpKeywordPrefix;
 			this.toolPath = MonoLocationHelper.GetBinDir ();
 			this.responseFileEncoding = Encoding.UTF8;
+			this.timeout = Int32.MaxValue;
 		}
 
 		static ToolTask ()
@@ -93,24 +98,16 @@ namespace Microsoft.Build.Utilities
 			return true;
 		}
 
-		[MonoTODO]
-		// FIXME: it should write responseFileCommands to temporary response file
-		protected virtual int ExecuteTool (string pathToTool,
-						   string responseFileCommands,
-						   string commandLineCommands)
-		{
-			return RealExecute (pathToTool, responseFileCommands, commandLineCommands) ? 0 : -1;
-		}
-		
 		public override bool Execute ()
 		{
 			if (SkipTaskExecution ())
 				return true;
 
-			int result = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
+			exitCode = ExecuteTool (GenerateFullPathToTool (), GenerateResponseFileCommands (),
 				GenerateCommandLineCommands ());
-			
-			return result == 0;
+
+			// HandleTaskExecutionErrors is called only if exitCode != 0
+			return exitCode == 0 || HandleTaskExecutionErrors ();
 		}
 		
 		[MonoTODO]
@@ -119,98 +116,114 @@ namespace Microsoft.Build.Utilities
 			return null;
 		}
 		
-		private bool RealExecute (string pathToTool,
-					   string responseFileCommands,
-					   string commandLineCommands)
+		protected virtual int ExecuteTool (string pathToTool,
+						   string responseFileCommands,
+						   string commandLineCommands)
 
 		{
 			if (pathToTool == null)
 				throw new ArgumentNullException ("pathToTool");
 
-			if (!File.Exists (pathToTool)) {
-				Log.LogError ("Unable to find tool {0} at '{1}'", ToolName, pathToTool);
-				return false;
-			}
-
-			string responseFileName = Path.GetTempFileName ();
-			File.WriteAllText (responseFileName, responseFileCommands);
+			string output, error, responseFileName;
+			StreamWriter outwr, errwr;
 
-			string arguments = String.Concat (commandLineCommands, " ", GetResponseFileSwitch (responseFileName));
+			outwr = errwr = null;
+			responseFileName = output = error = null;
+			toolOutput = new StringBuilder ();
 
-			Log.LogMessage (MessageImportance.Normal, String.Format ("Tool {0} execution started with arguments: {1} {2}",
-				pathToTool, commandLineCommands, responseFileCommands));
+			try {
+				string arguments = commandLineCommands;
+				if (!String.IsNullOrEmpty (responseFileCommands)) {
+					responseFileName = Path.GetTempFileName ();
+					File.WriteAllText (responseFileName, responseFileCommands);
+					arguments = arguments + " " + GetResponseFileSwitch (responseFileName);
+				}
 
-			string output = Path.GetTempFileName ();
-			string error = Path.GetTempFileName ();
-			StreamWriter outwr = new StreamWriter (output);
-			StreamWriter errwr = new StreamWriter (error);
+				LogToolCommand (String.Format ("Tool {0} execution started with arguments: {1} {2}",
+						pathToTool, commandLineCommands, responseFileCommands));
+
+				output = Path.GetTempFileName ();
+				error = Path.GetTempFileName ();
+				outwr = new StreamWriter (output);
+				errwr = new StreamWriter (error);
+
+				ProcessStartInfo pinfo = new ProcessStartInfo (pathToTool, arguments);
+				pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
+
+				pinfo.UseShellExecute = false;
+				pinfo.RedirectStandardOutput = true;
+				pinfo.RedirectStandardError = true;
+
+				try {
+					ProcessWrapper pw = ProcessService.StartProcess (pinfo, outwr, errwr, null, environmentOverride);
+					pw.WaitForOutput (timeout == Int32.MaxValue ? -1 : timeout);
+					exitCode = pw.ExitCode;
+					outwr.Close();
+					errwr.Close();
+					pw.Dispose ();
+				} catch (System.ComponentModel.Win32Exception e) {
+					Log.LogError ("Error executing tool '{0}': {1}", pathToTool, e.Message);
+					return -1;
+				}
 
-			ProcessStartInfo pinfo = new ProcessStartInfo (pathToTool, arguments);
-			pinfo.WorkingDirectory = GetWorkingDirectory () ?? Environment.CurrentDirectory;
+				ProcessOutputFile (output, standardOutputLoggingImportance);
+				ProcessOutputFile (error, standardErrorLoggingImportance);
 
-			pinfo.UseShellExecute = false;
-			pinfo.RedirectStandardOutput = true;
-			pinfo.RedirectStandardError = true;
+				Log.LogMessage (MessageImportance.Low, "Tool {0} execution finished.", pathToTool);
+				return exitCode;
+			} finally {
+				DeleteTempFile (responseFileName);
+				if (outwr != null)
+					outwr.Dispose ();
+				if (errwr != null)
+					errwr.Dispose ();
 
-			try {
-				ProcessWrapper pw = ProcessService.StartProcess (pinfo, outwr, errwr, null, environmentOverride);
-				pw.WaitForOutput();
-				exitCode = pw.ExitCode;
-				outwr.Close();
-				errwr.Close();
-				pw.Dispose ();
-			} catch (System.ComponentModel.Win32Exception e) {
-				Log.LogError ("Error executing tool '{0}': {1}", pathToTool, e.Message);
-				return false;
+				DeleteTempFile (output);
+				DeleteTempFile (error);
 			}
+		}
 
-			bool typeLoadException = false;
-			StringBuilder compilerOutput = new StringBuilder ();
-			foreach (string s in new string[] { output, error }) {
-				using (StreamReader sr = File.OpenText (s)) {
-					string line;
-					while ((line = sr.ReadLine ()) != null) {
-						if (typeLoadException) {
-							compilerOutput.Append (sr.ReadToEnd ());
-							break;
-						}
-
-						compilerOutput.AppendLine (line);
-
-						line = line.Trim ();
-						if (line.Length == 0)
-							continue;
-
-						if (line.StartsWith ("Unhandled Exception: System.TypeLoadException") ||
-						    line.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException")) {
-							typeLoadException = true;
-						}
-						LogEventsFromTextOutput (line, MessageImportance.Low);
+		void ProcessOutputFile (string filename, MessageImportance importance)
+		{
+			using (StreamReader sr = File.OpenText (filename)) {
+				string line;
+				while ((line = sr.ReadLine ()) != null) {
+					if (typeLoadException) {
+						toolOutput.Append (sr.ReadToEnd ());
+						string output_str = toolOutput.ToString ();
+						Regex reg  = new Regex (@".*WARNING.*used in (mscorlib|System),.*",
+								RegexOptions.Multiline);
+
+						if (reg.Match (output_str).Success)
+							Log.LogError (
+								"Error: A referenced assembly may be built with an incompatible " + 
+								"CLR version. See the compilation output for more details.");
+						else
+							Log.LogError (
+								"Error: A dependency of a referenced assembly may be missing, or " +
+								"you may be referencing an assembly created with a newer CLR " +
+								"version. See the compilation output for more details.");
+
+						Log.LogError (output_str);
 					}
-				}
-				if (typeLoadException) {
-					string output_str = compilerOutput.ToString ();
-					Regex reg  = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
-					if (reg.Match (output_str).Success)
-						Log.LogError ("Error: A referenced assembly may be built with an incompatible CLR version. See the compilation output for more details.");
-					else
-						Log.LogError ("Error: A dependency of a referenced assembly may be missing, or you may be referencing an assembly created with a newer CLR version. See the compilation output for more details.");
-					Log.LogError (output_str);
+
+					toolOutput.AppendLine (line);
+					LogEventsFromTextOutput (line, importance);
 				}
 			}
-
-			if (!Log.HasLoggedErrors && exitCode != 0)
-				Log.LogError ("Compiler crashed: " + compilerOutput.ToString ());
-			
-			Log.LogMessage (MessageImportance.Low, String.Format ("Tool {0} execution finished.", pathToTool));
-			
-			return !Log.HasLoggedErrors;
 		}
-		
-		
-		[MonoTODO]
+
 		protected virtual void LogEventsFromTextOutput (string singleLine, MessageImportance importance)
 		{
+			singleLine = singleLine.Trim ();
+			if (singleLine.Length == 0)
+				return;
+
+			if (singleLine.StartsWith ("Unhandled Exception: System.TypeLoadException") ||
+			    singleLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException")) {
+				typeLoadException = true;
+			}
+
 			// When IncludeDebugInformation is true, prevents the debug symbols stats from braeking this.
 			if (singleLine.StartsWith ("WROTE SYMFILE") ||
 				singleLine.StartsWith ("OffsetTable") ||
@@ -236,6 +249,8 @@ namespace Microsoft.Build.Utilities
 			} else if (category == "error") {
 				Log.LogError (subcategory, code, null, filename, lineNumber, columnNumber, endLineNumber,
 					endColumnNumber, text, null);
+			} else {
+				Log.LogMessage (singleLine);
 			}
 		}
 		
@@ -307,16 +322,19 @@ namespace Microsoft.Build.Utilities
 			return null;
 		}
 
-		[MonoTODO]
 		protected virtual string GetResponseFileSwitch (string responseFilePath)
 		{
 			return String.Format ("@{0}", responseFilePath);
 		}
 
-		[MonoTODO]
 		protected virtual bool HandleTaskExecutionErrors ()
 		{
-			return true;
+			if (!Log.HasLoggedErrors && exitCode != 0)
+				Log.LogError ("Tool exited with code: {0}. Output: {1}", exitCode,
+						toolOutput != null ? toolOutput.ToString () : String.Empty);
+			toolOutput = null;
+
+			return ExitCode == 0 && !Log.HasLoggedErrors;
 		}
 
 		protected virtual HostObjectInitializationStatus InitializeHostObject ()
@@ -327,6 +345,7 @@ namespace Microsoft.Build.Utilities
 		[MonoTODO]
 		protected virtual void LogToolCommand (string message)
 		{
+			Log.LogMessage (MessageImportance.Normal, message);
 		}
 		
 		[MonoTODO]
@@ -345,12 +364,25 @@ namespace Microsoft.Build.Utilities
 			return true;
 		}
 
+		protected void DeleteTempFile (string fileName)
+		{
+			if (String.IsNullOrEmpty (fileName))
+				return;
+
+			try {
+				File.Delete (fileName);
+			} catch (IOException ioe) {
+				Log.LogWarning ("Unable to delete temporary file '{0}' : {1}", ioe.Message);
+			} catch (UnauthorizedAccessException uae) {
+				Log.LogWarning ("Unable to delete temporary file '{0}' : {1}", uae.Message);
+			}
+		}
+
 		protected virtual StringDictionary EnvironmentOverride
 		{
 			get { return environmentOverride; }
 		}
 		
-		[MonoTODO]
 		[Output]
 		public int ExitCode {
 			get { return exitCode; }
@@ -379,6 +411,10 @@ namespace Microsoft.Build.Utilities
 			get { return standardOutputLoggingImportance; }
 		}
 
+		protected virtual bool HasLoggedErrors {
+			get { return Log.HasLoggedErrors; }
+		}
+
 		public virtual int Timeout
 		{
 			get { return timeout; }
diff --git a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ChangeLog b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ChangeLog
index f4753a9..eb169a3 100644
--- a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ChangeLog
+++ b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* ReservedNameUtils.cs: Fix 'RootDir', 'Directory'.
+	(WithTrailingSlash): New.
+	Update to use the new WithTrailingSlash method.
+
+2009-09-08  Ankit Jain  <jankit at novell.com>
+
+	* ReservedNameUtils.cs (RelativeDir): Add a trailing \ .
+
 2007-01-24  Marek Sieradzki  <marek.sieradzki at gmail.com>
 
 	* MonoLocationHelper.cs: Made class internal. It will be removed soon
diff --git a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
index aa0f577..d461230 100644
--- a/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
+++ b/mcs/class/Microsoft.Build.Utilities/Mono.XBuild.Utilities/ReservedNameUtils.cs
@@ -77,15 +77,20 @@ namespace Mono.XBuild.Utilities {
 			case "fullpath":
 				return Path.GetFullPath (itemSpec);
 			case "rootdir":
-				return Path.GetPathRoot (itemSpec);
+				if (Path.IsPathRooted (itemSpec))
+					return Path.GetPathRoot (itemSpec);
+				else
+					return Path.GetPathRoot (Environment.CurrentDirectory);
 			case "filename":
 				return Path.GetFileNameWithoutExtension (itemSpec);
 			case "extension":
 				return Path.GetExtension (itemSpec);
 			case "relativedir":
-				return Path.GetDirectoryName (itemSpec);
+				return WithTrailingSlash (Path.GetDirectoryName (itemSpec));
 			case "directory":
-				return Path.GetDirectoryName (Path.GetFullPath (itemSpec));
+				string fullpath = Path.GetFullPath (itemSpec);
+				return WithTrailingSlash (
+					 Path.GetDirectoryName (fullpath).Substring (Path.GetPathRoot (fullpath).Length));
 			case "recursivedir":
 				// FIXME: how to handle this?
 				return String.Empty;
@@ -116,6 +121,14 @@ namespace Mono.XBuild.Utilities {
 				throw new ArgumentException ("Invalid reserved metadata name");
 			}
 		}
+
+		static string WithTrailingSlash (string path)
+		{
+			if (path.Length > 0)
+				return path + Path.DirectorySeparatorChar;
+			else
+				return path;
+		}
 	}
 }
 
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
index bfcf653..62185e4 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-28  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	** Fixes #381151 - NRE
+	* Tds.cs (ProcessColumnInfo): Use Columns instead of creating a new list.
+	* TdsDataColumnCollection.cs (Clear, Add): New utility methods 
+	* Tdsxx.cs: ProcessColumnInfo definition changes.
+	
+2009-08-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* Fixes **522465 - based on the work by basheer.islam at gmail.com
+	* Tds70.cs (FormatParameter): For double, use "round-trip" format 
+	specifier in order to be sure of a successful conversion.
+	
+2009-07-25  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* TdsConnectionPool.cs: Fixed typo in ResetConnectionPool.
+
 2009-05-16  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	* Tds70.cs (WriteParameterInfo): fix r134256 backport errors.
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
index 163b19d..cbceb55 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs
@@ -414,6 +414,7 @@ namespace Mono.Data.Tds.Protocol
 			this.tdsVersion = tdsVersion;
 			this.packetSize = packetSize;
 			this.dataSource = dataSource;
+			this.columns = new TdsDataColumnCollection ();
 
 			comm = new TdsComm (dataSource, port, packetSize, timeout, tdsVersion);
 		}
@@ -1441,7 +1442,7 @@ namespace Mono.Data.Tds.Protocol
 			}
 		}
 
-		protected abstract TdsDataColumnCollection ProcessColumnInfo ();
+		protected abstract void ProcessColumnInfo ();
 
 		protected void ProcessColumnNames ()
 		{
@@ -1706,7 +1707,8 @@ namespace Mono.Data.Tds.Protocol
 			case TdsPacketSubType.ColumnInfo:      // TDS 4.2
 			case TdsPacketSubType.ColumnMetadata:  // TDS 7.0
 			case TdsPacketSubType.RowFormat:       // TDS 5.0
-				columns = ProcessColumnInfo ();
+				Columns.Clear ();
+				ProcessColumnInfo ();
 				break;
 			case TdsPacketSubType.ColumnDetail:
 				ProcessColumnDetail ();
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs
index a0bdeb8..fdca830 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs
@@ -218,15 +218,13 @@ namespace Mono.Data.Tds.Protocol {
 			return IsConnected;
 		}
 
-		protected override TdsDataColumnCollection ProcessColumnInfo ()
+		protected override void ProcessColumnInfo ()
 		{
 			byte precision;
 			byte scale;
 			int totalLength = Comm.GetTdsShort ();
 			int bytesRead = 0;
 
-			TdsDataColumnCollection result = new TdsDataColumnCollection ();
-
 			while (bytesRead < totalLength) {
 				scale = 0;
 				precision = 0;
@@ -273,7 +271,7 @@ namespace Mono.Data.Tds.Protocol {
 				}
 
 				TdsDataColumn col = new TdsDataColumn ();
-				int index = result.Add (col);
+				int index = Columns.Add (col);
 #if NET_2_0
 				col.ColumnType = columnType;
 				col.ColumnSize = bufLength;
@@ -294,8 +292,6 @@ namespace Mono.Data.Tds.Protocol {
 				col["AllowDBNull"] = nullable;
 #endif
 			}
-
-			return result;
 		}
 
 		#endregion // Methods
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs
index 11a73e1..0d0e86c 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs
@@ -460,10 +460,9 @@ namespace Mono.Data.Tds.Protocol
 			return id;
 		}
 
-		protected override TdsDataColumnCollection ProcessColumnInfo ()
+		protected override void ProcessColumnInfo ()
 		{
 			isSelectQuery = true; 
-			TdsDataColumnCollection result = new TdsDataColumnCollection ();
 			/*int totalLength = */Comm.GetTdsShort ();
 			int count = Comm.GetTdsShort ();
 			for (int i = 0; i < count; i += 1) {
@@ -507,7 +506,7 @@ namespace Mono.Data.Tds.Protocol
 					Comm.Skip (Comm.GetTdsShort ()); // Class ID
 
 				TdsDataColumn col = new TdsDataColumn ();
-				result.Add (col);
+				Columns.Add (col);
 #if NET_2_0
 				col.ColumnType = columnType;
 				col.ColumnName = columnName;
@@ -536,7 +535,6 @@ namespace Mono.Data.Tds.Protocol
 				col ["IsHidden"] = hidden;
 #endif
 			}
-			return result;
 		}
 
 		private void SendParamFormat ()
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
index 7f378fe..a5be936 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
@@ -573,7 +573,10 @@ namespace Mono.Data.Tds.Protocol
 				if (paramType.IsEnum)
 					paramValue = Convert.ChangeType (paramValue,
 						Type.GetTypeCode (paramType));
-				value = paramValue.ToString ();
+				if (paramType == typeof (Double))
+					value = ((Double) paramValue).ToString ("r");
+				else 
+					value = paramValue.ToString ();
 				break;
 			case "nvarchar":
 			case "nchar":
@@ -628,9 +631,8 @@ namespace Mono.Data.Tds.Protocol
 			//return ColumnValues [0].ToString ();
 		}
 
-		protected override TdsDataColumnCollection ProcessColumnInfo ()
+		protected override void ProcessColumnInfo ()
 		{
-			TdsDataColumnCollection result = new TdsDataColumnCollection ();
 			int numColumns = Comm.GetTdsShort ();
 			for (int i = 0; i < numColumns; i += 1) {
 				byte[] flagData = new byte[4];
@@ -682,7 +684,7 @@ namespace Mono.Data.Tds.Protocol
 				string columnName = Comm.GetString (Comm.GetByte ());
 
 				TdsDataColumn col = new TdsDataColumn ();
-				result.Add (col);
+				Columns.Add (col);
 #if NET_2_0
 				col.ColumnType = columnType;
 				col.ColumnName = columnName;
@@ -707,7 +709,6 @@ namespace Mono.Data.Tds.Protocol
 				col ["BaseTableName"] = tableName;
 #endif
 			}
-			return result;
 		}
 
 		public override void Unprepare (string statementId)
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
index 0e13b39..b319f55 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
@@ -61,7 +61,7 @@ namespace Mono.Data.Tds.Protocol {
 			throw new NotImplementedException ();
 		}
 
-		protected override TdsDataColumnCollection ProcessColumnInfo ()
+		protected override void ProcessColumnInfo ()
 		{
 			throw new NotImplementedException ();
 		}
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs
index 51a00df..6f566e3 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs
@@ -259,7 +259,7 @@ retry:
 				lock (conns) {
 					Tds tds;
 					int i;
-					for (i = conns.Count - 1; i >= 0; i++) {
+					for (i = conns.Count - 1; i >= 0; i--) {
 						tds = (Tds) conns [i];
 						tds.poolStatus = 2; // 2 -> disconnect me upon release
 					}
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs
index 2551788..f172ced 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs
@@ -76,11 +76,21 @@ namespace Mono.Data.Tds.Protocol {
 			return index;
 		}
 
+		public void Add (TdsDataColumnCollection columns)
+		{
+			foreach (TdsDataColumn col in columns)
+				Add (col);
+		}
+               
 		public IEnumerator GetEnumerator ()
 		{
 			return list.GetEnumerator ();
 		}
 
+		public void Clear ()
+		{
+			list.Clear ();
+		}
 		#endregion // Methods
 	}
 }
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
index bcc3ece..4b86ce0 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-20  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* TlsServerCertificate.cs: If no usage information is available then
+	assume it's ok for SSL since we'll (later) check that the CN contains
+	a host name (that match the server) and such a certificate wouldn't
+	be much useful for anything but SSL/TLS. Fix the new stmp.gmail.com
+	certificate usage failure.
+	[Backport r140358]
+
 2007-12-15  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* TlsServerCertificate.cs: Add support for wilcard (*) when matching
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
index ef12ed1..f5bf2e7 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
@@ -177,8 +177,9 @@ namespace Mono.Security.Protocol.Tls.Handshake.Client
 				return ct.Support (NetscapeCertTypeExtension.CertTypes.SslServer);
 			}
 
-			// certificate isn't valid for SSL server usage
-			return false;
+			// if the CN=host (checked later) then we assume this is meant for SSL/TLS
+			// e.g. the new smtp.gmail.com certificate
+			return true;
 		}
 
 		private void validateCertificates(X509CertificateCollection certificates)
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
index 24429ef..2413cee 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ServerContext.cs:
+	* SslServerStream.cs: add new parameter that forces sending the
+	CertificateRequest record. Make sure we raise the client certificate
+	validation event when it is requested or required.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpsClientStream.cs: if there's only an ICertificatePolicy and no
+	ServerCertificateValicationCallback, don't fail.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpsClientStream.cs: invoke the ServerCertificateValidationCallback
+	in the 2.0 profile. If there's a CertificatePolicy, it is run before
+	the 2.0 callback.
+
 2007-09-12  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* Context.cs: Clear key info memory (not just nullify). Fix bug #82819
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
index aa43523..6f1bcc5 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
@@ -32,6 +32,10 @@ using System.IO;
 using System.Net;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
+#if NET_2_0
+using SNS = System.Net.Security;
+using SNCX = System.Security.Cryptography.X509Certificates;
+#endif
 
 namespace Mono.Security.Protocol.Tls {
 
@@ -87,10 +91,38 @@ namespace Mono.Security.Protocol.Tls {
 			// only one problem can be reported by this interface
 			_status = ((failed) ? certificateErrors [0] : 0);
 
+#if NET_2_0
+#pragma warning disable 618
+#endif
 			if (ServicePointManager.CertificatePolicy != null) {
 				ServicePoint sp = _request.ServicePoint;
-				return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, _request, _status);
+				bool res = ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, _request, _status);
+				if (!res)
+					return false;
+				failed = true;
 			}
+#if NET_2_0
+#pragma warning restore 618
+#endif
+#if NET_2_0
+			SNS.RemoteCertificateValidationCallback cb = ServicePointManager.ServerCertificateValidationCallback;
+			if (cb != null) {
+				SNS.SslPolicyErrors ssl_errors = 0;
+				foreach (int i in certificateErrors) {
+					if (i == (int)-2146762490) // TODO: is this what happens when the purpose is wrong?
+						ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateNotAvailable;
+					else if (i == (int) -2146762481)
+						ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateNameMismatch;
+					else
+						ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateChainErrors;
+				}
+				SNCX.X509Certificate2 cert2 = new SNCX.X509Certificate2 (certificate.GetRawCertData ());
+				SNCX.X509Chain chain = new SNCX.X509Chain ();
+				if (!chain.Build (cert2))
+					ssl_errors |= SNS.SslPolicyErrors.RemoteCertificateChainErrors;
+				return cb (_request, cert2, chain, ssl_errors);
+			}
+#endif
 			return failed;
 		}
         }
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
index 8181974..2652501 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
@@ -37,6 +37,7 @@ namespace Mono.Security.Protocol.Tls
 		#region Fields
 
 		private SslServerStream sslStream;
+		private bool request_client_certificate;
 		private bool			clientCertificateRequired;
 
 		#endregion
@@ -53,6 +54,10 @@ namespace Mono.Security.Protocol.Tls
 			get { return this.clientCertificateRequired; }
 		}
 
+		public bool RequestClientCertificate {
+			get { return request_client_certificate; }
+		}
+
 		#endregion
 
 		#region Constructors
@@ -61,11 +66,13 @@ namespace Mono.Security.Protocol.Tls
 			SslServerStream			stream,
 			SecurityProtocolType	securityProtocolType,
 			X509Certificate			serverCertificate,
-			bool					clientCertificateRequired)
+			bool					clientCertificateRequired,
+			bool					requestClientCertificate)
 			: base(securityProtocolType)
 		{
 			this.sslStream					= stream;
 			this.clientCertificateRequired	= clientCertificateRequired;
+			this.request_client_certificate	= requestClientCertificate;
 
 			// Convert the System.Security cert to a Mono Cert
 			MonoX509.X509Certificate cert = new MonoX509.X509Certificate(serverCertificate.GetRawCertData());
diff --git a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
index c453abb..750ab44 100644
--- a/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+++ b/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
@@ -103,18 +103,40 @@ namespace Mono.Security.Protocol.Tls
 		}
 
 		public SslServerStream(
+			Stream			stream,
+			X509Certificate serverCertificate,
+			bool			clientCertificateRequired,
+			bool			requestClientCertificate,
+			bool			ownsStream)
+				: this (stream, serverCertificate, clientCertificateRequired, requestClientCertificate, ownsStream, SecurityProtocolType.Default)
+		{
+		}
+
+		public SslServerStream(
 			Stream					stream,
 			X509Certificate			serverCertificate,
 			bool					clientCertificateRequired,
 			bool					ownsStream,
 			SecurityProtocolType	securityProtocolType)
+			: this (stream, serverCertificate, clientCertificateRequired, false, ownsStream, securityProtocolType)
+		{
+		}
+
+		public SslServerStream(
+			Stream					stream,
+			X509Certificate			serverCertificate,
+			bool					clientCertificateRequired,
+			bool					requestClientCertificate,
+			bool					ownsStream,
+			SecurityProtocolType	securityProtocolType)
 			: base(stream, ownsStream)
 		{
 			this.context = new ServerContext(
 				this,
 				securityProtocolType,
 				serverCertificate,
-				clientCertificateRequired);
+				clientCertificateRequired,
+				requestClientCertificate);
 
 			this.protocol = new ServerRecordProtocol(innerStream, (ServerContext)this.context);
 		}
@@ -216,7 +238,8 @@ namespace Mono.Security.Protocol.Tls
 			// If the negotiated cipher is a KeyEx cipher or
 			// the client certificate is required send the CertificateRequest message
 			if (this.context.Negotiating.Cipher.IsExportable ||
-				((ServerContext)this.context).ClientCertificateRequired)
+				((ServerContext)this.context).ClientCertificateRequired ||
+				((ServerContext)this.context).RequestClientCertificate)
 			{
 				this.protocol.SendRecord(HandshakeType.CertificateRequest);
 				certRequested = true;
@@ -239,16 +262,13 @@ namespace Mono.Security.Protocol.Tls
 				}
 			}
 
-			if (certRequested && (this.context.ClientSettings.ClientCertificate == null))
-			{
-				// we asked for a certificate but didn't receive one
-				// e.g. wget for SSL3
-				if (!RaiseClientCertificateValidation(null, new int[0]))
-				{
-					throw new TlsException(
-						AlertDescription.BadCertificate,
-						"No certificate received from client.");
-				}
+			if (certRequested) {
+				X509Certificate client_cert = this.context.ClientSettings.ClientCertificate;
+				if (client_cert == null && ((ServerContext)this.context).ClientCertificateRequired)
+					throw new TlsException (AlertDescription.BadCertificate, "No certificate received from client.");
+
+				if (!RaiseClientCertificateValidation (client_cert, new int[0]))
+					throw new TlsException (AlertDescription.BadCertificate, "Client certificate not accepted.");
 			}
 
 			// Send ChangeCipherSpec and ServerFinished messages
diff --git a/mcs/class/Mono.Simd/ChangeLog b/mcs/class/Mono.Simd/ChangeLog
new file mode 100644
index 0000000..c915f31
--- /dev/null
+++ b/mcs/class/Mono.Simd/ChangeLog
@@ -0,0 +1,78 @@
+2009-07-14  Zoltan Varga  <vargaz at gmail.com>
+
+	* Changelog: Rename this to ChangeLog.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added VectorOperations.cs
+
+2008-12-05  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Documentation/en/Mono.Simd/Vector*.xml: Removed references to
+	ExtractByteMask.
+
+2008-11-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Makefile: Add reference to System.Core so we can
+	define extension methods.
+
+	* Mono.Simd.dll.sources: Add Mono.Simd/ArrayExtensions.cs.
+
+2008-11-12  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Documentation/en/Mono.Simd/Vector*.xml: Renamed ShiftRightLogic
+	to LogicalRightShift and ShiftRightArithmetic to ArithmeticRightShift.
+
+2008-11-12  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Documentation/en/Mono.Simd/Vector*.xml: Renamed SubWithSaturation
+	to SubtractWithSaturation.
+
+2008-11-12  Cedric Vivier  <cedricv at neonux.com>
+
+	* Documentation/en/Mono.Simd/Vector*.xml: Added Member entry for indexer (Component).
+
+2008-11-11  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Documentation/en/Mono.Simd/SimdRuntime.xml: Fixed some typos.
+	Added example.
+
+2008-11-02  Jonathan Pryor  <jpryor at novell.com>
+
+	* Documentation/**: Added.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added AccelMode.cs, AccelerationAttribute.cs and SimdRuntime.cs.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector2ul.cs.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector2l.cs.
+
+2008-10-27  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector2d.cs.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector8s.cs.
+
+2008-10-23  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector16sb.cs.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Type renaming adjustments.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Mono.Simd.dll.sources: Added Vector8us.cs and Vector16b.cs.
+
+2008-10-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Initial checking of the file layout
diff --git a/mcs/class/Mono.Simd/Mono.Simd/ArrayExtensions.cs b/mcs/class/Mono.Simd/Mono.Simd/ArrayExtensions.cs
index e0b14ed..4281557 100644
--- a/mcs/class/Mono.Simd/Mono.Simd/ArrayExtensions.cs
+++ b/mcs/class/Mono.Simd/Mono.Simd/ArrayExtensions.cs
@@ -80,7 +80,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 8)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector8s*)ptr;
 				}
 			}
@@ -93,7 +93,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 8)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector8us*)ptr;
 				}
 			}
@@ -106,7 +106,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 16)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector16sb*)ptr;
 				}
 			}
@@ -119,7 +119,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 16)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector16b*)ptr;
 				}
 			}
@@ -273,7 +273,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 8)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector8s*)ptr;
 				}
 			}
@@ -286,7 +286,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 8)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector8us*)ptr;
 				}
 			}
@@ -299,7 +299,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 16)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector16sb*)ptr;
 				}
 			}
@@ -312,7 +312,7 @@ namespace Mono.Simd
 			if (offset < 0 || offset > array.Length - 16)
 				throw new IndexOutOfRangeException ();
 			unsafe {
-				fixed (void *ptr = &array[0]) {
+				fixed (void *ptr = &array[offset]) {
 					return *(Vector16b*)ptr;
 				}
 			}
diff --git a/mcs/class/Mono.Simd/Mono.Simd/ChangeLog b/mcs/class/Mono.Simd/Mono.Simd/ChangeLog
new file mode 100644
index 0000000..d243260
--- /dev/null
+++ b/mcs/class/Mono.Simd/Mono.Simd/ChangeLog
@@ -0,0 +1,400 @@
+2009-07-14  Zoltan Varga  <vargaz at gmail.com>
+
+	* Changelog: Rename this to ChangeLog.
+	
+	* Mono.Simd/Mono.Simd/ArrayExtensions.cs: Don't ignore the 'offset'
+	parameter in the GetVector () methods. Fixes #521692.
+
+2009-01-19 Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Add ToString, single element constructors
+	and some helper constants.
+
+	Based on a patch by Jerry Maine.
+
+2009-01-07 Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Use explicit layout to avoid the runtime
+	miscalculating the size of vector types.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector16b.
+
+	* Vector16b.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector16sb.
+
+	* Vector16sb.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector8us.
+
+	* Vector8us.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector8s.
+
+	* Vector8s.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector4ui.
+
+	* Vector4ui.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector4i.
+
+	* Vector4i.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector2ul.
+
+	* Vector2ul.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector2l.
+
+	* Vector2l.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: Move methods from Vector2d.
+
+	* Vector2d.cs: Same.
+
+2008-12-08  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* VectorOperations.cs: New file with extension methods
+	for Vector*. Added methods from Vector4f.
+
+	* Vector4f.cs: Remove methods that are now in
+	VectorOperations.
+
+2008-12-05  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16(s)b.cs: Add operator == and !=.
+
+2008-12-05  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8(u)s.cs: Add operator == and !=.
+
+2008-12-05  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Add operator == and !=.
+
+2008-12-04  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4(u)i.cs: Add operator == and !=.
+
+2008-12-04  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2/4/8*.cs: Remove ExtractByteMask.
+
+2008-11-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* ArrayExtensions.cs (IsAligned): Add a sensible default
+	implementation that will give results similar to the instrinsic version.
+
+2008-11-27  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* ArrayExtensions.cs: Add aligned Get/SetVector variants for
+	all vector types.
+
+2008-11-27  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* ArrayExtensions.cs: Add Get/SetVector variants for
+	all vector types.
+
+	* ArrayExtensions.cs: Add IsAligned query method to check
+	is an index of a given array is property aligned for simd.
+
+2008-11-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* ArrayExtensions.cs: New type exposing extension
+	methods to primitive arrays to load/store Vectors
+	from.
+
+2008-11-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Use 4 bytes operations for bitwise ops (& | ^)
+	as it can cause problems on some archs.
+
+2008-11-17  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2l.cs (CompareGreaterThan): This method requires sse 4.2
+	and 4.1.
+
+2008-11-17  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* SimdRuntime.cs (MethodAccelerationMode): Add MethodInfo
+	overload.
+
+2008-11-12  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Renamed ShiftRightLogic to LogicalRightShift and
+	ShiftRightArithmetic to ArithmeticRightShift.
+	
+2008-11-12  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Renamed SubWithSaturation	to SubtractWithSaturation.
+
+2008-11-12  Cedric vivier  <cedricv at neonux.com>
+
+	* Vector*.cs: Add indexer to all Vector types to get/set an individual component's value.
+
+2008-11-12  Cedric Vivier  <cedricv at neonux.com>
+
+	* Vector*.cs: Optimize non-accelerated bitwise-operations (| & ^).
+
+2008-11-04  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Use a better name for the prefetch
+	instructions.
+
+2008-11-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Added prefetch operations.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector*.cs: Added casting between all types.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4i.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16sb.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8s.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2ul.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2l.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2d.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Fix acceleration attribute of Shuffle.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Add Acceleration attribute to all methods.
+
+2008-10-29  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* AccelMode.cs: 
+	* AccelerationAttribute.cs: 
+	* SimdRuntime.cs: Support files to provide runtime capabilities querying.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2ul.cs: New vector type.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2l.cs : Remove useless comments.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2l.cs (operator ^): Simplify and fix the implementation.
+
+2008-10-28  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2l.cs: New vector type.
+
+2008-10-27  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector2d.cs: New vector type.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b: Mark type as CLS compliant (remove attribute) and
+	mark the methods which are not.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4i.cs: New vector type.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Add missing SSE 4.1 comments.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16sb.cs: Fix a warning.
+
+	* Vector4f.cs: Add some missing CLSCompliant attributes.
+
+	* Vector8s.cs: Add CompareGreaterThan and a missing
+	CLSCompliant attribute.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Add some missing SSE 4.1 comments.
+
+2008-10-24  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8s.cs: New vector type.
+
+2008-10-23  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs: Remove methods without sse equivalent.
+	* Vector16b.cs (SumOfAbsoluteDifferences) Fix the signature.
+
+2008-10-23  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16sb.cs: New vector type.
+
+2008-10-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs: Added Load/StoreAligned with pointer args.
+
+	* Vector4f.cs: Added Load/StoreAligned with pointer args.
+
+	* Vector4ui.cs: Added Load/StoreAligned with pointer args.
+
+	* Vector8us.cs: Added Load/StoreAligned with pointer args.
+
+2008-10-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Renamed CompareEquals to CompareEqual.
+
+2008-10-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Added SignedPackWithUnsignedSaturation.
+
+2008-10-21  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Added SignedPackWithUnsignedSaturation.
+
+2008-10-20  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs: Added casts to Vector4ui and Vector8us
+
+	* Vector4f.cs: Added casts to Vector8us and Vector16b
+
+	* Vector4ui.cs: Added casts to Vector8us and Vector16b
+
+	* Vector8us.cs: Added casts to Vector4ui and Vector16b
+
+2008-10-20  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Added CompareEqual and MultiplyStoreHigh.
+
+2008-10-17  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Remove Average as there is no sse instruction for that.
+
+2008-10-17  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Added Min, Max, Average, ExtractByteMask,
+	Shuffle and CompareEqual.
+
+2008-10-16  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs: Added Min, Max, Average, ExtractByteMask,
+	SumOfAbsoluteDifferences and CompareEqual.
+
+2008-10-15  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Added Min, Max, Average, ExtractByteMask and
+	ShuffleLow/ShuffleHigh.
+
+2008-10-14  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Added DuplicateLow and DuplicateHigh.
+
+2008-10-13  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs: Added bitwise ops, reciprocal, interleave
+	and all flavors of compare.
+	Optimized Shuffle.
+
+	* Vector8us.cs: It turns out that packuswb doesn't work with unsigned
+	numbers that binary equivalent to negative numbers in signed form.
+	Removed PackWithUnsignedSaturation.
+
+	* Vector4ui.cs: Added SSE4.1 comment to relevant method. Removed
+	PackWithUnsignedSaturation for the same reason as above.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4ui.cs: Added common operations found in 
+	other unsigned int vector types.
+
+	* Vector8us.cs (ArithmeticRightShift): Do proper sign extention.
+
+	* Vector8us.cs: Fix conversion operators.
+
+	* Vector16b.cs (ArithmeticRightShift): Do proper sign extention.
+
+	* Vector16b.cs: Fix conversion operators.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector16b.cs, Vector4f.cs, Vector4ui.cs,Vector8us.cs:
+	Type renaming adjustments.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4u.cs: Renamed to Vector4ui.cs.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs: Use Math.Min/Max instead of ?:.
+	Fixed PackWithUnsignedSaturation.
+
+	* Vector16b.cs: Use Math.Min/Max instead of ?:.
+	Removed unused PackWithUnsignedSaturation.
+
+2008-10-10  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector8us.cs
+	* Vector16b.cs: Added.
+
+2008-10-07  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4f.cs (ShuffleSel): Better naming for the constants.
+	Added some helper constants.
+
+2008-10-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Vector4u.cs: Mask type as not CLS compliant.
+
+	* Vector4c.cs: Mask methods returning Vector4u as not CLS compliant.
+
+2008-10-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* Initial checking of the file layout
diff --git a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-8.cs b/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-8.cs
deleted file mode 100644
index 6ee9678..0000000
--- a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-8.cs
+++ /dev/null
@@ -1,6245 +0,0 @@
-// Autogenerated code. Do not edit.
-
-using RabbitMQ.Client;
-using RabbitMQ.Client.Exceptions;
-
-namespace RabbitMQ.Client.Framing.v0_8 {
-  public class Protocol: RabbitMQ.Client.Framing.Impl.v0_8.ProtocolBase {
-    ///<summary>Protocol major version (= 8)</summary>
-    public override int MajorVersion { get { return 8; } }
-    ///<summary>Protocol minor version (= 0)</summary>
-    public override int MinorVersion { get { return 0; } }
-    ///<summary>Protocol API name (= AMQP_0_8)</summary>
-    public override string ApiName { get { return "AMQP_0_8"; } }
-    ///<summary>Default TCP port (= 5672)</summary>
-    public override int DefaultPort { get { return 5672; } }
-
-    public override RabbitMQ.Client.Impl.MethodBase DecodeMethodFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-      ushort methodId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 10: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionStart result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionStartOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionSecure result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionSecure();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionSecureOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionSecureOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionTune result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionTune();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionTuneOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionTuneOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionOpen result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionRedirect result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionRedirect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionClose result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 61: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ConnectionCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ConnectionCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 20: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelOpen result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelFlow result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelFlow();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelFlowOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelFlowOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelAlert result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelAlert();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelClose result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ChannelCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ChannelCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 30: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.AccessRequest result = new RabbitMQ.Client.Framing.Impl.v0_8.AccessRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.AccessRequestOk result = new RabbitMQ.Client.Framing.Impl.v0_8.AccessRequestOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 40: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeclare result = new RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDelete result = new RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_8.ExchangeDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 50: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueDeclare result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueBind result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueBind();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueBindOk result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueBindOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueuePurge result = new RabbitMQ.Client.Framing.Impl.v0_8.QueuePurge();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueuePurgeOk result = new RabbitMQ.Client.Framing.Impl.v0_8.QueuePurgeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueDelete result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8.QueueDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_8.QueueDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 60: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicQos result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicConsume result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicCancel result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicPublish result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicReturn result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicGet result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicGet();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 71: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicGetOk result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicGetOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 72: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicGetEmpty result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicGetEmpty();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicAck result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicReject result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_8.BasicRecover result = new RabbitMQ.Client.Framing.Impl.v0_8.BasicRecover();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 70: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileQos result = new RabbitMQ.Client.Framing.Impl.v0_8.FileQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8.FileQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileConsume result = new RabbitMQ.Client.Framing.Impl.v0_8.FileConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8.FileConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileCancel result = new RabbitMQ.Client.Framing.Impl.v0_8.FileCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8.FileCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileOpen result = new RabbitMQ.Client.Framing.Impl.v0_8.FileOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8.FileOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileStage result = new RabbitMQ.Client.Framing.Impl.v0_8.FileStage();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FilePublish result = new RabbitMQ.Client.Framing.Impl.v0_8.FilePublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileReturn result = new RabbitMQ.Client.Framing.Impl.v0_8.FileReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8.FileDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileAck result = new RabbitMQ.Client.Framing.Impl.v0_8.FileAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_8.FileReject result = new RabbitMQ.Client.Framing.Impl.v0_8.FileReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 80: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamQos result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamConsume result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamCancel result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamPublish result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamReturn result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8.StreamDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8.StreamDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 90: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxSelect result = new RabbitMQ.Client.Framing.Impl.v0_8.TxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxCommit result = new RabbitMQ.Client.Framing.Impl.v0_8.TxCommit();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxCommitOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TxCommitOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxRollback result = new RabbitMQ.Client.Framing.Impl.v0_8.TxRollback();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TxRollbackOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TxRollbackOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 100: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.DtxSelect result = new RabbitMQ.Client.Framing.Impl.v0_8.DtxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.DtxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_8.DtxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.DtxStart result = new RabbitMQ.Client.Framing.Impl.v0_8.DtxStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.DtxStartOk result = new RabbitMQ.Client.Framing.Impl.v0_8.DtxStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 110: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TunnelRequest result = new RabbitMQ.Client.Framing.Impl.v0_8.TunnelRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 120: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestInteger result = new RabbitMQ.Client.Framing.Impl.v0_8.TestInteger();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestIntegerOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TestIntegerOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestString result = new RabbitMQ.Client.Framing.Impl.v0_8.TestString();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestStringOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TestStringOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestTable result = new RabbitMQ.Client.Framing.Impl.v0_8.TestTable();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestTableOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TestTableOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestContent result = new RabbitMQ.Client.Framing.Impl.v0_8.TestContent();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8.TestContentOk result = new RabbitMQ.Client.Framing.Impl.v0_8.TestContentOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, methodId);
-    }
-
-    public override RabbitMQ.Client.Impl.ContentHeaderBase DecodeContentHeaderFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 60: return new BasicProperties();
-        case 70: return new FileProperties();
-        case 80: return new StreamProperties();
-        case 110: return new TunnelProperties();
-        case 120: return new TestProperties();
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, 0);
-    }
-  }
-  public class Constants {
-    ///<summary>(= 1)</summary>
-    public const int FrameMethod = 1;
-    ///<summary>(= 2)</summary>
-    public const int FrameHeader = 2;
-    ///<summary>(= 3)</summary>
-    public const int FrameBody = 3;
-    ///<summary>(= 4)</summary>
-    public const int FrameOobMethod = 4;
-    ///<summary>(= 5)</summary>
-    public const int FrameOobHeader = 5;
-    ///<summary>(= 6)</summary>
-    public const int FrameOobBody = 6;
-    ///<summary>(= 7)</summary>
-    public const int FrameTrace = 7;
-    ///<summary>(= 8)</summary>
-    public const int FrameHeartbeat = 8;
-    ///<summary>(= 4096)</summary>
-    public const int FrameMinSize = 4096;
-    ///<summary>(= 206)</summary>
-    public const int FrameEnd = 206;
-    ///<summary>(= 200)</summary>
-    public const int ReplySuccess = 200;
-    ///<summary>(= 310)</summary>
-    public const int NotDelivered = 310;
-    ///<summary>(= 311)</summary>
-    public const int ContentTooLarge = 311;
-    ///<summary>(= 320)</summary>
-    public const int ConnectionForced = 320;
-    ///<summary>(= 402)</summary>
-    public const int InvalidPath = 402;
-    ///<summary>(= 403)</summary>
-    public const int AccessRefused = 403;
-    ///<summary>(= 404)</summary>
-    public const int NotFound = 404;
-    ///<summary>(= 405)</summary>
-    public const int ResourceLocked = 405;
-    ///<summary>(= 501)</summary>
-    public const int FrameError = 501;
-    ///<summary>(= 502)</summary>
-    public const int SyntaxError = 502;
-    ///<summary>(= 503)</summary>
-    public const int CommandInvalid = 503;
-    ///<summary>(= 504)</summary>
-    public const int ChannelError = 504;
-    ///<summary>(= 506)</summary>
-    public const int ResourceError = 506;
-    ///<summary>(= 530)</summary>
-    public const int NotAllowed = 530;
-    ///<summary>(= 540)</summary>
-    public const int NotImplemented = 540;
-    ///<summary>(= 541)</summary>
-    public const int InternalError = 541;
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start".</summary>
-  public interface IConnectionStart: IMethod {
-    byte VersionMajor { get; }
-    byte VersionMinor { get; }
-    System.Collections.IDictionary ServerProperties { get; }
-    byte[] Mechanisms { get; }
-    byte[] Locales { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start-ok".</summary>
-  public interface IConnectionStartOk: IMethod {
-    System.Collections.IDictionary ClientProperties { get; }
-    string Mechanism { get; }
-    byte[] Response { get; }
-    string Locale { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure".</summary>
-  public interface IConnectionSecure: IMethod {
-    byte[] Challenge { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure-ok".</summary>
-  public interface IConnectionSecureOk: IMethod {
-    byte[] Response { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune".</summary>
-  public interface IConnectionTune: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune-ok".</summary>
-  public interface IConnectionTuneOk: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open".</summary>
-  public interface IConnectionOpen: IMethod {
-    string VirtualHost { get; }
-    string Capabilities { get; }
-    bool Insist { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open-ok".</summary>
-  public interface IConnectionOpenOk: IMethod {
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.redirect".</summary>
-  public interface IConnectionRedirect: IMethod {
-    string Host { get; }
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close".</summary>
-  public interface IConnectionClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close-ok".</summary>
-  public interface IConnectionCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open".</summary>
-  public interface IChannelOpen: IMethod {
-    string OutOfBand { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open-ok".</summary>
-  public interface IChannelOpenOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow".</summary>
-  public interface IChannelFlow: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow-ok".</summary>
-  public interface IChannelFlowOk: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.alert".</summary>
-  public interface IChannelAlert: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    System.Collections.IDictionary Details { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close".</summary>
-  public interface IChannelClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close-ok".</summary>
-  public interface IChannelCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request".</summary>
-  public interface IAccessRequest: IMethod {
-    string Realm { get; }
-    bool Exclusive { get; }
-    bool Passive { get; }
-    bool Active { get; }
-    bool Write { get; }
-    bool Read { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request-ok".</summary>
-  public interface IAccessRequestOk: IMethod {
-    ushort Ticket { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare".</summary>
-  public interface IExchangeDeclare: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string Type { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool AutoDelete { get; }
-    bool Internal { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare-ok".</summary>
-  public interface IExchangeDeclareOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete".</summary>
-  public interface IExchangeDelete: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    bool IfUnused { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete-ok".</summary>
-  public interface IExchangeDeleteOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare".</summary>
-  public interface IQueueDeclare: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool Exclusive { get; }
-    bool AutoDelete { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare-ok".</summary>
-  public interface IQueueDeclareOk: IMethod {
-    string Queue { get; }
-    uint MessageCount { get; }
-    uint ConsumerCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind".</summary>
-  public interface IQueueBind: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind-ok".</summary>
-  public interface IQueueBindOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge".</summary>
-  public interface IQueuePurge: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge-ok".</summary>
-  public interface IQueuePurgeOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete".</summary>
-  public interface IQueueDelete: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool IfUnused { get; }
-    bool IfEmpty { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete-ok".</summary>
-  public interface IQueueDeleteOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos".</summary>
-  public interface IBasicQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos-ok".</summary>
-  public interface IBasicQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume".</summary>
-  public interface IBasicConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume-ok".</summary>
-  public interface IBasicConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel".</summary>
-  public interface IBasicCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel-ok".</summary>
-  public interface IBasicCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.publish".</summary>
-  public interface IBasicPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.return".</summary>
-  public interface IBasicReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.deliver".</summary>
-  public interface IBasicDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get".</summary>
-  public interface IBasicGet: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool NoAck { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-ok".</summary>
-  public interface IBasicGetOk: IMethod {
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-empty".</summary>
-  public interface IBasicGetEmpty: IMethod {
-    string ClusterId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.ack".</summary>
-  public interface IBasicAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.reject".</summary>
-  public interface IBasicReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.recover".</summary>
-  public interface IBasicRecover: IMethod {
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos".</summary>
-  public interface IFileQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos-ok".</summary>
-  public interface IFileQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume".</summary>
-  public interface IFileConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume-ok".</summary>
-  public interface IFileConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel".</summary>
-  public interface IFileCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel-ok".</summary>
-  public interface IFileCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open".</summary>
-  public interface IFileOpen: IMethod {
-    string Identifier { get; }
-    ulong ContentSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open-ok".</summary>
-  public interface IFileOpenOk: IMethod {
-    ulong StagedSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.stage".</summary>
-  public interface IFileStage: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.publish".</summary>
-  public interface IFilePublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.return".</summary>
-  public interface IFileReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.deliver".</summary>
-  public interface IFileDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.ack".</summary>
-  public interface IFileAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.reject".</summary>
-  public interface IFileReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos".</summary>
-  public interface IStreamQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    uint ConsumeRate { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos-ok".</summary>
-  public interface IStreamQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume".</summary>
-  public interface IStreamConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume-ok".</summary>
-  public interface IStreamConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel".</summary>
-  public interface IStreamCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel-ok".</summary>
-  public interface IStreamCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.publish".</summary>
-  public interface IStreamPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.return".</summary>
-  public interface IStreamReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.deliver".</summary>
-  public interface IStreamDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    string Exchange { get; }
-    string Queue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select".</summary>
-  public interface ITxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select-ok".</summary>
-  public interface ITxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit".</summary>
-  public interface ITxCommit: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit-ok".</summary>
-  public interface ITxCommitOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback".</summary>
-  public interface ITxRollback: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback-ok".</summary>
-  public interface ITxRollbackOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select".</summary>
-  public interface IDtxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select-ok".</summary>
-  public interface IDtxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start".</summary>
-  public interface IDtxStart: IMethod {
-    string DtxIdentifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start-ok".</summary>
-  public interface IDtxStartOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tunnel.request".</summary>
-  public interface ITunnelRequest: IMethod {
-    System.Collections.IDictionary MetaData { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.integer".</summary>
-  public interface ITestInteger: IMethod {
-    byte Integer1 { get; }
-    ushort Integer2 { get; }
-    uint Integer3 { get; }
-    ulong Integer4 { get; }
-    byte Operation { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.integer-ok".</summary>
-  public interface ITestIntegerOk: IMethod {
-    ulong Result { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.string".</summary>
-  public interface ITestString: IMethod {
-    string String1 { get; }
-    byte[] String2 { get; }
-    byte Operation { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.string-ok".</summary>
-  public interface ITestStringOk: IMethod {
-    byte[] Result { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.table".</summary>
-  public interface ITestTable: IMethod {
-    System.Collections.IDictionary Table { get; }
-    byte IntegerOp { get; }
-    byte StringOp { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.table-ok".</summary>
-  public interface ITestTableOk: IMethod {
-    ulong IntegerResult { get; }
-    byte[] StringResult { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.content".</summary>
-  public interface ITestContent: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.content-ok".</summary>
-  public interface ITestContentOk: IMethod {
-    uint ContentChecksum { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "basic"</summary>
-  public class BasicProperties: RabbitMQ.Client.Impl.BasicProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_deliveryMode;
-    private byte m_priority;
-    private string m_correlationId;
-    private string m_replyTo;
-    private string m_expiration;
-    private string m_messageId;
-    private AmqpTimestamp m_timestamp;
-    private string m_type;
-    private string m_userId;
-    private string m_appId;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool deliveryMode_present = false;
-    private bool priority_present = false;
-    private bool correlationId_present = false;
-    private bool replyTo_present = false;
-    private bool expiration_present = false;
-    private bool messageId_present = false;
-    private bool timestamp_present = false;
-    private bool type_present = false;
-    private bool userId_present = false;
-    private bool appId_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte DeliveryMode {
-      get {
-        return m_deliveryMode;
-      }
-      set {
-        deliveryMode_present = true;
-        m_deliveryMode = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string CorrelationId {
-      get {
-        return m_correlationId;
-      }
-      set {
-        correlationId_present = true;
-        m_correlationId = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string Expiration {
-      get {
-        return m_expiration;
-      }
-      set {
-        expiration_present = true;
-        m_expiration = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string Type {
-      get {
-        return m_type;
-      }
-      set {
-        type_present = true;
-        m_type = value;
-      }
-    }
-    public override string UserId {
-      get {
-        return m_userId;
-      }
-      set {
-        userId_present = true;
-        m_userId = value;
-      }
-    }
-    public override string AppId {
-      get {
-        return m_appId;
-      }
-      set {
-        appId_present = true;
-        m_appId = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearDeliveryMode() { deliveryMode_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearCorrelationId() { correlationId_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearExpiration() { expiration_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearType() { type_present = false; }
-    public override void ClearUserId() { userId_present = false; }
-    public override void ClearAppId() { appId_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public BasicProperties() {}
-    public override int ProtocolClassId { get { return 60; } }
-    public override string ProtocolClassName { get { return "basic"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      deliveryMode_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      correlationId_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      expiration_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      type_present = reader.ReadPresence();
-      userId_present = reader.ReadPresence();
-      appId_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (deliveryMode_present) { m_deliveryMode = reader.ReadOctet(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (correlationId_present) { m_correlationId = reader.ReadShortstr(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (expiration_present) { m_expiration = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (type_present) { m_type = reader.ReadShortstr(); }
-      if (userId_present) { m_userId = reader.ReadShortstr(); }
-      if (appId_present) { m_appId = reader.ReadShortstr(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(deliveryMode_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(correlationId_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(expiration_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(type_present);
-      writer.WritePresence(userId_present);
-      writer.WritePresence(appId_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (deliveryMode_present) { writer.WriteOctet(m_deliveryMode); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (correlationId_present) { writer.WriteShortstr(m_correlationId); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (expiration_present) { writer.WriteShortstr(m_expiration); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (type_present) { writer.WriteShortstr(m_type); }
-      if (userId_present) { writer.WriteShortstr(m_userId); }
-      if (appId_present) { writer.WriteShortstr(m_appId); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("delivery mode="); sb.Append(deliveryMode_present ? m_deliveryMode.ToString() : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("correlation id="); sb.Append(correlationId_present ? (m_correlationId == null ? "(null)" : m_correlationId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("reply to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("expiration="); sb.Append(expiration_present ? (m_expiration == null ? "(null)" : m_expiration.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("type="); sb.Append(type_present ? (m_type == null ? "(null)" : m_type.ToString()) : "_"); sb.Append(", ");
-      sb.Append("user id="); sb.Append(userId_present ? (m_userId == null ? "(null)" : m_userId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("app id="); sb.Append(appId_present ? (m_appId == null ? "(null)" : m_appId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("cluster id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "file"</summary>
-  public class FileProperties: RabbitMQ.Client.Impl.FileProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private string m_replyTo;
-    private string m_messageId;
-    private string m_filename;
-    private AmqpTimestamp m_timestamp;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool replyTo_present = false;
-    private bool messageId_present = false;
-    private bool filename_present = false;
-    private bool timestamp_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override string Filename {
-      get {
-        return m_filename;
-      }
-      set {
-        filename_present = true;
-        m_filename = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearFilename() { filename_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public FileProperties() {}
-    public override int ProtocolClassId { get { return 70; } }
-    public override string ProtocolClassName { get { return "file"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      filename_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (filename_present) { m_filename = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(filename_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (filename_present) { writer.WriteShortstr(m_filename); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("reply to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("filename="); sb.Append(filename_present ? (m_filename == null ? "(null)" : m_filename.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("cluster id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "stream"</summary>
-  public class StreamProperties: RabbitMQ.Client.Impl.StreamProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private AmqpTimestamp m_timestamp;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool timestamp_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-
-    public StreamProperties() {}
-    public override int ProtocolClassId { get { return 80; } }
-    public override string ProtocolClassName { get { return "stream"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(timestamp_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "tunnel"</summary>
-  public class TunnelProperties: RabbitMQ.Client.Impl.ContentHeaderBase {
-    private System.Collections.IDictionary m_headers;
-    private string m_proxyName;
-    private string m_dataName;
-    private byte m_durable;
-    private byte m_broadcast;
-
-    private bool headers_present = false;
-    private bool proxyName_present = false;
-    private bool dataName_present = false;
-    private bool durable_present = false;
-    private bool broadcast_present = false;
-
-    public System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public string ProxyName {
-      get {
-        return m_proxyName;
-      }
-      set {
-        proxyName_present = true;
-        m_proxyName = value;
-      }
-    }
-    public string DataName {
-      get {
-        return m_dataName;
-      }
-      set {
-        dataName_present = true;
-        m_dataName = value;
-      }
-    }
-    public byte Durable {
-      get {
-        return m_durable;
-      }
-      set {
-        durable_present = true;
-        m_durable = value;
-      }
-    }
-    public byte Broadcast {
-      get {
-        return m_broadcast;
-      }
-      set {
-        broadcast_present = true;
-        m_broadcast = value;
-      }
-    }
-
-    public void ClearHeaders() { headers_present = false; }
-    public void ClearProxyName() { proxyName_present = false; }
-    public void ClearDataName() { dataName_present = false; }
-    public void ClearDurable() { durable_present = false; }
-    public void ClearBroadcast() { broadcast_present = false; }
-
-    public TunnelProperties() {}
-    public override int ProtocolClassId { get { return 110; } }
-    public override string ProtocolClassName { get { return "tunnel"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      headers_present = reader.ReadPresence();
-      proxyName_present = reader.ReadPresence();
-      dataName_present = reader.ReadPresence();
-      durable_present = reader.ReadPresence();
-      broadcast_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (proxyName_present) { m_proxyName = reader.ReadShortstr(); }
-      if (dataName_present) { m_dataName = reader.ReadShortstr(); }
-      if (durable_present) { m_durable = reader.ReadOctet(); }
-      if (broadcast_present) { m_broadcast = reader.ReadOctet(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(headers_present);
-      writer.WritePresence(proxyName_present);
-      writer.WritePresence(dataName_present);
-      writer.WritePresence(durable_present);
-      writer.WritePresence(broadcast_present);
-      writer.FinishPresence();
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (proxyName_present) { writer.WriteShortstr(m_proxyName); }
-      if (dataName_present) { writer.WriteShortstr(m_dataName); }
-      if (durable_present) { writer.WriteOctet(m_durable); }
-      if (broadcast_present) { writer.WriteOctet(m_broadcast); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("proxy name="); sb.Append(proxyName_present ? (m_proxyName == null ? "(null)" : m_proxyName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("data name="); sb.Append(dataName_present ? (m_dataName == null ? "(null)" : m_dataName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("durable="); sb.Append(durable_present ? m_durable.ToString() : "_"); sb.Append(", ");
-      sb.Append("broadcast="); sb.Append(broadcast_present ? m_broadcast.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "test"</summary>
-  public class TestProperties: RabbitMQ.Client.Impl.ContentHeaderBase {
-
-
-
-
-    public TestProperties() {}
-    public override int ProtocolClassId { get { return 120; } }
-    public override string ProtocolClassName { get { return "test"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      reader.FinishPresence();
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.FinishPresence();
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-}
-namespace RabbitMQ.Client.Framing.Impl.v0_8 {
-  using RabbitMQ.Client.Framing.v0_8;
-  public enum ClassId {
-    Connection = 10,
-    Channel = 20,
-    Access = 30,
-    Exchange = 40,
-    Queue = 50,
-    Basic = 60,
-    File = 70,
-    Stream = 80,
-    Tx = 90,
-    Dtx = 100,
-    Tunnel = 110,
-    Test = 120,
-    Invalid = -1
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStart: RabbitMQ.Client.Impl.MethodBase, IConnectionStart {
-    public const int ClassId = 10;
-    public const int MethodId = 10;
-
-    public byte m_versionMajor;
-    public byte m_versionMinor;
-    public System.Collections.IDictionary m_serverProperties;
-    public byte[] m_mechanisms;
-    public byte[] m_locales;
-
-    byte IConnectionStart.VersionMajor { get { return m_versionMajor; } }
-    byte IConnectionStart.VersionMinor { get { return m_versionMinor; } }
-    System.Collections.IDictionary IConnectionStart.ServerProperties { get { return m_serverProperties; } }
-    byte[] IConnectionStart.Mechanisms { get { return m_mechanisms; } }
-    byte[] IConnectionStart.Locales { get { return m_locales; } }
-
-    public ConnectionStart() {}
-    public ConnectionStart(
-      byte initVersionMajor,
-      byte initVersionMinor,
-      System.Collections.IDictionary initServerProperties,
-      byte[] initMechanisms,
-      byte[] initLocales)
-    {
-      m_versionMajor = initVersionMajor;
-      m_versionMinor = initVersionMinor;
-      m_serverProperties = initServerProperties;
-      m_mechanisms = initMechanisms;
-      m_locales = initLocales;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "connection.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_versionMajor = reader.ReadOctet();
-      m_versionMinor = reader.ReadOctet();
-      m_serverProperties = reader.ReadTable();
-      m_mechanisms = reader.ReadLongstr();
-      m_locales = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteOctet(m_versionMajor);
-      writer.WriteOctet(m_versionMinor);
-      writer.WriteTable(m_serverProperties);
-      writer.WriteLongstr(m_mechanisms);
-      writer.WriteLongstr(m_locales);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_versionMajor); sb.Append(",");
-      sb.Append(m_versionMinor); sb.Append(",");
-      sb.Append(m_serverProperties); sb.Append(",");
-      sb.Append(m_mechanisms); sb.Append(",");
-      sb.Append(m_locales);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStartOk: RabbitMQ.Client.Impl.MethodBase, IConnectionStartOk {
-    public const int ClassId = 10;
-    public const int MethodId = 11;
-
-    public System.Collections.IDictionary m_clientProperties;
-    public string m_mechanism;
-    public byte[] m_response;
-    public string m_locale;
-
-    System.Collections.IDictionary IConnectionStartOk.ClientProperties { get { return m_clientProperties; } }
-    string IConnectionStartOk.Mechanism { get { return m_mechanism; } }
-    byte[] IConnectionStartOk.Response { get { return m_response; } }
-    string IConnectionStartOk.Locale { get { return m_locale; } }
-
-    public ConnectionStartOk() {}
-    public ConnectionStartOk(
-      System.Collections.IDictionary initClientProperties,
-      string initMechanism,
-      byte[] initResponse,
-      string initLocale)
-    {
-      m_clientProperties = initClientProperties;
-      m_mechanism = initMechanism;
-      m_response = initResponse;
-      m_locale = initLocale;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "connection.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clientProperties = reader.ReadTable();
-      m_mechanism = reader.ReadShortstr();
-      m_response = reader.ReadLongstr();
-      m_locale = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_clientProperties);
-      writer.WriteShortstr(m_mechanism);
-      writer.WriteLongstr(m_response);
-      writer.WriteShortstr(m_locale);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clientProperties); sb.Append(",");
-      sb.Append(m_mechanism); sb.Append(",");
-      sb.Append(m_response); sb.Append(",");
-      sb.Append(m_locale);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecure: RabbitMQ.Client.Impl.MethodBase, IConnectionSecure {
-    public const int ClassId = 10;
-    public const int MethodId = 20;
-
-    public byte[] m_challenge;
-
-    byte[] IConnectionSecure.Challenge { get { return m_challenge; } }
-
-    public ConnectionSecure() {}
-    public ConnectionSecure(
-      byte[] initChallenge)
-    {
-      m_challenge = initChallenge;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "connection.secure"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_challenge = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_challenge);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_challenge);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecureOk: RabbitMQ.Client.Impl.MethodBase, IConnectionSecureOk {
-    public const int ClassId = 10;
-    public const int MethodId = 21;
-
-    public byte[] m_response;
-
-    byte[] IConnectionSecureOk.Response { get { return m_response; } }
-
-    public ConnectionSecureOk() {}
-    public ConnectionSecureOk(
-      byte[] initResponse)
-    {
-      m_response = initResponse;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "connection.secure-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_response = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_response);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_response);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTune: RabbitMQ.Client.Impl.MethodBase, IConnectionTune {
-    public const int ClassId = 10;
-    public const int MethodId = 30;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTune.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTune.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTune.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTune() {}
-    public ConnectionTune(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "connection.tune"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTuneOk: RabbitMQ.Client.Impl.MethodBase, IConnectionTuneOk {
-    public const int ClassId = 10;
-    public const int MethodId = 31;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTuneOk.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTuneOk.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTuneOk.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTuneOk() {}
-    public ConnectionTuneOk(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "connection.tune-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpen: RabbitMQ.Client.Impl.MethodBase, IConnectionOpen {
-    public const int ClassId = 10;
-    public const int MethodId = 40;
-
-    public string m_virtualHost;
-    public string m_capabilities;
-    public bool m_insist;
-
-    string IConnectionOpen.VirtualHost { get { return m_virtualHost; } }
-    string IConnectionOpen.Capabilities { get { return m_capabilities; } }
-    bool IConnectionOpen.Insist { get { return m_insist; } }
-
-    public ConnectionOpen() {}
-    public ConnectionOpen(
-      string initVirtualHost,
-      string initCapabilities,
-      bool initInsist)
-    {
-      m_virtualHost = initVirtualHost;
-      m_capabilities = initCapabilities;
-      m_insist = initInsist;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "connection.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_virtualHost = reader.ReadShortstr();
-      m_capabilities = reader.ReadShortstr();
-      m_insist = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_virtualHost);
-      writer.WriteShortstr(m_capabilities);
-      writer.WriteBit(m_insist);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_virtualHost); sb.Append(",");
-      sb.Append(m_capabilities); sb.Append(",");
-      sb.Append(m_insist);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpenOk: RabbitMQ.Client.Impl.MethodBase, IConnectionOpenOk {
-    public const int ClassId = 10;
-    public const int MethodId = 41;
-
-    public string m_knownHosts;
-
-    string IConnectionOpenOk.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionOpenOk() {}
-    public ConnectionOpenOk(
-      string initKnownHosts)
-    {
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "connection.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionRedirect: RabbitMQ.Client.Impl.MethodBase, IConnectionRedirect {
-    public const int ClassId = 10;
-    public const int MethodId = 50;
-
-    public string m_host;
-    public string m_knownHosts;
-
-    string IConnectionRedirect.Host { get { return m_host; } }
-    string IConnectionRedirect.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionRedirect() {}
-    public ConnectionRedirect(
-      string initHost,
-      string initKnownHosts)
-    {
-      m_host = initHost;
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "connection.redirect"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_host = reader.ReadShortstr();
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_host);
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_host); sb.Append(",");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionClose: RabbitMQ.Client.Impl.MethodBase, IConnectionClose {
-    public const int ClassId = 10;
-    public const int MethodId = 60;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IConnectionClose.ReplyCode { get { return m_replyCode; } }
-    string IConnectionClose.ReplyText { get { return m_replyText; } }
-    ushort IConnectionClose.ClassId { get { return m_classId; } }
-    ushort IConnectionClose.MethodId { get { return m_methodId; } }
-
-    public ConnectionClose() {}
-    public ConnectionClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "connection.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionCloseOk: RabbitMQ.Client.Impl.MethodBase, IConnectionCloseOk {
-    public const int ClassId = 10;
-    public const int MethodId = 61;
-
-
-
-    public ConnectionCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 61; } }
-    public override string ProtocolMethodName { get { return "connection.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpen: RabbitMQ.Client.Impl.MethodBase, IChannelOpen {
-    public const int ClassId = 20;
-    public const int MethodId = 10;
-
-    public string m_outOfBand;
-
-    string IChannelOpen.OutOfBand { get { return m_outOfBand; } }
-
-    public ChannelOpen() {}
-    public ChannelOpen(
-      string initOutOfBand)
-    {
-      m_outOfBand = initOutOfBand;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "channel.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_outOfBand = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_outOfBand);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_outOfBand);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpenOk: RabbitMQ.Client.Impl.MethodBase, IChannelOpenOk {
-    public const int ClassId = 20;
-    public const int MethodId = 11;
-
-
-
-    public ChannelOpenOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "channel.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlow: RabbitMQ.Client.Impl.MethodBase, IChannelFlow {
-    public const int ClassId = 20;
-    public const int MethodId = 20;
-
-    public bool m_active;
-
-    bool IChannelFlow.Active { get { return m_active; } }
-
-    public ChannelFlow() {}
-    public ChannelFlow(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "channel.flow"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlowOk: RabbitMQ.Client.Impl.MethodBase, IChannelFlowOk {
-    public const int ClassId = 20;
-    public const int MethodId = 21;
-
-    public bool m_active;
-
-    bool IChannelFlowOk.Active { get { return m_active; } }
-
-    public ChannelFlowOk() {}
-    public ChannelFlowOk(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "channel.flow-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelAlert: RabbitMQ.Client.Impl.MethodBase, IChannelAlert {
-    public const int ClassId = 20;
-    public const int MethodId = 30;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public System.Collections.IDictionary m_details;
-
-    ushort IChannelAlert.ReplyCode { get { return m_replyCode; } }
-    string IChannelAlert.ReplyText { get { return m_replyText; } }
-    System.Collections.IDictionary IChannelAlert.Details { get { return m_details; } }
-
-    public ChannelAlert() {}
-    public ChannelAlert(
-      ushort initReplyCode,
-      string initReplyText,
-      System.Collections.IDictionary initDetails)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_details = initDetails;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "channel.alert"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_details = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteTable(m_details);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_details);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelClose: RabbitMQ.Client.Impl.MethodBase, IChannelClose {
-    public const int ClassId = 20;
-    public const int MethodId = 40;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IChannelClose.ReplyCode { get { return m_replyCode; } }
-    string IChannelClose.ReplyText { get { return m_replyText; } }
-    ushort IChannelClose.ClassId { get { return m_classId; } }
-    ushort IChannelClose.MethodId { get { return m_methodId; } }
-
-    public ChannelClose() {}
-    public ChannelClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "channel.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelCloseOk: RabbitMQ.Client.Impl.MethodBase, IChannelCloseOk {
-    public const int ClassId = 20;
-    public const int MethodId = 41;
-
-
-
-    public ChannelCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "channel.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequest: RabbitMQ.Client.Impl.MethodBase, IAccessRequest {
-    public const int ClassId = 30;
-    public const int MethodId = 10;
-
-    public string m_realm;
-    public bool m_exclusive;
-    public bool m_passive;
-    public bool m_active;
-    public bool m_write;
-    public bool m_read;
-
-    string IAccessRequest.Realm { get { return m_realm; } }
-    bool IAccessRequest.Exclusive { get { return m_exclusive; } }
-    bool IAccessRequest.Passive { get { return m_passive; } }
-    bool IAccessRequest.Active { get { return m_active; } }
-    bool IAccessRequest.Write { get { return m_write; } }
-    bool IAccessRequest.Read { get { return m_read; } }
-
-    public AccessRequest() {}
-    public AccessRequest(
-      string initRealm,
-      bool initExclusive,
-      bool initPassive,
-      bool initActive,
-      bool initWrite,
-      bool initRead)
-    {
-      m_realm = initRealm;
-      m_exclusive = initExclusive;
-      m_passive = initPassive;
-      m_active = initActive;
-      m_write = initWrite;
-      m_read = initRead;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "access.request"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_realm = reader.ReadShortstr();
-      m_exclusive = reader.ReadBit();
-      m_passive = reader.ReadBit();
-      m_active = reader.ReadBit();
-      m_write = reader.ReadBit();
-      m_read = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_realm);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_active);
-      writer.WriteBit(m_write);
-      writer.WriteBit(m_read);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_realm); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_active); sb.Append(",");
-      sb.Append(m_write); sb.Append(",");
-      sb.Append(m_read);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequestOk: RabbitMQ.Client.Impl.MethodBase, IAccessRequestOk {
-    public const int ClassId = 30;
-    public const int MethodId = 11;
-
-    public ushort m_ticket;
-
-    ushort IAccessRequestOk.Ticket { get { return m_ticket; } }
-
-    public AccessRequestOk() {}
-    public AccessRequestOk(
-      ushort initTicket)
-    {
-      m_ticket = initTicket;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "access.request-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclare: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclare {
-    public const int ClassId = 40;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_type;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_autoDelete;
-    public bool m_internal;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IExchangeDeclare.Ticket { get { return m_ticket; } }
-    string IExchangeDeclare.Exchange { get { return m_exchange; } }
-    string IExchangeDeclare.Type { get { return m_type; } }
-    bool IExchangeDeclare.Passive { get { return m_passive; } }
-    bool IExchangeDeclare.Durable { get { return m_durable; } }
-    bool IExchangeDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IExchangeDeclare.Internal { get { return m_internal; } }
-    bool IExchangeDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IExchangeDeclare.Arguments { get { return m_arguments; } }
-
-    public ExchangeDeclare() {}
-    public ExchangeDeclare(
-      ushort initTicket,
-      string initExchange,
-      string initType,
-      bool initPassive,
-      bool initDurable,
-      bool initAutoDelete,
-      bool initInternal,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_type = initType;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_autoDelete = initAutoDelete;
-      m_internal = initInternal;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "exchange.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_type = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_internal = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_type);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_internal);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_type); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_internal); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclareOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclareOk {
-    public const int ClassId = 40;
-    public const int MethodId = 11;
-
-
-
-    public ExchangeDeclareOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "exchange.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDelete: RabbitMQ.Client.Impl.MethodBase, IExchangeDelete {
-    public const int ClassId = 40;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public bool m_ifUnused;
-    public bool m_nowait;
-
-    ushort IExchangeDelete.Ticket { get { return m_ticket; } }
-    string IExchangeDelete.Exchange { get { return m_exchange; } }
-    bool IExchangeDelete.IfUnused { get { return m_ifUnused; } }
-    bool IExchangeDelete.Nowait { get { return m_nowait; } }
-
-    public ExchangeDelete() {}
-    public ExchangeDelete(
-      ushort initTicket,
-      string initExchange,
-      bool initIfUnused,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_ifUnused = initIfUnused;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "exchange.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeleteOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeleteOk {
-    public const int ClassId = 40;
-    public const int MethodId = 21;
-
-
-
-    public ExchangeDeleteOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "exchange.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclare: RabbitMQ.Client.Impl.MethodBase, IQueueDeclare {
-    public const int ClassId = 50;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_exclusive;
-    public bool m_autoDelete;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueDeclare.Ticket { get { return m_ticket; } }
-    string IQueueDeclare.Queue { get { return m_queue; } }
-    bool IQueueDeclare.Passive { get { return m_passive; } }
-    bool IQueueDeclare.Durable { get { return m_durable; } }
-    bool IQueueDeclare.Exclusive { get { return m_exclusive; } }
-    bool IQueueDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IQueueDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueDeclare.Arguments { get { return m_arguments; } }
-
-    public QueueDeclare() {}
-    public QueueDeclare(
-      ushort initTicket,
-      string initQueue,
-      bool initPassive,
-      bool initDurable,
-      bool initExclusive,
-      bool initAutoDelete,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_exclusive = initExclusive;
-      m_autoDelete = initAutoDelete;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "queue.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclareOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeclareOk {
-    public const int ClassId = 50;
-    public const int MethodId = 11;
-
-    public string m_queue;
-    public uint m_messageCount;
-    public uint m_consumerCount;
-
-    string IQueueDeclareOk.Queue { get { return m_queue; } }
-    uint IQueueDeclareOk.MessageCount { get { return m_messageCount; } }
-    uint IQueueDeclareOk.ConsumerCount { get { return m_consumerCount; } }
-
-    public QueueDeclareOk() {}
-    public QueueDeclareOk(
-      string initQueue,
-      uint initMessageCount,
-      uint initConsumerCount)
-    {
-      m_queue = initQueue;
-      m_messageCount = initMessageCount;
-      m_consumerCount = initConsumerCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "queue.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_queue = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-      m_consumerCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_queue);
-      writer.WriteLong(m_messageCount);
-      writer.WriteLong(m_consumerCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_messageCount); sb.Append(",");
-      sb.Append(m_consumerCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBind: RabbitMQ.Client.Impl.MethodBase, IQueueBind {
-    public const int ClassId = 50;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueBind.Ticket { get { return m_ticket; } }
-    string IQueueBind.Queue { get { return m_queue; } }
-    string IQueueBind.Exchange { get { return m_exchange; } }
-    string IQueueBind.RoutingKey { get { return m_routingKey; } }
-    bool IQueueBind.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueBind.Arguments { get { return m_arguments; } }
-
-    public QueueBind() {}
-    public QueueBind(
-      ushort initTicket,
-      string initQueue,
-      string initExchange,
-      string initRoutingKey,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "queue.bind"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBindOk: RabbitMQ.Client.Impl.MethodBase, IQueueBindOk {
-    public const int ClassId = 50;
-    public const int MethodId = 21;
-
-
-
-    public QueueBindOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "queue.bind-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurge: RabbitMQ.Client.Impl.MethodBase, IQueuePurge {
-    public const int ClassId = 50;
-    public const int MethodId = 30;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_nowait;
-
-    ushort IQueuePurge.Ticket { get { return m_ticket; } }
-    string IQueuePurge.Queue { get { return m_queue; } }
-    bool IQueuePurge.Nowait { get { return m_nowait; } }
-
-    public QueuePurge() {}
-    public QueuePurge(
-      ushort initTicket,
-      string initQueue,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "queue.purge"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurgeOk: RabbitMQ.Client.Impl.MethodBase, IQueuePurgeOk {
-    public const int ClassId = 50;
-    public const int MethodId = 31;
-
-    public uint m_messageCount;
-
-    uint IQueuePurgeOk.MessageCount { get { return m_messageCount; } }
-
-    public QueuePurgeOk() {}
-    public QueuePurgeOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "queue.purge-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDelete: RabbitMQ.Client.Impl.MethodBase, IQueueDelete {
-    public const int ClassId = 50;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_ifUnused;
-    public bool m_ifEmpty;
-    public bool m_nowait;
-
-    ushort IQueueDelete.Ticket { get { return m_ticket; } }
-    string IQueueDelete.Queue { get { return m_queue; } }
-    bool IQueueDelete.IfUnused { get { return m_ifUnused; } }
-    bool IQueueDelete.IfEmpty { get { return m_ifEmpty; } }
-    bool IQueueDelete.Nowait { get { return m_nowait; } }
-
-    public QueueDelete() {}
-    public QueueDelete(
-      ushort initTicket,
-      string initQueue,
-      bool initIfUnused,
-      bool initIfEmpty,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_ifUnused = initIfUnused;
-      m_ifEmpty = initIfEmpty;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "queue.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_ifEmpty = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_ifEmpty);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_ifEmpty); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeleteOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeleteOk {
-    public const int ClassId = 50;
-    public const int MethodId = 41;
-
-    public uint m_messageCount;
-
-    uint IQueueDeleteOk.MessageCount { get { return m_messageCount; } }
-
-    public QueueDeleteOk() {}
-    public QueueDeleteOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "queue.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQos: RabbitMQ.Client.Impl.MethodBase, IBasicQos {
-    public const int ClassId = 60;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IBasicQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IBasicQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IBasicQos.Global { get { return m_global; } }
-
-    public BasicQos() {}
-    public BasicQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "basic.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQosOk: RabbitMQ.Client.Impl.MethodBase, IBasicQosOk {
-    public const int ClassId = 60;
-    public const int MethodId = 11;
-
-
-
-    public BasicQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "basic.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsume: RabbitMQ.Client.Impl.MethodBase, IBasicConsume {
-    public const int ClassId = 60;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-
-    ushort IBasicConsume.Ticket { get { return m_ticket; } }
-    string IBasicConsume.Queue { get { return m_queue; } }
-    string IBasicConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicConsume.NoLocal { get { return m_noLocal; } }
-    bool IBasicConsume.NoAck { get { return m_noAck; } }
-    bool IBasicConsume.Exclusive { get { return m_exclusive; } }
-    bool IBasicConsume.Nowait { get { return m_nowait; } }
-
-    public BasicConsume() {}
-    public BasicConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "basic.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsumeOk: RabbitMQ.Client.Impl.MethodBase, IBasicConsumeOk {
-    public const int ClassId = 60;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IBasicConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicConsumeOk() {}
-    public BasicConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "basic.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancel: RabbitMQ.Client.Impl.MethodBase, IBasicCancel {
-    public const int ClassId = 60;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IBasicCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicCancel.Nowait { get { return m_nowait; } }
-
-    public BasicCancel() {}
-    public BasicCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "basic.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancelOk: RabbitMQ.Client.Impl.MethodBase, IBasicCancelOk {
-    public const int ClassId = 60;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IBasicCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicCancelOk() {}
-    public BasicCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "basic.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicPublish: RabbitMQ.Client.Impl.MethodBase, IBasicPublish {
-    public const int ClassId = 60;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IBasicPublish.Ticket { get { return m_ticket; } }
-    string IBasicPublish.Exchange { get { return m_exchange; } }
-    string IBasicPublish.RoutingKey { get { return m_routingKey; } }
-    bool IBasicPublish.Mandatory { get { return m_mandatory; } }
-    bool IBasicPublish.Immediate { get { return m_immediate; } }
-
-    public BasicPublish() {}
-    public BasicPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "basic.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReturn: RabbitMQ.Client.Impl.MethodBase, IBasicReturn {
-    public const int ClassId = 60;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IBasicReturn.ReplyCode { get { return m_replyCode; } }
-    string IBasicReturn.ReplyText { get { return m_replyText; } }
-    string IBasicReturn.Exchange { get { return m_exchange; } }
-    string IBasicReturn.RoutingKey { get { return m_routingKey; } }
-
-    public BasicReturn() {}
-    public BasicReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "basic.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicDeliver: RabbitMQ.Client.Impl.MethodBase, IBasicDeliver {
-    public const int ClassId = 60;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-
-    string IBasicDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IBasicDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicDeliver.Redelivered { get { return m_redelivered; } }
-    string IBasicDeliver.Exchange { get { return m_exchange; } }
-    string IBasicDeliver.RoutingKey { get { return m_routingKey; } }
-
-    public BasicDeliver() {}
-    public BasicDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "basic.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGet: RabbitMQ.Client.Impl.MethodBase, IBasicGet {
-    public const int ClassId = 60;
-    public const int MethodId = 70;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_noAck;
-
-    ushort IBasicGet.Ticket { get { return m_ticket; } }
-    string IBasicGet.Queue { get { return m_queue; } }
-    bool IBasicGet.NoAck { get { return m_noAck; } }
-
-    public BasicGet() {}
-    public BasicGet(
-      ushort initTicket,
-      string initQueue,
-      bool initNoAck)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_noAck = initNoAck;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "basic.get"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_noAck = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_noAck);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_noAck);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetOk: RabbitMQ.Client.Impl.MethodBase, IBasicGetOk {
-    public const int ClassId = 60;
-    public const int MethodId = 71;
-
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public uint m_messageCount;
-
-    ulong IBasicGetOk.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicGetOk.Redelivered { get { return m_redelivered; } }
-    string IBasicGetOk.Exchange { get { return m_exchange; } }
-    string IBasicGetOk.RoutingKey { get { return m_routingKey; } }
-    uint IBasicGetOk.MessageCount { get { return m_messageCount; } }
-
-    public BasicGetOk() {}
-    public BasicGetOk(
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      uint initMessageCount)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 71; } }
-    public override string ProtocolMethodName { get { return "basic.get-ok"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetEmpty: RabbitMQ.Client.Impl.MethodBase, IBasicGetEmpty {
-    public const int ClassId = 60;
-    public const int MethodId = 72;
-
-    public string m_clusterId;
-
-    string IBasicGetEmpty.ClusterId { get { return m_clusterId; } }
-
-    public BasicGetEmpty() {}
-    public BasicGetEmpty(
-      string initClusterId)
-    {
-      m_clusterId = initClusterId;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 72; } }
-    public override string ProtocolMethodName { get { return "basic.get-empty"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clusterId = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_clusterId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clusterId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicAck: RabbitMQ.Client.Impl.MethodBase, IBasicAck {
-    public const int ClassId = 60;
-    public const int MethodId = 80;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IBasicAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicAck.Multiple { get { return m_multiple; } }
-
-    public BasicAck() {}
-    public BasicAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "basic.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReject: RabbitMQ.Client.Impl.MethodBase, IBasicReject {
-    public const int ClassId = 60;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IBasicReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicReject.Requeue { get { return m_requeue; } }
-
-    public BasicReject() {}
-    public BasicReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "basic.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicRecover: RabbitMQ.Client.Impl.MethodBase, IBasicRecover {
-    public const int ClassId = 60;
-    public const int MethodId = 100;
-
-    public bool m_requeue;
-
-    bool IBasicRecover.Requeue { get { return m_requeue; } }
-
-    public BasicRecover() {}
-    public BasicRecover(
-      bool initRequeue)
-    {
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "basic.recover"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQos: RabbitMQ.Client.Impl.MethodBase, IFileQos {
-    public const int ClassId = 70;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IFileQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IFileQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IFileQos.Global { get { return m_global; } }
-
-    public FileQos() {}
-    public FileQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "file.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQosOk: RabbitMQ.Client.Impl.MethodBase, IFileQosOk {
-    public const int ClassId = 70;
-    public const int MethodId = 11;
-
-
-
-    public FileQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "file.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsume: RabbitMQ.Client.Impl.MethodBase, IFileConsume {
-    public const int ClassId = 70;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-
-    ushort IFileConsume.Ticket { get { return m_ticket; } }
-    string IFileConsume.Queue { get { return m_queue; } }
-    string IFileConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileConsume.NoLocal { get { return m_noLocal; } }
-    bool IFileConsume.NoAck { get { return m_noAck; } }
-    bool IFileConsume.Exclusive { get { return m_exclusive; } }
-    bool IFileConsume.Nowait { get { return m_nowait; } }
-
-    public FileConsume() {}
-    public FileConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "file.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsumeOk: RabbitMQ.Client.Impl.MethodBase, IFileConsumeOk {
-    public const int ClassId = 70;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IFileConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileConsumeOk() {}
-    public FileConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "file.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancel: RabbitMQ.Client.Impl.MethodBase, IFileCancel {
-    public const int ClassId = 70;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IFileCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileCancel.Nowait { get { return m_nowait; } }
-
-    public FileCancel() {}
-    public FileCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "file.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancelOk: RabbitMQ.Client.Impl.MethodBase, IFileCancelOk {
-    public const int ClassId = 70;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IFileCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileCancelOk() {}
-    public FileCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "file.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpen: RabbitMQ.Client.Impl.MethodBase, IFileOpen {
-    public const int ClassId = 70;
-    public const int MethodId = 40;
-
-    public string m_identifier;
-    public ulong m_contentSize;
-
-    string IFileOpen.Identifier { get { return m_identifier; } }
-    ulong IFileOpen.ContentSize { get { return m_contentSize; } }
-
-    public FileOpen() {}
-    public FileOpen(
-      string initIdentifier,
-      ulong initContentSize)
-    {
-      m_identifier = initIdentifier;
-      m_contentSize = initContentSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "file.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_identifier = reader.ReadShortstr();
-      m_contentSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_identifier);
-      writer.WriteLonglong(m_contentSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_identifier); sb.Append(",");
-      sb.Append(m_contentSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpenOk: RabbitMQ.Client.Impl.MethodBase, IFileOpenOk {
-    public const int ClassId = 70;
-    public const int MethodId = 41;
-
-    public ulong m_stagedSize;
-
-    ulong IFileOpenOk.StagedSize { get { return m_stagedSize; } }
-
-    public FileOpenOk() {}
-    public FileOpenOk(
-      ulong initStagedSize)
-    {
-      m_stagedSize = initStagedSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "file.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_stagedSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_stagedSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_stagedSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileStage: RabbitMQ.Client.Impl.MethodBase, IFileStage {
-    public const int ClassId = 70;
-    public const int MethodId = 50;
-
-
-
-    public FileStage(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "file.stage"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FilePublish: RabbitMQ.Client.Impl.MethodBase, IFilePublish {
-    public const int ClassId = 70;
-    public const int MethodId = 60;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-    public string m_identifier;
-
-    ushort IFilePublish.Ticket { get { return m_ticket; } }
-    string IFilePublish.Exchange { get { return m_exchange; } }
-    string IFilePublish.RoutingKey { get { return m_routingKey; } }
-    bool IFilePublish.Mandatory { get { return m_mandatory; } }
-    bool IFilePublish.Immediate { get { return m_immediate; } }
-    string IFilePublish.Identifier { get { return m_identifier; } }
-
-    public FilePublish() {}
-    public FilePublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate,
-      string initIdentifier)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "file.publish"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReturn: RabbitMQ.Client.Impl.MethodBase, IFileReturn {
-    public const int ClassId = 70;
-    public const int MethodId = 70;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IFileReturn.ReplyCode { get { return m_replyCode; } }
-    string IFileReturn.ReplyText { get { return m_replyText; } }
-    string IFileReturn.Exchange { get { return m_exchange; } }
-    string IFileReturn.RoutingKey { get { return m_routingKey; } }
-
-    public FileReturn() {}
-    public FileReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "file.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileDeliver: RabbitMQ.Client.Impl.MethodBase, IFileDeliver {
-    public const int ClassId = 70;
-    public const int MethodId = 80;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public string m_identifier;
-
-    string IFileDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IFileDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileDeliver.Redelivered { get { return m_redelivered; } }
-    string IFileDeliver.Exchange { get { return m_exchange; } }
-    string IFileDeliver.RoutingKey { get { return m_routingKey; } }
-    string IFileDeliver.Identifier { get { return m_identifier; } }
-
-    public FileDeliver() {}
-    public FileDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      string initIdentifier)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "file.deliver"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileAck: RabbitMQ.Client.Impl.MethodBase, IFileAck {
-    public const int ClassId = 70;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IFileAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileAck.Multiple { get { return m_multiple; } }
-
-    public FileAck() {}
-    public FileAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "file.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReject: RabbitMQ.Client.Impl.MethodBase, IFileReject {
-    public const int ClassId = 70;
-    public const int MethodId = 100;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IFileReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileReject.Requeue { get { return m_requeue; } }
-
-    public FileReject() {}
-    public FileReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "file.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQos: RabbitMQ.Client.Impl.MethodBase, IStreamQos {
-    public const int ClassId = 80;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public uint m_consumeRate;
-    public bool m_global;
-
-    uint IStreamQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IStreamQos.PrefetchCount { get { return m_prefetchCount; } }
-    uint IStreamQos.ConsumeRate { get { return m_consumeRate; } }
-    bool IStreamQos.Global { get { return m_global; } }
-
-    public StreamQos() {}
-    public StreamQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      uint initConsumeRate,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_consumeRate = initConsumeRate;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "stream.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_consumeRate = reader.ReadLong();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteLong(m_consumeRate);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_consumeRate); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQosOk: RabbitMQ.Client.Impl.MethodBase, IStreamQosOk {
-    public const int ClassId = 80;
-    public const int MethodId = 11;
-
-
-
-    public StreamQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "stream.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsume: RabbitMQ.Client.Impl.MethodBase, IStreamConsume {
-    public const int ClassId = 80;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_exclusive;
-    public bool m_nowait;
-
-    ushort IStreamConsume.Ticket { get { return m_ticket; } }
-    string IStreamConsume.Queue { get { return m_queue; } }
-    string IStreamConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamConsume.NoLocal { get { return m_noLocal; } }
-    bool IStreamConsume.Exclusive { get { return m_exclusive; } }
-    bool IStreamConsume.Nowait { get { return m_nowait; } }
-
-    public StreamConsume() {}
-    public StreamConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initExclusive,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "stream.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsumeOk: RabbitMQ.Client.Impl.MethodBase, IStreamConsumeOk {
-    public const int ClassId = 80;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IStreamConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamConsumeOk() {}
-    public StreamConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "stream.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancel: RabbitMQ.Client.Impl.MethodBase, IStreamCancel {
-    public const int ClassId = 80;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IStreamCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamCancel.Nowait { get { return m_nowait; } }
-
-    public StreamCancel() {}
-    public StreamCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "stream.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancelOk: RabbitMQ.Client.Impl.MethodBase, IStreamCancelOk {
-    public const int ClassId = 80;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IStreamCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamCancelOk() {}
-    public StreamCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "stream.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamPublish: RabbitMQ.Client.Impl.MethodBase, IStreamPublish {
-    public const int ClassId = 80;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IStreamPublish.Ticket { get { return m_ticket; } }
-    string IStreamPublish.Exchange { get { return m_exchange; } }
-    string IStreamPublish.RoutingKey { get { return m_routingKey; } }
-    bool IStreamPublish.Mandatory { get { return m_mandatory; } }
-    bool IStreamPublish.Immediate { get { return m_immediate; } }
-
-    public StreamPublish() {}
-    public StreamPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "stream.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamReturn: RabbitMQ.Client.Impl.MethodBase, IStreamReturn {
-    public const int ClassId = 80;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IStreamReturn.ReplyCode { get { return m_replyCode; } }
-    string IStreamReturn.ReplyText { get { return m_replyText; } }
-    string IStreamReturn.Exchange { get { return m_exchange; } }
-    string IStreamReturn.RoutingKey { get { return m_routingKey; } }
-
-    public StreamReturn() {}
-    public StreamReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "stream.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamDeliver: RabbitMQ.Client.Impl.MethodBase, IStreamDeliver {
-    public const int ClassId = 80;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public string m_exchange;
-    public string m_queue;
-
-    string IStreamDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IStreamDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    string IStreamDeliver.Exchange { get { return m_exchange; } }
-    string IStreamDeliver.Queue { get { return m_queue; } }
-
-    public StreamDeliver() {}
-    public StreamDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      string initExchange,
-      string initQueue)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_exchange = initExchange;
-      m_queue = initQueue;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "stream.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_exchange = reader.ReadShortstr();
-      m_queue = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_queue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_queue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelect: RabbitMQ.Client.Impl.MethodBase, ITxSelect {
-    public const int ClassId = 90;
-    public const int MethodId = 10;
-
-
-
-    public TxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelectOk: RabbitMQ.Client.Impl.MethodBase, ITxSelectOk {
-    public const int ClassId = 90;
-    public const int MethodId = 11;
-
-
-
-    public TxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "tx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommit: RabbitMQ.Client.Impl.MethodBase, ITxCommit {
-    public const int ClassId = 90;
-    public const int MethodId = 20;
-
-
-
-    public TxCommit(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "tx.commit"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommitOk: RabbitMQ.Client.Impl.MethodBase, ITxCommitOk {
-    public const int ClassId = 90;
-    public const int MethodId = 21;
-
-
-
-    public TxCommitOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "tx.commit-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollback: RabbitMQ.Client.Impl.MethodBase, ITxRollback {
-    public const int ClassId = 90;
-    public const int MethodId = 30;
-
-
-
-    public TxRollback(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "tx.rollback"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollbackOk: RabbitMQ.Client.Impl.MethodBase, ITxRollbackOk {
-    public const int ClassId = 90;
-    public const int MethodId = 31;
-
-
-
-    public TxRollbackOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "tx.rollback-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelect: RabbitMQ.Client.Impl.MethodBase, IDtxSelect {
-    public const int ClassId = 100;
-    public const int MethodId = 10;
-
-
-
-    public DtxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "dtx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelectOk: RabbitMQ.Client.Impl.MethodBase, IDtxSelectOk {
-    public const int ClassId = 100;
-    public const int MethodId = 11;
-
-
-
-    public DtxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "dtx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStart: RabbitMQ.Client.Impl.MethodBase, IDtxStart {
-    public const int ClassId = 100;
-    public const int MethodId = 20;
-
-    public string m_dtxIdentifier;
-
-    string IDtxStart.DtxIdentifier { get { return m_dtxIdentifier; } }
-
-    public DtxStart() {}
-    public DtxStart(
-      string initDtxIdentifier)
-    {
-      m_dtxIdentifier = initDtxIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "dtx.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_dtxIdentifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_dtxIdentifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_dtxIdentifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStartOk: RabbitMQ.Client.Impl.MethodBase, IDtxStartOk {
-    public const int ClassId = 100;
-    public const int MethodId = 21;
-
-
-
-    public DtxStartOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "dtx.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TunnelRequest: RabbitMQ.Client.Impl.MethodBase, ITunnelRequest {
-    public const int ClassId = 110;
-    public const int MethodId = 10;
-
-    public System.Collections.IDictionary m_metaData;
-
-    System.Collections.IDictionary ITunnelRequest.MetaData { get { return m_metaData; } }
-
-    public TunnelRequest() {}
-    public TunnelRequest(
-      System.Collections.IDictionary initMetaData)
-    {
-      m_metaData = initMetaData;
-    }
-
-    public override int ProtocolClassId { get { return 110; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tunnel.request"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_metaData = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_metaData);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_metaData);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestInteger: RabbitMQ.Client.Impl.MethodBase, ITestInteger {
-    public const int ClassId = 120;
-    public const int MethodId = 10;
-
-    public byte m_integer1;
-    public ushort m_integer2;
-    public uint m_integer3;
-    public ulong m_integer4;
-    public byte m_operation;
-
-    byte ITestInteger.Integer1 { get { return m_integer1; } }
-    ushort ITestInteger.Integer2 { get { return m_integer2; } }
-    uint ITestInteger.Integer3 { get { return m_integer3; } }
-    ulong ITestInteger.Integer4 { get { return m_integer4; } }
-    byte ITestInteger.Operation { get { return m_operation; } }
-
-    public TestInteger() {}
-    public TestInteger(
-      byte initInteger1,
-      ushort initInteger2,
-      uint initInteger3,
-      ulong initInteger4,
-      byte initOperation)
-    {
-      m_integer1 = initInteger1;
-      m_integer2 = initInteger2;
-      m_integer3 = initInteger3;
-      m_integer4 = initInteger4;
-      m_operation = initOperation;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "test.integer"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_integer1 = reader.ReadOctet();
-      m_integer2 = reader.ReadShort();
-      m_integer3 = reader.ReadLong();
-      m_integer4 = reader.ReadLonglong();
-      m_operation = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteOctet(m_integer1);
-      writer.WriteShort(m_integer2);
-      writer.WriteLong(m_integer3);
-      writer.WriteLonglong(m_integer4);
-      writer.WriteOctet(m_operation);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_integer1); sb.Append(",");
-      sb.Append(m_integer2); sb.Append(",");
-      sb.Append(m_integer3); sb.Append(",");
-      sb.Append(m_integer4); sb.Append(",");
-      sb.Append(m_operation);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestIntegerOk: RabbitMQ.Client.Impl.MethodBase, ITestIntegerOk {
-    public const int ClassId = 120;
-    public const int MethodId = 11;
-
-    public ulong m_result;
-
-    ulong ITestIntegerOk.Result { get { return m_result; } }
-
-    public TestIntegerOk() {}
-    public TestIntegerOk(
-      ulong initResult)
-    {
-      m_result = initResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "test.integer-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_result = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_result);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_result);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestString: RabbitMQ.Client.Impl.MethodBase, ITestString {
-    public const int ClassId = 120;
-    public const int MethodId = 20;
-
-    public string m_string1;
-    public byte[] m_string2;
-    public byte m_operation;
-
-    string ITestString.String1 { get { return m_string1; } }
-    byte[] ITestString.String2 { get { return m_string2; } }
-    byte ITestString.Operation { get { return m_operation; } }
-
-    public TestString() {}
-    public TestString(
-      string initString1,
-      byte[] initString2,
-      byte initOperation)
-    {
-      m_string1 = initString1;
-      m_string2 = initString2;
-      m_operation = initOperation;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "test.string"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_string1 = reader.ReadShortstr();
-      m_string2 = reader.ReadLongstr();
-      m_operation = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_string1);
-      writer.WriteLongstr(m_string2);
-      writer.WriteOctet(m_operation);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_string1); sb.Append(",");
-      sb.Append(m_string2); sb.Append(",");
-      sb.Append(m_operation);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestStringOk: RabbitMQ.Client.Impl.MethodBase, ITestStringOk {
-    public const int ClassId = 120;
-    public const int MethodId = 21;
-
-    public byte[] m_result;
-
-    byte[] ITestStringOk.Result { get { return m_result; } }
-
-    public TestStringOk() {}
-    public TestStringOk(
-      byte[] initResult)
-    {
-      m_result = initResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "test.string-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_result = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_result);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_result);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestTable: RabbitMQ.Client.Impl.MethodBase, ITestTable {
-    public const int ClassId = 120;
-    public const int MethodId = 30;
-
-    public System.Collections.IDictionary m_table;
-    public byte m_integerOp;
-    public byte m_stringOp;
-
-    System.Collections.IDictionary ITestTable.Table { get { return m_table; } }
-    byte ITestTable.IntegerOp { get { return m_integerOp; } }
-    byte ITestTable.StringOp { get { return m_stringOp; } }
-
-    public TestTable() {}
-    public TestTable(
-      System.Collections.IDictionary initTable,
-      byte initIntegerOp,
-      byte initStringOp)
-    {
-      m_table = initTable;
-      m_integerOp = initIntegerOp;
-      m_stringOp = initStringOp;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "test.table"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_table = reader.ReadTable();
-      m_integerOp = reader.ReadOctet();
-      m_stringOp = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_table);
-      writer.WriteOctet(m_integerOp);
-      writer.WriteOctet(m_stringOp);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_table); sb.Append(",");
-      sb.Append(m_integerOp); sb.Append(",");
-      sb.Append(m_stringOp);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestTableOk: RabbitMQ.Client.Impl.MethodBase, ITestTableOk {
-    public const int ClassId = 120;
-    public const int MethodId = 31;
-
-    public ulong m_integerResult;
-    public byte[] m_stringResult;
-
-    ulong ITestTableOk.IntegerResult { get { return m_integerResult; } }
-    byte[] ITestTableOk.StringResult { get { return m_stringResult; } }
-
-    public TestTableOk() {}
-    public TestTableOk(
-      ulong initIntegerResult,
-      byte[] initStringResult)
-    {
-      m_integerResult = initIntegerResult;
-      m_stringResult = initStringResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "test.table-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_integerResult = reader.ReadLonglong();
-      m_stringResult = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_integerResult);
-      writer.WriteLongstr(m_stringResult);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_integerResult); sb.Append(",");
-      sb.Append(m_stringResult);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestContent: RabbitMQ.Client.Impl.MethodBase, ITestContent {
-    public const int ClassId = 120;
-    public const int MethodId = 40;
-
-
-
-    public TestContent(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "test.content"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestContentOk: RabbitMQ.Client.Impl.MethodBase, ITestContentOk {
-    public const int ClassId = 120;
-    public const int MethodId = 41;
-
-    public uint m_contentChecksum;
-
-    uint ITestContentOk.ContentChecksum { get { return m_contentChecksum; } }
-
-    public TestContentOk() {}
-    public TestContentOk(
-      uint initContentChecksum)
-    {
-      m_contentChecksum = initContentChecksum;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "test.content-ok"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_contentChecksum = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_contentChecksum);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_contentChecksum);
-      sb.Append(")");
-    }
-  }
-
-  public class Model: RabbitMQ.Client.Impl.ModelBase {
-    public Model(RabbitMQ.Client.Impl.ISession session): base(session) {}
-    public override System.UInt16 _Private_AccessRequest(
-      System.String @realm,
-      System.Boolean @exclusive,
-      System.Boolean @passive,
-      System.Boolean @active,
-      System.Boolean @write,
-      System.Boolean @read)
-    {
-      AccessRequest __req = new AccessRequest();
-      __req.m_realm = @realm;
-      __req.m_exclusive = @exclusive;
-      __req.m_passive = @passive;
-      __req.m_active = @active;
-      __req.m_write = @write;
-      __req.m_read = @read;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      AccessRequestOk __rep = __repBase as AccessRequestOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_ticket;
-    }
-    public override void _Private_BasicPublish(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @mandatory,
-      System.Boolean @immediate,
-      RabbitMQ.Client.IBasicProperties @basicProperties,
-      System.Byte[] @body)
-    {
-      BasicPublish __req = new BasicPublish();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_mandatory = @mandatory;
-      __req.m_immediate = @immediate;
-      ModelSend(__req, (BasicProperties) basicProperties,body);
-    }
-    public override void _Private_BasicConsume(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @consumerTag,
-      System.Boolean @noLocal,
-      System.Boolean @noAck,
-      System.Boolean @exclusive,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @filter)
-    {
-      BasicConsume __req = new BasicConsume();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_consumerTag = @consumerTag;
-      __req.m_noLocal = @noLocal;
-      __req.m_noAck = @noAck;
-      __req.m_exclusive = @exclusive;
-      __req.m_nowait = @nowait;
-      if (@filter != null) {
-        throw new UnsupportedMethodFieldException("_Private_BasicConsume","filter");
-      }
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicCancel(
-      System.String @consumerTag,
-      System.Boolean @nowait)
-    {
-      BasicCancel __req = new BasicCancel();
-      __req.m_consumerTag = @consumerTag;
-      __req.m_nowait = @nowait;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelOpen(
-      System.String @outOfBand)
-    {
-      ChannelOpen __req = new ChannelOpen();
-      __req.m_outOfBand = @outOfBand;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelOpenOk __rep = __repBase as ChannelOpenOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ChannelCloseOk()
-    {
-      ChannelCloseOk __req = new ChannelCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ChannelClose __req = new ChannelClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicGet(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @noAck)
-    {
-      BasicGet __req = new BasicGet();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_noAck = @noAck;
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.Impl.ConnectionTuneDetails ConnectionStartOk(
-      System.Collections.IDictionary @clientProperties,
-      System.String @mechanism,
-      System.Byte[] @response,
-      System.String @locale)
-    {
-      ConnectionStartOk __req = new ConnectionStartOk();
-      __req.m_clientProperties = @clientProperties;
-      __req.m_mechanism = @mechanism;
-      __req.m_response = @response;
-      __req.m_locale = @locale;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionTune __rep = __repBase as ConnectionTune;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      RabbitMQ.Client.Impl.ConnectionTuneDetails __result = new RabbitMQ.Client.Impl.ConnectionTuneDetails();
-      __result.channelMax = __rep.m_channelMax;
-      __result.frameMax = __rep.m_frameMax;
-      __result.heartbeat = __rep.m_heartbeat;
-      return __result;
-    }
-    public override void ConnectionTuneOk(
-      System.UInt16 @channelMax,
-      System.UInt32 @frameMax,
-      System.UInt16 @heartbeat)
-    {
-      ConnectionTuneOk __req = new ConnectionTuneOk();
-      __req.m_channelMax = @channelMax;
-      __req.m_frameMax = @frameMax;
-      __req.m_heartbeat = @heartbeat;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionOpen(
-      System.String @virtualHost,
-      System.String @capabilities,
-      System.Boolean @insist)
-    {
-      ConnectionOpen __req = new ConnectionOpen();
-      __req.m_virtualHost = @virtualHost;
-      __req.m_capabilities = @capabilities;
-      __req.m_insist = @insist;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ConnectionClose __req = new ConnectionClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionCloseOk __rep = __repBase as ConnectionCloseOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ConnectionCloseOk()
-    {
-      ConnectionCloseOk __req = new ConnectionCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.IBasicProperties CreateBasicProperties()
-    {
-      return new BasicProperties();
-    }
-    public override RabbitMQ.Client.IFileProperties CreateFileProperties()
-    {
-      return new FileProperties();
-    }
-    public override RabbitMQ.Client.IStreamProperties CreateStreamProperties()
-    {
-      return new StreamProperties();
-    }
-    public override void ChannelFlow(
-      System.Boolean @active)
-    {
-      ChannelFlow __req = new ChannelFlow();
-      __req.m_active = @active;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelFlowOk __rep = __repBase as ChannelFlowOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDeclare(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @type,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @autoDelete,
-      System.Boolean @internal,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      ExchangeDeclare __req = new ExchangeDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_type = @type;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_internal = @internal;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeclareOk __rep = __repBase as ExchangeDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDelete(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.Boolean @ifUnused,
-      System.Boolean @nowait)
-    {
-      ExchangeDelete __req = new ExchangeDelete();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeleteOk __rep = __repBase as ExchangeDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override System.String QueueDeclare(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @exclusive,
-      System.Boolean @autoDelete,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueDeclare __req = new QueueDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_exclusive = @exclusive;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return null;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeclareOk __rep = __repBase as QueueDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_queue;
-    }
-    public override void QueueBind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueBind __req = new QueueBind();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueBindOk __rep = __repBase as QueueBindOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void QueueUnbind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Collections.IDictionary @arguments)
-    {
-      throw new UnsupportedMethodException("QueueUnbind");
-    }
-    public override System.UInt32 QueuePurge(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @nowait)
-    {
-      QueuePurge __req = new QueuePurge();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueuePurgeOk __rep = __repBase as QueuePurgeOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override System.UInt32 QueueDelete(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @ifUnused,
-      System.Boolean @ifEmpty,
-      System.Boolean @nowait)
-    {
-      QueueDelete __req = new QueueDelete();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_ifEmpty = @ifEmpty;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeleteOk __rep = __repBase as QueueDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override void BasicQos(
-      System.UInt32 @prefetchSize,
-      System.UInt16 @prefetchCount,
-      System.Boolean @global)
-    {
-      BasicQos __req = new BasicQos();
-      __req.m_prefetchSize = @prefetchSize;
-      __req.m_prefetchCount = @prefetchCount;
-      __req.m_global = @global;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      BasicQosOk __rep = __repBase as BasicQosOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void BasicAck(
-      System.UInt64 @deliveryTag,
-      System.Boolean @multiple)
-    {
-      BasicAck __req = new BasicAck();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_multiple = @multiple;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicReject(
-      System.UInt64 @deliveryTag,
-      System.Boolean @requeue)
-    {
-      BasicReject __req = new BasicReject();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_requeue = @requeue;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicRecover(
-      System.Boolean @requeue)
-    {
-      BasicRecover __req = new BasicRecover();
-      __req.m_requeue = @requeue;
-      ModelSend(__req,null,null);
-    }
-    public override void TxSelect()
-    {
-      TxSelect __req = new TxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxSelectOk __rep = __repBase as TxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxCommit()
-    {
-      TxCommit __req = new TxCommit();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxCommitOk __rep = __repBase as TxCommitOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxRollback()
-    {
-      TxRollback __req = new TxRollback();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxRollbackOk __rep = __repBase as TxRollbackOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxSelect()
-    {
-      DtxSelect __req = new DtxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxSelectOk __rep = __repBase as DtxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxStart(
-      System.String @dtxIdentifier)
-    {
-      DtxStart __req = new DtxStart();
-      __req.m_dtxIdentifier = @dtxIdentifier;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxStartOk __rep = __repBase as DtxStartOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override bool DispatchAsynchronous(RabbitMQ.Client.Impl.Command cmd) {
-      RabbitMQ.Client.Impl.MethodBase __method = (RabbitMQ.Client.Impl.MethodBase) cmd.Method;
-      switch ((__method.ProtocolClassId << 16) | __method.ProtocolMethodId) {
-        case 3932181: {
-          BasicConsumeOk __impl = (BasicConsumeOk) __method;
-          HandleBasicConsumeOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932191: {
-          BasicCancelOk __impl = (BasicCancelOk) __method;
-          HandleBasicCancelOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932231: {
-          BasicGetOk __impl = (BasicGetOk) __method;
-          HandleBasicGetOk(
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            __impl.m_messageCount,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932232: {
-          HandleBasicGetEmpty();
-          return true;
-        }
-        case 3932220: {
-          BasicDeliver __impl = (BasicDeliver) __method;
-          HandleBasicDeliver(
-            __impl.m_consumerTag,
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932210: {
-          BasicReturn __impl = (BasicReturn) __method;
-          HandleBasicReturn(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 1310760: {
-          ChannelClose __impl = (ChannelClose) __method;
-          HandleChannelClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        case 1310761: {
-          HandleChannelCloseOk();
-          return true;
-        }
-        case 655370: {
-          ConnectionStart __impl = (ConnectionStart) __method;
-          HandleConnectionStart(
-            __impl.m_versionMajor,
-            __impl.m_versionMinor,
-            __impl.m_serverProperties,
-            __impl.m_mechanisms,
-            __impl.m_locales);
-          return true;
-        }
-        case 655401: {
-          ConnectionOpenOk __impl = (ConnectionOpenOk) __method;
-          HandleConnectionOpenOk(
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655410: {
-          ConnectionRedirect __impl = (ConnectionRedirect) __method;
-          HandleConnectionRedirect(
-            __impl.m_host,
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655420: {
-          ConnectionClose __impl = (ConnectionClose) __method;
-          HandleConnectionClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        default: return false;
-      }
-    }
-  }
-}
diff --git a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-9.cs b/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-9.cs
deleted file mode 100644
index 336fea5..0000000
--- a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-0-9.cs
+++ /dev/null
@@ -1,6985 +0,0 @@
-// Autogenerated code. Do not edit.
-
-using RabbitMQ.Client;
-using RabbitMQ.Client.Exceptions;
-
-namespace RabbitMQ.Client.Framing.v0_9 {
-  public class Protocol: RabbitMQ.Client.Framing.Impl.v0_9.ProtocolBase {
-    ///<summary>Protocol major version (= 0)</summary>
-    public override int MajorVersion { get { return 0; } }
-    ///<summary>Protocol minor version (= 9)</summary>
-    public override int MinorVersion { get { return 9; } }
-    ///<summary>Protocol API name (= AMQP_0_9)</summary>
-    public override string ApiName { get { return "AMQP_0_9"; } }
-    ///<summary>Default TCP port (= 5672)</summary>
-    public override int DefaultPort { get { return 5672; } }
-
-    public override RabbitMQ.Client.Impl.MethodBase DecodeMethodFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-      ushort methodId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 10: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionStart result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionStartOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionSecure result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionSecure();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionSecureOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionSecureOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionTune result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionTune();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionTuneOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionTuneOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionOpen result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 42: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionRedirect result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionRedirect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionClose result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 51: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ConnectionCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ConnectionCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 20: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelOpen result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelFlow result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelFlow();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelFlowOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelFlowOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelClose result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelResume result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelResume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelPing result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelPing();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelPong result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelPong();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ChannelOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ChannelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 30: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.AccessRequest result = new RabbitMQ.Client.Framing.Impl.v0_9.AccessRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.AccessRequestOk result = new RabbitMQ.Client.Framing.Impl.v0_9.AccessRequestOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 40: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeclare result = new RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDelete result = new RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_9.ExchangeDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 50: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueDeclare result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueBind result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueBind();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueBindOk result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueBindOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueUnbind result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueUnbind();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 51: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueUnbindOk result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueUnbindOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueuePurge result = new RabbitMQ.Client.Framing.Impl.v0_9.QueuePurge();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueuePurgeOk result = new RabbitMQ.Client.Framing.Impl.v0_9.QueuePurgeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueDelete result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_9.QueueDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_9.QueueDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 60: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicQos result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicQosOk result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicConsume result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicCancel result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicPublish result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicReturn result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicDeliver result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicGet result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicGet();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 71: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicGetOk result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicGetOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 72: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicGetEmpty result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicGetEmpty();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicAck result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicReject result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_9.BasicRecover result = new RabbitMQ.Client.Framing.Impl.v0_9.BasicRecover();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 70: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileQos result = new RabbitMQ.Client.Framing.Impl.v0_9.FileQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileQosOk result = new RabbitMQ.Client.Framing.Impl.v0_9.FileQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileConsume result = new RabbitMQ.Client.Framing.Impl.v0_9.FileConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_9.FileConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileCancel result = new RabbitMQ.Client.Framing.Impl.v0_9.FileCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_9.FileCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileOpen result = new RabbitMQ.Client.Framing.Impl.v0_9.FileOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_9.FileOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileStage result = new RabbitMQ.Client.Framing.Impl.v0_9.FileStage();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FilePublish result = new RabbitMQ.Client.Framing.Impl.v0_9.FilePublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileReturn result = new RabbitMQ.Client.Framing.Impl.v0_9.FileReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileDeliver result = new RabbitMQ.Client.Framing.Impl.v0_9.FileDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileAck result = new RabbitMQ.Client.Framing.Impl.v0_9.FileAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_9.FileReject result = new RabbitMQ.Client.Framing.Impl.v0_9.FileReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 80: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamQos result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamQosOk result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamConsume result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamCancel result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamPublish result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamReturn result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_9.StreamDeliver result = new RabbitMQ.Client.Framing.Impl.v0_9.StreamDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 90: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxSelect result = new RabbitMQ.Client.Framing.Impl.v0_9.TxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_9.TxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxCommit result = new RabbitMQ.Client.Framing.Impl.v0_9.TxCommit();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxCommitOk result = new RabbitMQ.Client.Framing.Impl.v0_9.TxCommitOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxRollback result = new RabbitMQ.Client.Framing.Impl.v0_9.TxRollback();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TxRollbackOk result = new RabbitMQ.Client.Framing.Impl.v0_9.TxRollbackOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 100: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.DtxSelect result = new RabbitMQ.Client.Framing.Impl.v0_9.DtxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_9.DtxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_9.DtxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.DtxStart result = new RabbitMQ.Client.Framing.Impl.v0_9.DtxStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_9.DtxStartOk result = new RabbitMQ.Client.Framing.Impl.v0_9.DtxStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 110: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.TunnelRequest result = new RabbitMQ.Client.Framing.Impl.v0_9.TunnelRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 120: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageTransfer result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageTransfer();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageConsume result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageCancel result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageGet result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageGet();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageRecover result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageRecover();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageOpen result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageClose result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageAppend result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageAppend();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageCheckpoint result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageCheckpoint();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageResume result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageResume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 110: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageQos result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 500: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageOk result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 510: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageEmpty result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageEmpty();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 520: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageReject result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 530: {
-              RabbitMQ.Client.Framing.Impl.v0_9.MessageOffset result = new RabbitMQ.Client.Framing.Impl.v0_9.MessageOffset();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, methodId);
-    }
-
-    public override RabbitMQ.Client.Impl.ContentHeaderBase DecodeContentHeaderFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 60: return new BasicProperties();
-        case 70: return new FileProperties();
-        case 80: return new StreamProperties();
-        case 110: return new TunnelProperties();
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, 0);
-    }
-  }
-  public class Constants {
-    ///<summary>(= 1)</summary>
-    public const int FrameMethod = 1;
-    ///<summary>(= 2)</summary>
-    public const int FrameHeader = 2;
-    ///<summary>(= 3)</summary>
-    public const int FrameBody = 3;
-    ///<summary>(= 4)</summary>
-    public const int FrameOobMethod = 4;
-    ///<summary>(= 5)</summary>
-    public const int FrameOobHeader = 5;
-    ///<summary>(= 6)</summary>
-    public const int FrameOobBody = 6;
-    ///<summary>(= 7)</summary>
-    public const int FrameTrace = 7;
-    ///<summary>(= 8)</summary>
-    public const int FrameHeartbeat = 8;
-    ///<summary>(= 4096)</summary>
-    public const int FrameMinSize = 4096;
-    ///<summary>(= 206)</summary>
-    public const int FrameEnd = 206;
-    ///<summary>(= 200)</summary>
-    public const int ReplySuccess = 200;
-    ///<summary>(= 310)</summary>
-    public const int NotDelivered = 310;
-    ///<summary>(= 311)</summary>
-    public const int ContentTooLarge = 311;
-    ///<summary>(= 312)</summary>
-    public const int NoRoute = 312;
-    ///<summary>(= 313)</summary>
-    public const int NoConsumers = 313;
-    ///<summary>(= 320)</summary>
-    public const int ConnectionForced = 320;
-    ///<summary>(= 402)</summary>
-    public const int InvalidPath = 402;
-    ///<summary>(= 403)</summary>
-    public const int AccessRefused = 403;
-    ///<summary>(= 404)</summary>
-    public const int NotFound = 404;
-    ///<summary>(= 405)</summary>
-    public const int ResourceLocked = 405;
-    ///<summary>(= 406)</summary>
-    public const int PreconditionFailed = 406;
-    ///<summary>(= 501)</summary>
-    public const int FrameError = 501;
-    ///<summary>(= 502)</summary>
-    public const int SyntaxError = 502;
-    ///<summary>(= 503)</summary>
-    public const int CommandInvalid = 503;
-    ///<summary>(= 504)</summary>
-    public const int ChannelError = 504;
-    ///<summary>(= 506)</summary>
-    public const int ResourceError = 506;
-    ///<summary>(= 530)</summary>
-    public const int NotAllowed = 530;
-    ///<summary>(= 540)</summary>
-    public const int NotImplemented = 540;
-    ///<summary>(= 541)</summary>
-    public const int InternalError = 541;
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start".</summary>
-  public interface IConnectionStart: IMethod {
-    byte VersionMajor { get; }
-    byte VersionMinor { get; }
-    System.Collections.IDictionary ServerProperties { get; }
-    byte[] Mechanisms { get; }
-    byte[] Locales { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start-ok".</summary>
-  public interface IConnectionStartOk: IMethod {
-    System.Collections.IDictionary ClientProperties { get; }
-    string Mechanism { get; }
-    byte[] Response { get; }
-    string Locale { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure".</summary>
-  public interface IConnectionSecure: IMethod {
-    byte[] Challenge { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure-ok".</summary>
-  public interface IConnectionSecureOk: IMethod {
-    byte[] Response { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune".</summary>
-  public interface IConnectionTune: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune-ok".</summary>
-  public interface IConnectionTuneOk: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open".</summary>
-  public interface IConnectionOpen: IMethod {
-    string VirtualHost { get; }
-    string Capabilities { get; }
-    bool Insist { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open-ok".</summary>
-  public interface IConnectionOpenOk: IMethod {
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.redirect".</summary>
-  public interface IConnectionRedirect: IMethod {
-    string Host { get; }
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close".</summary>
-  public interface IConnectionClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close-ok".</summary>
-  public interface IConnectionCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open".</summary>
-  public interface IChannelOpen: IMethod {
-    string OutOfBand { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open-ok".</summary>
-  public interface IChannelOpenOk: IMethod {
-    byte[] ChannelId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow".</summary>
-  public interface IChannelFlow: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow-ok".</summary>
-  public interface IChannelFlowOk: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close".</summary>
-  public interface IChannelClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close-ok".</summary>
-  public interface IChannelCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.resume".</summary>
-  public interface IChannelResume: IMethod {
-    byte[] ChannelId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.ping".</summary>
-  public interface IChannelPing: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.pong".</summary>
-  public interface IChannelPong: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.ok".</summary>
-  public interface IChannelOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request".</summary>
-  public interface IAccessRequest: IMethod {
-    string Realm { get; }
-    bool Exclusive { get; }
-    bool Passive { get; }
-    bool Active { get; }
-    bool Write { get; }
-    bool Read { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request-ok".</summary>
-  public interface IAccessRequestOk: IMethod {
-    ushort Ticket { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare".</summary>
-  public interface IExchangeDeclare: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string Type { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool AutoDelete { get; }
-    bool Internal { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare-ok".</summary>
-  public interface IExchangeDeclareOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete".</summary>
-  public interface IExchangeDelete: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    bool IfUnused { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete-ok".</summary>
-  public interface IExchangeDeleteOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare".</summary>
-  public interface IQueueDeclare: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool Exclusive { get; }
-    bool AutoDelete { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare-ok".</summary>
-  public interface IQueueDeclareOk: IMethod {
-    string Queue { get; }
-    uint MessageCount { get; }
-    uint ConsumerCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind".</summary>
-  public interface IQueueBind: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind-ok".</summary>
-  public interface IQueueBindOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.unbind".</summary>
-  public interface IQueueUnbind: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.unbind-ok".</summary>
-  public interface IQueueUnbindOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge".</summary>
-  public interface IQueuePurge: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge-ok".</summary>
-  public interface IQueuePurgeOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete".</summary>
-  public interface IQueueDelete: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool IfUnused { get; }
-    bool IfEmpty { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete-ok".</summary>
-  public interface IQueueDeleteOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos".</summary>
-  public interface IBasicQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos-ok".</summary>
-  public interface IBasicQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume".</summary>
-  public interface IBasicConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Filter { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume-ok".</summary>
-  public interface IBasicConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel".</summary>
-  public interface IBasicCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel-ok".</summary>
-  public interface IBasicCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.publish".</summary>
-  public interface IBasicPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.return".</summary>
-  public interface IBasicReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.deliver".</summary>
-  public interface IBasicDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get".</summary>
-  public interface IBasicGet: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool NoAck { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-ok".</summary>
-  public interface IBasicGetOk: IMethod {
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-empty".</summary>
-  public interface IBasicGetEmpty: IMethod {
-    string ClusterId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.ack".</summary>
-  public interface IBasicAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.reject".</summary>
-  public interface IBasicReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.recover".</summary>
-  public interface IBasicRecover: IMethod {
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos".</summary>
-  public interface IFileQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos-ok".</summary>
-  public interface IFileQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume".</summary>
-  public interface IFileConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Filter { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume-ok".</summary>
-  public interface IFileConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel".</summary>
-  public interface IFileCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel-ok".</summary>
-  public interface IFileCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open".</summary>
-  public interface IFileOpen: IMethod {
-    string Identifier { get; }
-    ulong ContentSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open-ok".</summary>
-  public interface IFileOpenOk: IMethod {
-    ulong StagedSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.stage".</summary>
-  public interface IFileStage: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.publish".</summary>
-  public interface IFilePublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.return".</summary>
-  public interface IFileReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.deliver".</summary>
-  public interface IFileDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.ack".</summary>
-  public interface IFileAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.reject".</summary>
-  public interface IFileReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos".</summary>
-  public interface IStreamQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    uint ConsumeRate { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos-ok".</summary>
-  public interface IStreamQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume".</summary>
-  public interface IStreamConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Filter { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume-ok".</summary>
-  public interface IStreamConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel".</summary>
-  public interface IStreamCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel-ok".</summary>
-  public interface IStreamCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.publish".</summary>
-  public interface IStreamPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.return".</summary>
-  public interface IStreamReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.deliver".</summary>
-  public interface IStreamDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    string Exchange { get; }
-    string Queue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select".</summary>
-  public interface ITxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select-ok".</summary>
-  public interface ITxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit".</summary>
-  public interface ITxCommit: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit-ok".</summary>
-  public interface ITxCommitOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback".</summary>
-  public interface ITxRollback: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback-ok".</summary>
-  public interface ITxRollbackOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select".</summary>
-  public interface IDtxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select-ok".</summary>
-  public interface IDtxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start".</summary>
-  public interface IDtxStart: IMethod {
-    string DtxIdentifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start-ok".</summary>
-  public interface IDtxStartOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tunnel.request".</summary>
-  public interface ITunnelRequest: IMethod {
-    System.Collections.IDictionary MetaData { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.transfer".</summary>
-  public interface IMessageTransfer: IMethod {
-    ushort Ticket { get; }
-    string Destination { get; }
-    bool Redelivered { get; }
-    bool Immediate { get; }
-    ulong Ttl { get; }
-    byte Priority { get; }
-    AmqpTimestamp Timestamp { get; }
-    byte DeliveryMode { get; }
-    AmqpTimestamp Expiration { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    string MessageId { get; }
-    string CorrelationId { get; }
-    string ReplyTo { get; }
-    string ContentType { get; }
-    string ContentEncoding { get; }
-    string UserId { get; }
-    string AppId { get; }
-    string TransactionId { get; }
-    byte[] SecurityToken { get; }
-    System.Collections.IDictionary ApplicationHeaders { get; }
-    byte[] Body { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.consume".</summary>
-  public interface IMessageConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Destination { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    System.Collections.IDictionary Filter { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.cancel".</summary>
-  public interface IMessageCancel: IMethod {
-    string Destination { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.get".</summary>
-  public interface IMessageGet: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Destination { get; }
-    bool NoAck { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.recover".</summary>
-  public interface IMessageRecover: IMethod {
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.open".</summary>
-  public interface IMessageOpen: IMethod {
-    byte[] Reference { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.close".</summary>
-  public interface IMessageClose: IMethod {
-    byte[] Reference { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.append".</summary>
-  public interface IMessageAppend: IMethod {
-    byte[] Reference { get; }
-    byte[] Bytes { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.checkpoint".</summary>
-  public interface IMessageCheckpoint: IMethod {
-    byte[] Reference { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.resume".</summary>
-  public interface IMessageResume: IMethod {
-    byte[] Reference { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.qos".</summary>
-  public interface IMessageQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.ok".</summary>
-  public interface IMessageOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.empty".</summary>
-  public interface IMessageEmpty: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.reject".</summary>
-  public interface IMessageReject: IMethod {
-    ushort Code { get; }
-    string Text { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "message.offset".</summary>
-  public interface IMessageOffset: IMethod {
-    ulong Value { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "basic"</summary>
-  public class BasicProperties: RabbitMQ.Client.Impl.BasicProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_deliveryMode;
-    private byte m_priority;
-    private string m_correlationId;
-    private string m_replyTo;
-    private string m_expiration;
-    private string m_messageId;
-    private AmqpTimestamp m_timestamp;
-    private string m_type;
-    private string m_userId;
-    private string m_appId;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool deliveryMode_present = false;
-    private bool priority_present = false;
-    private bool correlationId_present = false;
-    private bool replyTo_present = false;
-    private bool expiration_present = false;
-    private bool messageId_present = false;
-    private bool timestamp_present = false;
-    private bool type_present = false;
-    private bool userId_present = false;
-    private bool appId_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte DeliveryMode {
-      get {
-        return m_deliveryMode;
-      }
-      set {
-        deliveryMode_present = true;
-        m_deliveryMode = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string CorrelationId {
-      get {
-        return m_correlationId;
-      }
-      set {
-        correlationId_present = true;
-        m_correlationId = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string Expiration {
-      get {
-        return m_expiration;
-      }
-      set {
-        expiration_present = true;
-        m_expiration = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string Type {
-      get {
-        return m_type;
-      }
-      set {
-        type_present = true;
-        m_type = value;
-      }
-    }
-    public override string UserId {
-      get {
-        return m_userId;
-      }
-      set {
-        userId_present = true;
-        m_userId = value;
-      }
-    }
-    public override string AppId {
-      get {
-        return m_appId;
-      }
-      set {
-        appId_present = true;
-        m_appId = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearDeliveryMode() { deliveryMode_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearCorrelationId() { correlationId_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearExpiration() { expiration_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearType() { type_present = false; }
-    public override void ClearUserId() { userId_present = false; }
-    public override void ClearAppId() { appId_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public BasicProperties() {}
-    public override int ProtocolClassId { get { return 60; } }
-    public override string ProtocolClassName { get { return "basic"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      deliveryMode_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      correlationId_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      expiration_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      type_present = reader.ReadPresence();
-      userId_present = reader.ReadPresence();
-      appId_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (deliveryMode_present) { m_deliveryMode = reader.ReadOctet(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (correlationId_present) { m_correlationId = reader.ReadShortstr(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (expiration_present) { m_expiration = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (type_present) { m_type = reader.ReadShortstr(); }
-      if (userId_present) { m_userId = reader.ReadShortstr(); }
-      if (appId_present) { m_appId = reader.ReadShortstr(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(deliveryMode_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(correlationId_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(expiration_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(type_present);
-      writer.WritePresence(userId_present);
-      writer.WritePresence(appId_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (deliveryMode_present) { writer.WriteOctet(m_deliveryMode); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (correlationId_present) { writer.WriteShortstr(m_correlationId); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (expiration_present) { writer.WriteShortstr(m_expiration); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (type_present) { writer.WriteShortstr(m_type); }
-      if (userId_present) { writer.WriteShortstr(m_userId); }
-      if (appId_present) { writer.WriteShortstr(m_appId); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content-type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content-encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("delivery-mode="); sb.Append(deliveryMode_present ? m_deliveryMode.ToString() : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("correlation-id="); sb.Append(correlationId_present ? (m_correlationId == null ? "(null)" : m_correlationId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("reply-to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("expiration="); sb.Append(expiration_present ? (m_expiration == null ? "(null)" : m_expiration.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message-id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("type="); sb.Append(type_present ? (m_type == null ? "(null)" : m_type.ToString()) : "_"); sb.Append(", ");
-      sb.Append("user-id="); sb.Append(userId_present ? (m_userId == null ? "(null)" : m_userId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("app-id="); sb.Append(appId_present ? (m_appId == null ? "(null)" : m_appId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("cluster-id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "file"</summary>
-  public class FileProperties: RabbitMQ.Client.Impl.FileProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private string m_replyTo;
-    private string m_messageId;
-    private string m_filename;
-    private AmqpTimestamp m_timestamp;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool replyTo_present = false;
-    private bool messageId_present = false;
-    private bool filename_present = false;
-    private bool timestamp_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override string Filename {
-      get {
-        return m_filename;
-      }
-      set {
-        filename_present = true;
-        m_filename = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearFilename() { filename_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public FileProperties() {}
-    public override int ProtocolClassId { get { return 70; } }
-    public override string ProtocolClassName { get { return "file"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      filename_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (filename_present) { m_filename = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(filename_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (filename_present) { writer.WriteShortstr(m_filename); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content-type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content-encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("reply-to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message-id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("filename="); sb.Append(filename_present ? (m_filename == null ? "(null)" : m_filename.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("cluster-id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "stream"</summary>
-  public class StreamProperties: RabbitMQ.Client.Impl.StreamProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private AmqpTimestamp m_timestamp;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool timestamp_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-
-    public StreamProperties() {}
-    public override int ProtocolClassId { get { return 80; } }
-    public override string ProtocolClassName { get { return "stream"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(timestamp_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content-type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content-encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "tunnel"</summary>
-  public class TunnelProperties: RabbitMQ.Client.Impl.ContentHeaderBase {
-    private System.Collections.IDictionary m_headers;
-    private string m_proxyName;
-    private string m_dataName;
-    private byte m_durable;
-    private byte m_broadcast;
-
-    private bool headers_present = false;
-    private bool proxyName_present = false;
-    private bool dataName_present = false;
-    private bool durable_present = false;
-    private bool broadcast_present = false;
-
-    public System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public string ProxyName {
-      get {
-        return m_proxyName;
-      }
-      set {
-        proxyName_present = true;
-        m_proxyName = value;
-      }
-    }
-    public string DataName {
-      get {
-        return m_dataName;
-      }
-      set {
-        dataName_present = true;
-        m_dataName = value;
-      }
-    }
-    public byte Durable {
-      get {
-        return m_durable;
-      }
-      set {
-        durable_present = true;
-        m_durable = value;
-      }
-    }
-    public byte Broadcast {
-      get {
-        return m_broadcast;
-      }
-      set {
-        broadcast_present = true;
-        m_broadcast = value;
-      }
-    }
-
-    public void ClearHeaders() { headers_present = false; }
-    public void ClearProxyName() { proxyName_present = false; }
-    public void ClearDataName() { dataName_present = false; }
-    public void ClearDurable() { durable_present = false; }
-    public void ClearBroadcast() { broadcast_present = false; }
-
-    public TunnelProperties() {}
-    public override int ProtocolClassId { get { return 110; } }
-    public override string ProtocolClassName { get { return "tunnel"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      headers_present = reader.ReadPresence();
-      proxyName_present = reader.ReadPresence();
-      dataName_present = reader.ReadPresence();
-      durable_present = reader.ReadPresence();
-      broadcast_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (proxyName_present) { m_proxyName = reader.ReadShortstr(); }
-      if (dataName_present) { m_dataName = reader.ReadShortstr(); }
-      if (durable_present) { m_durable = reader.ReadOctet(); }
-      if (broadcast_present) { m_broadcast = reader.ReadOctet(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(headers_present);
-      writer.WritePresence(proxyName_present);
-      writer.WritePresence(dataName_present);
-      writer.WritePresence(durable_present);
-      writer.WritePresence(broadcast_present);
-      writer.FinishPresence();
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (proxyName_present) { writer.WriteShortstr(m_proxyName); }
-      if (dataName_present) { writer.WriteShortstr(m_dataName); }
-      if (durable_present) { writer.WriteOctet(m_durable); }
-      if (broadcast_present) { writer.WriteOctet(m_broadcast); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("proxy-name="); sb.Append(proxyName_present ? (m_proxyName == null ? "(null)" : m_proxyName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("data-name="); sb.Append(dataName_present ? (m_dataName == null ? "(null)" : m_dataName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("durable="); sb.Append(durable_present ? m_durable.ToString() : "_"); sb.Append(", ");
-      sb.Append("broadcast="); sb.Append(broadcast_present ? m_broadcast.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-}
-namespace RabbitMQ.Client.Framing.Impl.v0_9 {
-  using RabbitMQ.Client.Framing.v0_9;
-  public enum ClassId {
-    Connection = 10,
-    Channel = 20,
-    Access = 30,
-    Exchange = 40,
-    Queue = 50,
-    Basic = 60,
-    File = 70,
-    Stream = 80,
-    Tx = 90,
-    Dtx = 100,
-    Tunnel = 110,
-    Message = 120,
-    Invalid = -1
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStart: RabbitMQ.Client.Impl.MethodBase, IConnectionStart {
-    public const int ClassId = 10;
-    public const int MethodId = 10;
-
-    public byte m_versionMajor;
-    public byte m_versionMinor;
-    public System.Collections.IDictionary m_serverProperties;
-    public byte[] m_mechanisms;
-    public byte[] m_locales;
-
-    byte IConnectionStart.VersionMajor { get { return m_versionMajor; } }
-    byte IConnectionStart.VersionMinor { get { return m_versionMinor; } }
-    System.Collections.IDictionary IConnectionStart.ServerProperties { get { return m_serverProperties; } }
-    byte[] IConnectionStart.Mechanisms { get { return m_mechanisms; } }
-    byte[] IConnectionStart.Locales { get { return m_locales; } }
-
-    public ConnectionStart() {}
-    public ConnectionStart(
-      byte initVersionMajor,
-      byte initVersionMinor,
-      System.Collections.IDictionary initServerProperties,
-      byte[] initMechanisms,
-      byte[] initLocales)
-    {
-      m_versionMajor = initVersionMajor;
-      m_versionMinor = initVersionMinor;
-      m_serverProperties = initServerProperties;
-      m_mechanisms = initMechanisms;
-      m_locales = initLocales;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "connection.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_versionMajor = reader.ReadOctet();
-      m_versionMinor = reader.ReadOctet();
-      m_serverProperties = reader.ReadTable();
-      m_mechanisms = reader.ReadLongstr();
-      m_locales = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteOctet(m_versionMajor);
-      writer.WriteOctet(m_versionMinor);
-      writer.WriteTable(m_serverProperties);
-      writer.WriteLongstr(m_mechanisms);
-      writer.WriteLongstr(m_locales);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_versionMajor); sb.Append(",");
-      sb.Append(m_versionMinor); sb.Append(",");
-      sb.Append(m_serverProperties); sb.Append(",");
-      sb.Append(m_mechanisms); sb.Append(",");
-      sb.Append(m_locales);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStartOk: RabbitMQ.Client.Impl.MethodBase, IConnectionStartOk {
-    public const int ClassId = 10;
-    public const int MethodId = 11;
-
-    public System.Collections.IDictionary m_clientProperties;
-    public string m_mechanism;
-    public byte[] m_response;
-    public string m_locale;
-
-    System.Collections.IDictionary IConnectionStartOk.ClientProperties { get { return m_clientProperties; } }
-    string IConnectionStartOk.Mechanism { get { return m_mechanism; } }
-    byte[] IConnectionStartOk.Response { get { return m_response; } }
-    string IConnectionStartOk.Locale { get { return m_locale; } }
-
-    public ConnectionStartOk() {}
-    public ConnectionStartOk(
-      System.Collections.IDictionary initClientProperties,
-      string initMechanism,
-      byte[] initResponse,
-      string initLocale)
-    {
-      m_clientProperties = initClientProperties;
-      m_mechanism = initMechanism;
-      m_response = initResponse;
-      m_locale = initLocale;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "connection.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clientProperties = reader.ReadTable();
-      m_mechanism = reader.ReadShortstr();
-      m_response = reader.ReadLongstr();
-      m_locale = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_clientProperties);
-      writer.WriteShortstr(m_mechanism);
-      writer.WriteLongstr(m_response);
-      writer.WriteShortstr(m_locale);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clientProperties); sb.Append(",");
-      sb.Append(m_mechanism); sb.Append(",");
-      sb.Append(m_response); sb.Append(",");
-      sb.Append(m_locale);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecure: RabbitMQ.Client.Impl.MethodBase, IConnectionSecure {
-    public const int ClassId = 10;
-    public const int MethodId = 20;
-
-    public byte[] m_challenge;
-
-    byte[] IConnectionSecure.Challenge { get { return m_challenge; } }
-
-    public ConnectionSecure() {}
-    public ConnectionSecure(
-      byte[] initChallenge)
-    {
-      m_challenge = initChallenge;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "connection.secure"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_challenge = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_challenge);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_challenge);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecureOk: RabbitMQ.Client.Impl.MethodBase, IConnectionSecureOk {
-    public const int ClassId = 10;
-    public const int MethodId = 21;
-
-    public byte[] m_response;
-
-    byte[] IConnectionSecureOk.Response { get { return m_response; } }
-
-    public ConnectionSecureOk() {}
-    public ConnectionSecureOk(
-      byte[] initResponse)
-    {
-      m_response = initResponse;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "connection.secure-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_response = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_response);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_response);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTune: RabbitMQ.Client.Impl.MethodBase, IConnectionTune {
-    public const int ClassId = 10;
-    public const int MethodId = 30;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTune.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTune.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTune.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTune() {}
-    public ConnectionTune(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "connection.tune"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTuneOk: RabbitMQ.Client.Impl.MethodBase, IConnectionTuneOk {
-    public const int ClassId = 10;
-    public const int MethodId = 31;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTuneOk.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTuneOk.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTuneOk.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTuneOk() {}
-    public ConnectionTuneOk(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "connection.tune-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpen: RabbitMQ.Client.Impl.MethodBase, IConnectionOpen {
-    public const int ClassId = 10;
-    public const int MethodId = 40;
-
-    public string m_virtualHost;
-    public string m_capabilities;
-    public bool m_insist;
-
-    string IConnectionOpen.VirtualHost { get { return m_virtualHost; } }
-    string IConnectionOpen.Capabilities { get { return m_capabilities; } }
-    bool IConnectionOpen.Insist { get { return m_insist; } }
-
-    public ConnectionOpen() {}
-    public ConnectionOpen(
-      string initVirtualHost,
-      string initCapabilities,
-      bool initInsist)
-    {
-      m_virtualHost = initVirtualHost;
-      m_capabilities = initCapabilities;
-      m_insist = initInsist;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "connection.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_virtualHost = reader.ReadShortstr();
-      m_capabilities = reader.ReadShortstr();
-      m_insist = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_virtualHost);
-      writer.WriteShortstr(m_capabilities);
-      writer.WriteBit(m_insist);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_virtualHost); sb.Append(",");
-      sb.Append(m_capabilities); sb.Append(",");
-      sb.Append(m_insist);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpenOk: RabbitMQ.Client.Impl.MethodBase, IConnectionOpenOk {
-    public const int ClassId = 10;
-    public const int MethodId = 41;
-
-    public string m_knownHosts;
-
-    string IConnectionOpenOk.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionOpenOk() {}
-    public ConnectionOpenOk(
-      string initKnownHosts)
-    {
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "connection.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionRedirect: RabbitMQ.Client.Impl.MethodBase, IConnectionRedirect {
-    public const int ClassId = 10;
-    public const int MethodId = 42;
-
-    public string m_host;
-    public string m_knownHosts;
-
-    string IConnectionRedirect.Host { get { return m_host; } }
-    string IConnectionRedirect.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionRedirect() {}
-    public ConnectionRedirect(
-      string initHost,
-      string initKnownHosts)
-    {
-      m_host = initHost;
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 42; } }
-    public override string ProtocolMethodName { get { return "connection.redirect"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_host = reader.ReadShortstr();
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_host);
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_host); sb.Append(",");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionClose: RabbitMQ.Client.Impl.MethodBase, IConnectionClose {
-    public const int ClassId = 10;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IConnectionClose.ReplyCode { get { return m_replyCode; } }
-    string IConnectionClose.ReplyText { get { return m_replyText; } }
-    ushort IConnectionClose.ClassId { get { return m_classId; } }
-    ushort IConnectionClose.MethodId { get { return m_methodId; } }
-
-    public ConnectionClose() {}
-    public ConnectionClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "connection.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionCloseOk: RabbitMQ.Client.Impl.MethodBase, IConnectionCloseOk {
-    public const int ClassId = 10;
-    public const int MethodId = 51;
-
-
-
-    public ConnectionCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 51; } }
-    public override string ProtocolMethodName { get { return "connection.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpen: RabbitMQ.Client.Impl.MethodBase, IChannelOpen {
-    public const int ClassId = 20;
-    public const int MethodId = 10;
-
-    public string m_outOfBand;
-
-    string IChannelOpen.OutOfBand { get { return m_outOfBand; } }
-
-    public ChannelOpen() {}
-    public ChannelOpen(
-      string initOutOfBand)
-    {
-      m_outOfBand = initOutOfBand;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "channel.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_outOfBand = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_outOfBand);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_outOfBand);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpenOk: RabbitMQ.Client.Impl.MethodBase, IChannelOpenOk {
-    public const int ClassId = 20;
-    public const int MethodId = 11;
-
-    public byte[] m_channelId;
-
-    byte[] IChannelOpenOk.ChannelId { get { return m_channelId; } }
-
-    public ChannelOpenOk() {}
-    public ChannelOpenOk(
-      byte[] initChannelId)
-    {
-      m_channelId = initChannelId;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "channel.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelId = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_channelId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlow: RabbitMQ.Client.Impl.MethodBase, IChannelFlow {
-    public const int ClassId = 20;
-    public const int MethodId = 20;
-
-    public bool m_active;
-
-    bool IChannelFlow.Active { get { return m_active; } }
-
-    public ChannelFlow() {}
-    public ChannelFlow(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "channel.flow"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlowOk: RabbitMQ.Client.Impl.MethodBase, IChannelFlowOk {
-    public const int ClassId = 20;
-    public const int MethodId = 21;
-
-    public bool m_active;
-
-    bool IChannelFlowOk.Active { get { return m_active; } }
-
-    public ChannelFlowOk() {}
-    public ChannelFlowOk(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "channel.flow-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelClose: RabbitMQ.Client.Impl.MethodBase, IChannelClose {
-    public const int ClassId = 20;
-    public const int MethodId = 40;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IChannelClose.ReplyCode { get { return m_replyCode; } }
-    string IChannelClose.ReplyText { get { return m_replyText; } }
-    ushort IChannelClose.ClassId { get { return m_classId; } }
-    ushort IChannelClose.MethodId { get { return m_methodId; } }
-
-    public ChannelClose() {}
-    public ChannelClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "channel.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelCloseOk: RabbitMQ.Client.Impl.MethodBase, IChannelCloseOk {
-    public const int ClassId = 20;
-    public const int MethodId = 41;
-
-
-
-    public ChannelCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "channel.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelResume: RabbitMQ.Client.Impl.MethodBase, IChannelResume {
-    public const int ClassId = 20;
-    public const int MethodId = 50;
-
-    public byte[] m_channelId;
-
-    byte[] IChannelResume.ChannelId { get { return m_channelId; } }
-
-    public ChannelResume() {}
-    public ChannelResume(
-      byte[] initChannelId)
-    {
-      m_channelId = initChannelId;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "channel.resume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelId = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_channelId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelPing: RabbitMQ.Client.Impl.MethodBase, IChannelPing {
-    public const int ClassId = 20;
-    public const int MethodId = 60;
-
-
-
-    public ChannelPing(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "channel.ping"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelPong: RabbitMQ.Client.Impl.MethodBase, IChannelPong {
-    public const int ClassId = 20;
-    public const int MethodId = 70;
-
-
-
-    public ChannelPong(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "channel.pong"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOk: RabbitMQ.Client.Impl.MethodBase, IChannelOk {
-    public const int ClassId = 20;
-    public const int MethodId = 80;
-
-
-
-    public ChannelOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "channel.ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequest: RabbitMQ.Client.Impl.MethodBase, IAccessRequest {
-    public const int ClassId = 30;
-    public const int MethodId = 10;
-
-    public string m_realm;
-    public bool m_exclusive;
-    public bool m_passive;
-    public bool m_active;
-    public bool m_write;
-    public bool m_read;
-
-    string IAccessRequest.Realm { get { return m_realm; } }
-    bool IAccessRequest.Exclusive { get { return m_exclusive; } }
-    bool IAccessRequest.Passive { get { return m_passive; } }
-    bool IAccessRequest.Active { get { return m_active; } }
-    bool IAccessRequest.Write { get { return m_write; } }
-    bool IAccessRequest.Read { get { return m_read; } }
-
-    public AccessRequest() {}
-    public AccessRequest(
-      string initRealm,
-      bool initExclusive,
-      bool initPassive,
-      bool initActive,
-      bool initWrite,
-      bool initRead)
-    {
-      m_realm = initRealm;
-      m_exclusive = initExclusive;
-      m_passive = initPassive;
-      m_active = initActive;
-      m_write = initWrite;
-      m_read = initRead;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "access.request"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_realm = reader.ReadShortstr();
-      m_exclusive = reader.ReadBit();
-      m_passive = reader.ReadBit();
-      m_active = reader.ReadBit();
-      m_write = reader.ReadBit();
-      m_read = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_realm);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_active);
-      writer.WriteBit(m_write);
-      writer.WriteBit(m_read);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_realm); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_active); sb.Append(",");
-      sb.Append(m_write); sb.Append(",");
-      sb.Append(m_read);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequestOk: RabbitMQ.Client.Impl.MethodBase, IAccessRequestOk {
-    public const int ClassId = 30;
-    public const int MethodId = 11;
-
-    public ushort m_ticket;
-
-    ushort IAccessRequestOk.Ticket { get { return m_ticket; } }
-
-    public AccessRequestOk() {}
-    public AccessRequestOk(
-      ushort initTicket)
-    {
-      m_ticket = initTicket;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "access.request-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclare: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclare {
-    public const int ClassId = 40;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_type;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_autoDelete;
-    public bool m_internal;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IExchangeDeclare.Ticket { get { return m_ticket; } }
-    string IExchangeDeclare.Exchange { get { return m_exchange; } }
-    string IExchangeDeclare.Type { get { return m_type; } }
-    bool IExchangeDeclare.Passive { get { return m_passive; } }
-    bool IExchangeDeclare.Durable { get { return m_durable; } }
-    bool IExchangeDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IExchangeDeclare.Internal { get { return m_internal; } }
-    bool IExchangeDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IExchangeDeclare.Arguments { get { return m_arguments; } }
-
-    public ExchangeDeclare() {}
-    public ExchangeDeclare(
-      ushort initTicket,
-      string initExchange,
-      string initType,
-      bool initPassive,
-      bool initDurable,
-      bool initAutoDelete,
-      bool initInternal,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_type = initType;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_autoDelete = initAutoDelete;
-      m_internal = initInternal;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "exchange.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_type = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_internal = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_type);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_internal);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_type); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_internal); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclareOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclareOk {
-    public const int ClassId = 40;
-    public const int MethodId = 11;
-
-
-
-    public ExchangeDeclareOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "exchange.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDelete: RabbitMQ.Client.Impl.MethodBase, IExchangeDelete {
-    public const int ClassId = 40;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public bool m_ifUnused;
-    public bool m_nowait;
-
-    ushort IExchangeDelete.Ticket { get { return m_ticket; } }
-    string IExchangeDelete.Exchange { get { return m_exchange; } }
-    bool IExchangeDelete.IfUnused { get { return m_ifUnused; } }
-    bool IExchangeDelete.Nowait { get { return m_nowait; } }
-
-    public ExchangeDelete() {}
-    public ExchangeDelete(
-      ushort initTicket,
-      string initExchange,
-      bool initIfUnused,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_ifUnused = initIfUnused;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "exchange.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeleteOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeleteOk {
-    public const int ClassId = 40;
-    public const int MethodId = 21;
-
-
-
-    public ExchangeDeleteOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "exchange.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclare: RabbitMQ.Client.Impl.MethodBase, IQueueDeclare {
-    public const int ClassId = 50;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_exclusive;
-    public bool m_autoDelete;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueDeclare.Ticket { get { return m_ticket; } }
-    string IQueueDeclare.Queue { get { return m_queue; } }
-    bool IQueueDeclare.Passive { get { return m_passive; } }
-    bool IQueueDeclare.Durable { get { return m_durable; } }
-    bool IQueueDeclare.Exclusive { get { return m_exclusive; } }
-    bool IQueueDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IQueueDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueDeclare.Arguments { get { return m_arguments; } }
-
-    public QueueDeclare() {}
-    public QueueDeclare(
-      ushort initTicket,
-      string initQueue,
-      bool initPassive,
-      bool initDurable,
-      bool initExclusive,
-      bool initAutoDelete,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_exclusive = initExclusive;
-      m_autoDelete = initAutoDelete;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "queue.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclareOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeclareOk {
-    public const int ClassId = 50;
-    public const int MethodId = 11;
-
-    public string m_queue;
-    public uint m_messageCount;
-    public uint m_consumerCount;
-
-    string IQueueDeclareOk.Queue { get { return m_queue; } }
-    uint IQueueDeclareOk.MessageCount { get { return m_messageCount; } }
-    uint IQueueDeclareOk.ConsumerCount { get { return m_consumerCount; } }
-
-    public QueueDeclareOk() {}
-    public QueueDeclareOk(
-      string initQueue,
-      uint initMessageCount,
-      uint initConsumerCount)
-    {
-      m_queue = initQueue;
-      m_messageCount = initMessageCount;
-      m_consumerCount = initConsumerCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "queue.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_queue = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-      m_consumerCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_queue);
-      writer.WriteLong(m_messageCount);
-      writer.WriteLong(m_consumerCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_messageCount); sb.Append(",");
-      sb.Append(m_consumerCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBind: RabbitMQ.Client.Impl.MethodBase, IQueueBind {
-    public const int ClassId = 50;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueBind.Ticket { get { return m_ticket; } }
-    string IQueueBind.Queue { get { return m_queue; } }
-    string IQueueBind.Exchange { get { return m_exchange; } }
-    string IQueueBind.RoutingKey { get { return m_routingKey; } }
-    bool IQueueBind.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueBind.Arguments { get { return m_arguments; } }
-
-    public QueueBind() {}
-    public QueueBind(
-      ushort initTicket,
-      string initQueue,
-      string initExchange,
-      string initRoutingKey,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "queue.bind"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBindOk: RabbitMQ.Client.Impl.MethodBase, IQueueBindOk {
-    public const int ClassId = 50;
-    public const int MethodId = 21;
-
-
-
-    public QueueBindOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "queue.bind-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueUnbind: RabbitMQ.Client.Impl.MethodBase, IQueueUnbind {
-    public const int ClassId = 50;
-    public const int MethodId = 50;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_exchange;
-    public string m_routingKey;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueUnbind.Ticket { get { return m_ticket; } }
-    string IQueueUnbind.Queue { get { return m_queue; } }
-    string IQueueUnbind.Exchange { get { return m_exchange; } }
-    string IQueueUnbind.RoutingKey { get { return m_routingKey; } }
-    System.Collections.IDictionary IQueueUnbind.Arguments { get { return m_arguments; } }
-
-    public QueueUnbind() {}
-    public QueueUnbind(
-      ushort initTicket,
-      string initQueue,
-      string initExchange,
-      string initRoutingKey,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "queue.unbind"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueUnbindOk: RabbitMQ.Client.Impl.MethodBase, IQueueUnbindOk {
-    public const int ClassId = 50;
-    public const int MethodId = 51;
-
-
-
-    public QueueUnbindOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 51; } }
-    public override string ProtocolMethodName { get { return "queue.unbind-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurge: RabbitMQ.Client.Impl.MethodBase, IQueuePurge {
-    public const int ClassId = 50;
-    public const int MethodId = 30;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_nowait;
-
-    ushort IQueuePurge.Ticket { get { return m_ticket; } }
-    string IQueuePurge.Queue { get { return m_queue; } }
-    bool IQueuePurge.Nowait { get { return m_nowait; } }
-
-    public QueuePurge() {}
-    public QueuePurge(
-      ushort initTicket,
-      string initQueue,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "queue.purge"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurgeOk: RabbitMQ.Client.Impl.MethodBase, IQueuePurgeOk {
-    public const int ClassId = 50;
-    public const int MethodId = 31;
-
-    public uint m_messageCount;
-
-    uint IQueuePurgeOk.MessageCount { get { return m_messageCount; } }
-
-    public QueuePurgeOk() {}
-    public QueuePurgeOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "queue.purge-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDelete: RabbitMQ.Client.Impl.MethodBase, IQueueDelete {
-    public const int ClassId = 50;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_ifUnused;
-    public bool m_ifEmpty;
-    public bool m_nowait;
-
-    ushort IQueueDelete.Ticket { get { return m_ticket; } }
-    string IQueueDelete.Queue { get { return m_queue; } }
-    bool IQueueDelete.IfUnused { get { return m_ifUnused; } }
-    bool IQueueDelete.IfEmpty { get { return m_ifEmpty; } }
-    bool IQueueDelete.Nowait { get { return m_nowait; } }
-
-    public QueueDelete() {}
-    public QueueDelete(
-      ushort initTicket,
-      string initQueue,
-      bool initIfUnused,
-      bool initIfEmpty,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_ifUnused = initIfUnused;
-      m_ifEmpty = initIfEmpty;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "queue.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_ifEmpty = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_ifEmpty);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_ifEmpty); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeleteOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeleteOk {
-    public const int ClassId = 50;
-    public const int MethodId = 41;
-
-    public uint m_messageCount;
-
-    uint IQueueDeleteOk.MessageCount { get { return m_messageCount; } }
-
-    public QueueDeleteOk() {}
-    public QueueDeleteOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "queue.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQos: RabbitMQ.Client.Impl.MethodBase, IBasicQos {
-    public const int ClassId = 60;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IBasicQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IBasicQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IBasicQos.Global { get { return m_global; } }
-
-    public BasicQos() {}
-    public BasicQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "basic.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQosOk: RabbitMQ.Client.Impl.MethodBase, IBasicQosOk {
-    public const int ClassId = 60;
-    public const int MethodId = 11;
-
-
-
-    public BasicQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "basic.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsume: RabbitMQ.Client.Impl.MethodBase, IBasicConsume {
-    public const int ClassId = 60;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_filter;
-
-    ushort IBasicConsume.Ticket { get { return m_ticket; } }
-    string IBasicConsume.Queue { get { return m_queue; } }
-    string IBasicConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicConsume.NoLocal { get { return m_noLocal; } }
-    bool IBasicConsume.NoAck { get { return m_noAck; } }
-    bool IBasicConsume.Exclusive { get { return m_exclusive; } }
-    bool IBasicConsume.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IBasicConsume.Filter { get { return m_filter; } }
-
-    public BasicConsume() {}
-    public BasicConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait,
-      System.Collections.IDictionary initFilter)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-      m_filter = initFilter;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "basic.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_filter = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_filter);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_filter);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsumeOk: RabbitMQ.Client.Impl.MethodBase, IBasicConsumeOk {
-    public const int ClassId = 60;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IBasicConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicConsumeOk() {}
-    public BasicConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "basic.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancel: RabbitMQ.Client.Impl.MethodBase, IBasicCancel {
-    public const int ClassId = 60;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IBasicCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicCancel.Nowait { get { return m_nowait; } }
-
-    public BasicCancel() {}
-    public BasicCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "basic.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancelOk: RabbitMQ.Client.Impl.MethodBase, IBasicCancelOk {
-    public const int ClassId = 60;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IBasicCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicCancelOk() {}
-    public BasicCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "basic.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicPublish: RabbitMQ.Client.Impl.MethodBase, IBasicPublish {
-    public const int ClassId = 60;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IBasicPublish.Ticket { get { return m_ticket; } }
-    string IBasicPublish.Exchange { get { return m_exchange; } }
-    string IBasicPublish.RoutingKey { get { return m_routingKey; } }
-    bool IBasicPublish.Mandatory { get { return m_mandatory; } }
-    bool IBasicPublish.Immediate { get { return m_immediate; } }
-
-    public BasicPublish() {}
-    public BasicPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "basic.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReturn: RabbitMQ.Client.Impl.MethodBase, IBasicReturn {
-    public const int ClassId = 60;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IBasicReturn.ReplyCode { get { return m_replyCode; } }
-    string IBasicReturn.ReplyText { get { return m_replyText; } }
-    string IBasicReturn.Exchange { get { return m_exchange; } }
-    string IBasicReturn.RoutingKey { get { return m_routingKey; } }
-
-    public BasicReturn() {}
-    public BasicReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "basic.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicDeliver: RabbitMQ.Client.Impl.MethodBase, IBasicDeliver {
-    public const int ClassId = 60;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-
-    string IBasicDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IBasicDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicDeliver.Redelivered { get { return m_redelivered; } }
-    string IBasicDeliver.Exchange { get { return m_exchange; } }
-    string IBasicDeliver.RoutingKey { get { return m_routingKey; } }
-
-    public BasicDeliver() {}
-    public BasicDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "basic.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGet: RabbitMQ.Client.Impl.MethodBase, IBasicGet {
-    public const int ClassId = 60;
-    public const int MethodId = 70;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_noAck;
-
-    ushort IBasicGet.Ticket { get { return m_ticket; } }
-    string IBasicGet.Queue { get { return m_queue; } }
-    bool IBasicGet.NoAck { get { return m_noAck; } }
-
-    public BasicGet() {}
-    public BasicGet(
-      ushort initTicket,
-      string initQueue,
-      bool initNoAck)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_noAck = initNoAck;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "basic.get"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_noAck = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_noAck);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_noAck);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetOk: RabbitMQ.Client.Impl.MethodBase, IBasicGetOk {
-    public const int ClassId = 60;
-    public const int MethodId = 71;
-
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public uint m_messageCount;
-
-    ulong IBasicGetOk.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicGetOk.Redelivered { get { return m_redelivered; } }
-    string IBasicGetOk.Exchange { get { return m_exchange; } }
-    string IBasicGetOk.RoutingKey { get { return m_routingKey; } }
-    uint IBasicGetOk.MessageCount { get { return m_messageCount; } }
-
-    public BasicGetOk() {}
-    public BasicGetOk(
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      uint initMessageCount)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 71; } }
-    public override string ProtocolMethodName { get { return "basic.get-ok"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetEmpty: RabbitMQ.Client.Impl.MethodBase, IBasicGetEmpty {
-    public const int ClassId = 60;
-    public const int MethodId = 72;
-
-    public string m_clusterId;
-
-    string IBasicGetEmpty.ClusterId { get { return m_clusterId; } }
-
-    public BasicGetEmpty() {}
-    public BasicGetEmpty(
-      string initClusterId)
-    {
-      m_clusterId = initClusterId;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 72; } }
-    public override string ProtocolMethodName { get { return "basic.get-empty"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clusterId = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_clusterId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clusterId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicAck: RabbitMQ.Client.Impl.MethodBase, IBasicAck {
-    public const int ClassId = 60;
-    public const int MethodId = 80;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IBasicAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicAck.Multiple { get { return m_multiple; } }
-
-    public BasicAck() {}
-    public BasicAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "basic.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReject: RabbitMQ.Client.Impl.MethodBase, IBasicReject {
-    public const int ClassId = 60;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IBasicReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicReject.Requeue { get { return m_requeue; } }
-
-    public BasicReject() {}
-    public BasicReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "basic.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicRecover: RabbitMQ.Client.Impl.MethodBase, IBasicRecover {
-    public const int ClassId = 60;
-    public const int MethodId = 100;
-
-    public bool m_requeue;
-
-    bool IBasicRecover.Requeue { get { return m_requeue; } }
-
-    public BasicRecover() {}
-    public BasicRecover(
-      bool initRequeue)
-    {
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "basic.recover"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQos: RabbitMQ.Client.Impl.MethodBase, IFileQos {
-    public const int ClassId = 70;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IFileQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IFileQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IFileQos.Global { get { return m_global; } }
-
-    public FileQos() {}
-    public FileQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "file.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQosOk: RabbitMQ.Client.Impl.MethodBase, IFileQosOk {
-    public const int ClassId = 70;
-    public const int MethodId = 11;
-
-
-
-    public FileQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "file.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsume: RabbitMQ.Client.Impl.MethodBase, IFileConsume {
-    public const int ClassId = 70;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_filter;
-
-    ushort IFileConsume.Ticket { get { return m_ticket; } }
-    string IFileConsume.Queue { get { return m_queue; } }
-    string IFileConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileConsume.NoLocal { get { return m_noLocal; } }
-    bool IFileConsume.NoAck { get { return m_noAck; } }
-    bool IFileConsume.Exclusive { get { return m_exclusive; } }
-    bool IFileConsume.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IFileConsume.Filter { get { return m_filter; } }
-
-    public FileConsume() {}
-    public FileConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait,
-      System.Collections.IDictionary initFilter)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-      m_filter = initFilter;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "file.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_filter = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_filter);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_filter);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsumeOk: RabbitMQ.Client.Impl.MethodBase, IFileConsumeOk {
-    public const int ClassId = 70;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IFileConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileConsumeOk() {}
-    public FileConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "file.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancel: RabbitMQ.Client.Impl.MethodBase, IFileCancel {
-    public const int ClassId = 70;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IFileCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileCancel.Nowait { get { return m_nowait; } }
-
-    public FileCancel() {}
-    public FileCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "file.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancelOk: RabbitMQ.Client.Impl.MethodBase, IFileCancelOk {
-    public const int ClassId = 70;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IFileCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileCancelOk() {}
-    public FileCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "file.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpen: RabbitMQ.Client.Impl.MethodBase, IFileOpen {
-    public const int ClassId = 70;
-    public const int MethodId = 40;
-
-    public string m_identifier;
-    public ulong m_contentSize;
-
-    string IFileOpen.Identifier { get { return m_identifier; } }
-    ulong IFileOpen.ContentSize { get { return m_contentSize; } }
-
-    public FileOpen() {}
-    public FileOpen(
-      string initIdentifier,
-      ulong initContentSize)
-    {
-      m_identifier = initIdentifier;
-      m_contentSize = initContentSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "file.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_identifier = reader.ReadShortstr();
-      m_contentSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_identifier);
-      writer.WriteLonglong(m_contentSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_identifier); sb.Append(",");
-      sb.Append(m_contentSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpenOk: RabbitMQ.Client.Impl.MethodBase, IFileOpenOk {
-    public const int ClassId = 70;
-    public const int MethodId = 41;
-
-    public ulong m_stagedSize;
-
-    ulong IFileOpenOk.StagedSize { get { return m_stagedSize; } }
-
-    public FileOpenOk() {}
-    public FileOpenOk(
-      ulong initStagedSize)
-    {
-      m_stagedSize = initStagedSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "file.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_stagedSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_stagedSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_stagedSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileStage: RabbitMQ.Client.Impl.MethodBase, IFileStage {
-    public const int ClassId = 70;
-    public const int MethodId = 50;
-
-
-
-    public FileStage(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "file.stage"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FilePublish: RabbitMQ.Client.Impl.MethodBase, IFilePublish {
-    public const int ClassId = 70;
-    public const int MethodId = 60;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-    public string m_identifier;
-
-    ushort IFilePublish.Ticket { get { return m_ticket; } }
-    string IFilePublish.Exchange { get { return m_exchange; } }
-    string IFilePublish.RoutingKey { get { return m_routingKey; } }
-    bool IFilePublish.Mandatory { get { return m_mandatory; } }
-    bool IFilePublish.Immediate { get { return m_immediate; } }
-    string IFilePublish.Identifier { get { return m_identifier; } }
-
-    public FilePublish() {}
-    public FilePublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate,
-      string initIdentifier)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "file.publish"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReturn: RabbitMQ.Client.Impl.MethodBase, IFileReturn {
-    public const int ClassId = 70;
-    public const int MethodId = 70;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IFileReturn.ReplyCode { get { return m_replyCode; } }
-    string IFileReturn.ReplyText { get { return m_replyText; } }
-    string IFileReturn.Exchange { get { return m_exchange; } }
-    string IFileReturn.RoutingKey { get { return m_routingKey; } }
-
-    public FileReturn() {}
-    public FileReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "file.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileDeliver: RabbitMQ.Client.Impl.MethodBase, IFileDeliver {
-    public const int ClassId = 70;
-    public const int MethodId = 80;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public string m_identifier;
-
-    string IFileDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IFileDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileDeliver.Redelivered { get { return m_redelivered; } }
-    string IFileDeliver.Exchange { get { return m_exchange; } }
-    string IFileDeliver.RoutingKey { get { return m_routingKey; } }
-    string IFileDeliver.Identifier { get { return m_identifier; } }
-
-    public FileDeliver() {}
-    public FileDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      string initIdentifier)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "file.deliver"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileAck: RabbitMQ.Client.Impl.MethodBase, IFileAck {
-    public const int ClassId = 70;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IFileAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileAck.Multiple { get { return m_multiple; } }
-
-    public FileAck() {}
-    public FileAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "file.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReject: RabbitMQ.Client.Impl.MethodBase, IFileReject {
-    public const int ClassId = 70;
-    public const int MethodId = 100;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IFileReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileReject.Requeue { get { return m_requeue; } }
-
-    public FileReject() {}
-    public FileReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "file.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQos: RabbitMQ.Client.Impl.MethodBase, IStreamQos {
-    public const int ClassId = 80;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public uint m_consumeRate;
-    public bool m_global;
-
-    uint IStreamQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IStreamQos.PrefetchCount { get { return m_prefetchCount; } }
-    uint IStreamQos.ConsumeRate { get { return m_consumeRate; } }
-    bool IStreamQos.Global { get { return m_global; } }
-
-    public StreamQos() {}
-    public StreamQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      uint initConsumeRate,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_consumeRate = initConsumeRate;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "stream.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_consumeRate = reader.ReadLong();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteLong(m_consumeRate);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_consumeRate); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQosOk: RabbitMQ.Client.Impl.MethodBase, IStreamQosOk {
-    public const int ClassId = 80;
-    public const int MethodId = 11;
-
-
-
-    public StreamQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "stream.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsume: RabbitMQ.Client.Impl.MethodBase, IStreamConsume {
-    public const int ClassId = 80;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_exclusive;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_filter;
-
-    ushort IStreamConsume.Ticket { get { return m_ticket; } }
-    string IStreamConsume.Queue { get { return m_queue; } }
-    string IStreamConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamConsume.NoLocal { get { return m_noLocal; } }
-    bool IStreamConsume.Exclusive { get { return m_exclusive; } }
-    bool IStreamConsume.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IStreamConsume.Filter { get { return m_filter; } }
-
-    public StreamConsume() {}
-    public StreamConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initExclusive,
-      bool initNowait,
-      System.Collections.IDictionary initFilter)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-      m_filter = initFilter;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "stream.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_filter = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_filter);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_filter);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsumeOk: RabbitMQ.Client.Impl.MethodBase, IStreamConsumeOk {
-    public const int ClassId = 80;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IStreamConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamConsumeOk() {}
-    public StreamConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "stream.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancel: RabbitMQ.Client.Impl.MethodBase, IStreamCancel {
-    public const int ClassId = 80;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IStreamCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamCancel.Nowait { get { return m_nowait; } }
-
-    public StreamCancel() {}
-    public StreamCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "stream.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancelOk: RabbitMQ.Client.Impl.MethodBase, IStreamCancelOk {
-    public const int ClassId = 80;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IStreamCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamCancelOk() {}
-    public StreamCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "stream.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamPublish: RabbitMQ.Client.Impl.MethodBase, IStreamPublish {
-    public const int ClassId = 80;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IStreamPublish.Ticket { get { return m_ticket; } }
-    string IStreamPublish.Exchange { get { return m_exchange; } }
-    string IStreamPublish.RoutingKey { get { return m_routingKey; } }
-    bool IStreamPublish.Mandatory { get { return m_mandatory; } }
-    bool IStreamPublish.Immediate { get { return m_immediate; } }
-
-    public StreamPublish() {}
-    public StreamPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "stream.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamReturn: RabbitMQ.Client.Impl.MethodBase, IStreamReturn {
-    public const int ClassId = 80;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IStreamReturn.ReplyCode { get { return m_replyCode; } }
-    string IStreamReturn.ReplyText { get { return m_replyText; } }
-    string IStreamReturn.Exchange { get { return m_exchange; } }
-    string IStreamReturn.RoutingKey { get { return m_routingKey; } }
-
-    public StreamReturn() {}
-    public StreamReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "stream.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamDeliver: RabbitMQ.Client.Impl.MethodBase, IStreamDeliver {
-    public const int ClassId = 80;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public string m_exchange;
-    public string m_queue;
-
-    string IStreamDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IStreamDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    string IStreamDeliver.Exchange { get { return m_exchange; } }
-    string IStreamDeliver.Queue { get { return m_queue; } }
-
-    public StreamDeliver() {}
-    public StreamDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      string initExchange,
-      string initQueue)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_exchange = initExchange;
-      m_queue = initQueue;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "stream.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_exchange = reader.ReadShortstr();
-      m_queue = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_queue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_queue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelect: RabbitMQ.Client.Impl.MethodBase, ITxSelect {
-    public const int ClassId = 90;
-    public const int MethodId = 10;
-
-
-
-    public TxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelectOk: RabbitMQ.Client.Impl.MethodBase, ITxSelectOk {
-    public const int ClassId = 90;
-    public const int MethodId = 11;
-
-
-
-    public TxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "tx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommit: RabbitMQ.Client.Impl.MethodBase, ITxCommit {
-    public const int ClassId = 90;
-    public const int MethodId = 20;
-
-
-
-    public TxCommit(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "tx.commit"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommitOk: RabbitMQ.Client.Impl.MethodBase, ITxCommitOk {
-    public const int ClassId = 90;
-    public const int MethodId = 21;
-
-
-
-    public TxCommitOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "tx.commit-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollback: RabbitMQ.Client.Impl.MethodBase, ITxRollback {
-    public const int ClassId = 90;
-    public const int MethodId = 30;
-
-
-
-    public TxRollback(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "tx.rollback"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollbackOk: RabbitMQ.Client.Impl.MethodBase, ITxRollbackOk {
-    public const int ClassId = 90;
-    public const int MethodId = 31;
-
-
-
-    public TxRollbackOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "tx.rollback-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelect: RabbitMQ.Client.Impl.MethodBase, IDtxSelect {
-    public const int ClassId = 100;
-    public const int MethodId = 10;
-
-
-
-    public DtxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "dtx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelectOk: RabbitMQ.Client.Impl.MethodBase, IDtxSelectOk {
-    public const int ClassId = 100;
-    public const int MethodId = 11;
-
-
-
-    public DtxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "dtx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStart: RabbitMQ.Client.Impl.MethodBase, IDtxStart {
-    public const int ClassId = 100;
-    public const int MethodId = 20;
-
-    public string m_dtxIdentifier;
-
-    string IDtxStart.DtxIdentifier { get { return m_dtxIdentifier; } }
-
-    public DtxStart() {}
-    public DtxStart(
-      string initDtxIdentifier)
-    {
-      m_dtxIdentifier = initDtxIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "dtx.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_dtxIdentifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_dtxIdentifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_dtxIdentifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStartOk: RabbitMQ.Client.Impl.MethodBase, IDtxStartOk {
-    public const int ClassId = 100;
-    public const int MethodId = 21;
-
-
-
-    public DtxStartOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "dtx.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TunnelRequest: RabbitMQ.Client.Impl.MethodBase, ITunnelRequest {
-    public const int ClassId = 110;
-    public const int MethodId = 10;
-
-    public System.Collections.IDictionary m_metaData;
-
-    System.Collections.IDictionary ITunnelRequest.MetaData { get { return m_metaData; } }
-
-    public TunnelRequest() {}
-    public TunnelRequest(
-      System.Collections.IDictionary initMetaData)
-    {
-      m_metaData = initMetaData;
-    }
-
-    public override int ProtocolClassId { get { return 110; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tunnel.request"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_metaData = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_metaData);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_metaData);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageTransfer: RabbitMQ.Client.Impl.MethodBase, IMessageTransfer {
-    public const int ClassId = 120;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_destination;
-    public bool m_redelivered;
-    public bool m_immediate;
-    public ulong m_ttl;
-    public byte m_priority;
-    public AmqpTimestamp m_timestamp;
-    public byte m_deliveryMode;
-    public AmqpTimestamp m_expiration;
-    public string m_exchange;
-    public string m_routingKey;
-    public string m_messageId;
-    public string m_correlationId;
-    public string m_replyTo;
-    public string m_contentType;
-    public string m_contentEncoding;
-    public string m_userId;
-    public string m_appId;
-    public string m_transactionId;
-    public byte[] m_securityToken;
-    public System.Collections.IDictionary m_applicationHeaders;
-    public byte[] m_body;
-
-    ushort IMessageTransfer.Ticket { get { return m_ticket; } }
-    string IMessageTransfer.Destination { get { return m_destination; } }
-    bool IMessageTransfer.Redelivered { get { return m_redelivered; } }
-    bool IMessageTransfer.Immediate { get { return m_immediate; } }
-    ulong IMessageTransfer.Ttl { get { return m_ttl; } }
-    byte IMessageTransfer.Priority { get { return m_priority; } }
-    AmqpTimestamp IMessageTransfer.Timestamp { get { return m_timestamp; } }
-    byte IMessageTransfer.DeliveryMode { get { return m_deliveryMode; } }
-    AmqpTimestamp IMessageTransfer.Expiration { get { return m_expiration; } }
-    string IMessageTransfer.Exchange { get { return m_exchange; } }
-    string IMessageTransfer.RoutingKey { get { return m_routingKey; } }
-    string IMessageTransfer.MessageId { get { return m_messageId; } }
-    string IMessageTransfer.CorrelationId { get { return m_correlationId; } }
-    string IMessageTransfer.ReplyTo { get { return m_replyTo; } }
-    string IMessageTransfer.ContentType { get { return m_contentType; } }
-    string IMessageTransfer.ContentEncoding { get { return m_contentEncoding; } }
-    string IMessageTransfer.UserId { get { return m_userId; } }
-    string IMessageTransfer.AppId { get { return m_appId; } }
-    string IMessageTransfer.TransactionId { get { return m_transactionId; } }
-    byte[] IMessageTransfer.SecurityToken { get { return m_securityToken; } }
-    System.Collections.IDictionary IMessageTransfer.ApplicationHeaders { get { return m_applicationHeaders; } }
-    byte[] IMessageTransfer.Body { get { return m_body; } }
-
-    public MessageTransfer() {}
-    public MessageTransfer(
-      ushort initTicket,
-      string initDestination,
-      bool initRedelivered,
-      bool initImmediate,
-      ulong initTtl,
-      byte initPriority,
-      AmqpTimestamp initTimestamp,
-      byte initDeliveryMode,
-      AmqpTimestamp initExpiration,
-      string initExchange,
-      string initRoutingKey,
-      string initMessageId,
-      string initCorrelationId,
-      string initReplyTo,
-      string initContentType,
-      string initContentEncoding,
-      string initUserId,
-      string initAppId,
-      string initTransactionId,
-      byte[] initSecurityToken,
-      System.Collections.IDictionary initApplicationHeaders,
-      byte[] initBody)
-    {
-      m_ticket = initTicket;
-      m_destination = initDestination;
-      m_redelivered = initRedelivered;
-      m_immediate = initImmediate;
-      m_ttl = initTtl;
-      m_priority = initPriority;
-      m_timestamp = initTimestamp;
-      m_deliveryMode = initDeliveryMode;
-      m_expiration = initExpiration;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_messageId = initMessageId;
-      m_correlationId = initCorrelationId;
-      m_replyTo = initReplyTo;
-      m_contentType = initContentType;
-      m_contentEncoding = initContentEncoding;
-      m_userId = initUserId;
-      m_appId = initAppId;
-      m_transactionId = initTransactionId;
-      m_securityToken = initSecurityToken;
-      m_applicationHeaders = initApplicationHeaders;
-      m_body = initBody;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "message.transfer"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_destination = reader.ReadShortstr();
-      m_redelivered = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-      m_ttl = reader.ReadLonglong();
-      m_priority = reader.ReadOctet();
-      m_timestamp = reader.ReadTimestamp();
-      m_deliveryMode = reader.ReadOctet();
-      m_expiration = reader.ReadTimestamp();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_messageId = reader.ReadShortstr();
-      m_correlationId = reader.ReadShortstr();
-      m_replyTo = reader.ReadShortstr();
-      m_contentType = reader.ReadShortstr();
-      m_contentEncoding = reader.ReadShortstr();
-      m_userId = reader.ReadShortstr();
-      m_appId = reader.ReadShortstr();
-      m_transactionId = reader.ReadShortstr();
-      m_securityToken = reader.ReadLongstr();
-      m_applicationHeaders = reader.ReadTable();
-      m_body = reader.ReadContent();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_destination);
-      writer.WriteBit(m_redelivered);
-      writer.WriteBit(m_immediate);
-      writer.WriteLonglong(m_ttl);
-      writer.WriteOctet(m_priority);
-      writer.WriteTimestamp(m_timestamp);
-      writer.WriteOctet(m_deliveryMode);
-      writer.WriteTimestamp(m_expiration);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteShortstr(m_messageId);
-      writer.WriteShortstr(m_correlationId);
-      writer.WriteShortstr(m_replyTo);
-      writer.WriteShortstr(m_contentType);
-      writer.WriteShortstr(m_contentEncoding);
-      writer.WriteShortstr(m_userId);
-      writer.WriteShortstr(m_appId);
-      writer.WriteShortstr(m_transactionId);
-      writer.WriteLongstr(m_securityToken);
-      writer.WriteTable(m_applicationHeaders);
-      writer.WriteContent(m_body);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_destination); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_immediate); sb.Append(",");
-      sb.Append(m_ttl); sb.Append(",");
-      sb.Append(m_priority); sb.Append(",");
-      sb.Append(m_timestamp); sb.Append(",");
-      sb.Append(m_deliveryMode); sb.Append(",");
-      sb.Append(m_expiration); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_messageId); sb.Append(",");
-      sb.Append(m_correlationId); sb.Append(",");
-      sb.Append(m_replyTo); sb.Append(",");
-      sb.Append(m_contentType); sb.Append(",");
-      sb.Append(m_contentEncoding); sb.Append(",");
-      sb.Append(m_userId); sb.Append(",");
-      sb.Append(m_appId); sb.Append(",");
-      sb.Append(m_transactionId); sb.Append(",");
-      sb.Append(m_securityToken); sb.Append(",");
-      sb.Append(m_applicationHeaders); sb.Append(",");
-      sb.Append(m_body);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageConsume: RabbitMQ.Client.Impl.MethodBase, IMessageConsume {
-    public const int ClassId = 120;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_destination;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public System.Collections.IDictionary m_filter;
-
-    ushort IMessageConsume.Ticket { get { return m_ticket; } }
-    string IMessageConsume.Queue { get { return m_queue; } }
-    string IMessageConsume.Destination { get { return m_destination; } }
-    bool IMessageConsume.NoLocal { get { return m_noLocal; } }
-    bool IMessageConsume.NoAck { get { return m_noAck; } }
-    bool IMessageConsume.Exclusive { get { return m_exclusive; } }
-    System.Collections.IDictionary IMessageConsume.Filter { get { return m_filter; } }
-
-    public MessageConsume() {}
-    public MessageConsume(
-      ushort initTicket,
-      string initQueue,
-      string initDestination,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      System.Collections.IDictionary initFilter)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_destination = initDestination;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_filter = initFilter;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "message.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_destination = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_filter = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_destination);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteTable(m_filter);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_destination); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_filter);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageCancel: RabbitMQ.Client.Impl.MethodBase, IMessageCancel {
-    public const int ClassId = 120;
-    public const int MethodId = 30;
-
-    public string m_destination;
-
-    string IMessageCancel.Destination { get { return m_destination; } }
-
-    public MessageCancel() {}
-    public MessageCancel(
-      string initDestination)
-    {
-      m_destination = initDestination;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "message.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_destination = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_destination);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_destination);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageGet: RabbitMQ.Client.Impl.MethodBase, IMessageGet {
-    public const int ClassId = 120;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_destination;
-    public bool m_noAck;
-
-    ushort IMessageGet.Ticket { get { return m_ticket; } }
-    string IMessageGet.Queue { get { return m_queue; } }
-    string IMessageGet.Destination { get { return m_destination; } }
-    bool IMessageGet.NoAck { get { return m_noAck; } }
-
-    public MessageGet() {}
-    public MessageGet(
-      ushort initTicket,
-      string initQueue,
-      string initDestination,
-      bool initNoAck)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_destination = initDestination;
-      m_noAck = initNoAck;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "message.get"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_destination = reader.ReadShortstr();
-      m_noAck = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_destination);
-      writer.WriteBit(m_noAck);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_destination); sb.Append(",");
-      sb.Append(m_noAck);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageRecover: RabbitMQ.Client.Impl.MethodBase, IMessageRecover {
-    public const int ClassId = 120;
-    public const int MethodId = 50;
-
-    public bool m_requeue;
-
-    bool IMessageRecover.Requeue { get { return m_requeue; } }
-
-    public MessageRecover() {}
-    public MessageRecover(
-      bool initRequeue)
-    {
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "message.recover"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageOpen: RabbitMQ.Client.Impl.MethodBase, IMessageOpen {
-    public const int ClassId = 120;
-    public const int MethodId = 60;
-
-    public byte[] m_reference;
-
-    byte[] IMessageOpen.Reference { get { return m_reference; } }
-
-    public MessageOpen() {}
-    public MessageOpen(
-      byte[] initReference)
-    {
-      m_reference = initReference;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "message.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_reference = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_reference);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_reference);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageClose: RabbitMQ.Client.Impl.MethodBase, IMessageClose {
-    public const int ClassId = 120;
-    public const int MethodId = 70;
-
-    public byte[] m_reference;
-
-    byte[] IMessageClose.Reference { get { return m_reference; } }
-
-    public MessageClose() {}
-    public MessageClose(
-      byte[] initReference)
-    {
-      m_reference = initReference;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "message.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_reference = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_reference);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_reference);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageAppend: RabbitMQ.Client.Impl.MethodBase, IMessageAppend {
-    public const int ClassId = 120;
-    public const int MethodId = 80;
-
-    public byte[] m_reference;
-    public byte[] m_bytes;
-
-    byte[] IMessageAppend.Reference { get { return m_reference; } }
-    byte[] IMessageAppend.Bytes { get { return m_bytes; } }
-
-    public MessageAppend() {}
-    public MessageAppend(
-      byte[] initReference,
-      byte[] initBytes)
-    {
-      m_reference = initReference;
-      m_bytes = initBytes;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "message.append"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_reference = reader.ReadLongstr();
-      m_bytes = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_reference);
-      writer.WriteLongstr(m_bytes);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_reference); sb.Append(",");
-      sb.Append(m_bytes);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageCheckpoint: RabbitMQ.Client.Impl.MethodBase, IMessageCheckpoint {
-    public const int ClassId = 120;
-    public const int MethodId = 90;
-
-    public byte[] m_reference;
-    public string m_identifier;
-
-    byte[] IMessageCheckpoint.Reference { get { return m_reference; } }
-    string IMessageCheckpoint.Identifier { get { return m_identifier; } }
-
-    public MessageCheckpoint() {}
-    public MessageCheckpoint(
-      byte[] initReference,
-      string initIdentifier)
-    {
-      m_reference = initReference;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "message.checkpoint"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_reference = reader.ReadLongstr();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_reference);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_reference); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageResume: RabbitMQ.Client.Impl.MethodBase, IMessageResume {
-    public const int ClassId = 120;
-    public const int MethodId = 100;
-
-    public byte[] m_reference;
-    public string m_identifier;
-
-    byte[] IMessageResume.Reference { get { return m_reference; } }
-    string IMessageResume.Identifier { get { return m_identifier; } }
-
-    public MessageResume() {}
-    public MessageResume(
-      byte[] initReference,
-      string initIdentifier)
-    {
-      m_reference = initReference;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "message.resume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_reference = reader.ReadLongstr();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_reference);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_reference); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageQos: RabbitMQ.Client.Impl.MethodBase, IMessageQos {
-    public const int ClassId = 120;
-    public const int MethodId = 110;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IMessageQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IMessageQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IMessageQos.Global { get { return m_global; } }
-
-    public MessageQos() {}
-    public MessageQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 110; } }
-    public override string ProtocolMethodName { get { return "message.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageOk: RabbitMQ.Client.Impl.MethodBase, IMessageOk {
-    public const int ClassId = 120;
-    public const int MethodId = 500;
-
-
-
-    public MessageOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 500; } }
-    public override string ProtocolMethodName { get { return "message.ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageEmpty: RabbitMQ.Client.Impl.MethodBase, IMessageEmpty {
-    public const int ClassId = 120;
-    public const int MethodId = 510;
-
-
-
-    public MessageEmpty(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 510; } }
-    public override string ProtocolMethodName { get { return "message.empty"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageReject: RabbitMQ.Client.Impl.MethodBase, IMessageReject {
-    public const int ClassId = 120;
-    public const int MethodId = 520;
-
-    public ushort m_code;
-    public string m_text;
-
-    ushort IMessageReject.Code { get { return m_code; } }
-    string IMessageReject.Text { get { return m_text; } }
-
-    public MessageReject() {}
-    public MessageReject(
-      ushort initCode,
-      string initText)
-    {
-      m_code = initCode;
-      m_text = initText;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 520; } }
-    public override string ProtocolMethodName { get { return "message.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_code = reader.ReadShort();
-      m_text = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_code);
-      writer.WriteShortstr(m_text);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_code); sb.Append(",");
-      sb.Append(m_text);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class MessageOffset: RabbitMQ.Client.Impl.MethodBase, IMessageOffset {
-    public const int ClassId = 120;
-    public const int MethodId = 530;
-
-    public ulong m_value;
-
-    ulong IMessageOffset.Value { get { return m_value; } }
-
-    public MessageOffset() {}
-    public MessageOffset(
-      ulong initValue)
-    {
-      m_value = initValue;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 530; } }
-    public override string ProtocolMethodName { get { return "message.offset"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_value = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_value);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_value);
-      sb.Append(")");
-    }
-  }
-
-  public class Model: RabbitMQ.Client.Impl.ModelBase {
-    public Model(RabbitMQ.Client.Impl.ISession session): base(session) {}
-    public override System.UInt16 _Private_AccessRequest(
-      System.String @realm,
-      System.Boolean @exclusive,
-      System.Boolean @passive,
-      System.Boolean @active,
-      System.Boolean @write,
-      System.Boolean @read)
-    {
-      AccessRequest __req = new AccessRequest();
-      __req.m_realm = @realm;
-      __req.m_exclusive = @exclusive;
-      __req.m_passive = @passive;
-      __req.m_active = @active;
-      __req.m_write = @write;
-      __req.m_read = @read;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      AccessRequestOk __rep = __repBase as AccessRequestOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_ticket;
-    }
-    public override void _Private_BasicPublish(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @mandatory,
-      System.Boolean @immediate,
-      RabbitMQ.Client.IBasicProperties @basicProperties,
-      System.Byte[] @body)
-    {
-      BasicPublish __req = new BasicPublish();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_mandatory = @mandatory;
-      __req.m_immediate = @immediate;
-      ModelSend(__req, (BasicProperties) basicProperties,body);
-    }
-    public override void _Private_BasicConsume(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @consumerTag,
-      System.Boolean @noLocal,
-      System.Boolean @noAck,
-      System.Boolean @exclusive,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @filter)
-    {
-      BasicConsume __req = new BasicConsume();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_consumerTag = @consumerTag;
-      __req.m_noLocal = @noLocal;
-      __req.m_noAck = @noAck;
-      __req.m_exclusive = @exclusive;
-      __req.m_nowait = @nowait;
-      __req.m_filter = @filter;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicCancel(
-      System.String @consumerTag,
-      System.Boolean @nowait)
-    {
-      BasicCancel __req = new BasicCancel();
-      __req.m_consumerTag = @consumerTag;
-      __req.m_nowait = @nowait;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelOpen(
-      System.String @outOfBand)
-    {
-      ChannelOpen __req = new ChannelOpen();
-      __req.m_outOfBand = @outOfBand;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelOpenOk __rep = __repBase as ChannelOpenOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ChannelCloseOk()
-    {
-      ChannelCloseOk __req = new ChannelCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ChannelClose __req = new ChannelClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicGet(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @noAck)
-    {
-      BasicGet __req = new BasicGet();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_noAck = @noAck;
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.Impl.ConnectionTuneDetails ConnectionStartOk(
-      System.Collections.IDictionary @clientProperties,
-      System.String @mechanism,
-      System.Byte[] @response,
-      System.String @locale)
-    {
-      ConnectionStartOk __req = new ConnectionStartOk();
-      __req.m_clientProperties = @clientProperties;
-      __req.m_mechanism = @mechanism;
-      __req.m_response = @response;
-      __req.m_locale = @locale;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionTune __rep = __repBase as ConnectionTune;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      RabbitMQ.Client.Impl.ConnectionTuneDetails __result = new RabbitMQ.Client.Impl.ConnectionTuneDetails();
-      __result.channelMax = __rep.m_channelMax;
-      __result.frameMax = __rep.m_frameMax;
-      __result.heartbeat = __rep.m_heartbeat;
-      return __result;
-    }
-    public override void ConnectionTuneOk(
-      System.UInt16 @channelMax,
-      System.UInt32 @frameMax,
-      System.UInt16 @heartbeat)
-    {
-      ConnectionTuneOk __req = new ConnectionTuneOk();
-      __req.m_channelMax = @channelMax;
-      __req.m_frameMax = @frameMax;
-      __req.m_heartbeat = @heartbeat;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionOpen(
-      System.String @virtualHost,
-      System.String @capabilities,
-      System.Boolean @insist)
-    {
-      ConnectionOpen __req = new ConnectionOpen();
-      __req.m_virtualHost = @virtualHost;
-      __req.m_capabilities = @capabilities;
-      __req.m_insist = @insist;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ConnectionClose __req = new ConnectionClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionCloseOk __rep = __repBase as ConnectionCloseOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ConnectionCloseOk()
-    {
-      ConnectionCloseOk __req = new ConnectionCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.IBasicProperties CreateBasicProperties()
-    {
-      return new BasicProperties();
-    }
-    public override RabbitMQ.Client.IFileProperties CreateFileProperties()
-    {
-      return new FileProperties();
-    }
-    public override RabbitMQ.Client.IStreamProperties CreateStreamProperties()
-    {
-      return new StreamProperties();
-    }
-    public override void ChannelFlow(
-      System.Boolean @active)
-    {
-      ChannelFlow __req = new ChannelFlow();
-      __req.m_active = @active;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelFlowOk __rep = __repBase as ChannelFlowOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDeclare(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @type,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @autoDelete,
-      System.Boolean @internal,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      ExchangeDeclare __req = new ExchangeDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_type = @type;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_internal = @internal;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeclareOk __rep = __repBase as ExchangeDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDelete(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.Boolean @ifUnused,
-      System.Boolean @nowait)
-    {
-      ExchangeDelete __req = new ExchangeDelete();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeleteOk __rep = __repBase as ExchangeDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override System.String QueueDeclare(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @exclusive,
-      System.Boolean @autoDelete,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueDeclare __req = new QueueDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_exclusive = @exclusive;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return null;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeclareOk __rep = __repBase as QueueDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_queue;
-    }
-    public override void QueueBind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueBind __req = new QueueBind();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueBindOk __rep = __repBase as QueueBindOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void QueueUnbind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueUnbind __req = new QueueUnbind();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_arguments = @arguments;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueUnbindOk __rep = __repBase as QueueUnbindOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override System.UInt32 QueuePurge(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @nowait)
-    {
-      QueuePurge __req = new QueuePurge();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueuePurgeOk __rep = __repBase as QueuePurgeOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override System.UInt32 QueueDelete(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @ifUnused,
-      System.Boolean @ifEmpty,
-      System.Boolean @nowait)
-    {
-      QueueDelete __req = new QueueDelete();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_ifEmpty = @ifEmpty;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeleteOk __rep = __repBase as QueueDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override void BasicQos(
-      System.UInt32 @prefetchSize,
-      System.UInt16 @prefetchCount,
-      System.Boolean @global)
-    {
-      BasicQos __req = new BasicQos();
-      __req.m_prefetchSize = @prefetchSize;
-      __req.m_prefetchCount = @prefetchCount;
-      __req.m_global = @global;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      BasicQosOk __rep = __repBase as BasicQosOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void BasicAck(
-      System.UInt64 @deliveryTag,
-      System.Boolean @multiple)
-    {
-      BasicAck __req = new BasicAck();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_multiple = @multiple;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicReject(
-      System.UInt64 @deliveryTag,
-      System.Boolean @requeue)
-    {
-      BasicReject __req = new BasicReject();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_requeue = @requeue;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicRecover(
-      System.Boolean @requeue)
-    {
-      BasicRecover __req = new BasicRecover();
-      __req.m_requeue = @requeue;
-      ModelSend(__req,null,null);
-    }
-    public override void TxSelect()
-    {
-      TxSelect __req = new TxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxSelectOk __rep = __repBase as TxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxCommit()
-    {
-      TxCommit __req = new TxCommit();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxCommitOk __rep = __repBase as TxCommitOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxRollback()
-    {
-      TxRollback __req = new TxRollback();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxRollbackOk __rep = __repBase as TxRollbackOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxSelect()
-    {
-      DtxSelect __req = new DtxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxSelectOk __rep = __repBase as DtxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxStart(
-      System.String @dtxIdentifier)
-    {
-      DtxStart __req = new DtxStart();
-      __req.m_dtxIdentifier = @dtxIdentifier;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxStartOk __rep = __repBase as DtxStartOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override bool DispatchAsynchronous(RabbitMQ.Client.Impl.Command cmd) {
-      RabbitMQ.Client.Impl.MethodBase __method = (RabbitMQ.Client.Impl.MethodBase) cmd.Method;
-      switch ((__method.ProtocolClassId << 16) | __method.ProtocolMethodId) {
-        case 3932181: {
-          BasicConsumeOk __impl = (BasicConsumeOk) __method;
-          HandleBasicConsumeOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932191: {
-          BasicCancelOk __impl = (BasicCancelOk) __method;
-          HandleBasicCancelOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932231: {
-          BasicGetOk __impl = (BasicGetOk) __method;
-          HandleBasicGetOk(
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            __impl.m_messageCount,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932232: {
-          HandleBasicGetEmpty();
-          return true;
-        }
-        case 3932220: {
-          BasicDeliver __impl = (BasicDeliver) __method;
-          HandleBasicDeliver(
-            __impl.m_consumerTag,
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932210: {
-          BasicReturn __impl = (BasicReturn) __method;
-          HandleBasicReturn(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 1310760: {
-          ChannelClose __impl = (ChannelClose) __method;
-          HandleChannelClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        case 1310761: {
-          HandleChannelCloseOk();
-          return true;
-        }
-        case 655370: {
-          ConnectionStart __impl = (ConnectionStart) __method;
-          HandleConnectionStart(
-            __impl.m_versionMajor,
-            __impl.m_versionMinor,
-            __impl.m_serverProperties,
-            __impl.m_mechanisms,
-            __impl.m_locales);
-          return true;
-        }
-        case 655401: {
-          ConnectionOpenOk __impl = (ConnectionOpenOk) __method;
-          HandleConnectionOpenOk(
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655402: {
-          ConnectionRedirect __impl = (ConnectionRedirect) __method;
-          HandleConnectionRedirect(
-            __impl.m_host,
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655410: {
-          ConnectionClose __impl = (ConnectionClose) __method;
-          HandleConnectionClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        default: return false;
-      }
-    }
-  }
-}
diff --git a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs b/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs
deleted file mode 100644
index 7547c6e..0000000
--- a/mcs/class/RabbitMQ.Client/docs/specs/autogenerated-api-qpid-0-8.cs
+++ /dev/null
@@ -1,6401 +0,0 @@
-// Autogenerated code. Do not edit.
-
-using RabbitMQ.Client;
-using RabbitMQ.Client.Exceptions;
-
-namespace RabbitMQ.Client.Framing.v0_8qpid {
-  public class Protocol: RabbitMQ.Client.Framing.Impl.v0_8qpid.ProtocolBase {
-    ///<summary>Protocol major version (= 8)</summary>
-    public override int MajorVersion { get { return 8; } }
-    ///<summary>Protocol minor version (= 0)</summary>
-    public override int MinorVersion { get { return 0; } }
-    ///<summary>Protocol API name (= AMQP_0_8_QPID)</summary>
-    public override string ApiName { get { return "AMQP_0_8_QPID"; } }
-    ///<summary>Default TCP port (= 5672)</summary>
-    public override int DefaultPort { get { return 5672; } }
-
-    public override RabbitMQ.Client.Impl.MethodBase DecodeMethodFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-      ushort methodId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 10: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionStart result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionStartOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionSecure result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionSecure();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionSecureOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionSecureOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionTune result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionTune();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionTuneOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionTuneOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionOpen result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionRedirect result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionRedirect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionClose result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 61: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ConnectionCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 20: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelOpen result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelFlow result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelFlow();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelFlowOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelFlowOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelAlert result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelAlert();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelClose result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelClose();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelCloseOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ChannelCloseOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 30: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.AccessRequest result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.AccessRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.AccessRequestOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.AccessRequestOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 40: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeclare result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDelete result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 22: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeBound result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeBound();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 23: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeBoundOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.ExchangeBoundOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 50: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeclare result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeclare();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeclareOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeclareOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueBind result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueBind();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueBindOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueBindOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueuePurge result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueuePurge();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueuePurgeOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueuePurgeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDelete result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDelete();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeleteOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.QueueDeleteOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 60: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicQos result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicConsume result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicCancel result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicPublish result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicReturn result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGet result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGet();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 71: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGetOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGetOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 72: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGetEmpty result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicGetEmpty();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicAck result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicReject result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicRecover result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicRecover();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 101: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicRecoverOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.BasicRecoverOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 70: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileQos result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileConsume result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileCancel result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileOpen result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileOpen();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileOpenOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileOpenOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileStage result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileStage();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FilePublish result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FilePublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 70: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileReturn result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 80: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 90: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileAck result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileAck();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 100: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.FileReject result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.FileReject();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 80: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamQos result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamQos();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamQosOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamQosOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamConsume result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamConsume();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamConsumeOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamConsumeOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamCancel result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamCancel();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamCancelOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamCancelOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamPublish result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamPublish();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 50: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamReturn result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamReturn();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 60: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamDeliver result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.StreamDeliver();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 90: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxSelect result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxCommit result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxCommit();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxCommitOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxCommitOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxRollback result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxRollback();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TxRollbackOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TxRollbackOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 100: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxSelect result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxSelect();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxSelectOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxSelectOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxStart result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxStart();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxStartOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.DtxStartOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 110: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TunnelRequest result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TunnelRequest();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        case 120: {
-          switch (methodId) {
-            case 10: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestInteger result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestInteger();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 11: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestIntegerOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestIntegerOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 20: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestString result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestString();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 21: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestStringOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestStringOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 30: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestTable result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestTable();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 31: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestTableOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestTableOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 40: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestContent result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestContent();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            case 41: {
-              RabbitMQ.Client.Framing.Impl.v0_8qpid.TestContentOk result = new RabbitMQ.Client.Framing.Impl.v0_8qpid.TestContentOk();
-              result.ReadArgumentsFrom(new RabbitMQ.Client.Impl.MethodArgumentReader(reader));
-              return result;
-            }
-            default: break;
-          }
-          break;
-        }
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, methodId);
-    }
-
-    public override RabbitMQ.Client.Impl.ContentHeaderBase DecodeContentHeaderFrom(RabbitMQ.Util.NetworkBinaryReader reader) {
-      ushort classId = reader.ReadUInt16();
-
-      switch (classId) {
-        case 60: return new BasicProperties();
-        case 70: return new FileProperties();
-        case 80: return new StreamProperties();
-        case 110: return new TunnelProperties();
-        case 120: return new TestProperties();
-        default: break;
-      }
-      throw new RabbitMQ.Client.Impl.UnknownClassOrMethodException(classId, 0);
-    }
-  }
-  public class Constants {
-    ///<summary>(= 1)</summary>
-    public const int FrameMethod = 1;
-    ///<summary>(= 2)</summary>
-    public const int FrameHeader = 2;
-    ///<summary>(= 3)</summary>
-    public const int FrameBody = 3;
-    ///<summary>(= 4)</summary>
-    public const int FrameOobMethod = 4;
-    ///<summary>(= 5)</summary>
-    public const int FrameOobHeader = 5;
-    ///<summary>(= 6)</summary>
-    public const int FrameOobBody = 6;
-    ///<summary>(= 7)</summary>
-    public const int FrameTrace = 7;
-    ///<summary>(= 8)</summary>
-    public const int FrameHeartbeat = 8;
-    ///<summary>(= 4096)</summary>
-    public const int FrameMinSize = 4096;
-    ///<summary>(= 206)</summary>
-    public const int FrameEnd = 206;
-    ///<summary>(= 200)</summary>
-    public const int ReplySuccess = 200;
-    ///<summary>(= 310)</summary>
-    public const int NotDelivered = 310;
-    ///<summary>(= 311)</summary>
-    public const int ContentTooLarge = 311;
-    ///<summary>(= 320)</summary>
-    public const int ConnectionForced = 320;
-    ///<summary>(= 402)</summary>
-    public const int InvalidPath = 402;
-    ///<summary>(= 403)</summary>
-    public const int AccessRefused = 403;
-    ///<summary>(= 404)</summary>
-    public const int NotFound = 404;
-    ///<summary>(= 405)</summary>
-    public const int ResourceLocked = 405;
-    ///<summary>(= 501)</summary>
-    public const int FrameError = 501;
-    ///<summary>(= 502)</summary>
-    public const int SyntaxError = 502;
-    ///<summary>(= 503)</summary>
-    public const int CommandInvalid = 503;
-    ///<summary>(= 504)</summary>
-    public const int ChannelError = 504;
-    ///<summary>(= 506)</summary>
-    public const int ResourceError = 506;
-    ///<summary>(= 530)</summary>
-    public const int NotAllowed = 530;
-    ///<summary>(= 540)</summary>
-    public const int NotImplemented = 540;
-    ///<summary>(= 541)</summary>
-    public const int InternalError = 541;
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start".</summary>
-  public interface IConnectionStart: IMethod {
-    byte VersionMajor { get; }
-    byte VersionMinor { get; }
-    System.Collections.IDictionary ServerProperties { get; }
-    byte[] Mechanisms { get; }
-    byte[] Locales { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.start-ok".</summary>
-  public interface IConnectionStartOk: IMethod {
-    System.Collections.IDictionary ClientProperties { get; }
-    string Mechanism { get; }
-    byte[] Response { get; }
-    string Locale { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure".</summary>
-  public interface IConnectionSecure: IMethod {
-    byte[] Challenge { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.secure-ok".</summary>
-  public interface IConnectionSecureOk: IMethod {
-    byte[] Response { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune".</summary>
-  public interface IConnectionTune: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.tune-ok".</summary>
-  public interface IConnectionTuneOk: IMethod {
-    ushort ChannelMax { get; }
-    uint FrameMax { get; }
-    ushort Heartbeat { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open".</summary>
-  public interface IConnectionOpen: IMethod {
-    string VirtualHost { get; }
-    string Capabilities { get; }
-    bool Insist { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.open-ok".</summary>
-  public interface IConnectionOpenOk: IMethod {
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.redirect".</summary>
-  public interface IConnectionRedirect: IMethod {
-    string Host { get; }
-    string KnownHosts { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close".</summary>
-  public interface IConnectionClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "connection.close-ok".</summary>
-  public interface IConnectionCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open".</summary>
-  public interface IChannelOpen: IMethod {
-    string OutOfBand { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.open-ok".</summary>
-  public interface IChannelOpenOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow".</summary>
-  public interface IChannelFlow: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.flow-ok".</summary>
-  public interface IChannelFlowOk: IMethod {
-    bool Active { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.alert".</summary>
-  public interface IChannelAlert: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    System.Collections.IDictionary Details { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close".</summary>
-  public interface IChannelClose: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    ushort ClassId { get; }
-    ushort MethodId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "channel.close-ok".</summary>
-  public interface IChannelCloseOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request".</summary>
-  public interface IAccessRequest: IMethod {
-    string Realm { get; }
-    bool Exclusive { get; }
-    bool Passive { get; }
-    bool Active { get; }
-    bool Write { get; }
-    bool Read { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "access.request-ok".</summary>
-  public interface IAccessRequestOk: IMethod {
-    ushort Ticket { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare".</summary>
-  public interface IExchangeDeclare: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string Type { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool AutoDelete { get; }
-    bool Internal { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.declare-ok".</summary>
-  public interface IExchangeDeclareOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete".</summary>
-  public interface IExchangeDelete: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    bool IfUnused { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.delete-ok".</summary>
-  public interface IExchangeDeleteOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.bound".</summary>
-  public interface IExchangeBound: IMethod {
-    string Exchange { get; }
-    string RoutingKey { get; }
-    string Queue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "exchange.bound-ok".</summary>
-  public interface IExchangeBoundOk: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare".</summary>
-  public interface IQueueDeclare: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Passive { get; }
-    bool Durable { get; }
-    bool Exclusive { get; }
-    bool AutoDelete { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.declare-ok".</summary>
-  public interface IQueueDeclareOk: IMethod {
-    string Queue { get; }
-    uint MessageCount { get; }
-    uint ConsumerCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind".</summary>
-  public interface IQueueBind: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.bind-ok".</summary>
-  public interface IQueueBindOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge".</summary>
-  public interface IQueuePurge: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.purge-ok".</summary>
-  public interface IQueuePurgeOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete".</summary>
-  public interface IQueueDelete: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool IfUnused { get; }
-    bool IfEmpty { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "queue.delete-ok".</summary>
-  public interface IQueueDeleteOk: IMethod {
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos".</summary>
-  public interface IBasicQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.qos-ok".</summary>
-  public interface IBasicQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume".</summary>
-  public interface IBasicConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-    System.Collections.IDictionary Arguments { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.consume-ok".</summary>
-  public interface IBasicConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel".</summary>
-  public interface IBasicCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.cancel-ok".</summary>
-  public interface IBasicCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.publish".</summary>
-  public interface IBasicPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.return".</summary>
-  public interface IBasicReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.deliver".</summary>
-  public interface IBasicDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get".</summary>
-  public interface IBasicGet: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    bool NoAck { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-ok".</summary>
-  public interface IBasicGetOk: IMethod {
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    uint MessageCount { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.get-empty".</summary>
-  public interface IBasicGetEmpty: IMethod {
-    string ClusterId { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.ack".</summary>
-  public interface IBasicAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.reject".</summary>
-  public interface IBasicReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.recover".</summary>
-  public interface IBasicRecover: IMethod {
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "basic.recover-ok".</summary>
-  public interface IBasicRecoverOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos".</summary>
-  public interface IFileQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.qos-ok".</summary>
-  public interface IFileQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume".</summary>
-  public interface IFileConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool NoAck { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.consume-ok".</summary>
-  public interface IFileConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel".</summary>
-  public interface IFileCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.cancel-ok".</summary>
-  public interface IFileCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open".</summary>
-  public interface IFileOpen: IMethod {
-    string Identifier { get; }
-    ulong ContentSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.open-ok".</summary>
-  public interface IFileOpenOk: IMethod {
-    ulong StagedSize { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.stage".</summary>
-  public interface IFileStage: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.publish".</summary>
-  public interface IFilePublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.return".</summary>
-  public interface IFileReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.deliver".</summary>
-  public interface IFileDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    bool Redelivered { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    string Identifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.ack".</summary>
-  public interface IFileAck: IMethod {
-    ulong DeliveryTag { get; }
-    bool Multiple { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "file.reject".</summary>
-  public interface IFileReject: IMethod {
-    ulong DeliveryTag { get; }
-    bool Requeue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos".</summary>
-  public interface IStreamQos: IMethod {
-    uint PrefetchSize { get; }
-    ushort PrefetchCount { get; }
-    uint ConsumeRate { get; }
-    bool Global { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.qos-ok".</summary>
-  public interface IStreamQosOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume".</summary>
-  public interface IStreamConsume: IMethod {
-    ushort Ticket { get; }
-    string Queue { get; }
-    string ConsumerTag { get; }
-    bool NoLocal { get; }
-    bool Exclusive { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.consume-ok".</summary>
-  public interface IStreamConsumeOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel".</summary>
-  public interface IStreamCancel: IMethod {
-    string ConsumerTag { get; }
-    bool Nowait { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.cancel-ok".</summary>
-  public interface IStreamCancelOk: IMethod {
-    string ConsumerTag { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.publish".</summary>
-  public interface IStreamPublish: IMethod {
-    ushort Ticket { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-    bool Mandatory { get; }
-    bool Immediate { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.return".</summary>
-  public interface IStreamReturn: IMethod {
-    ushort ReplyCode { get; }
-    string ReplyText { get; }
-    string Exchange { get; }
-    string RoutingKey { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "stream.deliver".</summary>
-  public interface IStreamDeliver: IMethod {
-    string ConsumerTag { get; }
-    ulong DeliveryTag { get; }
-    string Exchange { get; }
-    string Queue { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select".</summary>
-  public interface ITxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.select-ok".</summary>
-  public interface ITxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit".</summary>
-  public interface ITxCommit: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.commit-ok".</summary>
-  public interface ITxCommitOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback".</summary>
-  public interface ITxRollback: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tx.rollback-ok".</summary>
-  public interface ITxRollbackOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select".</summary>
-  public interface IDtxSelect: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.select-ok".</summary>
-  public interface IDtxSelectOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start".</summary>
-  public interface IDtxStart: IMethod {
-    string DtxIdentifier { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "dtx.start-ok".</summary>
-  public interface IDtxStartOk: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "tunnel.request".</summary>
-  public interface ITunnelRequest: IMethod {
-    System.Collections.IDictionary MetaData { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.integer".</summary>
-  public interface ITestInteger: IMethod {
-    byte Integer1 { get; }
-    ushort Integer2 { get; }
-    uint Integer3 { get; }
-    ulong Integer4 { get; }
-    byte Operation { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.integer-ok".</summary>
-  public interface ITestIntegerOk: IMethod {
-    ulong Result { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.string".</summary>
-  public interface ITestString: IMethod {
-    string String1 { get; }
-    byte[] String2 { get; }
-    byte Operation { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.string-ok".</summary>
-  public interface ITestStringOk: IMethod {
-    byte[] Result { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.table".</summary>
-  public interface ITestTable: IMethod {
-    System.Collections.IDictionary Table { get; }
-    byte IntegerOp { get; }
-    byte StringOp { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.table-ok".</summary>
-  public interface ITestTableOk: IMethod {
-    ulong IntegerResult { get; }
-    byte[] StringResult { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.content".</summary>
-  public interface ITestContent: IMethod {
-  }
-  /// <summary>Autogenerated type. AMQP specification method "test.content-ok".</summary>
-  public interface ITestContentOk: IMethod {
-    uint ContentChecksum { get; }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "basic"</summary>
-  public class BasicProperties: RabbitMQ.Client.Impl.BasicProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_deliveryMode;
-    private byte m_priority;
-    private string m_correlationId;
-    private string m_replyTo;
-    private string m_expiration;
-    private string m_messageId;
-    private AmqpTimestamp m_timestamp;
-    private string m_type;
-    private string m_userId;
-    private string m_appId;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool deliveryMode_present = false;
-    private bool priority_present = false;
-    private bool correlationId_present = false;
-    private bool replyTo_present = false;
-    private bool expiration_present = false;
-    private bool messageId_present = false;
-    private bool timestamp_present = false;
-    private bool type_present = false;
-    private bool userId_present = false;
-    private bool appId_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte DeliveryMode {
-      get {
-        return m_deliveryMode;
-      }
-      set {
-        deliveryMode_present = true;
-        m_deliveryMode = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string CorrelationId {
-      get {
-        return m_correlationId;
-      }
-      set {
-        correlationId_present = true;
-        m_correlationId = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string Expiration {
-      get {
-        return m_expiration;
-      }
-      set {
-        expiration_present = true;
-        m_expiration = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string Type {
-      get {
-        return m_type;
-      }
-      set {
-        type_present = true;
-        m_type = value;
-      }
-    }
-    public override string UserId {
-      get {
-        return m_userId;
-      }
-      set {
-        userId_present = true;
-        m_userId = value;
-      }
-    }
-    public override string AppId {
-      get {
-        return m_appId;
-      }
-      set {
-        appId_present = true;
-        m_appId = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearDeliveryMode() { deliveryMode_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearCorrelationId() { correlationId_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearExpiration() { expiration_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearType() { type_present = false; }
-    public override void ClearUserId() { userId_present = false; }
-    public override void ClearAppId() { appId_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public BasicProperties() {}
-    public override int ProtocolClassId { get { return 60; } }
-    public override string ProtocolClassName { get { return "basic"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      deliveryMode_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      correlationId_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      expiration_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      type_present = reader.ReadPresence();
-      userId_present = reader.ReadPresence();
-      appId_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (deliveryMode_present) { m_deliveryMode = reader.ReadOctet(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (correlationId_present) { m_correlationId = reader.ReadShortstr(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (expiration_present) { m_expiration = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (type_present) { m_type = reader.ReadShortstr(); }
-      if (userId_present) { m_userId = reader.ReadShortstr(); }
-      if (appId_present) { m_appId = reader.ReadShortstr(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(deliveryMode_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(correlationId_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(expiration_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(type_present);
-      writer.WritePresence(userId_present);
-      writer.WritePresence(appId_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (deliveryMode_present) { writer.WriteOctet(m_deliveryMode); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (correlationId_present) { writer.WriteShortstr(m_correlationId); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (expiration_present) { writer.WriteShortstr(m_expiration); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (type_present) { writer.WriteShortstr(m_type); }
-      if (userId_present) { writer.WriteShortstr(m_userId); }
-      if (appId_present) { writer.WriteShortstr(m_appId); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("delivery mode="); sb.Append(deliveryMode_present ? m_deliveryMode.ToString() : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("correlation id="); sb.Append(correlationId_present ? (m_correlationId == null ? "(null)" : m_correlationId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("reply to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("expiration="); sb.Append(expiration_present ? (m_expiration == null ? "(null)" : m_expiration.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("type="); sb.Append(type_present ? (m_type == null ? "(null)" : m_type.ToString()) : "_"); sb.Append(", ");
-      sb.Append("user id="); sb.Append(userId_present ? (m_userId == null ? "(null)" : m_userId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("app id="); sb.Append(appId_present ? (m_appId == null ? "(null)" : m_appId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("cluster id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "file"</summary>
-  public class FileProperties: RabbitMQ.Client.Impl.FileProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private string m_replyTo;
-    private string m_messageId;
-    private string m_filename;
-    private AmqpTimestamp m_timestamp;
-    private string m_clusterId;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool replyTo_present = false;
-    private bool messageId_present = false;
-    private bool filename_present = false;
-    private bool timestamp_present = false;
-    private bool clusterId_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override string ReplyTo {
-      get {
-        return m_replyTo;
-      }
-      set {
-        replyTo_present = true;
-        m_replyTo = value;
-      }
-    }
-    public override string MessageId {
-      get {
-        return m_messageId;
-      }
-      set {
-        messageId_present = true;
-        m_messageId = value;
-      }
-    }
-    public override string Filename {
-      get {
-        return m_filename;
-      }
-      set {
-        filename_present = true;
-        m_filename = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-    public override string ClusterId {
-      get {
-        return m_clusterId;
-      }
-      set {
-        clusterId_present = true;
-        m_clusterId = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearReplyTo() { replyTo_present = false; }
-    public override void ClearMessageId() { messageId_present = false; }
-    public override void ClearFilename() { filename_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-    public override void ClearClusterId() { clusterId_present = false; }
-
-    public FileProperties() {}
-    public override int ProtocolClassId { get { return 70; } }
-    public override string ProtocolClassName { get { return "file"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      replyTo_present = reader.ReadPresence();
-      messageId_present = reader.ReadPresence();
-      filename_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      clusterId_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (replyTo_present) { m_replyTo = reader.ReadShortstr(); }
-      if (messageId_present) { m_messageId = reader.ReadShortstr(); }
-      if (filename_present) { m_filename = reader.ReadShortstr(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-      if (clusterId_present) { m_clusterId = reader.ReadShortstr(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(replyTo_present);
-      writer.WritePresence(messageId_present);
-      writer.WritePresence(filename_present);
-      writer.WritePresence(timestamp_present);
-      writer.WritePresence(clusterId_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (replyTo_present) { writer.WriteShortstr(m_replyTo); }
-      if (messageId_present) { writer.WriteShortstr(m_messageId); }
-      if (filename_present) { writer.WriteShortstr(m_filename); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-      if (clusterId_present) { writer.WriteShortstr(m_clusterId); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("reply to="); sb.Append(replyTo_present ? (m_replyTo == null ? "(null)" : m_replyTo.ToString()) : "_"); sb.Append(", ");
-      sb.Append("message id="); sb.Append(messageId_present ? (m_messageId == null ? "(null)" : m_messageId.ToString()) : "_"); sb.Append(", ");
-      sb.Append("filename="); sb.Append(filename_present ? (m_filename == null ? "(null)" : m_filename.ToString()) : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_"); sb.Append(", ");
-      sb.Append("cluster id="); sb.Append(clusterId_present ? (m_clusterId == null ? "(null)" : m_clusterId.ToString()) : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "stream"</summary>
-  public class StreamProperties: RabbitMQ.Client.Impl.StreamProperties {
-    private string m_contentType;
-    private string m_contentEncoding;
-    private System.Collections.IDictionary m_headers;
-    private byte m_priority;
-    private AmqpTimestamp m_timestamp;
-
-    private bool contentType_present = false;
-    private bool contentEncoding_present = false;
-    private bool headers_present = false;
-    private bool priority_present = false;
-    private bool timestamp_present = false;
-
-    public override string ContentType {
-      get {
-        return m_contentType;
-      }
-      set {
-        contentType_present = true;
-        m_contentType = value;
-      }
-    }
-    public override string ContentEncoding {
-      get {
-        return m_contentEncoding;
-      }
-      set {
-        contentEncoding_present = true;
-        m_contentEncoding = value;
-      }
-    }
-    public override System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public override byte Priority {
-      get {
-        return m_priority;
-      }
-      set {
-        priority_present = true;
-        m_priority = value;
-      }
-    }
-    public override AmqpTimestamp Timestamp {
-      get {
-        return m_timestamp;
-      }
-      set {
-        timestamp_present = true;
-        m_timestamp = value;
-      }
-    }
-
-    public override void ClearContentType() { contentType_present = false; }
-    public override void ClearContentEncoding() { contentEncoding_present = false; }
-    public override void ClearHeaders() { headers_present = false; }
-    public override void ClearPriority() { priority_present = false; }
-    public override void ClearTimestamp() { timestamp_present = false; }
-
-    public StreamProperties() {}
-    public override int ProtocolClassId { get { return 80; } }
-    public override string ProtocolClassName { get { return "stream"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      contentType_present = reader.ReadPresence();
-      contentEncoding_present = reader.ReadPresence();
-      headers_present = reader.ReadPresence();
-      priority_present = reader.ReadPresence();
-      timestamp_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (contentType_present) { m_contentType = reader.ReadShortstr(); }
-      if (contentEncoding_present) { m_contentEncoding = reader.ReadShortstr(); }
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (priority_present) { m_priority = reader.ReadOctet(); }
-      if (timestamp_present) { m_timestamp = reader.ReadTimestamp(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(contentType_present);
-      writer.WritePresence(contentEncoding_present);
-      writer.WritePresence(headers_present);
-      writer.WritePresence(priority_present);
-      writer.WritePresence(timestamp_present);
-      writer.FinishPresence();
-      if (contentType_present) { writer.WriteShortstr(m_contentType); }
-      if (contentEncoding_present) { writer.WriteShortstr(m_contentEncoding); }
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (priority_present) { writer.WriteOctet(m_priority); }
-      if (timestamp_present) { writer.WriteTimestamp(m_timestamp); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("content type="); sb.Append(contentType_present ? (m_contentType == null ? "(null)" : m_contentType.ToString()) : "_"); sb.Append(", ");
-      sb.Append("content encoding="); sb.Append(contentEncoding_present ? (m_contentEncoding == null ? "(null)" : m_contentEncoding.ToString()) : "_"); sb.Append(", ");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("priority="); sb.Append(priority_present ? m_priority.ToString() : "_"); sb.Append(", ");
-      sb.Append("timestamp="); sb.Append(timestamp_present ? m_timestamp.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "tunnel"</summary>
-  public class TunnelProperties: RabbitMQ.Client.Impl.ContentHeaderBase {
-    private System.Collections.IDictionary m_headers;
-    private string m_proxyName;
-    private string m_dataName;
-    private byte m_durable;
-    private byte m_broadcast;
-
-    private bool headers_present = false;
-    private bool proxyName_present = false;
-    private bool dataName_present = false;
-    private bool durable_present = false;
-    private bool broadcast_present = false;
-
-    public System.Collections.IDictionary Headers {
-      get {
-        return m_headers;
-      }
-      set {
-        headers_present = true;
-        m_headers = value;
-      }
-    }
-    public string ProxyName {
-      get {
-        return m_proxyName;
-      }
-      set {
-        proxyName_present = true;
-        m_proxyName = value;
-      }
-    }
-    public string DataName {
-      get {
-        return m_dataName;
-      }
-      set {
-        dataName_present = true;
-        m_dataName = value;
-      }
-    }
-    public byte Durable {
-      get {
-        return m_durable;
-      }
-      set {
-        durable_present = true;
-        m_durable = value;
-      }
-    }
-    public byte Broadcast {
-      get {
-        return m_broadcast;
-      }
-      set {
-        broadcast_present = true;
-        m_broadcast = value;
-      }
-    }
-
-    public void ClearHeaders() { headers_present = false; }
-    public void ClearProxyName() { proxyName_present = false; }
-    public void ClearDataName() { dataName_present = false; }
-    public void ClearDurable() { durable_present = false; }
-    public void ClearBroadcast() { broadcast_present = false; }
-
-    public TunnelProperties() {}
-    public override int ProtocolClassId { get { return 110; } }
-    public override string ProtocolClassName { get { return "tunnel"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      headers_present = reader.ReadPresence();
-      proxyName_present = reader.ReadPresence();
-      dataName_present = reader.ReadPresence();
-      durable_present = reader.ReadPresence();
-      broadcast_present = reader.ReadPresence();
-      reader.FinishPresence();
-      if (headers_present) { m_headers = reader.ReadTable(); }
-      if (proxyName_present) { m_proxyName = reader.ReadShortstr(); }
-      if (dataName_present) { m_dataName = reader.ReadShortstr(); }
-      if (durable_present) { m_durable = reader.ReadOctet(); }
-      if (broadcast_present) { m_broadcast = reader.ReadOctet(); }
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.WritePresence(headers_present);
-      writer.WritePresence(proxyName_present);
-      writer.WritePresence(dataName_present);
-      writer.WritePresence(durable_present);
-      writer.WritePresence(broadcast_present);
-      writer.FinishPresence();
-      if (headers_present) { writer.WriteTable(m_headers); }
-      if (proxyName_present) { writer.WriteShortstr(m_proxyName); }
-      if (dataName_present) { writer.WriteShortstr(m_dataName); }
-      if (durable_present) { writer.WriteOctet(m_durable); }
-      if (broadcast_present) { writer.WriteOctet(m_broadcast); }
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append("headers="); sb.Append(headers_present ? (m_headers == null ? "(null)" : m_headers.ToString()) : "_"); sb.Append(", ");
-      sb.Append("proxy name="); sb.Append(proxyName_present ? (m_proxyName == null ? "(null)" : m_proxyName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("data name="); sb.Append(dataName_present ? (m_dataName == null ? "(null)" : m_dataName.ToString()) : "_"); sb.Append(", ");
-      sb.Append("durable="); sb.Append(durable_present ? m_durable.ToString() : "_"); sb.Append(", ");
-      sb.Append("broadcast="); sb.Append(broadcast_present ? m_broadcast.ToString() : "_");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. AMQP specification content header properties for content class "test"</summary>
-  public class TestProperties: RabbitMQ.Client.Impl.ContentHeaderBase {
-
-
-
-
-    public TestProperties() {}
-    public override int ProtocolClassId { get { return 120; } }
-    public override string ProtocolClassName { get { return "test"; } }
-
-    public override void ReadPropertiesFrom(RabbitMQ.Client.Impl.ContentHeaderPropertyReader reader) {
-      reader.FinishPresence();
-    }
-
-    public override void WritePropertiesTo(RabbitMQ.Client.Impl.ContentHeaderPropertyWriter writer) {
-      writer.FinishPresence();
-    }
-
-    public override void AppendPropertyDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-}
-namespace RabbitMQ.Client.Framing.Impl.v0_8qpid {
-  using RabbitMQ.Client.Framing.v0_8qpid;
-  public enum ClassId {
-    Connection = 10,
-    Channel = 20,
-    Access = 30,
-    Exchange = 40,
-    Queue = 50,
-    Basic = 60,
-    File = 70,
-    Stream = 80,
-    Tx = 90,
-    Dtx = 100,
-    Tunnel = 110,
-    Test = 120,
-    Invalid = -1
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStart: RabbitMQ.Client.Impl.MethodBase, IConnectionStart {
-    public const int ClassId = 10;
-    public const int MethodId = 10;
-
-    public byte m_versionMajor;
-    public byte m_versionMinor;
-    public System.Collections.IDictionary m_serverProperties;
-    public byte[] m_mechanisms;
-    public byte[] m_locales;
-
-    byte IConnectionStart.VersionMajor { get { return m_versionMajor; } }
-    byte IConnectionStart.VersionMinor { get { return m_versionMinor; } }
-    System.Collections.IDictionary IConnectionStart.ServerProperties { get { return m_serverProperties; } }
-    byte[] IConnectionStart.Mechanisms { get { return m_mechanisms; } }
-    byte[] IConnectionStart.Locales { get { return m_locales; } }
-
-    public ConnectionStart() {}
-    public ConnectionStart(
-      byte initVersionMajor,
-      byte initVersionMinor,
-      System.Collections.IDictionary initServerProperties,
-      byte[] initMechanisms,
-      byte[] initLocales)
-    {
-      m_versionMajor = initVersionMajor;
-      m_versionMinor = initVersionMinor;
-      m_serverProperties = initServerProperties;
-      m_mechanisms = initMechanisms;
-      m_locales = initLocales;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "connection.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_versionMajor = reader.ReadOctet();
-      m_versionMinor = reader.ReadOctet();
-      m_serverProperties = reader.ReadTable();
-      m_mechanisms = reader.ReadLongstr();
-      m_locales = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteOctet(m_versionMajor);
-      writer.WriteOctet(m_versionMinor);
-      writer.WriteTable(m_serverProperties);
-      writer.WriteLongstr(m_mechanisms);
-      writer.WriteLongstr(m_locales);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_versionMajor); sb.Append(",");
-      sb.Append(m_versionMinor); sb.Append(",");
-      sb.Append(m_serverProperties); sb.Append(",");
-      sb.Append(m_mechanisms); sb.Append(",");
-      sb.Append(m_locales);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionStartOk: RabbitMQ.Client.Impl.MethodBase, IConnectionStartOk {
-    public const int ClassId = 10;
-    public const int MethodId = 11;
-
-    public System.Collections.IDictionary m_clientProperties;
-    public string m_mechanism;
-    public byte[] m_response;
-    public string m_locale;
-
-    System.Collections.IDictionary IConnectionStartOk.ClientProperties { get { return m_clientProperties; } }
-    string IConnectionStartOk.Mechanism { get { return m_mechanism; } }
-    byte[] IConnectionStartOk.Response { get { return m_response; } }
-    string IConnectionStartOk.Locale { get { return m_locale; } }
-
-    public ConnectionStartOk() {}
-    public ConnectionStartOk(
-      System.Collections.IDictionary initClientProperties,
-      string initMechanism,
-      byte[] initResponse,
-      string initLocale)
-    {
-      m_clientProperties = initClientProperties;
-      m_mechanism = initMechanism;
-      m_response = initResponse;
-      m_locale = initLocale;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "connection.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clientProperties = reader.ReadTable();
-      m_mechanism = reader.ReadShortstr();
-      m_response = reader.ReadLongstr();
-      m_locale = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_clientProperties);
-      writer.WriteShortstr(m_mechanism);
-      writer.WriteLongstr(m_response);
-      writer.WriteShortstr(m_locale);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clientProperties); sb.Append(",");
-      sb.Append(m_mechanism); sb.Append(",");
-      sb.Append(m_response); sb.Append(",");
-      sb.Append(m_locale);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecure: RabbitMQ.Client.Impl.MethodBase, IConnectionSecure {
-    public const int ClassId = 10;
-    public const int MethodId = 20;
-
-    public byte[] m_challenge;
-
-    byte[] IConnectionSecure.Challenge { get { return m_challenge; } }
-
-    public ConnectionSecure() {}
-    public ConnectionSecure(
-      byte[] initChallenge)
-    {
-      m_challenge = initChallenge;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "connection.secure"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_challenge = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_challenge);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_challenge);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionSecureOk: RabbitMQ.Client.Impl.MethodBase, IConnectionSecureOk {
-    public const int ClassId = 10;
-    public const int MethodId = 21;
-
-    public byte[] m_response;
-
-    byte[] IConnectionSecureOk.Response { get { return m_response; } }
-
-    public ConnectionSecureOk() {}
-    public ConnectionSecureOk(
-      byte[] initResponse)
-    {
-      m_response = initResponse;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "connection.secure-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_response = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_response);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_response);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTune: RabbitMQ.Client.Impl.MethodBase, IConnectionTune {
-    public const int ClassId = 10;
-    public const int MethodId = 30;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTune.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTune.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTune.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTune() {}
-    public ConnectionTune(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "connection.tune"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionTuneOk: RabbitMQ.Client.Impl.MethodBase, IConnectionTuneOk {
-    public const int ClassId = 10;
-    public const int MethodId = 31;
-
-    public ushort m_channelMax;
-    public uint m_frameMax;
-    public ushort m_heartbeat;
-
-    ushort IConnectionTuneOk.ChannelMax { get { return m_channelMax; } }
-    uint IConnectionTuneOk.FrameMax { get { return m_frameMax; } }
-    ushort IConnectionTuneOk.Heartbeat { get { return m_heartbeat; } }
-
-    public ConnectionTuneOk() {}
-    public ConnectionTuneOk(
-      ushort initChannelMax,
-      uint initFrameMax,
-      ushort initHeartbeat)
-    {
-      m_channelMax = initChannelMax;
-      m_frameMax = initFrameMax;
-      m_heartbeat = initHeartbeat;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "connection.tune-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_channelMax = reader.ReadShort();
-      m_frameMax = reader.ReadLong();
-      m_heartbeat = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_channelMax);
-      writer.WriteLong(m_frameMax);
-      writer.WriteShort(m_heartbeat);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_channelMax); sb.Append(",");
-      sb.Append(m_frameMax); sb.Append(",");
-      sb.Append(m_heartbeat);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpen: RabbitMQ.Client.Impl.MethodBase, IConnectionOpen {
-    public const int ClassId = 10;
-    public const int MethodId = 40;
-
-    public string m_virtualHost;
-    public string m_capabilities;
-    public bool m_insist;
-
-    string IConnectionOpen.VirtualHost { get { return m_virtualHost; } }
-    string IConnectionOpen.Capabilities { get { return m_capabilities; } }
-    bool IConnectionOpen.Insist { get { return m_insist; } }
-
-    public ConnectionOpen() {}
-    public ConnectionOpen(
-      string initVirtualHost,
-      string initCapabilities,
-      bool initInsist)
-    {
-      m_virtualHost = initVirtualHost;
-      m_capabilities = initCapabilities;
-      m_insist = initInsist;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "connection.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_virtualHost = reader.ReadShortstr();
-      m_capabilities = reader.ReadShortstr();
-      m_insist = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_virtualHost);
-      writer.WriteShortstr(m_capabilities);
-      writer.WriteBit(m_insist);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_virtualHost); sb.Append(",");
-      sb.Append(m_capabilities); sb.Append(",");
-      sb.Append(m_insist);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionOpenOk: RabbitMQ.Client.Impl.MethodBase, IConnectionOpenOk {
-    public const int ClassId = 10;
-    public const int MethodId = 41;
-
-    public string m_knownHosts;
-
-    string IConnectionOpenOk.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionOpenOk() {}
-    public ConnectionOpenOk(
-      string initKnownHosts)
-    {
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "connection.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionRedirect: RabbitMQ.Client.Impl.MethodBase, IConnectionRedirect {
-    public const int ClassId = 10;
-    public const int MethodId = 50;
-
-    public string m_host;
-    public string m_knownHosts;
-
-    string IConnectionRedirect.Host { get { return m_host; } }
-    string IConnectionRedirect.KnownHosts { get { return m_knownHosts; } }
-
-    public ConnectionRedirect() {}
-    public ConnectionRedirect(
-      string initHost,
-      string initKnownHosts)
-    {
-      m_host = initHost;
-      m_knownHosts = initKnownHosts;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "connection.redirect"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_host = reader.ReadShortstr();
-      m_knownHosts = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_host);
-      writer.WriteShortstr(m_knownHosts);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_host); sb.Append(",");
-      sb.Append(m_knownHosts);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionClose: RabbitMQ.Client.Impl.MethodBase, IConnectionClose {
-    public const int ClassId = 10;
-    public const int MethodId = 60;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IConnectionClose.ReplyCode { get { return m_replyCode; } }
-    string IConnectionClose.ReplyText { get { return m_replyText; } }
-    ushort IConnectionClose.ClassId { get { return m_classId; } }
-    ushort IConnectionClose.MethodId { get { return m_methodId; } }
-
-    public ConnectionClose() {}
-    public ConnectionClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "connection.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ConnectionCloseOk: RabbitMQ.Client.Impl.MethodBase, IConnectionCloseOk {
-    public const int ClassId = 10;
-    public const int MethodId = 61;
-
-
-
-    public ConnectionCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 10; } }
-    public override int ProtocolMethodId { get { return 61; } }
-    public override string ProtocolMethodName { get { return "connection.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpen: RabbitMQ.Client.Impl.MethodBase, IChannelOpen {
-    public const int ClassId = 20;
-    public const int MethodId = 10;
-
-    public string m_outOfBand;
-
-    string IChannelOpen.OutOfBand { get { return m_outOfBand; } }
-
-    public ChannelOpen() {}
-    public ChannelOpen(
-      string initOutOfBand)
-    {
-      m_outOfBand = initOutOfBand;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "channel.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_outOfBand = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_outOfBand);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_outOfBand);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelOpenOk: RabbitMQ.Client.Impl.MethodBase, IChannelOpenOk {
-    public const int ClassId = 20;
-    public const int MethodId = 11;
-
-
-
-    public ChannelOpenOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "channel.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlow: RabbitMQ.Client.Impl.MethodBase, IChannelFlow {
-    public const int ClassId = 20;
-    public const int MethodId = 20;
-
-    public bool m_active;
-
-    bool IChannelFlow.Active { get { return m_active; } }
-
-    public ChannelFlow() {}
-    public ChannelFlow(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "channel.flow"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelFlowOk: RabbitMQ.Client.Impl.MethodBase, IChannelFlowOk {
-    public const int ClassId = 20;
-    public const int MethodId = 21;
-
-    public bool m_active;
-
-    bool IChannelFlowOk.Active { get { return m_active; } }
-
-    public ChannelFlowOk() {}
-    public ChannelFlowOk(
-      bool initActive)
-    {
-      m_active = initActive;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "channel.flow-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_active = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_active);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_active);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelAlert: RabbitMQ.Client.Impl.MethodBase, IChannelAlert {
-    public const int ClassId = 20;
-    public const int MethodId = 30;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public System.Collections.IDictionary m_details;
-
-    ushort IChannelAlert.ReplyCode { get { return m_replyCode; } }
-    string IChannelAlert.ReplyText { get { return m_replyText; } }
-    System.Collections.IDictionary IChannelAlert.Details { get { return m_details; } }
-
-    public ChannelAlert() {}
-    public ChannelAlert(
-      ushort initReplyCode,
-      string initReplyText,
-      System.Collections.IDictionary initDetails)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_details = initDetails;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "channel.alert"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_details = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteTable(m_details);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_details);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelClose: RabbitMQ.Client.Impl.MethodBase, IChannelClose {
-    public const int ClassId = 20;
-    public const int MethodId = 40;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public ushort m_classId;
-    public ushort m_methodId;
-
-    ushort IChannelClose.ReplyCode { get { return m_replyCode; } }
-    string IChannelClose.ReplyText { get { return m_replyText; } }
-    ushort IChannelClose.ClassId { get { return m_classId; } }
-    ushort IChannelClose.MethodId { get { return m_methodId; } }
-
-    public ChannelClose() {}
-    public ChannelClose(
-      ushort initReplyCode,
-      string initReplyText,
-      ushort initClassId,
-      ushort initMethodId)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_classId = initClassId;
-      m_methodId = initMethodId;
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "channel.close"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_classId = reader.ReadShort();
-      m_methodId = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShort(m_classId);
-      writer.WriteShort(m_methodId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_classId); sb.Append(",");
-      sb.Append(m_methodId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ChannelCloseOk: RabbitMQ.Client.Impl.MethodBase, IChannelCloseOk {
-    public const int ClassId = 20;
-    public const int MethodId = 41;
-
-
-
-    public ChannelCloseOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 20; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "channel.close-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequest: RabbitMQ.Client.Impl.MethodBase, IAccessRequest {
-    public const int ClassId = 30;
-    public const int MethodId = 10;
-
-    public string m_realm;
-    public bool m_exclusive;
-    public bool m_passive;
-    public bool m_active;
-    public bool m_write;
-    public bool m_read;
-
-    string IAccessRequest.Realm { get { return m_realm; } }
-    bool IAccessRequest.Exclusive { get { return m_exclusive; } }
-    bool IAccessRequest.Passive { get { return m_passive; } }
-    bool IAccessRequest.Active { get { return m_active; } }
-    bool IAccessRequest.Write { get { return m_write; } }
-    bool IAccessRequest.Read { get { return m_read; } }
-
-    public AccessRequest() {}
-    public AccessRequest(
-      string initRealm,
-      bool initExclusive,
-      bool initPassive,
-      bool initActive,
-      bool initWrite,
-      bool initRead)
-    {
-      m_realm = initRealm;
-      m_exclusive = initExclusive;
-      m_passive = initPassive;
-      m_active = initActive;
-      m_write = initWrite;
-      m_read = initRead;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "access.request"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_realm = reader.ReadShortstr();
-      m_exclusive = reader.ReadBit();
-      m_passive = reader.ReadBit();
-      m_active = reader.ReadBit();
-      m_write = reader.ReadBit();
-      m_read = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_realm);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_active);
-      writer.WriteBit(m_write);
-      writer.WriteBit(m_read);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_realm); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_active); sb.Append(",");
-      sb.Append(m_write); sb.Append(",");
-      sb.Append(m_read);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class AccessRequestOk: RabbitMQ.Client.Impl.MethodBase, IAccessRequestOk {
-    public const int ClassId = 30;
-    public const int MethodId = 11;
-
-    public ushort m_ticket;
-
-    ushort IAccessRequestOk.Ticket { get { return m_ticket; } }
-
-    public AccessRequestOk() {}
-    public AccessRequestOk(
-      ushort initTicket)
-    {
-      m_ticket = initTicket;
-    }
-
-    public override int ProtocolClassId { get { return 30; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "access.request-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclare: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclare {
-    public const int ClassId = 40;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_type;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_autoDelete;
-    public bool m_internal;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IExchangeDeclare.Ticket { get { return m_ticket; } }
-    string IExchangeDeclare.Exchange { get { return m_exchange; } }
-    string IExchangeDeclare.Type { get { return m_type; } }
-    bool IExchangeDeclare.Passive { get { return m_passive; } }
-    bool IExchangeDeclare.Durable { get { return m_durable; } }
-    bool IExchangeDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IExchangeDeclare.Internal { get { return m_internal; } }
-    bool IExchangeDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IExchangeDeclare.Arguments { get { return m_arguments; } }
-
-    public ExchangeDeclare() {}
-    public ExchangeDeclare(
-      ushort initTicket,
-      string initExchange,
-      string initType,
-      bool initPassive,
-      bool initDurable,
-      bool initAutoDelete,
-      bool initInternal,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_type = initType;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_autoDelete = initAutoDelete;
-      m_internal = initInternal;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "exchange.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_type = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_internal = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_type);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_internal);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_type); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_internal); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeclareOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeclareOk {
-    public const int ClassId = 40;
-    public const int MethodId = 11;
-
-
-
-    public ExchangeDeclareOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "exchange.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDelete: RabbitMQ.Client.Impl.MethodBase, IExchangeDelete {
-    public const int ClassId = 40;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public bool m_ifUnused;
-    public bool m_nowait;
-
-    ushort IExchangeDelete.Ticket { get { return m_ticket; } }
-    string IExchangeDelete.Exchange { get { return m_exchange; } }
-    bool IExchangeDelete.IfUnused { get { return m_ifUnused; } }
-    bool IExchangeDelete.Nowait { get { return m_nowait; } }
-
-    public ExchangeDelete() {}
-    public ExchangeDelete(
-      ushort initTicket,
-      string initExchange,
-      bool initIfUnused,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_ifUnused = initIfUnused;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "exchange.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeDeleteOk: RabbitMQ.Client.Impl.MethodBase, IExchangeDeleteOk {
-    public const int ClassId = 40;
-    public const int MethodId = 21;
-
-
-
-    public ExchangeDeleteOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "exchange.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeBound: RabbitMQ.Client.Impl.MethodBase, IExchangeBound {
-    public const int ClassId = 40;
-    public const int MethodId = 22;
-
-    public string m_exchange;
-    public string m_routingKey;
-    public string m_queue;
-
-    string IExchangeBound.Exchange { get { return m_exchange; } }
-    string IExchangeBound.RoutingKey { get { return m_routingKey; } }
-    string IExchangeBound.Queue { get { return m_queue; } }
-
-    public ExchangeBound() {}
-    public ExchangeBound(
-      string initExchange,
-      string initRoutingKey,
-      string initQueue)
-    {
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_queue = initQueue;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 22; } }
-    public override string ProtocolMethodName { get { return "exchange.bound"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_queue = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteShortstr(m_queue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_queue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class ExchangeBoundOk: RabbitMQ.Client.Impl.MethodBase, IExchangeBoundOk {
-    public const int ClassId = 40;
-    public const int MethodId = 23;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-
-    ushort IExchangeBoundOk.ReplyCode { get { return m_replyCode; } }
-    string IExchangeBoundOk.ReplyText { get { return m_replyText; } }
-
-    public ExchangeBoundOk() {}
-    public ExchangeBoundOk(
-      ushort initReplyCode,
-      string initReplyText)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-    }
-
-    public override int ProtocolClassId { get { return 40; } }
-    public override int ProtocolMethodId { get { return 23; } }
-    public override string ProtocolMethodName { get { return "exchange.bound-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclare: RabbitMQ.Client.Impl.MethodBase, IQueueDeclare {
-    public const int ClassId = 50;
-    public const int MethodId = 10;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_passive;
-    public bool m_durable;
-    public bool m_exclusive;
-    public bool m_autoDelete;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueDeclare.Ticket { get { return m_ticket; } }
-    string IQueueDeclare.Queue { get { return m_queue; } }
-    bool IQueueDeclare.Passive { get { return m_passive; } }
-    bool IQueueDeclare.Durable { get { return m_durable; } }
-    bool IQueueDeclare.Exclusive { get { return m_exclusive; } }
-    bool IQueueDeclare.AutoDelete { get { return m_autoDelete; } }
-    bool IQueueDeclare.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueDeclare.Arguments { get { return m_arguments; } }
-
-    public QueueDeclare() {}
-    public QueueDeclare(
-      ushort initTicket,
-      string initQueue,
-      bool initPassive,
-      bool initDurable,
-      bool initExclusive,
-      bool initAutoDelete,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_passive = initPassive;
-      m_durable = initDurable;
-      m_exclusive = initExclusive;
-      m_autoDelete = initAutoDelete;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "queue.declare"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_passive = reader.ReadBit();
-      m_durable = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_autoDelete = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_passive);
-      writer.WriteBit(m_durable);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_autoDelete);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_passive); sb.Append(",");
-      sb.Append(m_durable); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_autoDelete); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeclareOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeclareOk {
-    public const int ClassId = 50;
-    public const int MethodId = 11;
-
-    public string m_queue;
-    public uint m_messageCount;
-    public uint m_consumerCount;
-
-    string IQueueDeclareOk.Queue { get { return m_queue; } }
-    uint IQueueDeclareOk.MessageCount { get { return m_messageCount; } }
-    uint IQueueDeclareOk.ConsumerCount { get { return m_consumerCount; } }
-
-    public QueueDeclareOk() {}
-    public QueueDeclareOk(
-      string initQueue,
-      uint initMessageCount,
-      uint initConsumerCount)
-    {
-      m_queue = initQueue;
-      m_messageCount = initMessageCount;
-      m_consumerCount = initConsumerCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "queue.declare-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_queue = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-      m_consumerCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_queue);
-      writer.WriteLong(m_messageCount);
-      writer.WriteLong(m_consumerCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_messageCount); sb.Append(",");
-      sb.Append(m_consumerCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBind: RabbitMQ.Client.Impl.MethodBase, IQueueBind {
-    public const int ClassId = 50;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IQueueBind.Ticket { get { return m_ticket; } }
-    string IQueueBind.Queue { get { return m_queue; } }
-    string IQueueBind.Exchange { get { return m_exchange; } }
-    string IQueueBind.RoutingKey { get { return m_routingKey; } }
-    bool IQueueBind.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IQueueBind.Arguments { get { return m_arguments; } }
-
-    public QueueBind() {}
-    public QueueBind(
-      ushort initTicket,
-      string initQueue,
-      string initExchange,
-      string initRoutingKey,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "queue.bind"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueBindOk: RabbitMQ.Client.Impl.MethodBase, IQueueBindOk {
-    public const int ClassId = 50;
-    public const int MethodId = 21;
-
-
-
-    public QueueBindOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "queue.bind-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurge: RabbitMQ.Client.Impl.MethodBase, IQueuePurge {
-    public const int ClassId = 50;
-    public const int MethodId = 30;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_nowait;
-
-    ushort IQueuePurge.Ticket { get { return m_ticket; } }
-    string IQueuePurge.Queue { get { return m_queue; } }
-    bool IQueuePurge.Nowait { get { return m_nowait; } }
-
-    public QueuePurge() {}
-    public QueuePurge(
-      ushort initTicket,
-      string initQueue,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "queue.purge"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueuePurgeOk: RabbitMQ.Client.Impl.MethodBase, IQueuePurgeOk {
-    public const int ClassId = 50;
-    public const int MethodId = 31;
-
-    public uint m_messageCount;
-
-    uint IQueuePurgeOk.MessageCount { get { return m_messageCount; } }
-
-    public QueuePurgeOk() {}
-    public QueuePurgeOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "queue.purge-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDelete: RabbitMQ.Client.Impl.MethodBase, IQueueDelete {
-    public const int ClassId = 50;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_ifUnused;
-    public bool m_ifEmpty;
-    public bool m_nowait;
-
-    ushort IQueueDelete.Ticket { get { return m_ticket; } }
-    string IQueueDelete.Queue { get { return m_queue; } }
-    bool IQueueDelete.IfUnused { get { return m_ifUnused; } }
-    bool IQueueDelete.IfEmpty { get { return m_ifEmpty; } }
-    bool IQueueDelete.Nowait { get { return m_nowait; } }
-
-    public QueueDelete() {}
-    public QueueDelete(
-      ushort initTicket,
-      string initQueue,
-      bool initIfUnused,
-      bool initIfEmpty,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_ifUnused = initIfUnused;
-      m_ifEmpty = initIfEmpty;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "queue.delete"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_ifUnused = reader.ReadBit();
-      m_ifEmpty = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_ifUnused);
-      writer.WriteBit(m_ifEmpty);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_ifUnused); sb.Append(",");
-      sb.Append(m_ifEmpty); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class QueueDeleteOk: RabbitMQ.Client.Impl.MethodBase, IQueueDeleteOk {
-    public const int ClassId = 50;
-    public const int MethodId = 41;
-
-    public uint m_messageCount;
-
-    uint IQueueDeleteOk.MessageCount { get { return m_messageCount; } }
-
-    public QueueDeleteOk() {}
-    public QueueDeleteOk(
-      uint initMessageCount)
-    {
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 50; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "queue.delete-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQos: RabbitMQ.Client.Impl.MethodBase, IBasicQos {
-    public const int ClassId = 60;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IBasicQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IBasicQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IBasicQos.Global { get { return m_global; } }
-
-    public BasicQos() {}
-    public BasicQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "basic.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicQosOk: RabbitMQ.Client.Impl.MethodBase, IBasicQosOk {
-    public const int ClassId = 60;
-    public const int MethodId = 11;
-
-
-
-    public BasicQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "basic.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsume: RabbitMQ.Client.Impl.MethodBase, IBasicConsume {
-    public const int ClassId = 60;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-    public System.Collections.IDictionary m_arguments;
-
-    ushort IBasicConsume.Ticket { get { return m_ticket; } }
-    string IBasicConsume.Queue { get { return m_queue; } }
-    string IBasicConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicConsume.NoLocal { get { return m_noLocal; } }
-    bool IBasicConsume.NoAck { get { return m_noAck; } }
-    bool IBasicConsume.Exclusive { get { return m_exclusive; } }
-    bool IBasicConsume.Nowait { get { return m_nowait; } }
-    System.Collections.IDictionary IBasicConsume.Arguments { get { return m_arguments; } }
-
-    public BasicConsume() {}
-    public BasicConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait,
-      System.Collections.IDictionary initArguments)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-      m_arguments = initArguments;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "basic.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-      m_arguments = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-      writer.WriteTable(m_arguments);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait); sb.Append(",");
-      sb.Append(m_arguments);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicConsumeOk: RabbitMQ.Client.Impl.MethodBase, IBasicConsumeOk {
-    public const int ClassId = 60;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IBasicConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicConsumeOk() {}
-    public BasicConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "basic.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancel: RabbitMQ.Client.Impl.MethodBase, IBasicCancel {
-    public const int ClassId = 60;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IBasicCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IBasicCancel.Nowait { get { return m_nowait; } }
-
-    public BasicCancel() {}
-    public BasicCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "basic.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicCancelOk: RabbitMQ.Client.Impl.MethodBase, IBasicCancelOk {
-    public const int ClassId = 60;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IBasicCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public BasicCancelOk() {}
-    public BasicCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "basic.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicPublish: RabbitMQ.Client.Impl.MethodBase, IBasicPublish {
-    public const int ClassId = 60;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IBasicPublish.Ticket { get { return m_ticket; } }
-    string IBasicPublish.Exchange { get { return m_exchange; } }
-    string IBasicPublish.RoutingKey { get { return m_routingKey; } }
-    bool IBasicPublish.Mandatory { get { return m_mandatory; } }
-    bool IBasicPublish.Immediate { get { return m_immediate; } }
-
-    public BasicPublish() {}
-    public BasicPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "basic.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReturn: RabbitMQ.Client.Impl.MethodBase, IBasicReturn {
-    public const int ClassId = 60;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IBasicReturn.ReplyCode { get { return m_replyCode; } }
-    string IBasicReturn.ReplyText { get { return m_replyText; } }
-    string IBasicReturn.Exchange { get { return m_exchange; } }
-    string IBasicReturn.RoutingKey { get { return m_routingKey; } }
-
-    public BasicReturn() {}
-    public BasicReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "basic.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicDeliver: RabbitMQ.Client.Impl.MethodBase, IBasicDeliver {
-    public const int ClassId = 60;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-
-    string IBasicDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IBasicDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicDeliver.Redelivered { get { return m_redelivered; } }
-    string IBasicDeliver.Exchange { get { return m_exchange; } }
-    string IBasicDeliver.RoutingKey { get { return m_routingKey; } }
-
-    public BasicDeliver() {}
-    public BasicDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "basic.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGet: RabbitMQ.Client.Impl.MethodBase, IBasicGet {
-    public const int ClassId = 60;
-    public const int MethodId = 70;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public bool m_noAck;
-
-    ushort IBasicGet.Ticket { get { return m_ticket; } }
-    string IBasicGet.Queue { get { return m_queue; } }
-    bool IBasicGet.NoAck { get { return m_noAck; } }
-
-    public BasicGet() {}
-    public BasicGet(
-      ushort initTicket,
-      string initQueue,
-      bool initNoAck)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_noAck = initNoAck;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "basic.get"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_noAck = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteBit(m_noAck);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_noAck);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetOk: RabbitMQ.Client.Impl.MethodBase, IBasicGetOk {
-    public const int ClassId = 60;
-    public const int MethodId = 71;
-
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public uint m_messageCount;
-
-    ulong IBasicGetOk.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicGetOk.Redelivered { get { return m_redelivered; } }
-    string IBasicGetOk.Exchange { get { return m_exchange; } }
-    string IBasicGetOk.RoutingKey { get { return m_routingKey; } }
-    uint IBasicGetOk.MessageCount { get { return m_messageCount; } }
-
-    public BasicGetOk() {}
-    public BasicGetOk(
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      uint initMessageCount)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_messageCount = initMessageCount;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 71; } }
-    public override string ProtocolMethodName { get { return "basic.get-ok"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_messageCount = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteLong(m_messageCount);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_messageCount);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicGetEmpty: RabbitMQ.Client.Impl.MethodBase, IBasicGetEmpty {
-    public const int ClassId = 60;
-    public const int MethodId = 72;
-
-    public string m_clusterId;
-
-    string IBasicGetEmpty.ClusterId { get { return m_clusterId; } }
-
-    public BasicGetEmpty() {}
-    public BasicGetEmpty(
-      string initClusterId)
-    {
-      m_clusterId = initClusterId;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 72; } }
-    public override string ProtocolMethodName { get { return "basic.get-empty"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_clusterId = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_clusterId);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_clusterId);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicAck: RabbitMQ.Client.Impl.MethodBase, IBasicAck {
-    public const int ClassId = 60;
-    public const int MethodId = 80;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IBasicAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicAck.Multiple { get { return m_multiple; } }
-
-    public BasicAck() {}
-    public BasicAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "basic.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicReject: RabbitMQ.Client.Impl.MethodBase, IBasicReject {
-    public const int ClassId = 60;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IBasicReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IBasicReject.Requeue { get { return m_requeue; } }
-
-    public BasicReject() {}
-    public BasicReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "basic.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicRecover: RabbitMQ.Client.Impl.MethodBase, IBasicRecover {
-    public const int ClassId = 60;
-    public const int MethodId = 100;
-
-    public bool m_requeue;
-
-    bool IBasicRecover.Requeue { get { return m_requeue; } }
-
-    public BasicRecover() {}
-    public BasicRecover(
-      bool initRequeue)
-    {
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "basic.recover"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class BasicRecoverOk: RabbitMQ.Client.Impl.MethodBase, IBasicRecoverOk {
-    public const int ClassId = 60;
-    public const int MethodId = 101;
-
-
-
-    public BasicRecoverOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 60; } }
-    public override int ProtocolMethodId { get { return 101; } }
-    public override string ProtocolMethodName { get { return "basic.recover-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQos: RabbitMQ.Client.Impl.MethodBase, IFileQos {
-    public const int ClassId = 70;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public bool m_global;
-
-    uint IFileQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IFileQos.PrefetchCount { get { return m_prefetchCount; } }
-    bool IFileQos.Global { get { return m_global; } }
-
-    public FileQos() {}
-    public FileQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "file.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileQosOk: RabbitMQ.Client.Impl.MethodBase, IFileQosOk {
-    public const int ClassId = 70;
-    public const int MethodId = 11;
-
-
-
-    public FileQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "file.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsume: RabbitMQ.Client.Impl.MethodBase, IFileConsume {
-    public const int ClassId = 70;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_noAck;
-    public bool m_exclusive;
-    public bool m_nowait;
-
-    ushort IFileConsume.Ticket { get { return m_ticket; } }
-    string IFileConsume.Queue { get { return m_queue; } }
-    string IFileConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileConsume.NoLocal { get { return m_noLocal; } }
-    bool IFileConsume.NoAck { get { return m_noAck; } }
-    bool IFileConsume.Exclusive { get { return m_exclusive; } }
-    bool IFileConsume.Nowait { get { return m_nowait; } }
-
-    public FileConsume() {}
-    public FileConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initNoAck,
-      bool initExclusive,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_noAck = initNoAck;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "file.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_noAck = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_noAck);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_noAck); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileConsumeOk: RabbitMQ.Client.Impl.MethodBase, IFileConsumeOk {
-    public const int ClassId = 70;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IFileConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileConsumeOk() {}
-    public FileConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "file.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancel: RabbitMQ.Client.Impl.MethodBase, IFileCancel {
-    public const int ClassId = 70;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IFileCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IFileCancel.Nowait { get { return m_nowait; } }
-
-    public FileCancel() {}
-    public FileCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "file.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileCancelOk: RabbitMQ.Client.Impl.MethodBase, IFileCancelOk {
-    public const int ClassId = 70;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IFileCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public FileCancelOk() {}
-    public FileCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "file.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpen: RabbitMQ.Client.Impl.MethodBase, IFileOpen {
-    public const int ClassId = 70;
-    public const int MethodId = 40;
-
-    public string m_identifier;
-    public ulong m_contentSize;
-
-    string IFileOpen.Identifier { get { return m_identifier; } }
-    ulong IFileOpen.ContentSize { get { return m_contentSize; } }
-
-    public FileOpen() {}
-    public FileOpen(
-      string initIdentifier,
-      ulong initContentSize)
-    {
-      m_identifier = initIdentifier;
-      m_contentSize = initContentSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "file.open"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_identifier = reader.ReadShortstr();
-      m_contentSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_identifier);
-      writer.WriteLonglong(m_contentSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_identifier); sb.Append(",");
-      sb.Append(m_contentSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileOpenOk: RabbitMQ.Client.Impl.MethodBase, IFileOpenOk {
-    public const int ClassId = 70;
-    public const int MethodId = 41;
-
-    public ulong m_stagedSize;
-
-    ulong IFileOpenOk.StagedSize { get { return m_stagedSize; } }
-
-    public FileOpenOk() {}
-    public FileOpenOk(
-      ulong initStagedSize)
-    {
-      m_stagedSize = initStagedSize;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "file.open-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_stagedSize = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_stagedSize);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_stagedSize);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileStage: RabbitMQ.Client.Impl.MethodBase, IFileStage {
-    public const int ClassId = 70;
-    public const int MethodId = 50;
-
-
-
-    public FileStage(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "file.stage"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FilePublish: RabbitMQ.Client.Impl.MethodBase, IFilePublish {
-    public const int ClassId = 70;
-    public const int MethodId = 60;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-    public string m_identifier;
-
-    ushort IFilePublish.Ticket { get { return m_ticket; } }
-    string IFilePublish.Exchange { get { return m_exchange; } }
-    string IFilePublish.RoutingKey { get { return m_routingKey; } }
-    bool IFilePublish.Mandatory { get { return m_mandatory; } }
-    bool IFilePublish.Immediate { get { return m_immediate; } }
-    string IFilePublish.Identifier { get { return m_identifier; } }
-
-    public FilePublish() {}
-    public FilePublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate,
-      string initIdentifier)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "file.publish"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReturn: RabbitMQ.Client.Impl.MethodBase, IFileReturn {
-    public const int ClassId = 70;
-    public const int MethodId = 70;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IFileReturn.ReplyCode { get { return m_replyCode; } }
-    string IFileReturn.ReplyText { get { return m_replyText; } }
-    string IFileReturn.Exchange { get { return m_exchange; } }
-    string IFileReturn.RoutingKey { get { return m_routingKey; } }
-
-    public FileReturn() {}
-    public FileReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 70; } }
-    public override string ProtocolMethodName { get { return "file.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileDeliver: RabbitMQ.Client.Impl.MethodBase, IFileDeliver {
-    public const int ClassId = 70;
-    public const int MethodId = 80;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public bool m_redelivered;
-    public string m_exchange;
-    public string m_routingKey;
-    public string m_identifier;
-
-    string IFileDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IFileDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileDeliver.Redelivered { get { return m_redelivered; } }
-    string IFileDeliver.Exchange { get { return m_exchange; } }
-    string IFileDeliver.RoutingKey { get { return m_routingKey; } }
-    string IFileDeliver.Identifier { get { return m_identifier; } }
-
-    public FileDeliver() {}
-    public FileDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      bool initRedelivered,
-      string initExchange,
-      string initRoutingKey,
-      string initIdentifier)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_redelivered = initRedelivered;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_identifier = initIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 80; } }
-    public override string ProtocolMethodName { get { return "file.deliver"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_redelivered = reader.ReadBit();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_identifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_redelivered);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteShortstr(m_identifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_redelivered); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_identifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileAck: RabbitMQ.Client.Impl.MethodBase, IFileAck {
-    public const int ClassId = 70;
-    public const int MethodId = 90;
-
-    public ulong m_deliveryTag;
-    public bool m_multiple;
-
-    ulong IFileAck.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileAck.Multiple { get { return m_multiple; } }
-
-    public FileAck() {}
-    public FileAck(
-      ulong initDeliveryTag,
-      bool initMultiple)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_multiple = initMultiple;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 90; } }
-    public override string ProtocolMethodName { get { return "file.ack"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_multiple = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_multiple);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_multiple);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class FileReject: RabbitMQ.Client.Impl.MethodBase, IFileReject {
-    public const int ClassId = 70;
-    public const int MethodId = 100;
-
-    public ulong m_deliveryTag;
-    public bool m_requeue;
-
-    ulong IFileReject.DeliveryTag { get { return m_deliveryTag; } }
-    bool IFileReject.Requeue { get { return m_requeue; } }
-
-    public FileReject() {}
-    public FileReject(
-      ulong initDeliveryTag,
-      bool initRequeue)
-    {
-      m_deliveryTag = initDeliveryTag;
-      m_requeue = initRequeue;
-    }
-
-    public override int ProtocolClassId { get { return 70; } }
-    public override int ProtocolMethodId { get { return 100; } }
-    public override string ProtocolMethodName { get { return "file.reject"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_deliveryTag = reader.ReadLonglong();
-      m_requeue = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteBit(m_requeue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_requeue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQos: RabbitMQ.Client.Impl.MethodBase, IStreamQos {
-    public const int ClassId = 80;
-    public const int MethodId = 10;
-
-    public uint m_prefetchSize;
-    public ushort m_prefetchCount;
-    public uint m_consumeRate;
-    public bool m_global;
-
-    uint IStreamQos.PrefetchSize { get { return m_prefetchSize; } }
-    ushort IStreamQos.PrefetchCount { get { return m_prefetchCount; } }
-    uint IStreamQos.ConsumeRate { get { return m_consumeRate; } }
-    bool IStreamQos.Global { get { return m_global; } }
-
-    public StreamQos() {}
-    public StreamQos(
-      uint initPrefetchSize,
-      ushort initPrefetchCount,
-      uint initConsumeRate,
-      bool initGlobal)
-    {
-      m_prefetchSize = initPrefetchSize;
-      m_prefetchCount = initPrefetchCount;
-      m_consumeRate = initConsumeRate;
-      m_global = initGlobal;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "stream.qos"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_prefetchSize = reader.ReadLong();
-      m_prefetchCount = reader.ReadShort();
-      m_consumeRate = reader.ReadLong();
-      m_global = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_prefetchSize);
-      writer.WriteShort(m_prefetchCount);
-      writer.WriteLong(m_consumeRate);
-      writer.WriteBit(m_global);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_prefetchSize); sb.Append(",");
-      sb.Append(m_prefetchCount); sb.Append(",");
-      sb.Append(m_consumeRate); sb.Append(",");
-      sb.Append(m_global);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamQosOk: RabbitMQ.Client.Impl.MethodBase, IStreamQosOk {
-    public const int ClassId = 80;
-    public const int MethodId = 11;
-
-
-
-    public StreamQosOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "stream.qos-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsume: RabbitMQ.Client.Impl.MethodBase, IStreamConsume {
-    public const int ClassId = 80;
-    public const int MethodId = 20;
-
-    public ushort m_ticket;
-    public string m_queue;
-    public string m_consumerTag;
-    public bool m_noLocal;
-    public bool m_exclusive;
-    public bool m_nowait;
-
-    ushort IStreamConsume.Ticket { get { return m_ticket; } }
-    string IStreamConsume.Queue { get { return m_queue; } }
-    string IStreamConsume.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamConsume.NoLocal { get { return m_noLocal; } }
-    bool IStreamConsume.Exclusive { get { return m_exclusive; } }
-    bool IStreamConsume.Nowait { get { return m_nowait; } }
-
-    public StreamConsume() {}
-    public StreamConsume(
-      ushort initTicket,
-      string initQueue,
-      string initConsumerTag,
-      bool initNoLocal,
-      bool initExclusive,
-      bool initNowait)
-    {
-      m_ticket = initTicket;
-      m_queue = initQueue;
-      m_consumerTag = initConsumerTag;
-      m_noLocal = initNoLocal;
-      m_exclusive = initExclusive;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "stream.consume"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_queue = reader.ReadShortstr();
-      m_consumerTag = reader.ReadShortstr();
-      m_noLocal = reader.ReadBit();
-      m_exclusive = reader.ReadBit();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_queue);
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_noLocal);
-      writer.WriteBit(m_exclusive);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_queue); sb.Append(",");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_noLocal); sb.Append(",");
-      sb.Append(m_exclusive); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamConsumeOk: RabbitMQ.Client.Impl.MethodBase, IStreamConsumeOk {
-    public const int ClassId = 80;
-    public const int MethodId = 21;
-
-    public string m_consumerTag;
-
-    string IStreamConsumeOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamConsumeOk() {}
-    public StreamConsumeOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "stream.consume-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancel: RabbitMQ.Client.Impl.MethodBase, IStreamCancel {
-    public const int ClassId = 80;
-    public const int MethodId = 30;
-
-    public string m_consumerTag;
-    public bool m_nowait;
-
-    string IStreamCancel.ConsumerTag { get { return m_consumerTag; } }
-    bool IStreamCancel.Nowait { get { return m_nowait; } }
-
-    public StreamCancel() {}
-    public StreamCancel(
-      string initConsumerTag,
-      bool initNowait)
-    {
-      m_consumerTag = initConsumerTag;
-      m_nowait = initNowait;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "stream.cancel"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_nowait = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteBit(m_nowait);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_nowait);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamCancelOk: RabbitMQ.Client.Impl.MethodBase, IStreamCancelOk {
-    public const int ClassId = 80;
-    public const int MethodId = 31;
-
-    public string m_consumerTag;
-
-    string IStreamCancelOk.ConsumerTag { get { return m_consumerTag; } }
-
-    public StreamCancelOk() {}
-    public StreamCancelOk(
-      string initConsumerTag)
-    {
-      m_consumerTag = initConsumerTag;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "stream.cancel-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamPublish: RabbitMQ.Client.Impl.MethodBase, IStreamPublish {
-    public const int ClassId = 80;
-    public const int MethodId = 40;
-
-    public ushort m_ticket;
-    public string m_exchange;
-    public string m_routingKey;
-    public bool m_mandatory;
-    public bool m_immediate;
-
-    ushort IStreamPublish.Ticket { get { return m_ticket; } }
-    string IStreamPublish.Exchange { get { return m_exchange; } }
-    string IStreamPublish.RoutingKey { get { return m_routingKey; } }
-    bool IStreamPublish.Mandatory { get { return m_mandatory; } }
-    bool IStreamPublish.Immediate { get { return m_immediate; } }
-
-    public StreamPublish() {}
-    public StreamPublish(
-      ushort initTicket,
-      string initExchange,
-      string initRoutingKey,
-      bool initMandatory,
-      bool initImmediate)
-    {
-      m_ticket = initTicket;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-      m_mandatory = initMandatory;
-      m_immediate = initImmediate;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "stream.publish"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_ticket = reader.ReadShort();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-      m_mandatory = reader.ReadBit();
-      m_immediate = reader.ReadBit();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_ticket);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-      writer.WriteBit(m_mandatory);
-      writer.WriteBit(m_immediate);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_ticket); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey); sb.Append(",");
-      sb.Append(m_mandatory); sb.Append(",");
-      sb.Append(m_immediate);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamReturn: RabbitMQ.Client.Impl.MethodBase, IStreamReturn {
-    public const int ClassId = 80;
-    public const int MethodId = 50;
-
-    public ushort m_replyCode;
-    public string m_replyText;
-    public string m_exchange;
-    public string m_routingKey;
-
-    ushort IStreamReturn.ReplyCode { get { return m_replyCode; } }
-    string IStreamReturn.ReplyText { get { return m_replyText; } }
-    string IStreamReturn.Exchange { get { return m_exchange; } }
-    string IStreamReturn.RoutingKey { get { return m_routingKey; } }
-
-    public StreamReturn() {}
-    public StreamReturn(
-      ushort initReplyCode,
-      string initReplyText,
-      string initExchange,
-      string initRoutingKey)
-    {
-      m_replyCode = initReplyCode;
-      m_replyText = initReplyText;
-      m_exchange = initExchange;
-      m_routingKey = initRoutingKey;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 50; } }
-    public override string ProtocolMethodName { get { return "stream.return"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_replyCode = reader.ReadShort();
-      m_replyText = reader.ReadShortstr();
-      m_exchange = reader.ReadShortstr();
-      m_routingKey = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShort(m_replyCode);
-      writer.WriteShortstr(m_replyText);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_routingKey);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_replyCode); sb.Append(",");
-      sb.Append(m_replyText); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_routingKey);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class StreamDeliver: RabbitMQ.Client.Impl.MethodBase, IStreamDeliver {
-    public const int ClassId = 80;
-    public const int MethodId = 60;
-
-    public string m_consumerTag;
-    public ulong m_deliveryTag;
-    public string m_exchange;
-    public string m_queue;
-
-    string IStreamDeliver.ConsumerTag { get { return m_consumerTag; } }
-    ulong IStreamDeliver.DeliveryTag { get { return m_deliveryTag; } }
-    string IStreamDeliver.Exchange { get { return m_exchange; } }
-    string IStreamDeliver.Queue { get { return m_queue; } }
-
-    public StreamDeliver() {}
-    public StreamDeliver(
-      string initConsumerTag,
-      ulong initDeliveryTag,
-      string initExchange,
-      string initQueue)
-    {
-      m_consumerTag = initConsumerTag;
-      m_deliveryTag = initDeliveryTag;
-      m_exchange = initExchange;
-      m_queue = initQueue;
-    }
-
-    public override int ProtocolClassId { get { return 80; } }
-    public override int ProtocolMethodId { get { return 60; } }
-    public override string ProtocolMethodName { get { return "stream.deliver"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_consumerTag = reader.ReadShortstr();
-      m_deliveryTag = reader.ReadLonglong();
-      m_exchange = reader.ReadShortstr();
-      m_queue = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_consumerTag);
-      writer.WriteLonglong(m_deliveryTag);
-      writer.WriteShortstr(m_exchange);
-      writer.WriteShortstr(m_queue);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_consumerTag); sb.Append(",");
-      sb.Append(m_deliveryTag); sb.Append(",");
-      sb.Append(m_exchange); sb.Append(",");
-      sb.Append(m_queue);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelect: RabbitMQ.Client.Impl.MethodBase, ITxSelect {
-    public const int ClassId = 90;
-    public const int MethodId = 10;
-
-
-
-    public TxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxSelectOk: RabbitMQ.Client.Impl.MethodBase, ITxSelectOk {
-    public const int ClassId = 90;
-    public const int MethodId = 11;
-
-
-
-    public TxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "tx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommit: RabbitMQ.Client.Impl.MethodBase, ITxCommit {
-    public const int ClassId = 90;
-    public const int MethodId = 20;
-
-
-
-    public TxCommit(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "tx.commit"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxCommitOk: RabbitMQ.Client.Impl.MethodBase, ITxCommitOk {
-    public const int ClassId = 90;
-    public const int MethodId = 21;
-
-
-
-    public TxCommitOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "tx.commit-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollback: RabbitMQ.Client.Impl.MethodBase, ITxRollback {
-    public const int ClassId = 90;
-    public const int MethodId = 30;
-
-
-
-    public TxRollback(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "tx.rollback"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TxRollbackOk: RabbitMQ.Client.Impl.MethodBase, ITxRollbackOk {
-    public const int ClassId = 90;
-    public const int MethodId = 31;
-
-
-
-    public TxRollbackOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 90; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "tx.rollback-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelect: RabbitMQ.Client.Impl.MethodBase, IDtxSelect {
-    public const int ClassId = 100;
-    public const int MethodId = 10;
-
-
-
-    public DtxSelect(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "dtx.select"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxSelectOk: RabbitMQ.Client.Impl.MethodBase, IDtxSelectOk {
-    public const int ClassId = 100;
-    public const int MethodId = 11;
-
-
-
-    public DtxSelectOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "dtx.select-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStart: RabbitMQ.Client.Impl.MethodBase, IDtxStart {
-    public const int ClassId = 100;
-    public const int MethodId = 20;
-
-    public string m_dtxIdentifier;
-
-    string IDtxStart.DtxIdentifier { get { return m_dtxIdentifier; } }
-
-    public DtxStart() {}
-    public DtxStart(
-      string initDtxIdentifier)
-    {
-      m_dtxIdentifier = initDtxIdentifier;
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "dtx.start"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_dtxIdentifier = reader.ReadShortstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_dtxIdentifier);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_dtxIdentifier);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class DtxStartOk: RabbitMQ.Client.Impl.MethodBase, IDtxStartOk {
-    public const int ClassId = 100;
-    public const int MethodId = 21;
-
-
-
-    public DtxStartOk(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 100; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "dtx.start-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TunnelRequest: RabbitMQ.Client.Impl.MethodBase, ITunnelRequest {
-    public const int ClassId = 110;
-    public const int MethodId = 10;
-
-    public System.Collections.IDictionary m_metaData;
-
-    System.Collections.IDictionary ITunnelRequest.MetaData { get { return m_metaData; } }
-
-    public TunnelRequest() {}
-    public TunnelRequest(
-      System.Collections.IDictionary initMetaData)
-    {
-      m_metaData = initMetaData;
-    }
-
-    public override int ProtocolClassId { get { return 110; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "tunnel.request"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_metaData = reader.ReadTable();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_metaData);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_metaData);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestInteger: RabbitMQ.Client.Impl.MethodBase, ITestInteger {
-    public const int ClassId = 120;
-    public const int MethodId = 10;
-
-    public byte m_integer1;
-    public ushort m_integer2;
-    public uint m_integer3;
-    public ulong m_integer4;
-    public byte m_operation;
-
-    byte ITestInteger.Integer1 { get { return m_integer1; } }
-    ushort ITestInteger.Integer2 { get { return m_integer2; } }
-    uint ITestInteger.Integer3 { get { return m_integer3; } }
-    ulong ITestInteger.Integer4 { get { return m_integer4; } }
-    byte ITestInteger.Operation { get { return m_operation; } }
-
-    public TestInteger() {}
-    public TestInteger(
-      byte initInteger1,
-      ushort initInteger2,
-      uint initInteger3,
-      ulong initInteger4,
-      byte initOperation)
-    {
-      m_integer1 = initInteger1;
-      m_integer2 = initInteger2;
-      m_integer3 = initInteger3;
-      m_integer4 = initInteger4;
-      m_operation = initOperation;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 10; } }
-    public override string ProtocolMethodName { get { return "test.integer"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_integer1 = reader.ReadOctet();
-      m_integer2 = reader.ReadShort();
-      m_integer3 = reader.ReadLong();
-      m_integer4 = reader.ReadLonglong();
-      m_operation = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteOctet(m_integer1);
-      writer.WriteShort(m_integer2);
-      writer.WriteLong(m_integer3);
-      writer.WriteLonglong(m_integer4);
-      writer.WriteOctet(m_operation);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_integer1); sb.Append(",");
-      sb.Append(m_integer2); sb.Append(",");
-      sb.Append(m_integer3); sb.Append(",");
-      sb.Append(m_integer4); sb.Append(",");
-      sb.Append(m_operation);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestIntegerOk: RabbitMQ.Client.Impl.MethodBase, ITestIntegerOk {
-    public const int ClassId = 120;
-    public const int MethodId = 11;
-
-    public ulong m_result;
-
-    ulong ITestIntegerOk.Result { get { return m_result; } }
-
-    public TestIntegerOk() {}
-    public TestIntegerOk(
-      ulong initResult)
-    {
-      m_result = initResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 11; } }
-    public override string ProtocolMethodName { get { return "test.integer-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_result = reader.ReadLonglong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_result);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_result);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestString: RabbitMQ.Client.Impl.MethodBase, ITestString {
-    public const int ClassId = 120;
-    public const int MethodId = 20;
-
-    public string m_string1;
-    public byte[] m_string2;
-    public byte m_operation;
-
-    string ITestString.String1 { get { return m_string1; } }
-    byte[] ITestString.String2 { get { return m_string2; } }
-    byte ITestString.Operation { get { return m_operation; } }
-
-    public TestString() {}
-    public TestString(
-      string initString1,
-      byte[] initString2,
-      byte initOperation)
-    {
-      m_string1 = initString1;
-      m_string2 = initString2;
-      m_operation = initOperation;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 20; } }
-    public override string ProtocolMethodName { get { return "test.string"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_string1 = reader.ReadShortstr();
-      m_string2 = reader.ReadLongstr();
-      m_operation = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteShortstr(m_string1);
-      writer.WriteLongstr(m_string2);
-      writer.WriteOctet(m_operation);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_string1); sb.Append(",");
-      sb.Append(m_string2); sb.Append(",");
-      sb.Append(m_operation);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestStringOk: RabbitMQ.Client.Impl.MethodBase, ITestStringOk {
-    public const int ClassId = 120;
-    public const int MethodId = 21;
-
-    public byte[] m_result;
-
-    byte[] ITestStringOk.Result { get { return m_result; } }
-
-    public TestStringOk() {}
-    public TestStringOk(
-      byte[] initResult)
-    {
-      m_result = initResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 21; } }
-    public override string ProtocolMethodName { get { return "test.string-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_result = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLongstr(m_result);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_result);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestTable: RabbitMQ.Client.Impl.MethodBase, ITestTable {
-    public const int ClassId = 120;
-    public const int MethodId = 30;
-
-    public System.Collections.IDictionary m_table;
-    public byte m_integerOp;
-    public byte m_stringOp;
-
-    System.Collections.IDictionary ITestTable.Table { get { return m_table; } }
-    byte ITestTable.IntegerOp { get { return m_integerOp; } }
-    byte ITestTable.StringOp { get { return m_stringOp; } }
-
-    public TestTable() {}
-    public TestTable(
-      System.Collections.IDictionary initTable,
-      byte initIntegerOp,
-      byte initStringOp)
-    {
-      m_table = initTable;
-      m_integerOp = initIntegerOp;
-      m_stringOp = initStringOp;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 30; } }
-    public override string ProtocolMethodName { get { return "test.table"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_table = reader.ReadTable();
-      m_integerOp = reader.ReadOctet();
-      m_stringOp = reader.ReadOctet();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteTable(m_table);
-      writer.WriteOctet(m_integerOp);
-      writer.WriteOctet(m_stringOp);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_table); sb.Append(",");
-      sb.Append(m_integerOp); sb.Append(",");
-      sb.Append(m_stringOp);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestTableOk: RabbitMQ.Client.Impl.MethodBase, ITestTableOk {
-    public const int ClassId = 120;
-    public const int MethodId = 31;
-
-    public ulong m_integerResult;
-    public byte[] m_stringResult;
-
-    ulong ITestTableOk.IntegerResult { get { return m_integerResult; } }
-    byte[] ITestTableOk.StringResult { get { return m_stringResult; } }
-
-    public TestTableOk() {}
-    public TestTableOk(
-      ulong initIntegerResult,
-      byte[] initStringResult)
-    {
-      m_integerResult = initIntegerResult;
-      m_stringResult = initStringResult;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 31; } }
-    public override string ProtocolMethodName { get { return "test.table-ok"; } }
-    public override bool HasContent { get { return false; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_integerResult = reader.ReadLonglong();
-      m_stringResult = reader.ReadLongstr();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLonglong(m_integerResult);
-      writer.WriteLongstr(m_stringResult);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_integerResult); sb.Append(",");
-      sb.Append(m_stringResult);
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestContent: RabbitMQ.Client.Impl.MethodBase, ITestContent {
-    public const int ClassId = 120;
-    public const int MethodId = 40;
-
-
-
-    public TestContent(
-)
-    {
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 40; } }
-    public override string ProtocolMethodName { get { return "test.content"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(")");
-    }
-  }
-  /// <summary>Autogenerated type. Private implementation class - do not use directly.</summary>
-  public class TestContentOk: RabbitMQ.Client.Impl.MethodBase, ITestContentOk {
-    public const int ClassId = 120;
-    public const int MethodId = 41;
-
-    public uint m_contentChecksum;
-
-    uint ITestContentOk.ContentChecksum { get { return m_contentChecksum; } }
-
-    public TestContentOk() {}
-    public TestContentOk(
-      uint initContentChecksum)
-    {
-      m_contentChecksum = initContentChecksum;
-    }
-
-    public override int ProtocolClassId { get { return 120; } }
-    public override int ProtocolMethodId { get { return 41; } }
-    public override string ProtocolMethodName { get { return "test.content-ok"; } }
-    public override bool HasContent { get { return true; } }
-
-    public override void ReadArgumentsFrom(RabbitMQ.Client.Impl.MethodArgumentReader reader) {
-      m_contentChecksum = reader.ReadLong();
-    }
-
-    public override void WriteArgumentsTo(RabbitMQ.Client.Impl.MethodArgumentWriter writer) {
-      writer.WriteLong(m_contentChecksum);
-    }
-
-    public override void AppendArgumentDebugStringTo(System.Text.StringBuilder sb) {
-      sb.Append("(");
-      sb.Append(m_contentChecksum);
-      sb.Append(")");
-    }
-  }
-
-  public class Model: RabbitMQ.Client.Impl.ModelBase {
-    public Model(RabbitMQ.Client.Impl.ISession session): base(session) {}
-    public override System.UInt16 _Private_AccessRequest(
-      System.String @realm,
-      System.Boolean @exclusive,
-      System.Boolean @passive,
-      System.Boolean @active,
-      System.Boolean @write,
-      System.Boolean @read)
-    {
-      AccessRequest __req = new AccessRequest();
-      __req.m_realm = @realm;
-      __req.m_exclusive = @exclusive;
-      __req.m_passive = @passive;
-      __req.m_active = @active;
-      __req.m_write = @write;
-      __req.m_read = @read;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      AccessRequestOk __rep = __repBase as AccessRequestOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_ticket;
-    }
-    public override void _Private_BasicPublish(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @mandatory,
-      System.Boolean @immediate,
-      RabbitMQ.Client.IBasicProperties @basicProperties,
-      System.Byte[] @body)
-    {
-      BasicPublish __req = new BasicPublish();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_mandatory = @mandatory;
-      __req.m_immediate = @immediate;
-      ModelSend(__req, (BasicProperties) basicProperties,body);
-    }
-    public override void _Private_BasicConsume(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @consumerTag,
-      System.Boolean @noLocal,
-      System.Boolean @noAck,
-      System.Boolean @exclusive,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @filter)
-    {
-      BasicConsume __req = new BasicConsume();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_consumerTag = @consumerTag;
-      __req.m_noLocal = @noLocal;
-      __req.m_noAck = @noAck;
-      __req.m_exclusive = @exclusive;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @filter;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicCancel(
-      System.String @consumerTag,
-      System.Boolean @nowait)
-    {
-      BasicCancel __req = new BasicCancel();
-      __req.m_consumerTag = @consumerTag;
-      __req.m_nowait = @nowait;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelOpen(
-      System.String @outOfBand)
-    {
-      ChannelOpen __req = new ChannelOpen();
-      __req.m_outOfBand = @outOfBand;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelOpenOk __rep = __repBase as ChannelOpenOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ChannelCloseOk()
-    {
-      ChannelCloseOk __req = new ChannelCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ChannelClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ChannelClose __req = new ChannelClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_BasicGet(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @noAck)
-    {
-      BasicGet __req = new BasicGet();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_noAck = @noAck;
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.Impl.ConnectionTuneDetails ConnectionStartOk(
-      System.Collections.IDictionary @clientProperties,
-      System.String @mechanism,
-      System.Byte[] @response,
-      System.String @locale)
-    {
-      ConnectionStartOk __req = new ConnectionStartOk();
-      __req.m_clientProperties = @clientProperties;
-      __req.m_mechanism = @mechanism;
-      __req.m_response = @response;
-      __req.m_locale = @locale;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionTune __rep = __repBase as ConnectionTune;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      RabbitMQ.Client.Impl.ConnectionTuneDetails __result = new RabbitMQ.Client.Impl.ConnectionTuneDetails();
-      __result.channelMax = __rep.m_channelMax;
-      __result.frameMax = __rep.m_frameMax;
-      __result.heartbeat = __rep.m_heartbeat;
-      return __result;
-    }
-    public override void ConnectionTuneOk(
-      System.UInt16 @channelMax,
-      System.UInt32 @frameMax,
-      System.UInt16 @heartbeat)
-    {
-      ConnectionTuneOk __req = new ConnectionTuneOk();
-      __req.m_channelMax = @channelMax;
-      __req.m_frameMax = @frameMax;
-      __req.m_heartbeat = @heartbeat;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionOpen(
-      System.String @virtualHost,
-      System.String @capabilities,
-      System.Boolean @insist)
-    {
-      ConnectionOpen __req = new ConnectionOpen();
-      __req.m_virtualHost = @virtualHost;
-      __req.m_capabilities = @capabilities;
-      __req.m_insist = @insist;
-      ModelSend(__req,null,null);
-    }
-    public override void _Private_ConnectionClose(
-      System.UInt16 @replyCode,
-      System.String @replyText,
-      System.UInt16 @classId,
-      System.UInt16 @methodId)
-    {
-      ConnectionClose __req = new ConnectionClose();
-      __req.m_replyCode = @replyCode;
-      __req.m_replyText = @replyText;
-      __req.m_classId = @classId;
-      __req.m_methodId = @methodId;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ConnectionCloseOk __rep = __repBase as ConnectionCloseOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void _Private_ConnectionCloseOk()
-    {
-      ConnectionCloseOk __req = new ConnectionCloseOk();
-      ModelSend(__req,null,null);
-    }
-    public override RabbitMQ.Client.IBasicProperties CreateBasicProperties()
-    {
-      return new BasicProperties();
-    }
-    public override RabbitMQ.Client.IFileProperties CreateFileProperties()
-    {
-      return new FileProperties();
-    }
-    public override RabbitMQ.Client.IStreamProperties CreateStreamProperties()
-    {
-      return new StreamProperties();
-    }
-    public override void ChannelFlow(
-      System.Boolean @active)
-    {
-      ChannelFlow __req = new ChannelFlow();
-      __req.m_active = @active;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ChannelFlowOk __rep = __repBase as ChannelFlowOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDeclare(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.String @type,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @autoDelete,
-      System.Boolean @internal,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      ExchangeDeclare __req = new ExchangeDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_type = @type;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_internal = @internal;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeclareOk __rep = __repBase as ExchangeDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void ExchangeDelete(
-      System.UInt16 @ticket,
-      System.String @exchange,
-      System.Boolean @ifUnused,
-      System.Boolean @nowait)
-    {
-      ExchangeDelete __req = new ExchangeDelete();
-      __req.m_ticket = @ticket;
-      __req.m_exchange = @exchange;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      ExchangeDeleteOk __rep = __repBase as ExchangeDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override System.String QueueDeclare(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @passive,
-      System.Boolean @durable,
-      System.Boolean @exclusive,
-      System.Boolean @autoDelete,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueDeclare __req = new QueueDeclare();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_passive = @passive;
-      __req.m_durable = @durable;
-      __req.m_exclusive = @exclusive;
-      __req.m_autoDelete = @autoDelete;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return null;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeclareOk __rep = __repBase as QueueDeclareOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_queue;
-    }
-    public override void QueueBind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Boolean @nowait,
-      System.Collections.IDictionary @arguments)
-    {
-      QueueBind __req = new QueueBind();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_exchange = @exchange;
-      __req.m_routingKey = @routingKey;
-      __req.m_nowait = @nowait;
-      __req.m_arguments = @arguments;
-      if (nowait) {
-        ModelSend(__req,null,null);
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueBindOk __rep = __repBase as QueueBindOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void QueueUnbind(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.String @exchange,
-      System.String @routingKey,
-      System.Collections.IDictionary @arguments)
-    {
-      throw new UnsupportedMethodException("QueueUnbind");
-    }
-    public override System.UInt32 QueuePurge(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @nowait)
-    {
-      QueuePurge __req = new QueuePurge();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueuePurgeOk __rep = __repBase as QueuePurgeOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override System.UInt32 QueueDelete(
-      System.UInt16 @ticket,
-      System.String @queue,
-      System.Boolean @ifUnused,
-      System.Boolean @ifEmpty,
-      System.Boolean @nowait)
-    {
-      QueueDelete __req = new QueueDelete();
-      __req.m_ticket = @ticket;
-      __req.m_queue = @queue;
-      __req.m_ifUnused = @ifUnused;
-      __req.m_ifEmpty = @ifEmpty;
-      __req.m_nowait = @nowait;
-      if (nowait) {
-        ModelSend(__req,null,null);
-        return 0xFFFFFFFF;
-      }
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      QueueDeleteOk __rep = __repBase as QueueDeleteOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-      return __rep.m_messageCount;
-    }
-    public override void BasicQos(
-      System.UInt32 @prefetchSize,
-      System.UInt16 @prefetchCount,
-      System.Boolean @global)
-    {
-      BasicQos __req = new BasicQos();
-      __req.m_prefetchSize = @prefetchSize;
-      __req.m_prefetchCount = @prefetchCount;
-      __req.m_global = @global;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      BasicQosOk __rep = __repBase as BasicQosOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void BasicAck(
-      System.UInt64 @deliveryTag,
-      System.Boolean @multiple)
-    {
-      BasicAck __req = new BasicAck();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_multiple = @multiple;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicReject(
-      System.UInt64 @deliveryTag,
-      System.Boolean @requeue)
-    {
-      BasicReject __req = new BasicReject();
-      __req.m_deliveryTag = @deliveryTag;
-      __req.m_requeue = @requeue;
-      ModelSend(__req,null,null);
-    }
-    public override void BasicRecover(
-      System.Boolean @requeue)
-    {
-      BasicRecover __req = new BasicRecover();
-      __req.m_requeue = @requeue;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      BasicRecoverOk __rep = __repBase as BasicRecoverOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxSelect()
-    {
-      TxSelect __req = new TxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxSelectOk __rep = __repBase as TxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxCommit()
-    {
-      TxCommit __req = new TxCommit();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxCommitOk __rep = __repBase as TxCommitOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void TxRollback()
-    {
-      TxRollback __req = new TxRollback();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      TxRollbackOk __rep = __repBase as TxRollbackOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxSelect()
-    {
-      DtxSelect __req = new DtxSelect();
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxSelectOk __rep = __repBase as DtxSelectOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override void DtxStart(
-      System.String @dtxIdentifier)
-    {
-      DtxStart __req = new DtxStart();
-      __req.m_dtxIdentifier = @dtxIdentifier;
-      RabbitMQ.Client.Impl.MethodBase __repBase = ModelRpc(__req,null,null);
-      DtxStartOk __rep = __repBase as DtxStartOk;
-      if (__rep == null) throw new UnexpectedMethodException(__repBase);
-    }
-    public override bool DispatchAsynchronous(RabbitMQ.Client.Impl.Command cmd) {
-      RabbitMQ.Client.Impl.MethodBase __method = (RabbitMQ.Client.Impl.MethodBase) cmd.Method;
-      switch ((__method.ProtocolClassId << 16) | __method.ProtocolMethodId) {
-        case 3932181: {
-          BasicConsumeOk __impl = (BasicConsumeOk) __method;
-          HandleBasicConsumeOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932191: {
-          BasicCancelOk __impl = (BasicCancelOk) __method;
-          HandleBasicCancelOk(
-            __impl.m_consumerTag);
-          return true;
-        }
-        case 3932231: {
-          BasicGetOk __impl = (BasicGetOk) __method;
-          HandleBasicGetOk(
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            __impl.m_messageCount,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932232: {
-          HandleBasicGetEmpty();
-          return true;
-        }
-        case 3932220: {
-          BasicDeliver __impl = (BasicDeliver) __method;
-          HandleBasicDeliver(
-            __impl.m_consumerTag,
-            __impl.m_deliveryTag,
-            __impl.m_redelivered,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 3932210: {
-          BasicReturn __impl = (BasicReturn) __method;
-          HandleBasicReturn(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_exchange,
-            __impl.m_routingKey,
-            (RabbitMQ.Client.IBasicProperties) cmd.Header,
-            cmd.Body);
-          return true;
-        }
-        case 1310760: {
-          ChannelClose __impl = (ChannelClose) __method;
-          HandleChannelClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        case 1310761: {
-          HandleChannelCloseOk();
-          return true;
-        }
-        case 655370: {
-          ConnectionStart __impl = (ConnectionStart) __method;
-          HandleConnectionStart(
-            __impl.m_versionMajor,
-            __impl.m_versionMinor,
-            __impl.m_serverProperties,
-            __impl.m_mechanisms,
-            __impl.m_locales);
-          return true;
-        }
-        case 655401: {
-          ConnectionOpenOk __impl = (ConnectionOpenOk) __method;
-          HandleConnectionOpenOk(
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655410: {
-          ConnectionRedirect __impl = (ConnectionRedirect) __method;
-          HandleConnectionRedirect(
-            __impl.m_host,
-            __impl.m_knownHosts);
-          return true;
-        }
-        case 655420: {
-          ConnectionClose __impl = (ConnectionClose) __method;
-          HandleConnectionClose(
-            __impl.m_replyCode,
-            __impl.m_replyText,
-            __impl.m_classId,
-            __impl.m_methodId);
-          return true;
-        }
-        default: return false;
-      }
-    }
-  }
-}
diff --git a/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs b/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
index 75f7aa7..de97cae 100644
--- a/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
+++ b/mcs/class/System.Configuration/Assembly/AssemblyInfo.cs
@@ -62,6 +62,7 @@ using System.Runtime.InteropServices;
 #endif
 
 #if NET_2_0
+	[assembly: InternalsVisibleTo ("System.Web, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
 	[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
 	[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)]
 	[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
diff --git a/mcs/class/System.Configuration/Assembly/ChangeLog b/mcs/class/System.Configuration/Assembly/ChangeLog
index e9742aa..fce50bc 100644
--- a/mcs/class/System.Configuration/Assembly/ChangeLog
+++ b/mcs/class/System.Configuration/Assembly/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-14  Marek Habersack  <mhabersack at novell.com>
+
+	* AssemblyInfo.cs: added InternalsVisibleTo for System.Web
+
 2008-04-15  Andreas Nahr <ClassDevelopment at A-SoftTech.com>
 
 	* AssemblyInfo.cs: Added missing attributes
diff --git a/mcs/class/System.Configuration/ChangeLog b/mcs/class/System.Configuration/ChangeLog
index 7226e69..03c2dac 100644
--- a/mcs/class/System.Configuration/ChangeLog
+++ b/mcs/class/System.Configuration/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-14  Marek Habersack  <mhabersack at novell.com>
+
+	* System.Configuration.dll.sources: added
+	System.Configuration/ConfigurationSaveEventArgs.cs
+	System.Configuration/ConfigurationSaveEventHandler.cs
+
 2008-09-14  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* System.Configuration_test.dll.sources: added
diff --git a/mcs/class/System.Configuration/System.Configuration.dll.sources b/mcs/class/System.Configuration/System.Configuration.dll.sources
index 311f19c..dc7d3f8 100644
--- a/mcs/class/System.Configuration/System.Configuration.dll.sources
+++ b/mcs/class/System.Configuration/System.Configuration.dll.sources
@@ -50,6 +50,8 @@ System.Configuration/ConfigurationPropertyCollection.cs
 System.Configuration/ConfigurationPropertyOptions.cs
 System.Configuration/ConfigurationRemoveElement.cs
 System.Configuration/ConfigurationSaveMode.cs
+System.Configuration/ConfigurationSaveEventArgs.cs
+System.Configuration/ConfigurationSaveEventHandler.cs
 System.Configuration/ConfigurationSection.cs
 System.Configuration/ConfigurationSectionCollection.cs
 System.Configuration/ConfigurationSectionGroup.cs
diff --git a/mcs/class/System.Configuration/System.Configuration/ChangeLog b/mcs/class/System.Configuration/System.Configuration/ChangeLog
index 6ae39cd..1a3fb0d 100644
--- a/mcs/class/System.Configuration/System.Configuration/ChangeLog
+++ b/mcs/class/System.Configuration/System.Configuration/ChangeLog
@@ -1,3 +1,32 @@
+2009-10-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Configuration.cs: make this work again with bundled configuration
+	files. Fixes bug #495957. Patch from Tor Lillqvist.
+
+2009-07-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ConfigurationElement.cs: don't skip xml nodes when reading 2
+	ConfigurationElement in a row. Patch by Greg Smolyn that fixes bug
+	#521231.
+
+2009-07-15  Marek Habersack  <mhabersack at novell.com>
+
+	* Configuration.cs: explicitly flush the stream when writing XML
+	data. Part of fix for bug #522017
+
+2009-07-14  Marek Habersack  <mhabersack at novell.com>
+
+	* ConfigurationSaveEventArgs.cs, ConfigurationSaveEventHandler.cs:
+	added
+
+	* Configuration.cs: added two internal events - SaveStart and
+	SaveEnd. They are used by System.Web's configuration system to
+	suppress application reloads when configuration is modified and
+	saved from within a web application. It is necessary to use events
+	since there is no guarantee the web application will use
+	WebConfigurationManager (and thus WebConfigurationHost) for
+	writing.
+
 2009-06-08  Marek Habersack  <mhabersack at novell.com>
 
 	* ConfigurationLocation.cs: if the path passed to constructor
diff --git a/mcs/class/System.Configuration/System.Configuration/Configuration.cs b/mcs/class/System.Configuration/System.Configuration/Configuration.cs
index 3ecd0cf..f50ad8b 100644
--- a/mcs/class/System.Configuration/System.Configuration/Configuration.cs
+++ b/mcs/class/System.Configuration/System.Configuration/Configuration.cs
@@ -30,15 +30,16 @@
 using System;
 using System.Collections;
 using System.Collections.Specialized;
+using System.Configuration.Internal;
+using System.ComponentModel;
 using System.Reflection;
 using System.Xml;
 using System.IO;
-using System.Configuration.Internal;
 
 namespace System.Configuration {
 
 	public sealed class Configuration
-	{
+	{		
 		Configuration parent;
 		Hashtable elementData = new Hashtable ();
 		string streamName;
@@ -53,6 +54,9 @@ namespace System.Configuration {
 		string locationConfigPath;
 		string locationSubPath;
 
+		internal static event ConfigurationSaveEventHandler SaveStart;
+		internal static event ConfigurationSaveEventHandler SaveEnd;
+		
 		internal Configuration (Configuration parent, string locationSubPath)
 		{
 			this.parent = parent;
@@ -370,16 +374,26 @@ namespace System.Configuration {
 		
 		public void Save (ConfigurationSaveMode mode, bool forceUpdateAll)
 		{
+			ConfigurationSaveEventHandler saveStart = SaveStart;
+			ConfigurationSaveEventHandler saveEnd = SaveEnd;
+			
 			object ctx = null;
+			Exception saveEx = null;
 			Stream stream = system.Host.OpenStreamForWrite (streamName, null, ref ctx);
 			try {
+				if (saveStart != null)
+					saveStart (this, new ConfigurationSaveEventArgs (streamName, true, null, ctx));
+				
 				Save (stream, mode, forceUpdateAll);
 				system.Host.WriteCompleted (streamName, true, ctx);
-			} catch (Exception) {
+			} catch (Exception ex) {
+				saveEx = ex;
 				system.Host.WriteCompleted (streamName, false, ctx);
 				throw;
 			} finally {
 				stream.Close ();
+				if (saveEnd != null)
+					saveEnd (this, new ConfigurationSaveEventArgs (streamName, false, saveEx, ctx));
 			}
 		}
 		
@@ -435,6 +449,7 @@ namespace System.Configuration {
 				tw.WriteEndElement ();
 			}
 			finally {
+				tw.Flush ();
 				tw.Close ();
 			}
 		}
@@ -449,10 +464,13 @@ namespace System.Configuration {
 			if (String.IsNullOrEmpty (streamName))
 				return true;
 
-			if (!File.Exists (streamName))
+			Stream stream = null;
+			try {
+				stream = stream = system.Host.OpenStreamForRead (streamName);
+			} catch {
 				return false;
+			}
 
-			Stream stream = stream = system.Host.OpenStreamForRead (streamName);
 			using (XmlTextReader reader = new ConfigXmlTextReader (stream, streamName)) {
 				ReadConfigFile (reader, streamName);
 			}
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
index cf36378..fcf0f06 100644
--- a/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs
@@ -384,12 +384,10 @@ namespace System.Configuration
 					val.DeserializeElement (reader, serializeCollectionKey);
 					readProps [prop] = prop.Name;
 
-					reader.Read();
+					if(depth == reader.Depth)
+						reader.Read();
 
-				} while (depth < reader.Depth);
-
-				if (reader.NodeType == XmlNodeType.EndElement)
-					reader.Read ();
+				} while (depth < reader.Depth);				
 			}
 			
 			modified = false;
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventArgs.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventArgs.cs
new file mode 100644
index 0000000..a226764
--- /dev/null
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventArgs.cs
@@ -0,0 +1,52 @@
+//
+// System.Configuration.ConfigurationSaveEventArgs.cs
+//
+// Authors:
+//	Marek Habersack (mhabersack at novell.com)
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+#if NET_2_0
+using System;
+
+namespace System.Configuration 
+{
+	class ConfigurationSaveEventArgs : EventArgs
+	{
+		public string StreamPath { get; private set; }
+		public bool Start { get; private set; }
+		public object Context { get; private set; }
+		public bool Failed { get; private set; }
+		public Exception Exception { get; private set; }
+		
+		public ConfigurationSaveEventArgs (string streamPath, bool start, Exception ex, object context)
+		{
+			this.StreamPath = streamPath;
+			this.Start = start;
+			this.Failed = ex != null;
+			this.Exception = ex;
+			this.Context = context;
+		}
+	}
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventHandler.cs b/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventHandler.cs
new file mode 100644
index 0000000..2a8b8ef
--- /dev/null
+++ b/mcs/class/System.Configuration/System.Configuration/ConfigurationSaveEventHandler.cs
@@ -0,0 +1,37 @@
+//
+// System.Configuration.ConfigurationSaveEventHandler.cs
+//
+// Authors:
+//	Marek Habersack (mhabersack at novell.com)
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+//
+#if NET_2_0
+using System;
+
+namespace System.Configuration 
+{
+	internal delegate void ConfigurationSaveEventHandler (Configuration sender, ConfigurationSaveEventArgs args);
+}
+#endif
+	
\ No newline at end of file
diff --git a/mcs/class/System.Configuration/System.Configuration_test.dll.sources b/mcs/class/System.Configuration/System.Configuration_test.dll.sources
index 29a9eb1..c858560 100644
--- a/mcs/class/System.Configuration/System.Configuration_test.dll.sources
+++ b/mcs/class/System.Configuration/System.Configuration_test.dll.sources
@@ -8,6 +8,7 @@ System.Configuration/ConfigurationPermissionTest.cs
 System.Configuration/ConfigurationPropertyTest.cs
 System.Configuration/ConfigurationManagerTest.cs
 System.Configuration/ConfigurationSectionGroupTest.cs
+System.Configuration/ConfigurationSectionTest.cs
 System.Configuration/ConnectionStringSettingsTest.cs
 System.Configuration/DefaultValidatorTest.cs
 System.Configuration/ExeConfigurationFileMapTest.cs
diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ChangeLog b/mcs/class/System.Configuration/Test/System.Configuration/ChangeLog
index 5954c62..02808d6 100644
--- a/mcs/class/System.Configuration/Test/System.Configuration/ChangeLog
+++ b/mcs/class/System.Configuration/Test/System.Configuration/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ConfigurationSectionTest.cs: New test.
+
 2008-09-14  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* ConfigurationManagerTest.cs: Added test for bug #323622.
diff --git a/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSectionTest.cs b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSectionTest.cs
new file mode 100644
index 0000000..fbd3f1b
--- /dev/null
+++ b/mcs/class/System.Configuration/Test/System.Configuration/ConfigurationSectionTest.cs
@@ -0,0 +1,123 @@
+//
+// System.Configuration.ConfigurationSectionTest.cs - Unit tests
+//
+// Author:
+//	Greg Smolyn
+//	Gonzalo Paniagua Javier <gonzalo at novell.com
+//
+// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+using System.Configuration;
+using System.IO;
+using System.Xml;
+using NUnit.Framework;
+
+namespace MonoTests.System.Configuration {
+	[TestFixture]
+	public class ConfigurationElementCollectionTest
+	{
+		[Test]
+		public void TwoConfigElementsInARow () // Bug #521231
+		{
+			string config = @"<fooconfig><foos><foo id=""1"" /></foos><bars><bar id=""1"" /></bars></fooconfig>";
+			var fooSection = new FooConfigSection ();
+			fooSection.Load (config);
+		}
+
+		class FooConfigSection : ConfigurationSection
+		{
+			public void Load (string xml) 
+			{ 
+				Init (); 
+				using (StringReader sr = new StringReader(xml))  
+					using (XmlReader reader = new XmlTextReader(sr)) { 
+						DeserializeSection (reader); 
+					} 
+			}
+
+			[ConfigurationProperty("foos")]
+			[ConfigurationCollection(typeof(FooConfigElementCollection), AddItemName="foo")]
+			public FooConfigElementCollection Foos {
+				get { return (FooConfigElementCollection)base["foos"]; }
+				set { base["foos"] = value; }
+			}
+
+			[ConfigurationProperty("bars")]
+			[ConfigurationCollection(typeof(BarConfigElementCollection), AddItemName="bar")]
+			public BarConfigElementCollection Bars {
+				get { return (BarConfigElementCollection)base["bars"]; }
+				set { base["bars"] = value; }
+			}			
+		}
+
+		class FooConfigElementCollection : ConfigurationElementCollection
+		{
+			protected override ConfigurationElement CreateNewElement ()
+			{
+				return new FooConfigElement();
+			}
+
+			protected override object GetElementKey (ConfigurationElement element)
+			{
+				return ((FooConfigElement)element).Id;
+			}
+		}
+
+		class FooConfigElement : ConfigurationElement
+		{
+			[ConfigurationProperty("id")]
+			public int Id {
+				get { return (int)base["id"]; }
+				set { base["id"] = value; }
+			}
+
+		}
+
+		class BarConfigElementCollection : ConfigurationElementCollection
+		{
+			protected override ConfigurationElement CreateNewElement ()
+			{
+				return new BarConfigElement();
+			}
+
+			protected override object GetElementKey (ConfigurationElement element)
+			{
+				return ((BarConfigElement)element).Id;
+			}
+		}
+
+		class BarConfigElement : ConfigurationElement
+		{
+			[ConfigurationProperty("id")]
+			public int Id {
+				get { return (int)base["id"]; }
+				set { base["id"] = value; }
+			}		
+		}	
+	}
+}
+
+#endif
diff --git a/mcs/class/System.Core/System.Collections.Generic/ChangeLog b/mcs/class/System.Core/System.Collections.Generic/ChangeLog
index 136d8fc..2f5bee8 100644
--- a/mcs/class/System.Core/System.Collections.Generic/ChangeLog
+++ b/mcs/class/System.Core/System.Collections.Generic/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-09  Jb Evain  <jbevain at novell.com>
+
+	backport of 137653.
+
+	* HashSet.cs (ICollection<T>.Add): fix for bug #520760. Do not throw
+	when adding duplicates.
+
 2008-12-17  Jb Evain  <jbevain at novell.com>
 
 	* HashSet.cs (CopyTo): fix logic.
diff --git a/mcs/class/System.Core/System.Collections.Generic/HashSet.cs b/mcs/class/System.Core/System.Collections.Generic/HashSet.cs
index cd0c6d7..789e2da 100644
--- a/mcs/class/System.Core/System.Collections.Generic/HashSet.cs
+++ b/mcs/class/System.Core/System.Collections.Generic/HashSet.cs
@@ -548,8 +548,7 @@ namespace System.Collections.Generic {
 
 		void ICollection<T>.Add (T item)
 		{
-			if (!Add (item))
-				throw new ArgumentException ();
+			Add (item);
 		}
 
 		IEnumerator IEnumerable.GetEnumerator ()
diff --git a/mcs/class/System.Core/System.Linq/ChangeLog b/mcs/class/System.Core/System.Linq/ChangeLog
index b720818..82363bc 100644
--- a/mcs/class/System.Core/System.Linq/ChangeLog
+++ b/mcs/class/System.Core/System.Linq/ChangeLog
@@ -1,3 +1,14 @@
+2009-07-20  Jb Evain  <jbevain at novell.com>
+
+	backport of 138194.
+
+	* Lookup.cs: avoid a double dictionary lookup on the indexer.
+
+2009-07-19 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Lookup.cs: when there are no matching elements, return an empty
+	enumerable. Fixes bug #523386.
+
 2009-05-18  Jb Evain  <jbevain at novell.com>
 
 	backport of 134333.
diff --git a/mcs/class/System.Core/System.Linq/Lookup.cs b/mcs/class/System.Core/System.Linq/Lookup.cs
index 0398ad6..16cac37 100644
--- a/mcs/class/System.Core/System.Linq/Lookup.cs
+++ b/mcs/class/System.Core/System.Linq/Lookup.cs
@@ -44,7 +44,13 @@ namespace System.Linq {
 		}
 
 		public IEnumerable<TElement> this [TKey key] {
-			get { return groups [key]; }
+			get {
+				IGrouping<TKey, TElement> group;
+				if (groups.TryGetValue (key, out group))
+					return group;
+
+				return new TElement [0];
+			}
 		}
 
 		internal Lookup (Dictionary<TKey, List<TElement>> lookup)
diff --git a/mcs/class/System.Core/System.Security.Cryptography/Aes.cs b/mcs/class/System.Core/System.Security.Cryptography/Aes.cs
index 0c83565..d65743a 100644
--- a/mcs/class/System.Core/System.Security.Cryptography/Aes.cs
+++ b/mcs/class/System.Core/System.Security.Cryptography/Aes.cs
@@ -42,7 +42,7 @@ namespace System.Security.Cryptography {
 
 		public static new Aes Create () 
 		{
-			return Create ("System.Security.Cryptography.Aes");
+			return Create ("System.Security.Cryptography.AesManaged, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
 		}
 
 		public static new Aes Create (string algName) 
diff --git a/mcs/class/System.Core/System.Security.Cryptography/ChangeLog b/mcs/class/System.Core/System.Security.Cryptography/ChangeLog
index 306ae65..6e02660 100644
--- a/mcs/class/System.Core/System.Security.Cryptography/ChangeLog
+++ b/mcs/class/System.Core/System.Security.Cryptography/ChangeLog
@@ -1,3 +1,10 @@
+2009-07-20  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* Aes.cs: Use the fully qualified name since this is not a type known
+	in the default corlib (2.0 or 1.x).
+	[Fix bug #523687]
+	[Backport r138249]
+
 2008-08-07  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* Aes.cs: Don't set the (unexisting) FeedbackSizeValue field
diff --git a/mcs/class/System.Core/Test/System.Linq/LookupTest.cs b/mcs/class/System.Core/Test/System.Linq/LookupTest.cs
index 8500775..6f790a5 100644
--- a/mcs/class/System.Core/Test/System.Linq/LookupTest.cs
+++ b/mcs/class/System.Core/Test/System.Linq/LookupTest.cs
@@ -68,5 +68,19 @@ namespace MonoTests.System.Linq {
 			Assert.AreEqual (0x00ff00, lookup ["GrEeN"].First ());
 			Assert.AreEqual (0x0000ff, lookup ["Blue"].First ());
 		}
+
+		[Test]
+		public void EmptyResult ()
+		{
+			var lookup = GetColors ().ToLookup (
+				c => c.Name,
+				c => c.Value,
+				StringComparer.OrdinalIgnoreCase);
+
+			var l = lookup ["notexist"];
+			Assert.IsNotNull (l);
+			int [] values = (int []) l;
+			Assert.AreEqual (values.Length, 0);
+		}
 	}
 }
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs
index 9647825..8c653e3 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciCalls.cs
@@ -349,6 +349,12 @@ namespace System.Data.OracleClient.Oci
 				byte csfrm);
 
 			[DllImport ("oci")]
+			internal static extern int OCILobCharSetForm (IntPtr svchp, 
+				IntPtr errhp,
+				IntPtr locp,
+				out byte csfrm);
+			
+			[DllImport ("oci")]
 			internal static extern int OCINlsGetInfo (IntPtr hndl,
 				IntPtr errhp,
 				[In][Out] byte[] bufp,
@@ -969,6 +975,17 @@ namespace System.Data.OracleClient.Oci
 				piece, ctxp, cbfp, csid, csfrm);
 		}
 
+		internal static int OCILobCharSetForm (IntPtr svchp, 
+			IntPtr errhp,
+			IntPtr locp,
+			out byte csfrm)
+		{
+			#if TRACE
+			Trace.WriteLineIf(traceOci, "OCILobCharSetForm", "OCI");
+			#endif
+			return OciNativeCalls.OCILobCharSetForm (svchp, errhp, locp, out csfrm);			
+		}
+		
 		internal static int OCINlsGetInfo (IntPtr hndl,
 			IntPtr errhp,
 			ref byte[] bufp,
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs
index d278d9c..031646b 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciDefineHandle.cs
@@ -338,6 +338,7 @@ namespace System.Data.OracleClient.Oci
 			value = lobLocator.Handle;
 			lobLocator.ErrorHandle = connection.ErrorHandle;
 			lobLocator.Service = connection.ServiceContext;
+			lobLocator.Environment = connection.Environment;
 
 			status = OciCalls.OCIDefineByPosPtr (Parent,
 							out handle,
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciLobLocator.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciLobLocator.cs
index e51c79e..a5d1255 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciLobLocator.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient.Oci/OciLobLocator.cs
@@ -27,6 +27,7 @@ namespace System.Data.OracleClient.Oci {
 		bool disposed = false;
 		OciErrorHandle errorHandle;
 		OciServiceHandle service;
+		OciEnvironmentHandle environment;
 		OciDataType type;
 
 		#endregion // Fields
@@ -57,6 +58,11 @@ namespace System.Data.OracleClient.Oci {
 			set { type = value; }
 		}
 		
+		public OciEnvironmentHandle Environment {
+			get { return environment; }
+			set { environment = value; }
+		}
+		
 		#endregion // Properties
 
 		#region Methods
@@ -164,12 +170,22 @@ namespace System.Data.OracleClient.Oci {
 		{
 			int status = 0;
 			uint amount = count;
+			byte csfrm = 0; 
 
 			// Character types are UTF-16, so amount of characters is 1/2
 			// the amount of bytes
-			if (!binary) 
+			if (!binary) {
 				amount /= 2;
-
+				status = OciCalls.OCILobCharSetForm (environment, 
+				             ErrorHandle, 
+				             this, 
+				             out csfrm);
+				if (status != 0) {
+					OciErrorInfo info = ErrorHandle.HandleError ();
+					throw new OracleException (info.ErrorCode, info.ErrorMessage);
+				}
+			}
+			
 			status = OciCalls.OCILobRead (Service,
 						ErrorHandle,
 						this,
@@ -180,7 +196,7 @@ namespace System.Data.OracleClient.Oci {
 						IntPtr.Zero,
 						IntPtr.Zero,
 						1000,  // OCI_UCS2ID
-						0);    // Ignored if csid is specified as above
+						csfrm);
 
 			if (status != 0) {
 				OciErrorInfo info = ErrorHandle.HandleError ();
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/ChangeLog b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/ChangeLog
index 6d58cfa..dc32d08 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/ChangeLog
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/ChangeLog
@@ -1,3 +1,26 @@
+2009-10-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #322695
+	* OracleParameter.cs: Use oracle returned rsize instead of 
+	MAXBYTECOUNT.  Reduces the size of allocated buffer.
+	
+2009-10-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #321718
+	* OracleParameter.cs: Update Environment handle in OciLobLocator.
+	
+2009-09-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #543207
+	* OracleParameter.cs (Bind): Do not remove the trailing-null-byte.
+	
+2009-09-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #535889
+	* OracleParameter.cs: In case of OUT param, update sizeSet even if 
+	value is null or DBNull.  Also, use rsize instead of bindSize to 
+	avoid extra allocation.
+	
 2009-06-04  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	* OracleParameter.cs: Infer size only for 2.0 profile when only 
diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
index a44d947..ec7374b 100644
--- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
+++ b/mcs/class/System.Data.OracleClient/System.Data.OracleClient/OracleParameter.cs
@@ -11,10 +11,12 @@
 //    Tim Coleman <tim at timcoleman.com>
 //    Daniel Moragn <monodanmorg at yahoo.com>
 //    Hubert FONGARNAND <informatique.internet at fiducial.fr>
+//    Veerapuram Varadhan  <vvaradhan at novell.com>	
 //
 // Copyright (C) Tim Coleman , 2003
 // Copyright (C) Daniel Morgan, 2005, 2008
 // Copyright (C) Hubert FONGARNAND, 2005
+// Copyright (C) Novell Inc, 2009
 //
 // Licensed under the MIT/X11 License.
 //
@@ -160,13 +162,15 @@ namespace System.Data.OracleClient
 			
 			this.value = value;
 			this.size = size;
+			Direction = direction;
+
 			// set sizeSet to true iff value is not-null or non-zero size value
-			if (value != null && value != DBNull.Value && size > 0)
+			if (((value != null && value != DBNull.Value) || Direction == ParameterDirection.Output) && 
+			    size > 0) 			    
 				this.sizeSet = true;
 
 			SourceColumnNullMapping = sourceColumnNullMapping;
 			OracleType = oracleType;
-			Direction = direction;
 			SourceColumn = sourceColumn;
 			SourceVersion = sourceVersion;
 		}
@@ -180,9 +184,12 @@ namespace System.Data.OracleClient
 			
 			this.value = value;
 			this.size = size;
+
+			Direction = direction;
 			
 			// set sizeSet to true iff value is not-null or non-zero size value
-			if (value != null && value != DBNull.Value && size > 0)
+			if (((value != null && value != DBNull.Value) || Direction == ParameterDirection.Output) && 
+			    size > 0) 			    
 				this.sizeSet = true;
 
 			this.isNullable = isNullable;
@@ -190,7 +197,6 @@ namespace System.Data.OracleClient
 			this.scale = scale;
 
 			OracleType = oracleType;
-			Direction = direction;
 			SourceColumn = srcColumn;
 			SourceVersion = srcVersion;
 		}
@@ -228,7 +234,11 @@ namespace System.Data.OracleClient
 #endif
 		ParameterDirection Direction {
 			get { return direction; }
-			set { direction = value; }
+			set { 
+				direction = value; 
+				if (this.size > 0 && direction == ParameterDirection.Output)
+					this.sizeSet = true;
+			}
 		}
 
 #if !NET_2_0
@@ -466,16 +476,6 @@ namespace System.Data.OracleClient
 						svalue = svalue.ToString () + '\0';
 					}
 
-					// set bind length to size of data
-					//bindSize = (size + 1) * 4;
-					if (direction == ParameterDirection.Input)
-						bindSize = Encoding.UTF8.GetMaxByteCount (svalue.Length);
-					else
-						bindSize = Encoding.UTF8.GetMaxByteCount (size + 1);
-
-					// allocate memory based on bind length
-					bytes = new byte [bindSize];				
-
 					if (direction == ParameterDirection.Input ||
 						direction == ParameterDirection.InputOutput) {
 						
@@ -484,8 +484,13 @@ namespace System.Data.OracleClient
 						rsize = 0;
 						// Get size of buffer
 						status = OciCalls.OCIUnicodeToCharSet (statement.Parent, null, svalue, out rsize);
+
+						// allocate memory based on oracle returned length
+						bytes = new byte [rsize];
+
 						// Fill buffer
 						status = OciCalls.OCIUnicodeToCharSet (statement.Parent, bytes, svalue, out rsize);
+						bindSize = bytes.Length;
 					}
 					break;
 				case OciDataType.Date:
@@ -581,10 +586,6 @@ namespace System.Data.OracleClient
 					bindType = OciDataType.String;
 					indicator = 0;
 					svalue = "\0";
-					// define size for binding
-					bindSize = 30; // a NUMBER is 22 bytes but as a string we need more
-					// allocate memory
-					bytes = new byte [bindSize];
 					// convert value from managed type to type to marshal
 					if (direction == ParameterDirection.Input || 
 						direction == ParameterDirection.InputOutput) {
@@ -603,8 +604,8 @@ namespace System.Data.OracleClient
 						// Get size of buffer
 						OciCalls.OCIUnicodeToCharSet (statement.Parent, null, svalue, out rsize);
 
-						// Fill buffer
-						bytes = new byte [bindSize];
+						// Fill buffer 
+						bytes = new byte [rsize];
 						OciCalls.OCIUnicodeToCharSet (statement.Parent, bytes, svalue, out rsize);
 					} 
 					break;
@@ -677,6 +678,7 @@ namespace System.Data.OracleClient
 						bindValue = lobLocator.Handle;
 						lobLocator.ErrorHandle = connection.ErrorHandle;
 						lobLocator.Service = statement.Service;
+						lobLocator.Environment = connection.Environment;
 						useRef = true;
 					}
 					break;
@@ -729,6 +731,7 @@ namespace System.Data.OracleClient
 						bindValue = lobLocator.Handle;
 						lobLocator.ErrorHandle = connection.ErrorHandle;
 						lobLocator.Service = connection.ServiceContext;
+						lobLocator.Environment = connection.Environment;
 						useRef = true;
 					}
 					break;
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
index 760b6e1..16dbde8 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* OracleParameterTest.cs: Mark tests for bug #424908 as working.
+	
 2009-06-04  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	* OracleParameterTest.cs: Enable Constructor2 test for 2.0
diff --git a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
index b72780f..cf3c80b 100644
--- a/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
+++ b/mcs/class/System.Data.OracleClient/Test/System.Data.OracleClient/OracleParameterTest.cs
@@ -376,14 +376,14 @@ namespace MonoTests.System.Data.OracleClient
 		    string createSP =
 			"CREATE OR REPLACE PROCEDURE GetTextValue \n" +
 			"( \n" +
-			"id IN Number(10),\n" +
+			"idParam IN Number(10),\n" +
 			"text OUT varchar2(64) \n" +
 			")\n" +
 			"AS\n" +
 			"BEGIN\n" +
 			"SELECT oratest.text INTO text \n" +
 			"  FROM oratest\n" +
-			"  WHERE oratest.id = id; \n" +
+			"  WHERE oratest.id = idParam; \n" +
 			"END;\n";
 
 		    string insertValue = "INSERT INTO oratest VALUES " +
@@ -414,7 +414,7 @@ namespace MonoTests.System.Data.OracleClient
 		    using (command = connection.CreateCommand ()) {
 			
 			OracleParameter id = new OracleParameter ();
-			id.ParameterName = "id";
+			id.ParameterName = "idParam";
 			id.OracleType = OracleType.Number;
 			id.Direction = ParameterDirection.Input;
 			id.Value = 424908;
@@ -441,7 +441,6 @@ namespace MonoTests.System.Data.OracleClient
 		}
 
 		[Test]
-		[Category("NotWorking")]
 		public void ParamSize_424908_ConstructorSizeSetTest ()
 		{
 		    //OracleConnection conn = new OracleConnection (connection_string);
@@ -451,7 +450,7 @@ namespace MonoTests.System.Data.OracleClient
 
 		    using (command = connection.CreateCommand ()) {
 			OracleParameter id = new OracleParameter ();
-			id.ParameterName = "id";
+			id.ParameterName = "idParam";
 			id.OracleType = OracleType.Number;
 			id.Direction = ParameterDirection.Input;
 			id.Value = 424908;
@@ -471,7 +470,6 @@ namespace MonoTests.System.Data.OracleClient
 		}
 
 		[Test]
-		[Category("NotWorking")]
 		public void ParamSize_424908_SizeNotSetError ()
 		{
 
@@ -479,7 +477,7 @@ namespace MonoTests.System.Data.OracleClient
 
 		    using (command = connection.CreateCommand ()) {
 			OracleParameter id = new OracleParameter ();
-			id.ParameterName = "id";
+			id.ParameterName = "idParam";
 			id.OracleType = OracleType.Number;
 			id.Direction = ParameterDirection.Input;
 			id.Value = 424908;
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
index 215156e..1bdb0a3 100644
--- a/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
+++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-28  Marek Habersack  <mhabersack at novell.com>
+
+	* Tokenizer.cs, Parser.jay: a work around for 3 reduce/reduce
+	conflicts (use of 'NOT LIKE' and 'NOT IN' which would previously
+	be ignored because of the conflicts). The grammar still has 6 more
+	of those - the real fix is to rewrite it.
+
 2008-08-18  Marek Habersack  <mhabersack at novell.com>
 
 	* Numeric.cs: Max/Min operations do not convert string
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay b/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay
index 41ecaa7..613e4e2 100644
--- a/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay
+++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/Parser.jay
@@ -71,7 +71,7 @@ namespace Mono.Data.SqlExpressions {
 
 %token DOT COMMA
 
-%token IS IN LIKE
+%token IS IN NOT_IN LIKE NOT_LIKE
 
 %token COUNT SUM AVG MAX MIN STDEV VAR
 %token IIF SUBSTRING ISNULL LEN TRIM CONVERT
@@ -335,9 +335,9 @@ LikePredicate
 	{
 		$$ = new Like ((IExpression)$1, (IExpression)$3);
 	}
-	| StringExpr NOT LIKE StringExpr
+	| StringExpr NOT_LIKE StringExpr
 	{
-		$$ = new Negation (new Like ((IExpression)$1, (IExpression)$4));
+		$$ = new Negation (new Like ((IExpression)$1, (IExpression)$3));
 	}
 	;
 
@@ -346,9 +346,9 @@ InPredicate
 	{
 		$$ = new In ((IExpression)$1, (IList)$3);
 	}
-	| ArithExpr NOT IN InPredicateValue
+	| ArithExpr NOT_IN InPredicateValue
 	{
-		$$ = new Negation (new In ((IExpression)$1, (IList)$4));
+		$$ = new Negation (new In ((IExpression)$1, (IList)$3));
 	}
 	;
 
diff --git a/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs b/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs
index 05bd442..3907e24 100644
--- a/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs
+++ b/mcs/class/System.Data/Mono.Data.SqlExpressions/Tokenizer.cs
@@ -32,6 +32,7 @@
 
 using System;
 using System.Data;
+using System.Globalization;
 using System.IO;
 using System.Text;
 using System.Collections;
@@ -53,7 +54,9 @@ namespace Mono.Data.SqlExpressions {
 			
 			Token.IS, "is",
 			Token.IN, "in",
+			Token.NOT_IN, "not in",
 			Token.LIKE, "like",
+			Token.NOT_LIKE, "not like",
 			
 			Token.COUNT, "count",
 			Token.SUM, "sum",
@@ -207,13 +210,69 @@ namespace Mono.Data.SqlExpressions {
 			sb.Append (Current ());
 
 			char next;
+			string ret;
 			while ((next = Next ()) == '_' || Char.IsLetterOrDigit (next) || next == '\\') {
 				sb.Append (ProcessEscapes (next));				
 				if (!MoveNext ())
 					break;
 			}
+			ret = sb.ToString ();
+			if (String.Compare (ret,
+					    "not",
+#if NET_2_0
+					    StringComparison.OrdinalIgnoreCase
+#else
+					    true, CultureInfo.InvariantCulture
+#endif
+			    ) == 0) {
+				int savedPos = pos;
+				while (Char.IsWhiteSpace ((next = Next ()))) {
+					if (!MoveNext ()) {
+						pos = savedPos;
+						return ret;
+					}
+				}
+				MoveNext ();
+				
+				string target;
+				switch (Current ()) {
+					case 'i':
+					case 'I':
+						target = "in";
+						break;
+
+					case 'l':
+					case 'L':
+						target = "like";
+						break;
+					
+					default:
+						pos = savedPos;
+						return ret;
+				}
+
+				int tlen = target.Length;
+				int idx = 1;
+				while (tlen-- > 0 && Char.IsLetter ((next = Next ()))) {
+					char lc;
+#if NET_2_0
+					lc = Char.ToLowerInvariant (next);
+#else
+					lc = Char.ToLower (next);
+#endif
+					if (target [idx++] != lc) {
+						pos = savedPos;
+						return ret;
+					}
+					MoveNext ();
+				}
+
+				sb.Append (' ');
+				sb.Append (target);
+				ret = sb.ToString ();
+			}
 
-			return sb.ToString ();
+			return ret;
 		}
 
 		private int ParseIdentifier ()
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
index b4aea34..9025562 100644
--- a/mcs/class/System.Data/System.Data.Common/ChangeLog
+++ b/mcs/class/System.Data/System.Data.Common/ChangeLog
@@ -1,3 +1,49 @@
+2009-10-14  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #385028
+	* DbDataAdapter.cs (GetInsertCommand): New overload added to workaround 
+	columns with DEFAULT values.
+	
+2009-10-14  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #385029
+	* DbDataAdapter.cs (set_DataAdapter): Register for the RowUpdatingEventHandlers.
+	
+2009-07-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DbDataAdapter.cs (IDbDataAdapter.get_*Command): For non 2.0 profile, do not 
+	implement these properties and related changes.
+	
+2009-07-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	* DbDataAdapter.cs (set_DeleteCommand): Code cleanup.
+	
+2009-07-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	* DbDataAdapter.cs (*Command properties): Don't call IDbDataAdapter.*Command, 
+	as provider specific DbDataAdapters would have its own implementation.
+	
+2009-07-27  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DbCommandBuilder.cs (CreateUpdateCommand): Don't set Nullable 
+	property "Original_*" fields.
+	
+2009-07-24  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	* DbCommandBuilder.cs (Create*Command): Fill up the missing pieces from 
+	SqlCommandBuilder version of Create*Commands that fixes the failing tests.
+	
+2009-07-24  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	* DbCommandBuilder.cs (CreateDeleteCommand, CreateUpdateCommand): Add the 
+	nullcheck-param into the respective command's parameter list.  Fixes 
+	build breaks.  Individual provider's CommandBuilder classes from 2.0 
+	profile onwards use the base version of methods to maintain these commands.
+	(Get*Command): Cleanup code duplication
+	* DbDataAdapter (Update): Use SourceColumnNullMapping property to handle 
+	nullcheckparams.  Fixes #522624.  Patch by 
+	Gert Driesen  <drieseng at users.sourceforge.net>.
+	
 2009-03-31  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	* Fixes rest of #480377
diff --git a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
index f60b64e..d4e4767 100644
--- a/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbCommandBuilder.cs
@@ -181,7 +181,7 @@ namespace System.Data.Common {
 			// If no table was found, then we can't do an delete
 			if (QuotedTableName == String.Empty)
 				return null;
-
+			
 			CreateNewCommand (ref _deleteCommand);
 
 			string command = String.Format ("DELETE FROM {0}", QuotedTableName);
@@ -198,8 +198,9 @@ namespace System.Data.Common {
 				if (whereClause.Length > 0) 
 					whereClause.Append (" AND ");
 
-				bool isKey = (bool) schemaRow ["IsKey"];
+				bool isKey = !schemaRow.IsNull ("IsKey") & (bool) schemaRow ["IsKey"];
 				DbParameter parameter = null;
+				string sourceColumnName;
 
 				if (isKey)
 					keyFound = true;
@@ -207,26 +208,38 @@ namespace System.Data.Common {
 				//ms.net 1.1 generates the null check for columns even if AllowDBNull is false
 				//while ms.net 2.0 does not. Anyways, since both forms are logically equivalent
 				//following the 2.0 approach
-				bool allowNull = (bool) schemaRow ["AllowDBNull"];
+				bool allowNull = !schemaRow.IsNull ("AllowDBNull") & (bool) schemaRow ["AllowDBNull"];
 				if (!isKey && allowNull) {
 					parameter = _deleteCommand.CreateParameter ();
 					if (option) {
-						parameter.ParameterName = String.Format ("@{0}",
+						parameter.ParameterName = String.Format ("@IsNull_{0}",
 											 schemaRow ["BaseColumnName"]);
 					} else {
 						parameter.ParameterName = String.Format ("@p{0}", parmIndex++);
 					}
-					String sourceColumnName = (string) schemaRow ["BaseColumnName"];
 					parameter.Value = 1;
-
+					parameter.DbType = DbType.Int32;
+					// This should be set for nullcheckparam
+					sourceColumnName = (string) schemaRow ["BaseColumnName"];
+					parameter.SourceColumn = sourceColumnName;
+					parameter.SourceColumnNullMapping = true;
+					parameter.SourceVersion = DataRowVersion.Original;
+					_deleteCommand.Parameters.Add (parameter);
+					
 					whereClause.Append ("(");
 					whereClause.Append (String.Format (clause1, parameter.ParameterName, 
 									   GetQuotedString (sourceColumnName)));
 					whereClause.Append (" OR ");
 				}
 
-				parameter = CreateParameter (_deleteCommand, String.Format ("@{0}", option ? schemaRow ["BaseColumnName"] : "p" + parmIndex++), schemaRow);
+				if (option)
+					parameter = CreateParameter (_deleteCommand, schemaRow, true);
+				else 
+					parameter = CreateParameter (_deleteCommand, parmIndex++, schemaRow);
+				
 				parameter.SourceVersion = DataRowVersion.Original;
+				ApplyParameterInfo (parameter, schemaRow, StatementType.Delete, true);
+				//parameter.IsNullable = allowNull;
 
 				whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
 
@@ -243,7 +256,7 @@ namespace System.Data.Common {
 			return _deleteCommand;
 		}
 
-		private DbCommand CreateInsertCommand (bool option)
+		private DbCommand CreateInsertCommand (bool option, DataRow row)
 		{
 			if (QuotedTableName == String.Empty)
 				return null;
@@ -256,6 +269,7 @@ namespace System.Data.Common {
 			StringBuilder values = new StringBuilder ();
 
 			int parmIndex = 1;
+			DbParameter parameter = null;
 			foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
 				if (!IncludedInInsert (schemaRow))
 					continue;
@@ -265,11 +279,26 @@ namespace System.Data.Common {
 					values.Append (", ");
 				}
 
-				DbParameter parameter = CreateParameter (_insertCommand, String.Format ("@{0}", option ? schemaRow ["BaseColumnName"] : "p" + parmIndex++), schemaRow);
+				if (option)
+					parameter = CreateParameter (_insertCommand, schemaRow, false);
+				else 
+					parameter = CreateParameter (_insertCommand, parmIndex++, schemaRow);			
 				parameter.SourceVersion = DataRowVersion.Current;
-
+				ApplyParameterInfo (parameter, schemaRow, StatementType.Insert, false);
+				
 				columns.Append (GetQuotedString (parameter.SourceColumn));
-				values.Append (parameter.ParameterName);
+
+				// Workaround for columns that may have a default/bound value and for now, 
+				// the framework, don't provide a mechanism to read these values yet
+				// AllowDBNull and DataRow is used to workaround #385028 by using DEFAULT 
+				string colName = schemaRow ["ColumnName"] as string;
+				bool allowDBNull = !schemaRow.IsNull ("AllowDBNull") & (bool) schemaRow ["AllowDBNull"];
+				if (!allowDBNull && row != null &&
+				    (row [colName] == DBNull.Value || row [colName] == null)) {
+					values.Append ("DEFAULT");
+				} else {
+					values.Append (parameter.ParameterName);
+				}
 			}
 
 			sql = String.Format ("{0} ({1}) VALUES ({2})", command, columns.ToString (), values.ToString ());
@@ -304,6 +333,7 @@ namespace System.Data.Common {
 			StringBuilder whereClause = new StringBuilder ();
 			int parmIndex = 1;
 			bool keyFound = false;
+			DbParameter parameter = null;
 
 			// First, create the X=Y list for UPDATE
 			foreach (DataRow schemaRow in _dbSchemaTable.Rows) {
@@ -312,9 +342,13 @@ namespace System.Data.Common {
 				if (columns.Length > 0) 
 					columns.Append (", ");
 
-				DbParameter parameter = CreateParameter (_updateCommand, String.Format ("@{0}", option ? schemaRow ["BaseColumnName"] : "p" + parmIndex++), schemaRow);
+				if (option)
+					parameter = CreateParameter (_updateCommand, schemaRow, false);
+				else 
+					parameter = CreateParameter (_updateCommand, parmIndex++, schemaRow);
 				parameter.SourceVersion = DataRowVersion.Current;
-
+				ApplyParameterInfo (parameter, schemaRow, StatementType.Update, false);
+				//parameter.IsNullable = (bool) schemaRow ["AllowDBNull"];
 				columns.Append (String.Format ("{0} = {1}", GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
 			}
 
@@ -330,36 +364,41 @@ namespace System.Data.Common {
 				if (whereClause.Length > 0) 
 					whereClause.Append (" AND ");
 
-				bool isKey = (bool) schemaRow ["IsKey"];
-				DbParameter parameter = null;
-
+				bool isKey = !schemaRow.IsNull ("IsKey") & (bool) schemaRow ["IsKey"];
 				if (isKey)
 					keyFound = true;
 
 				//ms.net 1.1 generates the null check for columns even if AllowDBNull is false
 				//while ms.net 2.0 does not. Anyways, since both forms are logically equivalent
 				//following the 2.0 approach
-				bool allowNull = (bool) schemaRow ["AllowDBNull"];
+				bool allowNull = !schemaRow.IsNull ("AllowDBNull") & (bool) schemaRow ["AllowDBNull"];
 				if (!isKey && allowNull) {
 					parameter = _updateCommand.CreateParameter ();
 					if (option) {
-						parameter.ParameterName = String.Format ("@{0} IS NULL",
+						parameter.ParameterName = String.Format ("@IsNull_{0}",
 											 schemaRow ["BaseColumnName"]);
 					} else {
 						parameter.ParameterName = String.Format ("@p{0}", parmIndex++);
 					}
+					parameter.DbType = DbType.Int32;
 					parameter.Value = 1;
+					parameter.SourceColumn = (string) schemaRow ["BaseColumnName"];
+					parameter.SourceColumnNullMapping = true;
+					parameter.SourceVersion = DataRowVersion.Original;
 					whereClause.Append ("(");
 					whereClause.Append (String.Format (clause1, parameter.ParameterName,
 									   GetQuotedString ((string) schemaRow ["BaseColumnName"])));
 					whereClause.Append (" OR ");
+					_updateCommand.Parameters.Add (parameter);
 				}
 
 				if (option)
-					parameter = CreateParameter (_updateCommand, String.Format ("@Original_{0}", schemaRow ["BaseColumnName"]), schemaRow);
-				else
-					parameter = CreateParameter (_updateCommand, String.Format ("@p{0}", parmIndex++), schemaRow);
+					parameter = CreateParameter (_updateCommand, schemaRow, true);
+				else 
+					parameter = CreateParameter (_updateCommand, parmIndex++, schemaRow);
 				parameter.SourceVersion = DataRowVersion.Original;
+				//parameter.IsNullable = allowNull;
+				ApplyParameterInfo (parameter, schemaRow, StatementType.Update, true);
 
 				whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
 
@@ -376,16 +415,31 @@ namespace System.Data.Common {
 			return _updateCommand;
 		}
 
-		private DbParameter CreateParameter (DbCommand _dbCommand, string parameterName, DataRow schemaRow)
+		private DbParameter CreateParameter (DbCommand _dbCommand, DataRow schemaRow, bool whereClause)
 		{
+			string sourceColumn = (string) schemaRow ["BaseColumnName"];
 			DbParameter parameter = _dbCommand.CreateParameter ();
-			parameter.ParameterName = parameterName;
-			parameter.SourceColumn = (string) schemaRow ["BaseColumnName"];
-			parameter.Size = (int) schemaRow ["ColumnSize"];
+			if (whereClause)
+				parameter.ParameterName = GetParameterName ("Original_" + sourceColumn);
+			else
+				parameter.ParameterName = GetParameterName (sourceColumn);
+			parameter.SourceColumn = sourceColumn;
+			//parameter.Size = (int) schemaRow ["ColumnSize"];
 			_dbCommand.Parameters.Add (parameter);
 			return parameter;
 		}
 
+		private DbParameter CreateParameter (DbCommand _dbCommand, int paramIndex, DataRow schemaRow)
+		{
+			string sourceColumn = (string) schemaRow ["BaseColumnName"];
+			DbParameter parameter = _dbCommand.CreateParameter ();
+			parameter.ParameterName = GetParameterName (paramIndex);
+			parameter.SourceColumn = sourceColumn;
+			//parameter.Size = (int) schemaRow ["ColumnSize"];
+			_dbCommand.Parameters.Add (parameter);
+			return parameter;
+		}
+		
 		[DefaultValue (CatalogLocation.Start)]
 		public virtual CatalogLocation CatalogLocation {
 			get { return _catalogLocation; }
@@ -420,7 +474,11 @@ namespace System.Data.Common {
 		[Browsable (false)]
 		public DbDataAdapter DataAdapter {
 			get { return _dbDataAdapter; }
-			set {  if (value != null) _dbDataAdapter = value; }
+			set {  if (value != null) {
+					SetRowUpdatingHandler (value);
+					_dbDataAdapter = value; 
+				}
+			}
 		}
 
 		[DefaultValue ("")]
@@ -505,48 +563,44 @@ namespace System.Data.Common {
 
 		public DbCommand GetDeleteCommand ()
 		{
-			BuildCache (true);
-			if (_deleteCommand == null)
-				return CreateDeleteCommand (false);
-			return _deleteCommand;
+			return GetDeleteCommand (false);
 		}
 
 		public DbCommand GetDeleteCommand (bool option)
 		{
 			BuildCache (true);
-			if (_deleteCommand == null)
+			if (_deleteCommand == null || option)
 				return CreateDeleteCommand (option);
 			return _deleteCommand;
 		}
 
 		public DbCommand GetInsertCommand ()
 		{
-			BuildCache (true);
-			if (_insertCommand == null)
-				return CreateInsertCommand (false);
-			return _insertCommand;
+			return GetInsertCommand (false);
 		}
 
 		public DbCommand GetInsertCommand (bool option)
 		{
+			return GetInsertCommand (option, null);
+		}
+		
+		internal DbCommand GetInsertCommand (bool option, DataRow row)
+		{
 			BuildCache (true);
-			if (_insertCommand == null)
-				return CreateInsertCommand (option);
-			return _insertCommand;
+			if (_insertCommand == null || option)
+				return CreateInsertCommand (option, row);
+			return _insertCommand;	
 		}
 
 		public DbCommand GetUpdateCommand ()
 		{
-			BuildCache (true);
-			if (_updateCommand == null)
-				return CreateUpdateCommand (false);
-			return _updateCommand;
+			return GetUpdateCommand (false);
 		}
 
 		public DbCommand GetUpdateCommand (bool option)
 		{
 			BuildCache (true);
-			if (_updateCommand == null)
+			if (_updateCommand == null || option)
 				return CreateUpdateCommand (option);
 			return _updateCommand;
 		}
@@ -601,7 +655,7 @@ namespace System.Data.Common {
 			try {
 				switch (args.StatementType) {
 				case StatementType.Insert:
-					args.Command = GetInsertCommand ();
+					args.Command = GetInsertCommand (false, args.Row);
 					break;
 				case StatementType.Update:
 					args.Command = GetUpdateCommand ();
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
index cebbe01..f6699ea 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataAdapter.cs
@@ -5,13 +5,14 @@
 //   Rodrigo Moya (rodrigo at ximian.com)
 //   Tim Coleman (tim at timcoleman.com)
 //   Sureshkumar T <tsureshkumar at novell.com>
+//   Veerapuram Varadhan  <vvaradhan at novell.com>
 //
 // (C) Ximian, Inc
 // Copyright (C) Tim Coleman, 2002-2003
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -106,29 +107,29 @@ namespace System.Data.Common
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public DbCommand SelectCommand {
-			get { return (DbCommand) ((IDbDataAdapter) this).SelectCommand; }
-			set { ((IDbDataAdapter) this).SelectCommand = value; }
+			get { return (DbCommand) _selectCommand; }
+			set { _selectCommand = value; }
 		}
 
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public DbCommand DeleteCommand {
-			get { return (DbCommand) ((IDbDataAdapter) this).DeleteCommand; }
-			set { ((IDbDataAdapter) this).DeleteCommand = value; }
+			get { return (DbCommand) _deleteCommand; }
+			set { _deleteCommand = value; }
 		}
 
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public DbCommand InsertCommand {
-			get { return (DbCommand) ((IDbDataAdapter) this).InsertCommand; }
-			set { ((IDbDataAdapter) this).InsertCommand = value; }
+			get { return (DbCommand)_insertCommand; }
+			set { _insertCommand = value; }
 		}
 
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public DbCommand UpdateCommand {
-			get { return (DbCommand) ((IDbDataAdapter) this).UpdateCommand; }
-			set { ((IDbDataAdapter) this).UpdateCommand = value; }
+			get { return (DbCommand)_updateCommand; }
+			set { _updateCommand = value; }
 		}
 
 		[DefaultValue (1)]
@@ -139,10 +140,6 @@ namespace System.Data.Common
 					throw new NotSupportedException ();
 			}
 		}
-#else
-		IDbCommand SelectCommand {
-			get { return ((IDbDataAdapter) this).SelectCommand; }
-		}
 #endif
 
 		#endregion // Properties
@@ -477,8 +474,9 @@ namespace System.Data.Common
 		[EditorBrowsable (EditorBrowsableState.Advanced)]
 		public override IDataParameter[] GetFillParameters ()
 		{
-			IDataParameter[] parameters = new IDataParameter [SelectCommand.Parameters.Count];
-			SelectCommand.Parameters.CopyTo (parameters, 0);
+			IDbCommand selectCmd = ((IDbDataAdapter) this).SelectCommand;
+			IDataParameter[] parameters = new IDataParameter [selectCmd.Parameters.Count];
+			selectCmd.Parameters.CopyTo (parameters, 0);
 			return parameters;
 		}
 		
@@ -654,28 +652,48 @@ namespace System.Data.Common
 				try {
 					if (command != null) {
 						DataColumnMappingCollection columnMappings = tableMapping.ColumnMappings;
+#if ONLY_1_1
 						IDataParameter nullCheckParam = null;
+#endif
 						foreach (IDataParameter parameter in command.Parameters) {
-							if ((parameter.Direction & ParameterDirection.Input) != 0) {
-								string dsColumnName = parameter.SourceColumn;
-								if (columnMappings.Contains(parameter.SourceColumn))
-									dsColumnName = columnMappings [parameter.SourceColumn].DataSetColumn;
-								if (dsColumnName == null || dsColumnName.Length <= 0) {
-									nullCheckParam = parameter;
-									continue;
-								}
+							if ((parameter.Direction & ParameterDirection.Input) == 0)
+								continue;
 
-								DataRowVersion rowVersion = parameter.SourceVersion;
-								// Parameter version is ignored for non-update commands
-								if (statementType == StatementType.Delete) 
-									rowVersion = DataRowVersion.Original;
+							DataRowVersion rowVersion = parameter.SourceVersion;
+							// Parameter version is ignored for non-update commands
+							if (statementType == StatementType.Delete)
+								rowVersion = DataRowVersion.Original;
 
+							string dsColumnName = parameter.SourceColumn;
+#if NET_2_0
+							if (columnMappings.Contains(dsColumnName)) {
+								dsColumnName = columnMappings [dsColumnName].DataSetColumn;
 								parameter.Value = row [dsColumnName, rowVersion];
-								if (nullCheckParam != null && (parameter.Value != null
-									&& parameter.Value != DBNull.Value)) {
+							} else {
+								parameter.Value = null;
+							}
+
+							DbParameter nullCheckParam = parameter as DbParameter;
+#else
+							if (columnMappings.Contains(dsColumnName))
+								dsColumnName = columnMappings [dsColumnName].DataSetColumn;
+							if (dsColumnName == null || dsColumnName.Length == 0) {
+								nullCheckParam = parameter;
+								continue;
+							}
+							parameter.Value = row [dsColumnName, rowVersion];
+#endif
+
+#if NET_2_0
+							if (nullCheckParam != null && nullCheckParam.SourceColumnNullMapping) {
+#else
+							if (nullCheckParam != null) {
+#endif
+								if (parameter.Value != null && parameter.Value != DBNull.Value)
 									nullCheckParam.Value = 0;
-									nullCheckParam = null;
-								}
+								else
+									nullCheckParam.Value = 1;
+								nullCheckParam = null;
 							}
 						}
 					}
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
index 4a48ca8..ad41acc 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
+++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
@@ -1,3 +1,43 @@
+2009-10-15  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** As part of fix for #385028
+	* SqlCommandBuilder.cs (RowUpdatingHandler): For 2.0 profile, call the 
+	base version of the handler.
+
+2009-07-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #526794
+	* SqlParameter.cs (ConvertToFrameworkType): For zero-length strings, 
+	return String.Empty.
+	
+2009-07-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* SqlParameter.cs (GetSqlValue): Simplify handling of SqlValue and SqlTypes.
+        (SqlTypeToFramworkType): Added support for SqlChars and SqlBytes types.
+	
+2009-07-28  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* SqlCommand.cs: Ensure connection is closed if CloseConnection
+	behavior is set, and reader could not be created.
+
+2009-07-28  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* More clean up of fix for #522624/#507663
+	* SqlCommandBuilder.cs: Appropriately handle rowUpdatingHandler and
+	more cleanup for 2.0 profile.
+
+2009-07-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* SqlDataReader.cs: Added new schema fields to the schema row. 
+	Fixes a failing provider test.
+
+2009-07-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* Fixes #507663
+	* SqlCommandBuilder.cs: From 2.0 onwards, use base's 
+	implementation for handling auto-generated commands.
+	* SqlDataAdapter.cs: -- ditto --
+       
 2009-05-08  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	** Fixes #497715
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
index 338680d..b74ff02 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommand.cs
@@ -588,9 +588,15 @@ namespace System.Data.SqlClient {
 			this.behavior = behavior;
 			if ((behavior & CommandBehavior.SequentialAccess) != 0)
 				Tds.SequentialAccess = true;
-			Execute (true);
-			Connection.DataReader = new SqlDataReader (this);
-			return Connection.DataReader;
+			try {
+				Execute (true);
+				Connection.DataReader = new SqlDataReader (this);
+				return Connection.DataReader;
+			} catch {
+				if ((behavior & CommandBehavior.CloseConnection) != 0)
+					Connection.Close ();
+				throw;
+			}
 		}
 
 		public
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
index 2abc592..c698e02 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlCommandBuilder.cs
@@ -3,12 +3,13 @@
 //
 // Author:
 //   Tim Coleman (tim at timcoleman.com)
+//   Veerapuram Varadhan (vvaradhan at novell.com)
 //
 // Copyright (C) Tim Coleman, 2002
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -50,29 +51,27 @@ namespace System.Data.SqlClient
 	{
 		#region Fields
 
+#if ONLY_1_1
 		bool disposed;
 
 		DataTable dbSchemaTable;
-		SqlDataAdapter adapter;
 		string quotePrefix;
 		string quoteSuffix;
 		string tableName;
-#if NET_2_0
-		readonly string _catalogSeparator = ".";
-		readonly string _schemaSeparator = ".";
-		readonly CatalogLocation _catalogLocation = CatalogLocation.Start;
-#endif
-	
-		SqlCommand deleteCommand;
+		SqlDataAdapter adapter;
 		SqlCommand insertCommand;
+		SqlCommand deleteCommand;
 		SqlCommand updateCommand;
-
 		// Used to construct WHERE clauses
 		static readonly string clause1 = "({0} = 1 AND {1} IS NULL)";
 		static readonly string clause2 = "({0} = {1})";
 
-		private SqlRowUpdatingEventHandler rowUpdatingHandler;
-
+#else
+		readonly string _catalogSeparator = ".";
+		readonly string _schemaSeparator = ".";
+		readonly CatalogLocation _catalogLocation = CatalogLocation.Start;
+#endif
+	
 		#endregion // Fields
 
 		#region Constructors
@@ -80,8 +79,8 @@ namespace System.Data.SqlClient
 		public SqlCommandBuilder ()
 		{
 #if NET_2_0
-			quoteSuffix = "]";
-			quotePrefix = "[";
+			QuoteSuffix = "]";
+			QuotePrefix = "[";
 #endif
 		}
 
@@ -100,21 +99,26 @@ namespace System.Data.SqlClient
 #endif
 		[DefaultValue (null)]
 		public new SqlDataAdapter DataAdapter {
-			get { return adapter; }
-			set { 
-				if (adapter != null)
-					adapter.RowUpdating -= new SqlRowUpdatingEventHandler (RowUpdatingHandler);
+			get { 
+#if ONLY_1_1
+				return adapter;
+#else
+				return (SqlDataAdapter)base.DataAdapter;
+#endif
+			} set {
+#if ONLY_1_1
+               if (adapter != null)
+                       adapter.RowUpdating -= new SqlRowUpdatingEventHandler (RowUpdatingHandler);
 
-				adapter = value; 
-				if (adapter != null)
-					adapter.RowUpdating += new SqlRowUpdatingEventHandler (RowUpdatingHandler);
+               adapter = value; 
+               if (adapter != null)
+                       adapter.RowUpdating += new SqlRowUpdatingEventHandler (RowUpdatingHandler);
+#else
+				base.DataAdapter = value;
+#endif
 			}
 		}
 
-		private string QuotedTableName {
-			get { return GetQuotedString (tableName); }
-		}
-
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 #if !NET_2_0
@@ -131,23 +135,27 @@ namespace System.Data.SqlClient
 #if ONLY_1_1
 				if (quotePrefix == null)
 					return string.Empty;
-#endif
 				return quotePrefix;
+#else
+				return base.QuotePrefix;
+#endif
 			}
 			set {
+#if ONLY_1_1
 				if (dbSchemaTable != null)
 					throw new InvalidOperationException (
 						"The QuotePrefix and QuoteSuffix " +
 						"properties cannot be changed once " +
 						"an Insert, Update, or Delete " +
 						"command has been generated.");
-#if NET_2_0
+				quotePrefix = value;
+#else
 				if (value != "[" && value != "\"")
 					throw new ArgumentException ("Only '[' " +
 						"and '\"' are allowed as value " +
 						"for the 'QuoteSuffix' property.");
+				base.QuotePrefix = value;
 #endif
-				quotePrefix = value;
 			}
 		}
 
@@ -167,23 +175,27 @@ namespace System.Data.SqlClient
 #if ONLY_1_1
 				if (quoteSuffix == null)
 					return string.Empty;
-#endif
 				return quoteSuffix;
+#else
+				return base.QuoteSuffix;
+#endif
 			}
 			set {
+#if ONLY_1_1
 				if (dbSchemaTable != null)
 					throw new InvalidOperationException (
 						"The QuotePrefix and QuoteSuffix " +
 						"properties cannot be changed once " +
 						"an Insert, Update, or Delete " +
 						"command has been generated.");
-#if NET_2_0
+				quoteSuffix = value;
+#else
 				if (value != "]" && value != "\"")
 					throw new ArgumentException ("Only ']' " +
 						"and '\"' are allowed as value " +
 						"for the 'QuoteSuffix' property.");
+				base.QuoteSuffix = value;
 #endif
-				quoteSuffix = value;
 			}
 		}
 
@@ -241,6 +253,7 @@ namespace System.Data.SqlClient
 
 #endif // NET_2_0
 
+#if ONLY_1_1
 		private SqlCommand SourceCommand {
 			get {
 				if (adapter != null)
@@ -248,11 +261,13 @@ namespace System.Data.SqlClient
 				return null;
 			}
 		}
+#endif
 
 		#endregion // Properties
 
 		#region Methods
 
+#if ONLY_1_1
 		private void BuildCache (bool closeConnection)
 		{
 			SqlCommand sourceCommand = SourceCommand;
@@ -303,13 +318,7 @@ namespace System.Data.SqlClient
 
 			CreateNewCommand (ref deleteCommand);
 
-			string command = String.Format (
-#if NET_2_0
-				"DELETE FROM {0}",
-#else
-				"DELETE FROM  {0}",
-#endif
-				QuotedTableName);
+			string command = String.Format ("DELETE FROM  {0}", QuotedTableName);
 			StringBuilder whereClause = new StringBuilder ();
 			bool keyFound = false;
 			int parmIndex = 1;
@@ -330,11 +339,7 @@ namespace System.Data.SqlClient
 					keyFound = true;
 
 				bool allowNull = (bool) schemaRow ["AllowDBNull"];
-#if NET_2_0
-				if (!isKey && allowNull) {
-#else
 				if (!isKey) {
-#endif
 					string sourceColumnName = (string) schemaRow ["BaseColumnName"];
 					if (useColumnsForParameterNames) {
 						parameter = deleteCommand.Parameters.Add (
@@ -345,21 +350,9 @@ namespace System.Data.SqlClient
 							GetParameterName (parmIndex++),
 							SqlDbType.Int);
 					}
-#if ONLY_1_1
 					parameter.IsNullable = allowNull;
-#endif
-#if NET_2_0
-					parameter.SourceColumn = sourceColumnName;
-					parameter.SourceColumnNullMapping = true;
-					parameter.SourceVersion = DataRowVersion.Original;
-#else
 					parameter.SourceVersion = DataRowVersion.Current;
-#endif
-#if NET_2_0
-					parameter.SqlValue = new SqlInt32 (1);
-#else
 					parameter.Value = 1;
-#endif
 
 					whereClause.Append ("(");
 					whereClause.Append (String.Format (clause1, parameter.ParameterName,
@@ -373,32 +366,19 @@ namespace System.Data.SqlClient
 					parameter = CreateParameter (parmIndex++, schemaRow);
 				deleteCommand.Parameters.Add (parameter);
 				ApplyParameterInfo (parameter, schemaRow, StatementType.Delete, true);
-#if ONLY_1_1
 				parameter.IsNullable = allowNull;
-#endif
 				parameter.SourceVersion = DataRowVersion.Original;
 
 				whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
 
-#if NET_2_0
-				if (!isKey && allowNull)
-#else
 				if (!isKey)
-#endif
 					whereClause.Append (")");
 			}
 			if (!keyFound)
 				throw new InvalidOperationException ("Dynamic SQL generation for the DeleteCommand is not supported against a SelectCommand that does not return any key column information.");
 
 			// We're all done, so bring it on home
-			string sql = String.Format (
-#if NET_2_0
-				"{0} WHERE ({1})",
-#else
-				"{0} WHERE ( {1} )",
-#endif
-				command,
-				whereClause.ToString ());
+			string sql = String.Format ("{0} WHERE ( {1} )", command, whereClause.ToString ());
 			deleteCommand.CommandText = sql;
 			return deleteCommand;
 		}
@@ -421,13 +401,8 @@ namespace System.Data.SqlClient
 					continue;
 
 				if (parmIndex > 1) {
-#if NET_2_0
-					columns.Append (", ");
-					values.Append (", ");
-#else
 					columns.Append (" , ");
 					values.Append (" , ");
-#endif
 				}
 
 				SqlParameter parameter = null;
@@ -440,9 +415,7 @@ namespace System.Data.SqlClient
 				insertCommand.Parameters.Add (parameter);
 				ApplyParameterInfo (parameter, schemaRow, StatementType.Insert, false);
 				parameter.SourceVersion = DataRowVersion.Current;
-#if ONLY_1_1
 				parameter.IsNullable = (bool) schemaRow ["AllowDBNull"];
-#endif
 
 				columns.Append (GetQuotedString (parameter.SourceColumn));
 				values.Append (parameter.ParameterName);
@@ -450,15 +423,7 @@ namespace System.Data.SqlClient
 				parmIndex++;
 			}
 
-			sql = String.Format (
-#if NET_2_0
-				"{0} ({1}) VALUES ({2})",
-#else
-				"{0}( {1} ) VALUES ( {2} )",
-#endif
-				command,
-				columns.ToString (),
-				values.ToString ());
+			sql = String.Format ("{0}( {1} ) VALUES ( {2} )", command, columns.ToString (), values.ToString ());
 			insertCommand.CommandText = sql;
 			return insertCommand;
 		}
@@ -495,11 +460,7 @@ namespace System.Data.SqlClient
 				if (!IncludedInUpdate (schemaRow))
 					continue;
 				if (columns.Length > 0)
-#if NET_2_0
-					columns.Append (", ");
-#else
 					columns.Append (" , ");
-#endif
 
 				SqlParameter parameter = null;
 				if (useColumnsForParameterNames) {
@@ -509,9 +470,7 @@ namespace System.Data.SqlClient
 				}
 				updateCommand.Parameters.Add (parameter);
 				ApplyParameterInfo (parameter, schemaRow, StatementType.Update, false);
-#if ONLY_1_1
 				parameter.IsNullable = (bool) schemaRow ["AllowDBNull"];
-#endif
 				parameter.SourceVersion = DataRowVersion.Current;
 
 				columns.Append (String.Format ("{0} = {1}", GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
@@ -536,11 +495,7 @@ namespace System.Data.SqlClient
 					keyFound = true;
 
 				bool allowNull = (bool) schemaRow ["AllowDBNull"];
-#if NET_2_0
-				if (!isKey && allowNull) {
-#else
 				if (!isKey) {
-#endif
 					string sourceColumnName = (string) schemaRow ["BaseColumnName"];
 					if (useColumnsForParameterNames) {
 						parameter = updateCommand.Parameters.Add (
@@ -551,25 +506,15 @@ namespace System.Data.SqlClient
 							GetParameterName (parmIndex++),
 							SqlDbType.Int);
 					}
-#if ONLY_1_1
 					parameter.IsNullable = allowNull;
-#endif
-#if NET_2_0
-					parameter.SourceColumn = sourceColumnName;
-					parameter.SourceColumnNullMapping = true;
-					parameter.SourceVersion = DataRowVersion.Original;
-#else
 					parameter.SourceVersion = DataRowVersion.Current;
-#endif
-#if NET_2_0
-					parameter.SqlValue = new SqlInt32 (1);
-#else
 					parameter.Value = 1;
-#endif
+					
 					whereClause.Append ("(");
 					whereClause.Append (String.Format (clause1, parameter.ParameterName,
 									GetQuotedString (sourceColumnName)));
 					whereClause.Append (" OR ");
+					
 				}
 
 				if (useColumnsForParameterNames) {
@@ -579,33 +524,19 @@ namespace System.Data.SqlClient
 				}
 				updateCommand.Parameters.Add (parameter);
 				ApplyParameterInfo (parameter, schemaRow, StatementType.Update, true);
-#if ONLY_1_1
 				parameter.IsNullable = allowNull;
-#endif
 				parameter.SourceVersion = DataRowVersion.Original;
 
 				whereClause.Append (String.Format (clause2, GetQuotedString (parameter.SourceColumn), parameter.ParameterName));
 
-#if NET_2_0
-				if (!isKey && allowNull)
-#else
 				if (!isKey)
-#endif
 					whereClause.Append (")");
 			}
 			if (!keyFound)
 				throw new InvalidOperationException ("Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.");
 
 			// We're all done, so bring it on home
-			string sql = String.Format (
-#if NET_2_0
-				"{0}{1} WHERE ({2})",
-#else
-				"{0}{1} WHERE ( {2} )",
-#endif
-				command,
-				columns.ToString (),
-				whereClause.ToString ());
+			string sql = String.Format ("{0}{1} WHERE ( {2} )", command, columns.ToString (), whereClause.ToString ());
 			updateCommand.CommandText = sql;
 			return updateCommand;
 		}
@@ -635,18 +566,15 @@ namespace System.Data.SqlClient
 			param.SourceColumn = sourceColumn;
 			return param;
 		}
-
+#endif // ONLY_1_1
+				
 		public static void DeriveParameters (SqlCommand command)
 		{
 			command.DeriveParameters ();
 		}
 
-#if NET_2_0
-		new
-#else
-		protected override
-#endif
-		void Dispose (bool disposing)
+#if ONLY_1_1
+		protected override void Dispose (bool disposing)
 		{
 			if (!disposed) {
 				if (disposing) {
@@ -662,6 +590,7 @@ namespace System.Data.SqlClient
 				disposed = true;
 			}
 		}
+#endif
 
 		public
 #if NET_2_0
@@ -669,10 +598,14 @@ namespace System.Data.SqlClient
 #endif // NET_2_0
 		SqlCommand GetDeleteCommand ()
 		{
+#if NET_2_0 
+			return (SqlCommand) base.GetDeleteCommand (false);
+#else
 			BuildCache (true);
 			if (deleteCommand == null)
 				return CreateDeleteCommand (false);
 			return deleteCommand;
+#endif
 		}
 
 		public
@@ -681,23 +614,14 @@ namespace System.Data.SqlClient
 #endif // NET_2_0
 		SqlCommand GetInsertCommand ()
 		{
+#if NET_2_0
+			return (SqlCommand) base.GetInsertCommand (false);
+#else
 			BuildCache (true);
 			if (insertCommand == null)
 				return CreateInsertCommand (false);
 			return insertCommand;
-		}
-
-		private string GetQuotedString (string value)
-		{
-			if (value == null || value.Length == 0)
-				return value;
-
-			string prefix = QuotePrefix;
-			string suffix = QuoteSuffix;
-
-			if (prefix.Length == 0 && suffix.Length == 0)
-				return value;
-			return String.Format ("{0}{1}{2}", prefix, value, suffix);
+#endif
 		}
 
 		public 
@@ -706,35 +630,30 @@ namespace System.Data.SqlClient
 #endif // NET_2_0
 		SqlCommand GetUpdateCommand ()
 		{
+#if NET_2_0
+			return (SqlCommand) base.GetUpdateCommand (false);
+#else
 			BuildCache (true);
 			if (updateCommand == null)
 				return CreateUpdateCommand (false);
 			return updateCommand;
+#endif
 		}
 
 #if NET_2_0
 		public new SqlCommand GetUpdateCommand (bool useColumnsForParameterNames)
 		{
-			BuildCache (true);
-			if (updateCommand == null || useColumnsForParameterNames)
-				return CreateUpdateCommand (useColumnsForParameterNames);
-			return updateCommand;
+			return (SqlCommand) base.GetUpdateCommand (useColumnsForParameterNames);
 		}
 
 		public new SqlCommand GetDeleteCommand (bool useColumnsForParameterNames)
 		{
-			BuildCache (true);
-			if (deleteCommand == null || useColumnsForParameterNames)
-				return CreateDeleteCommand (useColumnsForParameterNames);
-			return deleteCommand;
+			return (SqlCommand) base.GetDeleteCommand (useColumnsForParameterNames);
 		}
 
 		public new SqlCommand GetInsertCommand (bool useColumnsForParameterNames)
 		{
-			BuildCache (true);
-			if (insertCommand == null || useColumnsForParameterNames)
-				return CreateInsertCommand (useColumnsForParameterNames);
-			return insertCommand;
+			return (SqlCommand) base.GetInsertCommand (useColumnsForParameterNames);
 		}
 		
 		public override string QuoteIdentifier (string unquotedIdentifier)
@@ -804,11 +723,31 @@ namespace System.Data.SqlClient
 			return true;
 		}
 
-		public
-#if NET_2_0
-		new
-#endif
-		void RefreshSchema ()
+#if ONLY_1_1				
+		private string GetQuotedString (string value)
+		{
+			if (value == null || value.Length == 0)
+				return value;
+
+			string prefix = QuotePrefix;
+			string suffix = QuoteSuffix;
+
+			if (prefix.Length == 0 && suffix.Length == 0)
+				return value;
+			return String.Format ("{0}{1}{2}", prefix, value, suffix);
+		}
+
+		string GetNullCheckParameterName (string parameterName)
+		{
+			return GetParameterName ("IsNull_" + parameterName);
+		}
+
+
+		private string QuotedTableName {
+			get { return GetQuotedString (tableName); }
+		}
+
+		public void RefreshSchema ()
 		{
 			// FIXME: "Figure out what else needs to be cleaned up when we refresh."
 			tableName = String.Empty;
@@ -817,6 +756,7 @@ namespace System.Data.SqlClient
 			insertCommand = null;
 			updateCommand = null;
 		}
+#endif
 
 #if NET_2_0
 		protected override void ApplyParameterInfo (DbParameter parameter,
@@ -865,11 +805,6 @@ namespace System.Data.SqlClient
 			return String.Format ("@{0}", parameterName);
 		}
 
-		string GetNullCheckParameterName (string parameterName)
-		{
-			return GetParameterName ("IsNull_" + parameterName);
-		}
-
 #if NET_2_0
 		protected override string GetParameterPlaceholder (int parameterOrdinal)
 		{
@@ -881,8 +816,11 @@ namespace System.Data.SqlClient
 
 		#region Event Handlers
 
-		private void RowUpdatingHandler (object sender, SqlRowUpdatingEventArgs args)
+		void RowUpdatingHandler (object sender, SqlRowUpdatingEventArgs args)
 		{
+#if NET_2_0
+				base.RowUpdatingHandler (args);
+#else
 			if (args.Command != null)
 				return;
 			try {
@@ -901,21 +839,26 @@ namespace System.Data.SqlClient
 				args.Errors = e;
 				args.Status = UpdateStatus.ErrorsOccurred;
 			}
+#endif 
 		}
-
+			
 #if NET_2_0
 		protected override void SetRowUpdatingHandler (DbDataAdapter adapter)
 		{
-			if (!(adapter is SqlDataAdapter)) {
-				throw new InvalidOperationException ("Adapter needs to be a SqlDataAdapter");
-			}
-			rowUpdatingHandler = new SqlRowUpdatingEventHandler (RowUpdatingHandler);
-			((SqlDataAdapter) adapter).RowUpdating += rowUpdatingHandler;
+				SqlDataAdapter sda = adapter as SqlDataAdapter;
+				if (sda == null) {
+					throw new InvalidOperationException ("Adapter needs to be a SqlDataAdapter");
+				}
+				
+				if (sda != base.DataAdapter)
+					sda.RowUpdating += new SqlRowUpdatingEventHandler (RowUpdatingHandler);
+				else
+					sda.RowUpdating -= new SqlRowUpdatingEventHandler (RowUpdatingHandler);;
 		}
 
 		protected override DataTable GetSchemaTable (DbCommand srcCommand)
 		{
-			using (SqlDataReader rdr = (SqlDataReader) srcCommand.ExecuteReader ())
+			using (SqlDataReader rdr = (SqlDataReader) srcCommand.ExecuteReader (CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly))
 				return rdr.GetSchemaTable ();
 		}
 
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
index 29c1367..d14df46 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlDataAdapter.cs
@@ -5,11 +5,12 @@
 //   Rodrigo Moya (rodrigo at ximian.com)
 //   Daniel Morgan (danmorg at sc.rr.com)
 //   Tim Coleman (tim at timcoleman.com)
+//	 Veerapuram Varadhan  (vvaradhan at novell.com)
 //
 // (C) Ximian, Inc 2002
 // Copyright (C) 2002 Tim Coleman
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -40,17 +41,24 @@ namespace System.Data.SqlClient {
 	[DefaultEvent ("RowUpdated")]
 	[DesignerAttribute ("Microsoft.VSDesigner.Data.VS.SqlDataAdapterDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
 	[ToolboxItemAttribute ("Microsoft.VSDesigner.Data.VS.SqlDataAdapterToolboxItem, "+ Consts.AssemblyMicrosoft_VSDesigner)]
-	public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, ICloneable
+
+#if NET_2_0	
+	public sealed class SqlDataAdapter : DbDataAdapter, IDbDataAdapter, IDataAdapter, ICloneable
+#else
+	public sealed class SqlDataAdapter :  DbDataAdapter, IDbDataAdapter
+#endif
 	{
 		#region Fields
 
 #if !NET_2_0
 		bool disposed;
 #endif
-		SqlCommand deleteCommand;
-		SqlCommand insertCommand;
-		SqlCommand selectCommand;
-		SqlCommand updateCommand;
+#if ONLY_1_0 || ONLY_1_1
+		SqlCommand _selectCommand;
+		SqlCommand _insertCommand;
+		SqlCommand _updateCommand;
+		SqlCommand _deleteCommand;		
+#endif
 #if NET_2_0
 		int updateBatchSize;
 #endif
@@ -89,9 +97,25 @@ namespace System.Data.SqlClient {
 #endif
 		[DefaultValue (null)]
 		[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-		public new SqlCommand DeleteCommand {
-			get { return deleteCommand; }
-			set { deleteCommand = value; }
+		public
+#if ONLY_1_1
+		new 
+#endif 
+		SqlCommand DeleteCommand {
+			get { 
+#if NET_2_0
+				return (SqlCommand)base.DeleteCommand; 
+#else
+				return _deleteCommand;
+#endif
+			}
+			set { 
+#if NET_2_0
+				base.DeleteCommand = value; 
+#else
+				_deleteCommand = value;
+#endif
+			}
 		}
 
 #if !NET_2_0
@@ -99,9 +123,25 @@ namespace System.Data.SqlClient {
 #endif
 		[DefaultValue (null)]
 		[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-		public new SqlCommand InsertCommand {
-			get { return insertCommand; }
-			set { insertCommand = value; }
+		public
+#if ONLY_1_1
+		new 
+#endif 
+		SqlCommand InsertCommand {
+			get { 
+#if NET_2_0				
+				return (SqlCommand)base.InsertCommand; 
+#else
+				return _insertCommand;
+#endif
+			}
+			set { 
+#if NET_2_0				
+				base.InsertCommand = value; 
+#else
+				_insertCommand = value;
+#endif
+			}
 		}
 
 #if !NET_2_0
@@ -109,9 +149,25 @@ namespace System.Data.SqlClient {
 #endif
 		[DefaultValue (null)]
 		[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-		public new SqlCommand SelectCommand {
-			get { return selectCommand; }
-			set { selectCommand = value; }
+		public
+#if ONLY_1_1
+		new 
+#endif 
+		SqlCommand SelectCommand {
+			get { 
+#if NET_2_0
+				return (SqlCommand)base.SelectCommand; 
+#else
+				return _selectCommand;
+#endif
+			}
+			set { 
+#if NET_2_0
+				base.SelectCommand = value; 
+#else
+				_selectCommand = value;
+#endif
+			}
 		}
 
 #if !NET_2_0
@@ -119,30 +175,45 @@ namespace System.Data.SqlClient {
 #endif
 		[DefaultValue (null)]
 		[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
-		public new SqlCommand UpdateCommand {
-			get { return updateCommand; }
-			set { updateCommand = value; }
+		public
+#if ONLY_1_1
+		new 
+#endif 
+		SqlCommand UpdateCommand {
+			get { 
+#if NET_2_0
+				return (SqlCommand)base.UpdateCommand; 
+#else
+				return _updateCommand;
+#endif
+			}
+			set { 
+#if NET_2_0
+				base.UpdateCommand = value; 
+#else
+				_updateCommand = value;
+#endif
+			}
 		}
-
-		IDbCommand IDbDataAdapter.DeleteCommand {
-			get { return DeleteCommand; }
-			set { DeleteCommand = (SqlCommand) value; }
+		
+		IDbCommand IDbDataAdapter.SelectCommand {
+			get { return SelectCommand; }
+			set { SelectCommand = (SqlCommand) value; }
 		}
-
+		
 		IDbCommand IDbDataAdapter.InsertCommand {
 			get { return InsertCommand; }
 			set { InsertCommand = (SqlCommand) value; }
 		}
-
-		IDbCommand IDbDataAdapter.SelectCommand {
-			get { return SelectCommand; }
-			set { SelectCommand = (SqlCommand) value; }
-		}
-
+		
 		IDbCommand IDbDataAdapter.UpdateCommand {
 			get { return UpdateCommand; }
 			set { UpdateCommand = (SqlCommand) value; }
 		}
+		IDbCommand IDbDataAdapter.DeleteCommand {
+			get { return DeleteCommand; }
+			set { DeleteCommand = (SqlCommand) value; }
+		}
 
 #if NET_2_0
 		public override int UpdateBatchSize {
@@ -196,11 +267,13 @@ namespace System.Data.SqlClient {
 				RowUpdating (this, (SqlRowUpdatingEventArgs) value);
 		}
 
+#if NET_2_0		
 		[MonoTODO]
 		object ICloneable.Clone()
 		{
 			throw new NotImplementedException ();
 		}
+#endif
 
 #if NET_2_0
 		// All the batch methods, should be implemented, if supported,
diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
index 1ea5681..7a9cee3 100644
--- a/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
+++ b/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
@@ -70,7 +70,7 @@ namespace System.Data.SqlClient {
 		DataRowVersion sourceVersion;
 		SqlCompareOptions compareInfo;
 		int localeId;
-		Object sqlValue;
+		Type sqlType;
 		bool typeChanged;
 #if NET_2_0
 		bool sourceColumnNullMapping;
@@ -454,7 +454,11 @@ namespace System.Data.SqlClient {
 		override
 #endif // NET_2_0
 		object Value {
-			get { return metaParameter.RawValue; }
+			get {
+				if (sqlType != null)
+					return GetSqlValue (metaParameter.RawValue);
+				return metaParameter.RawValue;
+			}
 			set {
 				if (!isTypeSet) {
 #if NET_2_0
@@ -464,6 +468,11 @@ namespace System.Data.SqlClient {
 						InferSqlType (value);
 #endif
 				}
+
+				if (value is INullable) {
+					sqlType = value.GetType ();
+					value = SqlTypeToFrameworkType (value);
+				}
 				metaParameter.RawValue = value;
 			}
 		}
@@ -484,11 +493,10 @@ namespace System.Data.SqlClient {
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		public Object SqlValue {
-			get { return sqlValue; }
+			get {
+				return GetSqlValue (metaParameter.RawValue);
+			}
 			set {
-				sqlValue = value;
-				if (value is INullable)
-					value = SqlTypeToFrameworkType (value);
 				Value = value;
 			}
 		}
@@ -873,6 +881,96 @@ namespace System.Data.SqlClient {
 			return tdsValue;
 		}
 
+		// TODO: Code copied from SqlDataReader, need a better approach
+		object GetSqlValue (object value)
+		{		
+			if (value == null)
+				return value;
+			switch (sqlDbType) {
+			case SqlDbType.BigInt:
+				if (value == DBNull.Value)
+					return SqlInt64.Null;
+				return (SqlInt64) ((long) value);
+			case SqlDbType.Binary:
+			case SqlDbType.Image:
+			case SqlDbType.VarBinary:
+			case SqlDbType.Timestamp:
+				if (value == DBNull.Value)
+					return SqlBinary.Null;
+				return (SqlBinary) (byte[]) value;
+			case SqlDbType.Bit:
+				if (value == DBNull.Value)
+					return SqlBoolean.Null;
+				return (SqlBoolean) ((bool) value);
+			case SqlDbType.Char:
+			case SqlDbType.NChar:
+			case SqlDbType.NText:
+			case SqlDbType.NVarChar:
+			case SqlDbType.Text:
+			case SqlDbType.VarChar:
+				if (value == DBNull.Value)
+					return SqlString.Null;
+
+				string str;
+				Type type = value.GetType ();
+				if (type == typeof (char))
+					str = value.ToString ();
+				else if (type == typeof (char[]))
+					str = new String ((char[])value);
+				else
+					str = ((string)value);
+					return (SqlString) str;
+			case SqlDbType.DateTime:
+			case SqlDbType.SmallDateTime:
+				if (value == DBNull.Value)
+					return SqlDateTime.Null;
+				return (SqlDateTime) ((DateTime) value);
+			case SqlDbType.Decimal:
+				if (value == DBNull.Value)
+					return SqlDecimal.Null;
+				if (value is TdsBigDecimal)
+					return SqlDecimal.FromTdsBigDecimal ((TdsBigDecimal) value);
+				return (SqlDecimal) ((decimal) value);
+			case SqlDbType.Float:
+				if (value == DBNull.Value)
+					return SqlDouble.Null;
+				return (SqlDouble) ((double) value);
+			case SqlDbType.Int:
+				if (value == DBNull.Value)
+					return SqlInt32.Null;
+				return (SqlInt32) ((int) value);
+			case SqlDbType.Money:
+			case SqlDbType.SmallMoney:
+				if (value == DBNull.Value)
+					return SqlMoney.Null;
+				return (SqlMoney) ((decimal) value);
+			case SqlDbType.Real:
+				if (value == DBNull.Value)
+					return SqlSingle.Null;
+				return (SqlSingle) ((float) value);
+			case SqlDbType.UniqueIdentifier:
+				if (value == DBNull.Value)
+					return SqlGuid.Null;
+				return (SqlGuid) ((Guid) value);
+			case SqlDbType.SmallInt:
+				if (value == DBNull.Value)
+					return SqlInt16.Null;
+				return (SqlInt16) ((short) value);
+			case SqlDbType.TinyInt:
+				if (value == DBNull.Value)
+					return SqlByte.Null;
+				return (SqlByte) ((byte) value);
+#if NET_2_0
+			case SqlDbType.Xml:
+				if (value == DBNull.Value)
+					return SqlXml.Null;
+				return (SqlXml) value;
+#endif
+			default:
+				throw new NotImplementedException ("Type '" + sqlDbType + "' not implemented.");
+			}
+		}
+
 		object SqlTypeToFrameworkType (object value)
 		{
 			if (!(value is INullable)) // if the value is not SqlType
@@ -905,6 +1003,15 @@ namespace System.Data.SqlClient {
 				return ((SqlBinary) value).Value;
 			}
 
+#if NET_2_0
+			if (typeof (SqlBytes) == type) {
+				return ((SqlBytes) value).Value;
+			}
+
+			if (typeof (SqlChars) == type) {
+				return ((SqlChars) value).Value;
+			}
+#endif
 			if (typeof (SqlBoolean) == type) {
 				return ((SqlBoolean) value).Value;
 			}
@@ -946,7 +1053,7 @@ namespace System.Data.SqlClient {
 				return value;
 			
 			if (value is string && ((string)value).Length == 0)
-				return DBNull.Value;
+				return String.Empty;
 			
 			switch (sqlDbType)  {
 			case SqlDbType.BigInt :
diff --git a/mcs/class/System.Data/System.Data/ChangeLog b/mcs/class/System.Data/System.Data/ChangeLog
index 2fc0808..b6e045b 100644
--- a/mcs/class/System.Data/System.Data/ChangeLog
+++ b/mcs/class/System.Data/System.Data/ChangeLog
@@ -1,3 +1,77 @@
+2009-10-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DataTable.cs: Reuse old utility methods for raising DataTable 
+	clearing/cleared events.
+	* DataRowCollection.cs (Clear): Raise DataTable clearing/cleared 
+	events only for non 1.x profiles.  Fixes broken 1.x build.
+	
+2009-10-30  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes 448296
+	* DataTable.cs (Clear): Do not raise TableClearing/Cleared events as 
+	they will be raised from DataRowCollection.Clear().  New utility methods 
+	for raising TableClearing/TableCleared events from outside DataTable.  
+	Don't manually reset indexes as ResetIndexes is called from 
+	DataRowCollection.Clear
+	* DataRowCollection.cs (Clear): Raise TableClearing/Cleared events accordingly.
+	
+2009-10-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+ 	** Fixes 332875 - based on analysis by Ben Martin <ben at trustorm.com.au>
+ 	* XmlSchemaDataImporter.cs (AddParentKeyColumn): If a table already has a 
+ 	PrimaryKey column defined, when called again, fill the PKCol data into the 
+ 	passed DataColumn and return.
+
+2009-10-29  Veerapuram Varadhan  <vvaradhan at novell.com>
+ 
+ 	** Fixes #550960 - Patch by Stefano <stefano.sapienti at apsystems.it>
+ 	* DataTable.cs (BinarySerialize): Use datatype from DataColumn 
+ 	instead of value of the column.
+
+2009-10-13  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #537229
+	* XmlDiffLoader (LoadColumnAttributes/Children): Decode column names in 
+	case if they are encoded.
+	
+2009-09-26  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes part of #427769 - Patch by John Lenz <jlenz2 at math.uiuc.edu>
+	* DataSet.cs: XML serialization improvements to be compatible with MS impl.
+	
+2009-09-15  Veerapuram Varadhan  <vvaradhan at novell.com>
+	
+	** Fixes #536194 - Patch by Andrew Kurochk <aaki.viper at gmail.com>
+	* MergeManager.cs (Merge*): Do nothing when source and target 
+	datasets are same.
+	
+2009-09-10  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+        ** Fixes #510176
+        * DataView.cs (OnRowChanged/OnRowDeleted): Raise appropriate events iff
+        view is affected. This silence of the numerous Add/Change events that were
+        getting raised from DataView.
+        (ToTable): Use appropriate index to generated DataTable in case of
+        RowFilter / Sort conditions.
+
+        * DataRow.cs (AcceptChanges/RejectChanges): Raise appropriate Changing events.
+        	
+2009-09-03  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DataColumnPropertyDescriptor.cs, DataView.cs: Not browsable if Hidden.
+	[Fixes the second part of bug #536547]
+
+2009-08-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DataViewManager.cs (CollectionToListChangeEventArgs) : Use IsAssignableFrom 
+	instead of type comparison.
+		
+2009-08-25  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	** Fixes #521951
+	* DataViewManager.cs (CollectionToListChangeEventArgs) : Use a corresponding 
+	DataTable/DataRelation obj instead of only DataRelation.
+	
 2009-05-16  Veerapuram Varadhan  <vvaradhan at novell.com>
 
 	** Fixes #325464 - ToolItems.xsd
diff --git a/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs b/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs
index dc8ae4f..50e2491 100644
--- a/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs
+++ b/mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs
@@ -42,6 +42,8 @@ namespace System.Data
 		private bool readOnly = true;
 		private Type componentType = null;
 		private Type propertyType = null;
+		private bool browsable = true;
+
 		//private PropertyInfo prop = null;
 		private int columnIndex = 0;
 
@@ -75,6 +77,11 @@ namespace System.Data
 			propertyType = type;
 		}
 
+		public void SetBrowsable (bool browsable)
+		{
+			this.browsable = browsable;
+		}
+
 		public override object GetValue (object component) 
 		{
 			// FIXME: what is the correct way to Get a Value?
@@ -149,6 +156,10 @@ namespace System.Data
 			}
 		}
 
+		public override bool IsBrowsable {
+			get { return browsable && base.IsBrowsable; }
+		}
+
 		public override Type PropertyType {
 			get {
 				return propertyType;
diff --git a/mcs/class/System.Data/System.Data/DataRow.cs b/mcs/class/System.Data/System.Data/DataRow.cs
index 1a899ba..4cf9c91 100644
--- a/mcs/class/System.Data/System.Data/DataRow.cs
+++ b/mcs/class/System.Data/System.Data/DataRow.cs
@@ -8,6 +8,7 @@
 //   Ville Palo <vi64pa at koti.soon.fi>
 //   Alan Tam Siu Lung <Tam at SiuLung.com>
 //   Sureshkumar T <tsureshkumar at novell.com>
+//   Veerapuram Varadhan  <varadhan at novell.com>
 //
 // (C) Ximian, Inc 2002
 // (C) Daniel Morgan 2002, 2003
@@ -15,7 +16,7 @@
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -603,8 +604,6 @@ namespace System.Data {
 			_table.ChangingDataRow (this, DataRowAction.Commit);
 			CheckChildRows (DataRowAction.Commit);
 			switch (RowState) {
-			case DataRowState.Unchanged:
-				return;
 			case DataRowState.Added:
 			case DataRowState.Modified:
 				if (Original >= 0)
@@ -1280,9 +1279,8 @@ namespace System.Data {
 			// If original is null, then nothing has happened since AcceptChanges
 			// was last called.  We have no "original" to go back to.
 
-			_table.ChangedDataRow (this, DataRowAction.Rollback);
-			CancelEdit ();
-
+			Table.ChangingDataRow (this, DataRowAction.Rollback);
+			
 			//TODO : Need to Verify the constraints..
 			switch (RowState) {
 			case DataRowState.Added:
@@ -1303,6 +1301,7 @@ namespace System.Data {
 				this.Validate ();
 				break;
 			}
+			Table.ChangedDataRow (this, DataRowAction.Rollback);
 		}
 
 		/// <summary>
diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs
index a992bf8..3cef979 100644
--- a/mcs/class/System.Data/System.Data/DataRowCollection.cs
+++ b/mcs/class/System.Data/System.Data/DataRowCollection.cs
@@ -163,11 +163,16 @@ namespace System.Data
 				}
 			}
 
+#if NET_2_0
+			table.DataTableClearing ();
+#endif	
 			List.Clear ();
 
 			// Remove from indexes
 			table.ResetIndexes ();
-
+#if NET_2_0
+			table.DataTableCleared ();
+#endif
 			OnListChanged (this, new ListChangedEventArgs (ListChangedType.Reset, -1, -1));
 		}
 
diff --git a/mcs/class/System.Data/System.Data/DataSet.cs b/mcs/class/System.Data/System.Data/DataSet.cs
index f6aa119..2bc74c9 100644
--- a/mcs/class/System.Data/System.Data/DataSet.cs
+++ b/mcs/class/System.Data/System.Data/DataSet.cs
@@ -91,6 +91,17 @@ namespace System.Data
 		protected DataSet (SerializationInfo info, StreamingContext context)
 			: this ()
 		{
+#if NET_2_0
+			if (IsBinarySerialized (info, context)) {
+				BinaryDeserialize (info);
+				return;
+			}
+#endif
+			string s = info.GetValue ("XmlSchema", typeof (String)) as String;
+			XmlTextReader reader = new XmlTextReader (new StringReader (s));
+			ReadXmlSchema (reader);
+			reader.Close ();
+
 			GetSerializationData (info, context);
 		}
 
@@ -1117,6 +1128,7 @@ namespace System.Data
 		{
 #if NET_2_0
 			if (RemotingFormat == SerializationFormat.Xml) {
+				info.AddValue ("SchemaSerializationMode.DataSet", this.SchemaSerializationMode);
 #endif
 				StringWriter sw = new StringWriter ();
 				XmlTextWriter writer = new XmlTextWriter (sw);
@@ -1140,19 +1152,8 @@ namespace System.Data
 		#region Protected Methods
 		protected void GetSerializationData (SerializationInfo info, StreamingContext context)
 		{
-#if NET_2_0
-			if (IsBinarySerialized (info, context)) {
-				BinaryDeserialize (info);
-				return;
-			}
-#endif
-			string s = info.GetValue ("XmlSchema", typeof (String)) as String;
+			string s = info.GetValue ("XmlDiffGram", typeof (String)) as String;
 			XmlTextReader reader = new XmlTextReader (new StringReader (s));
-			ReadXmlSchema (reader);
-			reader.Close ();
-
-			s = info.GetValue ("XmlDiffGram", typeof (String)) as String;
-			reader = new XmlTextReader (new StringReader (s));
 			ReadXml (reader, XmlReadMode.DiffGram);
 			reader.Close ();
 		}
@@ -1532,10 +1533,26 @@ namespace System.Data
 		private bool dataSetInitialized = true;
 		public event EventHandler Initialized;
 
-		[MonoTODO]
 		protected DataSet (SerializationInfo info, StreamingContext context, bool constructSchema)
-			: this (info, context)
+			: this ()
 		{
+			if (DetermineSchemaSerializationMode (info, context) == SchemaSerializationMode.ExcludeSchema) {
+				InitializeDerivedDataSet ();
+			}
+			
+			if (IsBinarySerialized (info, context)) {
+				BinaryDeserialize (info);
+				return;
+			}
+			
+			if (constructSchema) {
+				string s = info.GetValue ("XmlSchema", typeof (String)) as String;
+				XmlTextReader reader = new XmlTextReader (new StringReader (s));
+				ReadXmlSchema (reader);
+				reader.Close ();
+				
+				GetSerializationData (info, context);
+			}
 		}
 
 		SerializationFormat remotingFormat = SerializationFormat.Xml;
@@ -1736,10 +1753,8 @@ namespace System.Data
 			OnDataSetInitialized (e);
 		}
 
-		[MonoTODO]
 		protected virtual void InitializeDerivedDataSet ()
 		{
-			throw new NotImplementedException ();
 		}
 
 		protected SchemaSerializationMode DetermineSchemaSerializationMode (XmlReader reader)
@@ -1749,6 +1764,13 @@ namespace System.Data
 
 		protected SchemaSerializationMode DetermineSchemaSerializationMode (SerializationInfo info, StreamingContext context)
 		{
+			SerializationInfoEnumerator e = info.GetEnumerator ();
+			while (e.MoveNext ()) {
+				if (e.Name == "SchemaSerializationMode.DataSet") {
+					return (SchemaSerializationMode) e.Value;
+				}
+			}
+			
 			return SchemaSerializationMode.IncludeSchema;
 		}
 
diff --git a/mcs/class/System.Data/System.Data/DataTable.cs b/mcs/class/System.Data/System.Data/DataTable.cs
index ce53d36..21f5430 100644
--- a/mcs/class/System.Data/System.Data/DataTable.cs
+++ b/mcs/class/System.Data/System.Data/DataTable.cs
@@ -258,7 +258,7 @@ namespace System.Data {
 			DataRowChangeEventArgs e = new DataRowChangeEventArgs (dr, action);
 			OnRowChanging (e);
 		}
-
+		
 		/// <summary>
 		/// Gets the collection of child relations for this DataTable.
 		/// </summary>
@@ -773,18 +773,10 @@ namespace System.Data {
 		/// </summary>
 		public void Clear ()
 		{
-			DataTableClearing ();
 			// Foriegn key constraints are checked in _rows.Clear method
 			_rows.Clear ();
-			foreach (Index index in Indexes)
-				index.Reset ();
-			DataTableCleared ();
 		}
 
-		// defined in the NET_2_0 profile
-		partial void DataTableClearing ();
-		partial void DataTableCleared ();
-
 		/// <summary>
 		/// Clones the structure of the DataTable, including
 		///  all DataTable schemas and constraints.
@@ -2757,8 +2749,8 @@ namespace System.Data {
 				if (rowsCount == 0)
 					continue;
 				BitArray nullBits = new BitArray (rowsCount);
-				Array recordArray = Array.CreateInstance (Rows[0][j].GetType (), recordsCount);
 				DataColumn column = Columns [j];
+				Array recordArray = Array.CreateInstance (column.DataType, recordsCount);
 				for (int k = 0, l = 0; k < Rows.Count; k++, l++) {
 					DataRowVersion version;
 					DataRow dr = Rows[k];
@@ -2987,7 +2979,7 @@ namespace System.Data {
 				TableCleared (this, e);
 		}
 
-		partial void DataTableCleared ()
+		internal void DataTableCleared ()
 		{
 			OnTableCleared (new DataTableClearEventArgs (this));
 		}
@@ -2998,7 +2990,7 @@ namespace System.Data {
 				TableClearing (this, e);
 		}
 
-		partial void DataTableClearing ()
+		internal void DataTableClearing ()
 		{
 			OnTableClearing (new DataTableClearEventArgs (this));
 		}
diff --git a/mcs/class/System.Data/System.Data/DataView.cs b/mcs/class/System.Data/System.Data/DataView.cs
index 1c52aaf..04d655b 100644
--- a/mcs/class/System.Data/System.Data/DataView.cs
+++ b/mcs/class/System.Data/System.Data/DataView.cs
@@ -643,25 +643,43 @@ namespace System.Data
 			newIndex = IndexOf (args.Row);
 
 			/* ItemAdded */
-			if (args.Action == DataRowAction.Add)
+			if (args.Action == DataRowAction.Add && oldIndex != newIndex)
 				OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, newIndex, -1));
 
 			/* ItemChanged or ItemMoved */
 			if (args.Action == DataRowAction.Change) {
-				if (oldIndex == newIndex)
+				if (oldIndex != -1 && oldIndex == newIndex)
 					OnListChanged (new ListChangedEventArgs (ListChangedType.ItemChanged, newIndex, -1));
-				else
-					OnListChanged (new ListChangedEventArgs (ListChangedType.ItemMoved, newIndex, oldIndex));
+				else if (oldIndex != newIndex) {
+                	if (newIndex < 0)
+						OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, oldIndex));
+					else
+						OnListChanged (new ListChangedEventArgs (ListChangedType.ItemMoved, newIndex, oldIndex));
+				}
 			}
+                       
+			/* Rollback - ItemAdded or ItemDeleted */
+			if (args.Action == DataRowAction.Rollback) {
+				if (oldIndex < 0 && newIndex > -1)
+			    	OnListChanged (new ListChangedEventArgs (ListChangedType.ItemAdded, newIndex, -1));
+				else if (oldIndex > -1 && newIndex < 0)
+					OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, oldIndex));
+				else if (oldIndex != -1 && oldIndex == newIndex)
+					OnListChanged (new ListChangedEventArgs (ListChangedType.ItemChanged, newIndex, -1));
+			}		
 		}
 
 		private void OnRowDeleted (object sender, DataRowChangeEventArgs args)
 		{
 			/* ItemDeleted */
-			int newIndex;
+			int newIndex, oldCount;
+			oldCount = Count;
+			
 			newIndex = IndexOf (args.Row);
 			UpdateIndex (true);
-			OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, -1));
+			/* Fire ListChanged only when the RowFilter is affected */
+			if (oldCount != Count)
+				OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted, newIndex, -1));
 		}
 
 		protected virtual void ColumnCollectionChanged (object sender, CollectionChangeEventArgs e)
@@ -794,6 +812,7 @@ namespace System.Data
 				descriptor.SetComponentType (typeof (System.Data.DataRowView));
 				descriptor.SetPropertyType (dataColumn.DataType);
 				descriptor.SetReadOnly (dataColumn.ReadOnly);
+				descriptor.SetBrowsable (dataColumn.ColumnMapping != MappingType.Hidden);
 				descriptors [d++] = descriptor;
 			}
 			for (int rel = 0; rel < dataTable.ChildRelations.Count; rel ++) {
@@ -1163,7 +1182,7 @@ namespace System.Data
 
 			DataColumn[] columns;
 			ListSortDirection[] sortDirection = null;
-			if (columnNames.Length != 0) {
+			if (columnNames.Length > 0) {
 				columns = new DataColumn [columnNames.Length];
 				for (int i=0; i < columnNames.Length; ++i)
 					columns [i] = Table.Columns [columnNames [i]];
@@ -1197,7 +1216,13 @@ namespace System.Data
 			}
 
 			DataRow [] rows;
-			Index index = new Index (new Key(Table, columns, sortDirection, RowStateFilter, rowFilterExpr));
+			Index index = null;
+			
+			if (sort != String.Empty)
+				index = Table.GetIndex (sortColumns, sortOrder, RowStateFilter, FilterExpression, true);
+			else
+				index = new Index (new Key(Table, columns, sortDirection, RowStateFilter, rowFilterExpr));
+			
 			if (isDistinct)
 				rows = index.GetDistinctRows ();
 			else
diff --git a/mcs/class/System.Data/System.Data/DataViewManager.cs b/mcs/class/System.Data/System.Data/DataViewManager.cs
index 3983007..6e71d9f 100644
--- a/mcs/class/System.Data/System.Data/DataViewManager.cs
+++ b/mcs/class/System.Data/System.Data/DataViewManager.cs
@@ -419,10 +419,19 @@ namespace System.Data
 				args = null;
 			else if (e.Action == CollectionChangeAction.Refresh)
 				args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorChanged, null);
-			else if (e.Action == CollectionChangeAction.Add)
-				args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorAdded, new DataRelationPropertyDescriptor(((DataRelation) e.Element)));
-			else
-				args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorDeleted, new DataRelationPropertyDescriptor(((DataRelation) e.Element)));
+			else { 
+				object obj;
+				
+				if (typeof (DataTable).IsAssignableFrom (e.Element.GetType()))
+					obj = new DataTablePropertyDescriptor ((DataTable) e.Element);
+				else // Assume a DataRelation
+					obj = new DataRelationPropertyDescriptor((DataRelation) e.Element);
+				
+				if (e.Action == CollectionChangeAction.Add)
+					args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorAdded, (PropertyDescriptor) obj);
+				else
+					args = new ListChangedEventArgs(ListChangedType.PropertyDescriptorDeleted, (PropertyDescriptor) obj);
+			}
 
 			return args;
 		}
diff --git a/mcs/class/System.Data/System.Data/MergeManager.cs b/mcs/class/System.Data/System.Data/MergeManager.cs
index 1c5ab5a..09b8f58 100644
--- a/mcs/class/System.Data/System.Data/MergeManager.cs
+++ b/mcs/class/System.Data/System.Data/MergeManager.cs
@@ -37,6 +37,8 @@ namespace System.Data
 				throw new ArgumentNullException("targetSet");
 			if(sourceSet == null)
 				throw new ArgumentNullException("sourceSet");
+			if (sourceSet == targetSet)
+				return;
 
 			bool prevEC = targetSet.EnforceConstraints;
 			targetSet.EnforceConstraints = false;
@@ -54,6 +56,8 @@ namespace System.Data
 				throw new ArgumentNullException("targetSet");
 			if(sourceTable == null)
 				throw new ArgumentNullException("sourceTable");
+			if (sourceTable.DataSet == targetSet)
+				return;
 
 			bool savedEnfoceConstraints = targetSet.EnforceConstraints;
 			targetSet.EnforceConstraints = false;
@@ -75,6 +79,8 @@ namespace System.Data
 				throw new ArgumentNullException("targetTable");
 			if(sourceTable == null)
 				throw new ArgumentNullException("sourceTable");
+			if (sourceTable == targetTable)
+				return;
 
 			bool savedEnforceConstraints = targetTable.EnforceConstraints;
 			targetTable.EnforceConstraints = false;
diff --git a/mcs/class/System.Data/System.Data/XmlDiffLoader.cs b/mcs/class/System.Data/System.Data/XmlDiffLoader.cs
index 8bc21af..00c19be 100644
--- a/mcs/class/System.Data/System.Data/XmlDiffLoader.cs
+++ b/mcs/class/System.Data/System.Data/XmlDiffLoader.cs
@@ -238,7 +238,7 @@ namespace System.Data {
 				case XmlSchema.Namespace:
 					continue;
 				}
-				DataColumn c = Table.Columns [reader.LocalName];
+				DataColumn c = Table.Columns [XmlHelper.Decode (reader.LocalName)];
 				if (c == null ||
 					c.ColumnMapping != MappingType.Attribute)					continue;
 				if (c.Namespace == null && reader.NamespaceURI == String.Empty ||
@@ -268,9 +268,9 @@ namespace System.Data {
 			{
 				if (reader.NodeType != XmlNodeType.Element) { reader.Read (); continue; }
 				
-				if (Table.Columns.Contains (reader.LocalName)) 
+				string colName = XmlHelper.Decode (reader.LocalName);
+				if (Table.Columns.Contains (colName)) 
 				{
-					string colName = reader.LocalName;
 					object data = XmlDataLoader.StringToObject (Table.Columns[colName].DataType, reader.ReadString ());
 					
 					if (loadType == DataRowVersion.Current) Row [colName] = data;
diff --git a/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs b/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs
index 24950a7..b8826db 100644
--- a/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs
+++ b/mcs/class/System.Data/System.Data/XmlSchemaDataImporter.cs
@@ -843,17 +843,28 @@ namespace System.Data
 
 		private void AddParentKeyColumn (XmlSchemaElement parent, XmlSchemaElement el, DataColumn col)
 		{
-			if (currentTable.PrimaryKey != null)
+			// check existing primary key
+			if (currentTable.Table.PrimaryKey.Length > 0)
+				throw new DataException (String.Format ("There is already primary key columns in the table \"{0}\".", currentTable.Table.TableName));
+
+			if (currentTable.PrimaryKey != null) {
+				// fill pk column info and return
+				col.ColumnName = currentTable.PrimaryKey.ColumnName;
+				col.ColumnMapping = currentTable.PrimaryKey.ColumnMapping;
+				col.Namespace = currentTable.PrimaryKey.Namespace;
+				col.DataType = currentTable.PrimaryKey.DataType;
+				col.AutoIncrement = currentTable.PrimaryKey.AutoIncrement;
+				col.AllowDBNull = currentTable.PrimaryKey.AllowDBNull;
+				
+				ImportColumnMetaInfo (el, el.QualifiedName, col);
 				return;
+			}
 
 			// check name identity
 			string name = XmlHelper.Decode (parent.QualifiedName.Name) + "_Id";
 			int count = 0;
 			while (currentTable.ContainsColumn (name))
 				name = String.Format ("{0}_{1}", name, count++);
-			// check existing primary key
-			if (currentTable.Table.PrimaryKey.Length > 0)
-				throw new DataException (String.Format ("There is already primary key columns in the table \"{0}\".", currentTable.Table.TableName));
 
 			col.ColumnName = name;
 			col.ColumnMapping = MappingType.Hidden;
@@ -861,8 +872,8 @@ namespace System.Data
 			col.DataType = typeof (int);
 			col.AutoIncrement = true;
 			col.AllowDBNull = false;
-
 			ImportColumnMetaInfo (el, el.QualifiedName, col);
+			
 			AddColumn (col);
 			currentTable.PrimaryKey = col;
 		}
diff --git a/mcs/class/System.Data/Test/System.Data/ChangeLog b/mcs/class/System.Data/Test/System.Data/ChangeLog
index 7c2f4f7..c4b4311 100644
--- a/mcs/class/System.Data/Test/System.Data/ChangeLog
+++ b/mcs/class/System.Data/Test/System.Data/ChangeLog
@@ -1,3 +1,21 @@
+2009-10-13  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DataSetTest2.cs (Bug537229_BinFormatSerializer_Test): Added new.
+	
+2009-09-26  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DataSetTest2.cs: Don't run the test for Bug#536194 on 1.x
+	profiles.  Fixes 1.x test failures.
+	
+2009-09-26  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+	* DataSetTypedDataSet.cs: Test for #427769.  Patch by 
+	John Lenz <jlenz2 at math.uiuc.edu>.
+	
+2009-09-24  Veerapuram Varadhan  <vvaradhan at novell.com>
+
+        * DataSetTest2.cs (MergeTest_SameDataSet_536194): Added new.
+       
 2009-01-16  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* DataColumnTest.cs : try a string comparison fix.
diff --git a/mcs/class/System.Data/Test/System.Data/DataSetTest2.cs b/mcs/class/System.Data/Test/System.Data/DataSetTest2.cs
index 56cfbef..ccbfd59 100644
--- a/mcs/class/System.Data/Test/System.Data/DataSetTest2.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataSetTest2.cs
@@ -3,8 +3,10 @@
 //   Erez Lotan       <erezl at mainsoft.com>
 //   Oren Gurfinkel   <oreng at mainsoft.com>
 //   Ofer Borstein
+//   Veerapuram Varadhan  <vvaradhan at novell.com>
 //
 // Copyright (c) 2004 Mainsoft Co.
+// Copyright (c) 2009 Novell Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -33,6 +35,8 @@ using System.IO;
 using System.Data;
 using MonoTests.System.Data.Utils;
 using System.Xml;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
 
 namespace MonoTests_System.Data
 {
@@ -3466,6 +3470,22 @@ namespace MonoTests_System.Data
 			Assert.AreEqual (1, ds.Tables [0].Columns.Count, "#4"); 	
 			Assert.AreEqual (typeof (string), ds.Tables [0].Columns [0].DataType, "#5");
         	}
+
+#if NET_2_0               
+               [Test]
+               public void MergeTest_SameDataSet_536194 ()
+               {
+                       DataSet dataSet = new DataSet ("Test");
+                       
+                       DataTable dataTable = new DataTable("Test");
+                       dataTable.Columns.Add("Test");
+                       dataTable.Rows.Add("Test");
+                       dataSet.Tables.Add(dataTable);
+                       dataSet.Merge(dataSet);
+                       Assert.AreEqual (1, dataSet.Tables.Count, "1");
+               }
+#endif
+
 #if NET_2_0
 		[Test]	
         	public void LoadTest1 ()
@@ -3564,5 +3584,67 @@ namespace MonoTests_System.Data
 			}
 		}
 #endif
+		private void AssertDataTableValues (DataTable dt)
+		{
+			Assert.AreEqual ("data1", dt.Rows[0]["_ID"], "1");
+			Assert.AreEqual ("data2", dt.Rows[0]["#ID"], "2");
+			Assert.AreEqual ("data3", dt.Rows[0]["%ID"], "2");
+			Assert.AreEqual ("data4", dt.Rows[0]["$ID"], "2");
+			Assert.AreEqual ("data5", dt.Rows[0][":ID"], "2");
+			Assert.AreEqual ("data6", dt.Rows[0][".ID"], "2");
+			Assert.AreEqual ("data7", dt.Rows[0]["ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["*ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["+ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["-ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["~ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["@ID"], "2");
+			Assert.AreEqual ("data8", dt.Rows[0]["&ID"], "2");
+
+		}
+
+		[Test]	
+        	public void Bug537229_BinFormatSerializer_Test ()
+        	{
+			DataSet ds = new DataSet ();
+			DataTable dt = new DataTable ();
+                        ds.Tables.Add (dt);
+                        dt.Columns.Add ("_ID", typeof(String));
+                        dt.Columns.Add ("#ID", typeof(String));
+                        dt.Columns.Add ("%ID", typeof(String));
+                        dt.Columns.Add ("$ID", typeof(String));
+                        dt.Columns.Add (":ID", typeof(String));
+                        dt.Columns.Add (".ID", typeof(String));
+                        dt.Columns.Add ("ID", typeof(String));
+                        dt.Columns.Add ("*ID", typeof(String));
+                        dt.Columns.Add ("+ID", typeof(String));
+                        dt.Columns.Add ("-ID", typeof(String));
+                        dt.Columns.Add ("~ID", typeof(String));
+                        dt.Columns.Add ("@ID", typeof(String));
+                        dt.Columns.Add ("&ID", typeof(String));
+                        DataRow row = dt.NewRow ();
+                        row["#ID"] = "data2";
+                        row["%ID"] = "data3";
+                        row["$ID"] = "data4";
+                        row["ID"] = "data7";
+                        row[":ID"] = "data5";
+                        row[".ID"] = "data6";
+                        row["_ID"] = "data1";
+                        row["*ID"] = "data8";
+                        row["+ID"] = "data8";
+                        row["-ID"] = "data8";
+                        row["~ID"] = "data8";
+                        row["@ID"] = "data8";
+                        row["&ID"] = "data8";
+                        dt.Rows.Add (row);
+
+			AssertDataTableValues (dt);
+
+                        MemoryStream mstm=new MemoryStream();
+                        BinaryFormatter bfmt=new BinaryFormatter();
+                        bfmt.Serialize(mstm,dt);
+                        MemoryStream mstm2=new MemoryStream(mstm.ToArray());
+                        DataTable vdt=(DataTable)bfmt.Deserialize(mstm2);
+			AssertDataTableValues (vdt);
+		}
 	}
 }
diff --git a/mcs/class/System.Data/Test/System.Data/DataSetTypedDataSetTest.cs b/mcs/class/System.Data/Test/System.Data/DataSetTypedDataSetTest.cs
index b10faba..72cbc19 100644
--- a/mcs/class/System.Data/Test/System.Data/DataSetTypedDataSetTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataSetTypedDataSetTest.cs
@@ -196,6 +196,58 @@ namespace MonoTests.System.Data
 			myTypedDataSet.Order_DetailsRow[] drArr1 = ds.Orders[0].GetOrder_DetailsRows();
 			DataRow[] drArr2 = ds.Orders[0].GetChildRows(ds.Relations[0]);
 			Assert.AreEqual(drArr1 ,drArr2,"TDS25");
+
+#if NET_2_0
+                       //now test serialization of a typed dataset generated by microsoft's xsd.exe
+                       DataSet1 ds1 = new DataSet1();
+                       ds1.DataTable1.AddDataTable1Row("test");
+                       ds1.DataTable1.AddDataTable1Row("test2");
+
+                       global::System.Runtime.Serialization.Formatters.Binary.BinaryFormatter formatter =
+                         new global::System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
+                       MemoryStream stream = new MemoryStream();
+
+                       formatter.Serialize(stream, ds1);
+
+                       stream.Seek(0, SeekOrigin.Begin);
+
+                       DataSet1 ds1load = (DataSet1) formatter.Deserialize(stream);
+
+                       Assert.IsTrue(ds1load.Tables.Contains("DataTable1"));
+                       Assert.AreEqual("DataTable1DataTable", ds1load.Tables["DataTable1"].GetType().Name);
+                       Assert.AreEqual(2, ds1load.DataTable1.Rows.Count);
+                       Assert.AreEqual("DataTable1Row", ds1load.DataTable1[0].GetType().Name);
+                       if (ds1load.DataTable1[0].Column1 == "test") {
+                               Assert.AreEqual("test2", ds1load.DataTable1[1].Column1);
+                       } else if (ds1load.DataTable1[0].Column1 == "test2") {
+                               Assert.AreEqual("test", ds1load.DataTable1[1].Column1);
+                       } else {
+                               Assert.Fail("Invalid entry for Column1");
+                       }
+
+                       //now test when the mode is exclude schema
+                       ds1.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.ExcludeSchema;
+
+                       stream = new MemoryStream();
+
+                       formatter.Serialize(stream, ds1);
+
+                       stream.Seek(0, SeekOrigin.Begin);
+
+                       ds1load = (DataSet1) formatter.Deserialize(stream);
+
+                       Assert.IsTrue(ds1load.Tables.Contains("DataTable1"));
+                       Assert.AreEqual("DataTable1DataTable", ds1load.Tables["DataTable1"].GetType().Name);
+                       Assert.AreEqual(2, ds1load.DataTable1.Rows.Count);
+                       Assert.AreEqual("DataTable1Row", ds1load.DataTable1[0].GetType().Name);
+                       if (ds1load.DataTable1[0].Column1 == "test") {
+                               Assert.AreEqual("test2", ds1load.DataTable1[1].Column1);
+                       } else if (ds1load.DataTable1[0].Column1 == "test2") {
+                               Assert.AreEqual("test", ds1load.DataTable1[1].Column1);
+                       } else {
+                               Assert.Fail("Invalid entry for Column1");
+                       }
+#endif
 		}
 	
 		protected void T_Changing(object sender, myTypedDataSet.OrdersRowChangeEvent e) 
diff --git a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
index 74d627e..f9be000 100644
--- a/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
+++ b/mcs/class/System.Data/Test/System.Data/DataViewTest.cs
@@ -669,7 +669,7 @@ namespace MonoTests.System.Data
 		[Test]
 		public void CancelEditAndEvents ()
 		{
-			string reference = " =====ItemAdded:3 ------4 =====ItemAdded:3 =====ItemAdded:4 ------5 =====ItemAdded:4 =====ItemAdded:5 ------6 =====ItemDeleted:5 ------5 =====ItemAdded:5";
+			string reference = " =====ItemAdded:3 ------4 =====ItemAdded:4 ------5 =====ItemAdded:5 ------6 =====ItemDeleted:5 ------5 =====ItemAdded:5";
 
 			eventWriter = new StringWriter ();
 
diff --git a/mcs/class/System.Design/System.ComponentModel.Design/ChangeLog b/mcs/class/System.Design/System.ComponentModel.Design/ChangeLog
index 1c5d401..ea9c502 100644
--- a/mcs/class/System.Design/System.ComponentModel.Design/ChangeLog
+++ b/mcs/class/System.Design/System.ComponentModel.Design/ChangeLog
@@ -1,3 +1,27 @@
+2009-09-14  Ivan Zlatev  <contact at i-nz.net>
+
+	* DesignSurface.cs: Prevent a NRE in Flush by cheching if the 
+	designer loader is null.
+	[Fixes bug #538929]
+
+2009-09-10  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DesignSurface.cs: Changing the ISelectionService at run time was a 
+	bad idea, so wrap it inside the extended UISelectionService instead.
+
+2009-09-10  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DesignSurface.cs: Provide the default implementation of the 
+	ISelectionService in the DesignSurface service container.
+	[Fixes bug #538037]
+
+2009-09-07  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DesignSurface.cs: Don't be so strict and allow for the users 
+	to get the View even if the DesignSurface wasn't properly initialized 
+	with a DesignerLoader. MS compatibility.
+	[Fixes bug #537131]
+
 2008-07-06  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* DesignerActionMethodItem.cs: Fix typo where the action_list
diff --git a/mcs/class/System.Design/System.ComponentModel.Design/DesignSurface.cs b/mcs/class/System.Design/System.ComponentModel.Design/DesignSurface.cs
index 96c782e..cdb891c 100644
--- a/mcs/class/System.Design/System.ComponentModel.Design/DesignSurface.cs
+++ b/mcs/class/System.Design/System.ComponentModel.Design/DesignSurface.cs
@@ -144,6 +144,9 @@ namespace System.ComponentModel.Design
 			_serviceContainer.AddService (typeof (IExtenderProviderService), (IExtenderProviderService) extenderService);
 			_serviceContainer.AddService (typeof (IExtenderListService), (IExtenderListService) extenderService);
 			_serviceContainer.AddService (typeof (DesignSurface), this);
+
+			SelectionService selectionService = new SelectionService (_serviceContainer);
+			_serviceContainer.AddService (typeof (ISelectionService), (ISelectionService) selectionService);
 		}
 		
 		protected ServiceContainer ServiceContainer {
@@ -183,21 +186,22 @@ namespace System.ComponentModel.Design
 			get {
 				if (_designerHost == null)
 					throw new ObjectDisposedException ("DesignSurface");
-				if (this.LoadErrors.Count > 0 || !_isLoaded)
-					throw new InvalidOperationException ("DesignSurface isn't loaded.");
-				
 				
+				if (_designerHost.RootComponent == null || this.LoadErrors.Count > 0)
+					throw new InvalidOperationException ("The DesignSurface isn't loaded.");
+
 				IRootDesigner designer = _designerHost.GetDesigner (_designerHost.RootComponent) as IRootDesigner;
+				if (designer == null)
+					throw new InvalidOperationException ("The DesignSurface isn't loaded.");
+
 				ViewTechnology[] viewTech = designer.SupportedTechnologies;
-				
 				for (int i = 0; i < viewTech.Length; i++) {
 					try { 
 						return designer.GetView (viewTech[i]); 
 					} catch {}
 				}
-				// if this code is reached - there is no supported view technology
-				//
-				throw new NotSupportedException ();
+
+				throw new NotSupportedException ("No supported View Technology found.");
 			}
 		}
 
@@ -272,7 +276,8 @@ namespace System.ComponentModel.Design
 		
 		public void Flush ()
 		{	   
-			_designerLoader.Flush ();
+			if (_designerLoader != null)
+				_designerLoader.Flush ();
 
 			if (Flushed != null)
 				Flushed (this, EventArgs.Empty);
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog b/mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog
index f226f3a..7bdc5c9 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/ChangeLog
@@ -1,3 +1,22 @@
+2009-09-10  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DocumentDesigner.cs: Changing the ISelectionService at run time was a 
+	bad idea, so wrap it inside the extended UISelectionService instead.
+
+2009-09-10  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* DocumentDesigner.cs: If there is already a ISelectionService registered 
+	in the ServiceContainer but it's not an IUISelectionService (WinForms 
+	specific) then replace it with one.
+	[Fixes bug #538037]
+
+2009-09-09  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* ParentControlDesigner.cs, ControlDesigner.cs, UISelectionService.cs, 
+	IUISelectionService.cs: Support IToolboxService control creation via 
+	point-(resize)-click.
+	[Fixes part of bug #537604]
+
 2008-10-15  Ivan N. Zlatev  <contact at i-nz.net>
 
 	* StringCollectionEditor.cs: Minor fixes. 
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/ControlDesigner.cs b/mcs/class/System.Design/System.Windows.Forms.Design/ControlDesigner.cs
index 42a77fa..69ba60b 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/ControlDesigner.cs
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/ControlDesigner.cs
@@ -479,10 +479,10 @@ namespace System.Windows.Forms.Design
 			IUISelectionService uiSelection = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
 
 			if (_mouseDown) {
+				this.OnMouseDragEnd (false);
 				if (uiSelection != null && (uiSelection.SelectionInProgress || uiSelection.ResizeInProgress)) {
 					uiSelection.MouseDragEnd (false);
 				}
-				this.OnMouseDragEnd (false);
 				_mouseDown = false;
 			}
 			else {			  
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/DocumentDesigner.cs b/mcs/class/System.Design/System.Windows.Forms.Design/DocumentDesigner.cs
index f6b5025..14e6aa6 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/DocumentDesigner.cs
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/DocumentDesigner.cs
@@ -289,15 +289,14 @@ namespace System.Windows.Forms.Design
 
 		private void InitializeSelectionService ()
 		{
-			IServiceContainer serviceContainer = this.GetService (typeof (IServiceContainer)) as IServiceContainer;
-			if (serviceContainer.GetService (typeof (ISelectionService)) != null)
-				serviceContainer.RemoveService (typeof (ISelectionService));
-
-			UISelectionService selection = new UISelectionService (serviceContainer);
-			serviceContainer.AddService (typeof (ISelectionService), (ISelectionService) selection);
-			serviceContainer.AddService (typeof (IUISelectionService), (IUISelectionService) selection);
+			IUISelectionService guiSelectionService = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
+			if (guiSelectionService == null) {
+				IServiceContainer serviceContainer = this.GetService (typeof (IServiceContainer)) as IServiceContainer;
+				serviceContainer.AddService (typeof (IUISelectionService), (IUISelectionService) new UISelectionService (serviceContainer));
+			}
 
-			selection.SetSelectedComponents (new IComponent[] { this.Component });
+			ISelectionService selectionService = this.GetService (typeof (ISelectionService)) as ISelectionService;
+			selectionService.SetSelectedComponents (new IComponent[] { this.Component });
 		}
 
 #if !NET_2_0
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/IUISelectionService.cs b/mcs/class/System.Design/System.Windows.Forms.Design/IUISelectionService.cs
index b1e1277..3779ef7 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/IUISelectionService.cs
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/IUISelectionService.cs
@@ -51,6 +51,10 @@ namespace System.Windows.Forms.Design
 			get;
 		}
 
+		Rectangle SelectionBounds {
+			get;
+		}
+
 		void MouseDragBegin (Control container, int x, int y);
 		void MouseDragMove (int x, int y);
 		void MouseDragEnd (bool cancel);
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/ParentControlDesigner.cs b/mcs/class/System.Design/System.Windows.Forms.Design/ParentControlDesigner.cs
index df0a8ba..be8e0e6 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/ParentControlDesigner.cs
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/ParentControlDesigner.cs
@@ -152,7 +152,7 @@ namespace System.Windows.Forms.Design
 		// Creates a component from a ToolboxItem, sets its location and size if available and snaps it's
 		// location to the grid.
 		//
-		protected virtual IComponent[] CreateToolCore (ToolboxItem tool, int x, int y, int width,  int height,
+		protected virtual IComponent[] CreateToolCore (ToolboxItem tool, int x, int y, int width, int height,
 								bool hasLocation, bool hasSize)
 		{
 			if (tool == null)
@@ -174,6 +174,11 @@ namespace System.Windows.Forms.Design
 
 				Control control = component as Control;
 				if (control != null) {
+					this.Control.SuspendLayout ();
+					// set parent instead of controls.Add so that it gets serialized for Undo/Redo
+					TypeDescriptor.GetProperties (control)["Parent"].SetValue (control, this.Control);
+					this.Control.SuspendLayout ();
+
 					if (hasLocation)
 						base.SetValue (component, "Location", this.SnapPointToGrid (new Point (x, y)));
 					else
@@ -182,10 +187,6 @@ namespace System.Windows.Forms.Design
 					if (hasSize)
 						base.SetValue (component, "Size", new Size (width, height));
 
-					this.Control.SuspendLayout ();
-					// set parent instead of controls.Add so that it gets serialized for Undo/Redo
-					TypeDescriptor.GetProperties (control)["Parent"].SetValue (control, this.Control);
-					this.Control.SuspendLayout ();
 					this.Control.Refresh ();
 				}
 			}
@@ -470,7 +471,6 @@ namespace System.Windows.Forms.Design
 
 
 #region Design-Time Mouse Drag and Drop
-
 		protected override void OnMouseDragBegin (int x, int y)
 		{
 			// do not call base here because the behaviour is specific for the ControlDesgner (does IUISelectionService.DragBegin)
@@ -511,6 +511,28 @@ namespace System.Windows.Forms.Design
 		{
 			IUISelectionService selectionServ = this.GetService (typeof (IUISelectionService)) as IUISelectionService;
 			if (selectionServ != null) {
+				// If there is a Toolbox component seleted then create it instead of finishing the selection
+				IToolboxService toolBoxService = this.GetService (typeof (IToolboxService)) as IToolboxService;
+				if (!cancel && toolBoxService != null && toolBoxService.GetSelectedToolboxItem () != null) {
+					if (selectionServ.SelectionInProgress) {
+						bool hasSize = selectionServ.SelectionBounds.Width > 0 && 
+							       selectionServ.SelectionBounds.Height > 0;
+						CreateToolCore (toolBoxService.GetSelectedToolboxItem (),
+								selectionServ.SelectionBounds.X,
+								selectionServ.SelectionBounds.Y,
+								selectionServ.SelectionBounds.Width,
+								selectionServ.SelectionBounds.Height,
+								true, hasSize);
+						toolBoxService.SelectedToolboxItemUsed ();
+						cancel = true;
+					} else if (!selectionServ.SelectionInProgress && 
+						   !selectionServ.ResizeInProgress && !selectionServ.DragDropInProgress){
+						CreateTool (toolBoxService.GetSelectedToolboxItem (), _mouseDownPoint);
+						toolBoxService.SelectedToolboxItemUsed ();
+						cancel = true;
+					}
+				}
+
 				if (selectionServ.SelectionInProgress || selectionServ.ResizeInProgress)
 					selectionServ.MouseDragEnd (cancel);
 			}
@@ -523,12 +545,21 @@ namespace System.Windows.Forms.Design
 		}
 #endif
 
+		Point _mouseDownPoint = Point.Empty;
+
+		internal override void OnMouseDown (int x, int y)
+		{
+			_mouseDownPoint.X = x;
+			_mouseDownPoint.Y = y;
+			base.OnMouseDown (x, y);
+		}
+
 		internal override void OnMouseUp ()
 		{
 			base.OnMouseUp ();
-			if (!this.Control.AllowDrop) { // check MouseDragBegin for the reason of having this
+			if (!this.Control.AllowDrop) // check MouseDragBegin for the reason of having this
 				this.Control.AllowDrop = true;
-			}
+			_mouseDownPoint = Point.Empty;
 		}
 
 		internal override void OnMouseMove (int x, int y)
diff --git a/mcs/class/System.Design/System.Windows.Forms.Design/UISelectionService.cs b/mcs/class/System.Design/System.Windows.Forms.Design/UISelectionService.cs
index 2e0b9b4..4b2292a 100644
--- a/mcs/class/System.Design/System.Windows.Forms.Design/UISelectionService.cs
+++ b/mcs/class/System.Design/System.Windows.Forms.Design/UISelectionService.cs
@@ -38,19 +38,33 @@ using System.Windows.Forms;
 namespace System.Windows.Forms.Design
 {
 	
-	internal class UISelectionService : SelectionService, IUISelectionService
+	internal class UISelectionService : IUISelectionService
 	{
 
 		private IServiceProvider _serviceProvider;
 		private DesignerTransaction _transaction;
+		private ISelectionService _selectionService;
 
-		public UISelectionService (IServiceProvider serviceProvider) : base (serviceProvider)
+		public UISelectionService (IServiceProvider serviceProvider)
 		{
 			if (serviceProvider == null)
 				throw new ArgumentNullException ("serviceProvider");
 
 			_serviceProvider = serviceProvider;
 			_transaction = null;
+
+			_selectionService = serviceProvider.GetService (typeof (ISelectionService)) as ISelectionService;
+			if (_selectionService == null) {
+				IServiceContainer serviceContainer = serviceProvider.GetService (typeof (IServiceContainer)) as IServiceContainer;
+				_selectionService = new SelectionService (serviceContainer);
+				serviceContainer.AddService (typeof (ISelectionService), (ISelectionService) _selectionService);
+			}
+
+			_selectionService.SelectionChanged += new EventHandler (OnSelectionChanged);
+		}
+
+		private ISelectionService SelectionService {
+			get { return _selectionService; }
 		}
 
 		private object GetService (Type service)
@@ -92,11 +106,11 @@ namespace System.Windows.Forms.Design
 			SelectionFrame frame = GetSelectionFrameAt (x, y);
 			
 			if (frame != null && frame.HitTest (x, y)) {
-				this.SetSelectedComponents (new IComponent[] { frame.Control });
+				this.SelectionService.SetSelectedComponents (new IComponent[] { frame.Control });
 				if (_transaction == null) {
 					IDesignerHost host = this.GetService (typeof (IDesignerHost)) as IDesignerHost;
 					_transaction = host.CreateTransaction ("Resize " + 
-						(this.SelectionCount == 1 ? ((IComponent)this.PrimarySelection).Site.Name : "controls"));
+						(this.SelectionService.SelectionCount == 1 ? ((IComponent)this.SelectionService.PrimarySelection).Site.Name : "controls"));
 				}
 				this.ResizeBegin (x, y);
 			}
@@ -146,12 +160,12 @@ namespace System.Windows.Forms.Design
 			if (_transaction == null) {
 				IDesignerHost host = this.GetService (typeof (IDesignerHost)) as IDesignerHost;
 				_transaction = host.CreateTransaction ("Move " + 
-								       (this.SelectionCount == 1? ((IComponent)this.PrimarySelection).Site.Name : "controls"));
+								       (this.SelectionService.SelectionCount == 1? ((IComponent)this.SelectionService.PrimarySelection).Site.Name : "controls"));
 			}
 			_dragging = true;
 			_firstMove = true;
-			if (this.PrimarySelection != null)
-				((Control)this.PrimarySelection).DoDragDrop (new ControlDataObject ((Control)this.PrimarySelection), DragDropEffects.All);
+			if (this.SelectionService.PrimarySelection != null)
+				((Control)this.SelectionService.PrimarySelection).DoDragDrop (new ControlDataObject ((Control)this.SelectionService.PrimarySelection), DragDropEffects.All);
 		}
 		
 		// container cordinates
@@ -200,7 +214,7 @@ namespace System.Windows.Forms.Design
 				// Send mouse up message to the primary selection
 				// Else for parentcontroldesigner there is no mouseup event and it doesn't set allow drop back to false
 				//
-				Native.SendMessage (((Control)this.PrimarySelection).Handle, Native.Msg.WM_LBUTTONUP, (IntPtr) 0, (IntPtr) 0);
+				Native.SendMessage (((Control)this.SelectionService.PrimarySelection).Handle, Native.Msg.WM_LBUTTONUP, (IntPtr) 0, (IntPtr) 0);
 				if (_transaction != null) {
 					if (cancel)
 						_transaction.Cancel ();
@@ -216,15 +230,15 @@ namespace System.Windows.Forms.Design
 			bool reparent = false;
 			Control oldParent = null;
 			
-			if (((Control)this.PrimarySelection).Parent != container && !this.GetComponentSelected (container)) {
+			if (((Control)this.SelectionService.PrimarySelection).Parent != container && !this.SelectionService.GetComponentSelected (container)) {
 				reparent = true;
-				oldParent = ((Control)this.PrimarySelection).Parent;
+				oldParent = ((Control)this.SelectionService.PrimarySelection).Parent;
 			}
 			
 			// FIXME: Should check selectionstyle per control to determine if it's locked...
 			// if locked -> don't move
 			//
-			ICollection selection = this.GetSelectedComponents ();
+			ICollection selection = this.SelectionService.GetSelectedComponents ();
 			foreach (Component component in selection) {
 				Control control = component as Control;
 				if (reparent)
@@ -246,12 +260,18 @@ namespace System.Windows.Forms.Design
 
 
 #region Selection
+
 		private bool _selecting = false;
 		private Control _selectionContainer = null;
 		private Point _initialMousePosition;
 		private Rectangle _selectionRectangle;
 		// XXX
 		private ArrayList _selectionFrames = new ArrayList ();
+
+
+		public Rectangle SelectionBounds {
+			get { return _selectionRectangle; }
+		}
 		
 		// container coordinates
 		//
@@ -264,7 +284,7 @@ namespace System.Windows.Forms.Design
 			_initialMousePosition = _prevMousePosition;
 			_selectionRectangle = new Rectangle (x , y, 0, 0);
 		}
-		
+
 		private void SelectionContinue (int x, int y)
 		{
 			// Console.WriteLine ("SelectionContinue");
@@ -355,7 +375,7 @@ namespace System.Windows.Forms.Design
 			// do not change selection if nothing has changed
 			//
 			if (selectedControls.Count != 0)
-				this.SetSelectedComponents (selectedControls, SelectionTypes.Replace);
+				this.SelectionService.SetSelectedComponents (selectedControls, SelectionTypes.Replace);
 
 			_selectionContainer.Refresh ();
 		}
@@ -378,7 +398,7 @@ namespace System.Windows.Forms.Design
 		{
 			// Console.WriteLine ("ResizeContinue");
 			Rectangle deltaBounds = _selectionFrame.ResizeContinue (x, y);
-			ICollection selection = this.GetSelectedComponents ();
+			ICollection selection = this.SelectionService.GetSelectedComponents ();
 
 			foreach (IComponent component in selection) {
 				if (component is Control) {
@@ -439,10 +459,10 @@ namespace System.Windows.Forms.Design
 		{
 			IDesignerHost host = this.GetService (typeof (IDesignerHost)) as IDesignerHost;
 
-			if (host == null || !(this.PrimarySelection is Control))
+			if (host == null || !(this.SelectionService.PrimarySelection is Control))
 				 return;
 
-			if ((Control)this.PrimarySelection == container) {
+			if ((Control)this.SelectionService.PrimarySelection == container) {
 				if (_selecting) {
 					Color negativeColor = Color.FromArgb ((byte)~(_selectionContainer.BackColor.R),
 						 (byte)~(_selectionContainer.BackColor.G),
@@ -450,7 +470,7 @@ namespace System.Windows.Forms.Design
 					DrawSelectionRectangle (gfx, _selectionRectangle, negativeColor);
 				}
 			}
-			else if (((Control)this.PrimarySelection).Parent == container) {
+			else if (((Control)this.SelectionService.PrimarySelection).Parent == container) {
 				foreach (SelectionFrame frame in _selectionFrames)
 					frame.OnPaint (gfx);
 			}
@@ -465,10 +485,9 @@ namespace System.Windows.Forms.Design
 		}
 		
 		
-		protected override void OnSelectionChanged ()
+		private void OnSelectionChanged (object sender, EventArgs args)
 		{
-
-			ICollection selection = this.GetSelectedComponents ();
+			ICollection selection = this.SelectionService.GetSelectedComponents ();
 			
 			if (_selectionFrames.Count == 0) {
 				foreach (Component component in selection) {
@@ -496,8 +515,6 @@ namespace System.Windows.Forms.Design
 				else
 					root.Refresh ();
 			}
-			
-			base.OnSelectionChanged ();
 		}
 		
 		private ICollection GetControlsIn (Rectangle rect)
diff --git a/mcs/class/System.Drawing/System.Drawing/ChangeLog b/mcs/class/System.Drawing/System.Drawing/ChangeLog
index 040c26f..c2dc9d0 100644
--- a/mcs/class/System.Drawing/System.Drawing/ChangeLog
+++ b/mcs/class/System.Drawing/System.Drawing/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-13 Marek Safar  <marek.safar at gmail.com>
+
+	* KnownColors.cs: FindColorMatch has to match only predefined color
+	names ignoring system elements.
+
+	* ColorTranslator.cs: Add more predefined names.
+
+2009-07-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Font.cs: implement OriginalFontName.
+
+2009-07-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* gdipFunctions.cs: Fix XVisualIDFromVisual to return an IntPtr
+	since 64 bits X servers will return a 64 bits value.
+	* gdipStructs.cs: Fix XVisualInfo to use IntPtr on fields that
+	are 64 bits on 64 bits X servers.
+	* Graphics.cs: Adjust CopyFromScreenX11 to work with IntPtr so the
+	screenshot code can work on both 32 and 64 bits X servers.
+	[Fix bug #521718]
+	[Backport r137982]
+
 2008-11-24  Geoff Norton  <gnorton at novell.com>
 
 	* gdipFunctions.cs: Ensure that System.Drawing works on the mac as 
diff --git a/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs b/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
index b8c20e2..101a3b3 100644
--- a/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
+++ b/mcs/class/System.Drawing/System.Drawing/ColorTranslator.cs
@@ -45,13 +45,25 @@ namespace System.Drawing {
 			if ((htmlColor == null) || (htmlColor.Length == 0))
 				return Color.Empty;
 
+#if NET_2_0
+			switch (htmlColor.ToLowerInvariant ()) {
+#else
 			switch (htmlColor.ToLower ()) {
+#endif
 			case "buttonface":
+			case "threedface":		
 				return SystemColors.Control;
+			case "buttonhighlight":
+			case "threedlightshadow":
+				return SystemColors.ControlLightLight;
+			case "buttonshadow":
+				return SystemColors.ControlDark;
 			case "captiontext":
 				return SystemColors.ActiveCaptionText;
 			case "threeddarkshadow":
 				return SystemColors.ControlDarkDark;
+			case "threedhighlight":
+				return SystemColors.ControlLight;
 			case "background":
 				return SystemColors.Desktop;
 			case "buttontext":
@@ -62,6 +74,7 @@ namespace System.Drawing {
 			case "lightgrey":
 				return Color.LightGray;
 			}
+			
 			TypeConverter converter = TypeDescriptor.GetConverter (typeof (Color));
 			return (Color) converter.ConvertFromString (htmlColor);
 		}
diff --git a/mcs/class/System.Drawing/System.Drawing/Font.cs b/mcs/class/System.Drawing/System.Drawing/Font.cs
index ecf616d..6b16e44 100644
--- a/mcs/class/System.Drawing/System.Drawing/Font.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Font.cs
@@ -47,6 +47,7 @@ namespace System.Drawing
 		private IntPtr	fontObject = IntPtr.Zero;
 #if NET_2_0		
 		private string  systemFontName;
+		private string  originalFontName;
 #endif		
 		private float _size;
 		private object olf;
@@ -60,6 +61,9 @@ namespace System.Drawing
 			if (familyName == null)
 				throw new ArgumentNullException ("familyName");
 #endif
+#if NET_2_0
+			originalFontName = familyName;
+#endif
                         FontFamily family;
 			// NOTE: If family name is null, empty or invalid,
 			// MS creates Microsoft Sans Serif font.
@@ -503,6 +507,13 @@ namespace System.Drawing
 				return systemFontName;
 			}
 		}
+
+		[Browsable(false)]
+		public string OriginalFontName {
+			get {
+				return originalFontName;
+			}
+		}
 #endif
 		private bool _underline;
 
diff --git a/mcs/class/System.Drawing/System.Drawing/Graphics.cs b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
index 920262e..48a379b 100644
--- a/mcs/class/System.Drawing/System.Drawing/Graphics.cs
+++ b/mcs/class/System.Drawing/System.Drawing/Graphics.cs
@@ -221,39 +221,52 @@ namespace System.Drawing
 				throw new NotImplementedException ("Operation not implemented under X11");
 		
 			if (GDIPlus.Display == IntPtr.Zero) {
-				GDIPlus.Display = GDIPlus.XOpenDisplay (IntPtr.Zero);					
+				GDIPlus.Display = GDIPlus.XOpenDisplay (IntPtr.Zero);
 			}
 
 			window = GDIPlus.XRootWindow (GDIPlus.Display, 0);
-			defvisual = GDIPlus.XDefaultVisual (GDIPlus.Display, 0);				
+			defvisual = GDIPlus.XDefaultVisual (GDIPlus.Display, 0);
 			XVisualInfo visual = new XVisualInfo ();
 
 			/* Get XVisualInfo for this visual */
 			visual.visualid = GDIPlus.XVisualIDFromVisual(defvisual);
 			vPtr = GDIPlus.XGetVisualInfo (GDIPlus.Display, 0x1 /* VisualIDMask */, ref visual, ref nitems);
 			visual = (XVisualInfo) Marshal.PtrToStructure(vPtr, typeof (XVisualInfo));
-
-			/* Sorry I do not have access to a computer with > deepth. Fell free to add more pixel formats */	
+#if false
+			Console.WriteLine ("visual\t{0}", visual.visual);
+			Console.WriteLine ("visualid\t{0}", visual.visualid);
+			Console.WriteLine ("screen\t{0}", visual.screen);
+			Console.WriteLine ("depth\t{0}", visual.depth);
+			Console.WriteLine ("klass\t{0}", visual.klass);
+			Console.WriteLine ("red_mask\t{0:X}", visual.red_mask);
+			Console.WriteLine ("green_mask\t{0:X}", visual.green_mask);
+			Console.WriteLine ("blue_mask\t{0:X}", visual.blue_mask);
+			Console.WriteLine ("colormap_size\t{0}", visual.colormap_size);
+			Console.WriteLine ("bits_per_rgb\t{0}", visual.bits_per_rgb);
+#endif
 			image = GDIPlus.XGetImage (GDIPlus.Display, window, sourceX, sourceY, blockRegionSize.Width,
 				blockRegionSize.Height, AllPlanes, 2 /* ZPixmap*/);
 				
 			Bitmap bmp = new Bitmap (blockRegionSize.Width, blockRegionSize.Height);
 			int red, blue, green;
+			int red_mask = (int) visual.red_mask;
+			int blue_mask = (int) visual.blue_mask;
+			int green_mask = (int) visual.green_mask;
 			for (int y = 0; y < blockRegionSize.Height; y++) {
 				for (int x = 0; x < blockRegionSize.Width; x++) {
 					pixel = GDIPlus.XGetPixel (image, x, y);
 
 					switch (visual.depth) {
 						case 16: /* 16bbp pixel transformation */
-							red = (int) ((pixel & visual.red_mask ) >> 8) & 0xff;
-							green = (int) (((pixel & visual.green_mask ) >> 3 )) & 0xff;
-							blue = (int) ((pixel & visual.blue_mask ) << 3 ) & 0xff;
+							red = (int) ((pixel & red_mask ) >> 8) & 0xff;
+							green = (int) (((pixel & green_mask ) >> 3 )) & 0xff;
+							blue = (int) ((pixel & blue_mask ) << 3 ) & 0xff;
 							break;
 						case 24:
 						case 32:
-							red = (int) ((pixel & visual.red_mask ) >> 16) & 0xff;
-							green = (int) (((pixel & visual.green_mask ) >> 8 )) & 0xff;
-							blue = (int) ((pixel & visual.blue_mask )) & 0xff;
+							red = (int) ((pixel & red_mask ) >> 16) & 0xff;
+							green = (int) (((pixel & green_mask ) >> 8 )) & 0xff;
+							blue = (int) ((pixel & blue_mask )) & 0xff;
 							break;
 						default:
 							string text = Locale.GetText ("{0}bbp depth not supported.", visual.depth);
diff --git a/mcs/class/System.Drawing/System.Drawing/KnownColors.cs b/mcs/class/System.Drawing/System.Drawing/KnownColors.cs
index 3873df5..5773a0d 100644
--- a/mcs/class/System.Drawing/System.Drawing/KnownColors.cs
+++ b/mcs/class/System.Drawing/System.Drawing/KnownColors.cs
@@ -39,6 +39,7 @@ namespace System.Drawing {
 		{
 		}
 #endif
+		// FindColorMatch relies on the index + 1 == KnowColor match
 		static internal uint[] ArgbValues = new uint[] {
 			0x00000000,	/* 000 - Empty */
 			0xFFD4D0C8,	/* 001 - ActiveBorder */
@@ -489,13 +490,20 @@ namespace System.Drawing {
 			return GetName ((short)kc);
 		}
 
+		// FIXME: Linear scan
 		public static Color FindColorMatch (Color c)
 		{
 			uint argb = (uint) c.ToArgb ();
-			for (int i = 0; i < KnownColors.ArgbValues.Length; i++) {
+			
+			// 1-based
+			const int first_real_color_index = (int) KnownColor.AliceBlue;
+			const int last_real_color_index = (int) KnownColor.YellowGreen;
+			
+			for (int i = first_real_color_index - 1; i < last_real_color_index; i++) {
 				if (argb == KnownColors.ArgbValues [i])
 					return KnownColors.FromKnownColor ((KnownColor)i);
-                        }
+			}
+			
 			return Color.Empty;
 		}
 
diff --git a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
index bec9689..ec8839c 100644
--- a/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
+++ b/mcs/class/System.Drawing/System.Drawing/gdipFunctions.cs
@@ -1515,7 +1515,7 @@ namespace System.Drawing
 		internal extern static IntPtr XGetVisualInfo (IntPtr display, int vinfo_mask, ref XVisualInfo vinfo_template, ref int nitems);
 
 		[DllImport ("libX11", EntryPoint="XVisualIDFromVisual")]
-		internal extern static int XVisualIDFromVisual(IntPtr visual);
+		internal extern static IntPtr XVisualIDFromVisual (IntPtr visual);
 
 		[DllImport ("libX11", EntryPoint="XFree")]
 		internal extern static void XFree (IntPtr data);	
diff --git a/mcs/class/System.Drawing/System.Drawing/gdipStructs.cs b/mcs/class/System.Drawing/System.Drawing/gdipStructs.cs
index 7099c1a..58aae40 100644
--- a/mcs/class/System.Drawing/System.Drawing/gdipStructs.cs
+++ b/mcs/class/System.Drawing/System.Drawing/gdipStructs.cs
@@ -198,13 +198,13 @@ namespace System.Drawing
 	internal struct XVisualInfo
 	{
 		internal IntPtr visual;
-		internal int visualid;
+		internal IntPtr visualid;
 		internal int screen;
 		internal uint depth;
 		internal int klass;
-		internal uint red_mask;
-		internal uint green_mask;
-		internal uint blue_mask;
+		internal IntPtr red_mask;
+		internal IntPtr green_mask;
+		internal IntPtr blue_mask;
 		internal int colormap_size;
 		internal int bits_per_rgb;		
 	}
diff --git a/mcs/class/System.Net/System.Net.dll.sources b/mcs/class/System.Net/System.Net.dll.sources
index 0135bb6..bd353e7 100644
--- a/mcs/class/System.Net/System.Net.dll.sources
+++ b/mcs/class/System.Net/System.Net.dll.sources
@@ -84,6 +84,7 @@ System.Net.Sockets/SocketSecurityState.cs
 ../System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
 ../System/System.Net.NetworkInformation/IPv6InterfaceProperties.cs
 ../System/System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs
+../System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs
 ../System/System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs
 ../System/System.Net.NetworkInformation/MulticastIPAddressInformation.cs
 ../System/System.Net.NetworkInformation/NetBiosNodeType.cs
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointListener.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointListener.cs
index 52ad455..deb7922 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointListener.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointListener.cs
@@ -38,7 +38,6 @@ using System.Security.Cryptography.X509Certificates;
 using Mono.Security.Authenticode;
 
 using System; using System.Net; namespace MonoHttp {
-	
 	sealed class EndPointListener : IHttpListenerContextBinder
 	{
 		IPEndPoint endpoint;
@@ -66,6 +65,7 @@ using System; using System.Net; namespace MonoHttp {
 			sock.BeginAccept (OnAccept, this);
 			prefixes = new Hashtable ();
 		}
+
 #if !EMBEDDED_IN_1_0
 		void LoadCertificateAndKey (IPAddress addr, int port)
 		{
@@ -83,6 +83,7 @@ using System; using System.Net; namespace MonoHttp {
 			}
 		}
 #endif
+
 		static void OnAccept (IAsyncResult ares)
 		{
 			EndPointListener epl = (EndPointListener) ares.AsyncState;
@@ -317,6 +318,7 @@ try { raw_uri = new Uri (raw_url); } catch { raw_uri = null; } if (raw_uri != nu
 
 				if (prefixes.ContainsKey (prefix)) {
 					prefixes.Remove (prefix);
+					CheckIfRemove ();
 				}
 			}
 		}
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointManager.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointManager.cs
index 7ca0117..3e2934e 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointManager.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/EndPointManager.cs
@@ -54,7 +54,7 @@ using System; using System.Net; namespace MonoHttp {
 				}
 			} catch {
 				foreach (string prefix in added) {
-					RemovePrefixInternal (prefix, listener);
+					RemovePrefix (prefix, listener);
 				}
 				throw;
 			}
@@ -109,6 +109,9 @@ using System; using System.Net; namespace MonoHttp {
 				Hashtable p = null;
 				p = (Hashtable) ip_to_endpoints [ep.Address];
 				p.Remove (ep.Port);
+				if (p.Count == 0) {
+					ip_to_endpoints.Remove (ep.Address);
+				}
 				epl.Close ();
 			}
 		}
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpConnection.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpConnection.cs
index cd0121c..5016883 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpConnection.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpConnection.cs
@@ -36,18 +36,17 @@ using System.Reflection;
 using System.Text;
 using System.Security.Cryptography;
 using System.Security.Cryptography.X509Certificates;
-
 #if !EMBEDDED_IN_1_0
 using Mono.Security.Protocol.Tls;
 #endif
 
 using System; using System.Net; namespace MonoHttp {
-	
+
 	interface IHttpListenerContextBinder {
 		bool BindContext (HttpListenerContext context);
 		void UnbindContext (HttpListenerContext context);
 	}
-	
+
 	sealed class HttpConnection
 	{
 		const int BufferSize = 8192;
@@ -64,6 +63,8 @@ using System; using System.Net; namespace MonoHttp {
 		bool chunked;
 		int chunked_uses;
 		bool context_bound;
+		bool secure;
+		AsymmetricAlgorithm key;
 
 #if EMBEDDED_IN_1_0
 		public HttpConnection (Socket sock, IHttpListenerContextBinder epl)
@@ -83,15 +84,24 @@ using System; using System.Net; namespace MonoHttp {
 			if (secure == false) {
 				stream = new NetworkStream (sock, false);
 			} else {
+#if EMBEDDED_IN_1_0
+				throw new NotImplementedException ();
+#else
 				SslServerStream ssl_stream = new SslServerStream (new NetworkStream (sock, false), cert, false, false);
 				ssl_stream.PrivateKeyCertSelectionDelegate += OnPVKSelection;
 				stream = ssl_stream;
-
+#endif
 			}
 			Init ();
 		}
 #endif
 
+		AsymmetricAlgorithm OnPVKSelection (X509Certificate certificate, string targetHost)
+		{
+			return key;
+		}
+
+
 		void Init ()
 		{
 			context_bound = false;
@@ -119,7 +129,7 @@ using System; using System.Net; namespace MonoHttp {
 		}
 
 		public bool IsSecure {
-			get { return false; }
+			get { return secure; }
 		}
 
 		public ListenerPrefix Prefix {
@@ -159,6 +169,7 @@ using System; using System.Net; namespace MonoHttp {
 		{
 			// TODO: can we get this stream before reading the input?
 			if (o_stream == null) {
+				HttpListener listener = context.Listener;
 				bool ign = false;// ? true : listener.IgnoreWriteExceptions;
 				o_stream = new ResponseStream (stream, context.Response, ign);
 			}
@@ -173,7 +184,7 @@ using System; using System.Net; namespace MonoHttp {
 			try {
 				nread = stream.EndRead (ares);
 				ms.Write (buffer, 0, nread);
-			} catch (Exception) {
+			} catch (Exception e) {
 				//Console.WriteLine (e);
 				if (ms.Length > 0)
 					SendError ();
@@ -311,8 +322,21 @@ using System; using System.Net; namespace MonoHttp {
 			SendError (context.ErrorMessage, context.ErrorStatus);
 		}
 
+		void Unbind ()
+		{
+			if (context_bound) {
+				epl.UnbindContext (context);
+				context_bound = false;
+			}
+		}
+
 		public void Close ()
 		{
+			Close (false);
+		}
+
+		internal void Close (bool force_close)
+		{
 			if (sock != null) {
 				Stream st = GetResponseStream ();
 				st.Close ();
@@ -320,15 +344,16 @@ using System; using System.Net; namespace MonoHttp {
 			}
 
 			if (sock != null) {
-				if (chunked && context.Response.ForceCloseChunked == false) {
+				if (!force_close && chunked && context.Response.ForceCloseChunked == false) {
 					// Don't close. Keep working.
 					chunked_uses++;
+					Unbind ();
 					Init ();
 					BeginReadRequest ();
 					return;
 				}
 
-				if (context.Response.Headers ["connection"] == "close") {
+				if (force_close || context.Response.Headers ["connection"] == "close") {
 					Socket s = sock;
 					sock = null;
 					try {
@@ -337,14 +362,13 @@ using System; using System.Net; namespace MonoHttp {
 					} finally {
 						s.Close ();
 					}
+					Unbind ();
 				} else {
+					Unbind ();
 					Init ();
 					BeginReadRequest ();
 					return;
 				}
-
-				if (context_bound)
-					epl.UnbindContext (context);
 			}
 		}
 	}
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerPrefixCollection.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerPrefixCollection.cs
index e98b0b2..2c7b38a 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerPrefixCollection.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerPrefixCollection.cs
@@ -74,9 +74,9 @@ using System; using System.Net; namespace MonoHttp {
 		public void Clear ()
 		{
 			listener.CheckDisposed ();
+			prefixes.Clear ();
 			if (listener.IsListening)
 				EndPointManager.RemoveListener (listener);
-			prefixes.Clear ();
 		}
 
 		public bool Contains (string uriPrefix)
@@ -105,7 +105,6 @@ using System; using System.Net; namespace MonoHttp {
 #else
 		object ICollection.SyncRoot { get { return this; } }
 #endif
-
 	
 		IEnumerator IEnumerable.GetEnumerator ()
 		{
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerResponse.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerResponse.cs
index dc3bdbc..a53942a 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerResponse.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/HttpListenerResponse.cs
@@ -333,8 +333,7 @@ using System; using System.Net; namespace MonoHttp {
 
 		void Close (bool force)
 		{
-			// TODO: use the 'force' argument
-			context.Connection.Close ();
+			context.Connection.Close (force);
 			disposed = true;
 		}
 
diff --git a/mcs/class/System.Runtime.Remoting/MonoHttp/WebHeaderCollection.cs b/mcs/class/System.Runtime.Remoting/MonoHttp/WebHeaderCollection.cs
index 763e384..dd582ca 100644
--- a/mcs/class/System.Runtime.Remoting/MonoHttp/WebHeaderCollection.cs
+++ b/mcs/class/System.Runtime.Remoting/MonoHttp/WebHeaderCollection.cs
@@ -35,6 +35,9 @@
 
 using System;
 using System.Collections;
+#if EMBEDDED_IN_1_0
+using System.Collections.Generic;
+#endif
 using System.Collections.Specialized;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
@@ -73,7 +76,9 @@ using System; using System.Net; namespace MonoHttp
 			restricted.Add ("referer", true);
 			restricted.Add ("transfer-encoding", true);
 			restricted.Add ("user-agent", true);			
-			
+			restricted.Add ("proxy-connection", true);			
+
+			//
 			// see par 14 of RFC 2068 to see which header names
 			// accept multiple values each separated by a comma
 			multiValue = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
@@ -245,14 +250,25 @@ using System; using System.Net; namespace MonoHttp
 			if (headerName == "") // MS throw nullexception here!
 				throw new ArgumentException ("empty string", "headerName");
 
+			if (!IsHeaderName (headerName))
+				throw new ArgumentException ("Invalid character in header");
+
 			return restricted.ContainsKey (headerName);
 		}
 
 #if EMBEDDED_IN_1_0
-		[MonoNotSupported("")]
 		public static bool IsRestricted (string headerName, bool response)
 		{
-			throw new NotImplementedException ();
+			if (headerName == null || headerName.Length == 0)
+				throw new ArgumentNullException ("headerName");
+
+			if (!IsHeaderName (headerName))
+				throw new ArgumentException ("Invalid character in header");
+
+
+			if (response)
+				return false;
+			return restricted.ContainsKey (headerName);
 		}
 #endif
 
@@ -570,9 +586,7 @@ using System; using System.Net; namespace MonoHttp
 			}
 		}
 
-
-#endif
-#if EMBEDDED_IN_1_0 && !EMBEDDED_IN_1_0
+#if !EMBEDDED_IN_1_0
 		public override void Clear ()
 		{
 			base.Clear ();
@@ -584,6 +598,7 @@ using System; using System.Net; namespace MonoHttp
 			return(base.GetEnumerator ());
 		}
 #endif
+#endif
 
 		// Internal Methods
 		
@@ -668,31 +683,30 @@ using System; using System.Net; namespace MonoHttp
 		
 		internal static bool IsHeaderName (string name)
 		{
-			// token          = 1*<any CHAR except CTLs or tspecials>
-			// tspecials      = "(" | ")" | "<" | ">" | "@"
-			//                | "," | ";" | ":" | "\" | <">
-			//                | "/" | "[" | "]" | "?" | "="
-			//                | "{" | "}" | SP | HT
-			
 			if (name == null || name.Length == 0)
 				return false;
 
 			int len = name.Length;
 			for (int i = 0; i < len; i++) {			
 				char c = name [i];
-				if (c < 0x20 || c >= 0x7f)
+				if (c > 126 || !allowed_chars [(int) c])
 					return false;
 			}
 			
-			return name.IndexOfAny (tspecials) == -1;
+			return true;
 		}
 
-		private static char [] tspecials = 
-				new char [] {'(', ')', '<', '>', '@',
-					     ',', ';', ':', '\\', '"',
-					     '/', '[', ']', '?', '=',
-					     '{', '}', ' ', '\t'};
-							
+		static bool [] allowed_chars = new bool [126] {
+			false, false, false, false, false, false, false, false, false, false, false, false, false, false,
+			false, false, false, false, false, false, false, false, false, false, false, false, false, false,
+			false, false, false, false, false, true, false, true, true, true, true, false, false, false, true,
+			true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false,
+			false, false, false, false, false, false, true, true, true, true, true, true, true, true, true,
+			true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			false, true, false
+			};
 	}
 }
 
diff --git a/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs b/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs
index 5509eb7..a44bd8f 100644
--- a/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/BaseCalls.cs
@@ -193,18 +193,21 @@ namespace MonoTests.Remoting
 		}
 
 		[Test]
+		[Ignore ("Fails on MS")]
 		public void TestInstanceComplexParamsInOut ()
 		{
 			RunTestComplexParamsInOut (InternalGetInstanceSurrogate());
 		}
 
 		[Test]
+		[Ignore ("Fails on MS")]
 		public void TestAbstractComplexParamsInOut ()
 		{
 			RunTestComplexParamsInOut (InternalGetAbstractSurrogate());
 		}
 
 		[Test]
+		[Ignore ("Fails on MS")]
 		public void TestInterfaceComplexParamsInOut ()
 		{
 			RunTestComplexParamsInOut (InternalGetInterfaceSurrogate());
diff --git a/mcs/class/System.Runtime.Remoting/Test/ChangeLog b/mcs/class/System.Runtime.Remoting/Test/ChangeLog
index 2f3514c..9250c6a 100644
--- a/mcs/class/System.Runtime.Remoting/Test/ChangeLog
+++ b/mcs/class/System.Runtime.Remoting/Test/ChangeLog
@@ -1,3 +1,28 @@
+2009-09-12 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpServerChannelTests.cs:
+	* BaseCalls.cs:
+	* System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs: ignore tests
+	that fail on MS.NET.
+
+2009-05-24  Robert Jordan  <robertj at gmx.net>
+
+	* GenericTest.cs: differentiate between "Test(int)" and
+	"Test<int>(int)" to prove that the correct method is invoked.
+
+2009-05-24  Robert Jordan  <robertj at gmx.net>
+
+	* GenericTest.cs (TestCrossAppDomainChannel): disable on MS.NET as
+	some generic calls do not seem to be supported anymore. It looks
+	like a bug, though, since the same tests are passing when performed
+	over the TCP channel.
+
+2009-05-24  Robert Jordan  <robertj at gmx.net>
+
+	* GenericTest.cs (TestTcpChannel): create a unique channel and
+	unregister it upon termination. Fixes issues that were uncovered
+	by the NUnit upgrade (see Atsushi's changelogs below).
+
 2009-01-07  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* RemotingServicesTest.cs : mark failing test as NotWorking, and 
diff --git a/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs b/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs
index 8488a8d..f755e43 100644
--- a/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/GenericTest.cs
@@ -8,6 +8,7 @@
 #if NET_2_0
 
 using System;
+using System.Collections;
 using System.Runtime.Remoting;
 using System.Runtime.Remoting.Channels;
 using System.Runtime.Remoting.Channels.Tcp;
@@ -96,7 +97,7 @@ namespace MonoTests.Remoting
 		
 		public int Test (int i)
 		{
-			return i;
+			return i + 500;
 		}
 
 		int INested.Test (int a, int b)
@@ -129,7 +130,7 @@ namespace MonoTests.Remoting
 
 		public int Test (int i)
 		{
-			return i;
+			return i + 500;
 		}
 
 		int INested.Test (int a, int b)
@@ -152,33 +153,51 @@ namespace MonoTests.Remoting
 	[TestFixture]
 	public class GenericTest
 	{
+		// Under MS.NET, INested.Test<V>(V v) isn't supported over the
+		// xappdom channel anymore (as of .NET 3.5). The stacktrace
+		// looks like if INested.Test(int) is invoked in place of
+		// INested.Test<int>(int).
+		[Category("NotDotNet")]
 		[Test]
 		public void TestCrossAppDomainChannel ()
 		{
-			RunTests (GetRemObject <Server<object>> ());
+			RunTests (RegisterAndConnect <Server<object>> ());
 		}
 
 		[Test]
-		[Ignore ("disabled as it got not working by NUnit upgrade to 2.4.8 (applies to .NET too)")]
 		public void TestTcpChannel ()
 		{
-			RunTests (GetRemObjectTcp <Server<object>> ());
+			IDictionary props = new Hashtable ();
+			props ["name"] = Guid.NewGuid ().ToString("N");
+			props ["port"] = 18191;
+			TcpChannel chan = new TcpChannel (props, null, null);
+			ChannelServices.RegisterChannel (chan);
+			
+			try {
+				Register <Server<object>> ("gentcptest.rem");
+				RunTests (Connect <Server<object>> ("tcp://localhost:18191/gentcptest.rem"));
+			} finally {
+				ChannelServices.UnregisterChannel (chan);
+			}
 		}
 
-		static T GetRemObject <T> () where T: MarshalByRefObject
+		static T RegisterAndConnect <T> () where T: MarshalByRefObject
 		{
-			AppDomain d = BaseCallTest.CreateDomain ("Foo");
+			AppDomain d = BaseCallTest.CreateDomain ("GenericTests");
 			return (T) d.CreateInstanceAndUnwrap (
 				typeof (T).Assembly.FullName,
 				typeof (T).FullName);
 		}
 
-		static T GetRemObjectTcp <T> () where T: MarshalByRefObject
+		static void Register <T> (string uri) where T: MarshalByRefObject
 		{
-			new TcpChannel (18191);
 			object obj = Activator.CreateInstance (typeof(T));
-			RemotingServices.Marshal ((MarshalByRefObject)obj, "test.rem");
-			return (T) RemotingServices.Connect (typeof (T), "tcp://localhost:18191/test.rem");
+			RemotingServices.Marshal ((MarshalByRefObject)obj, uri);
+		}
+
+		static T Connect <T> (string uri) where T: MarshalByRefObject
+		{
+			return (T) RemotingServices.Connect (typeof (T), uri);
 		}
 
 		static void RunTests (ServerBase<object> rem)
@@ -200,7 +219,7 @@ namespace MonoTests.Remoting
 			Assert.AreEqual (42, cao.Test (),
 					 "#5a calling INested.Test ()");
 
-			Assert.AreEqual (42, cao.Test (42),
+			Assert.AreEqual (42 + 500, cao.Test (42),
 					 "#5 calling INested.Test (int)");
 
 			Assert.AreEqual (42, cao.Test (21, 21),
@@ -216,7 +235,7 @@ namespace MonoTests.Remoting
 			Assert.AreEqual (42, cao.Test (),
 					 "#9a calling INested.Test ()");
 
-			Assert.AreEqual (42, cao.Test (42),
+			Assert.AreEqual (42 + 500, cao.Test (42),
 					 "#9 calling INested.Test (int)");
 
 			Assert.AreEqual (42, cao.Test (21, 21),
diff --git a/mcs/class/System.Runtime.Remoting/Test/HttpServerChannelTests.cs b/mcs/class/System.Runtime.Remoting/Test/HttpServerChannelTests.cs
index 3a0ad78..673a5c7 100644
--- a/mcs/class/System.Runtime.Remoting/Test/HttpServerChannelTests.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/HttpServerChannelTests.cs
@@ -93,6 +93,7 @@ namespace MonoTests.Remoting {
 		};
 		
 		[Test] // HttpChannel.Parse ()
+		[Ignore ("Fails on MS")]
 		public void ParseURL ()
 		{
 			HttpChannel channel;
diff --git a/mcs/class/System.Runtime.Remoting/Test/System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs b/mcs/class/System.Runtime.Remoting/Test/System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs
index 48ef148..9074921 100644
--- a/mcs/class/System.Runtime.Remoting/Test/System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs
+++ b/mcs/class/System.Runtime.Remoting/Test/System.Runtime.Remoting.Channels.Tcp/TcpChannelTest.cs
@@ -161,6 +161,7 @@ namespace MonoTests.Remoting
 		
 		[Test]
 		[Category ("NotWorking")]  // seems to hang - "too many open files" ???
+		[Ignore ("Fails on MS")]
 		public void TestTcpRemoting ()
 		{
 			TcpServerChannel serverChannel = GetServerChannel ("TcpRemotingTest", 9090);
diff --git a/mcs/class/System.Web.Abstractions/System.Web/ChangeLog b/mcs/class/System.Web.Abstractions/System.Web/ChangeLog
index 8a2c3f4..5988165 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/ChangeLog
+++ b/mcs/class/System.Web.Abstractions/System.Web/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpResponseWrapper.cs: removed a few TODO/NotImplemented.
+	Fixes bug #526297.
+
+2009-06-16  Marek Habersack  <mhabersack at novell.com>
+
+	* Decorated all classes with the TypeForwardedFrom attribute for
+	the 4.0 profile.
+
 2008-09-09  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* HttpApplicationStateBase.cs
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateBase.cs
index a645f55..f0c6bd0 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateBase.cs
@@ -32,12 +32,16 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpApplicationStateBase : NameObjectCollectionBase, ICollection, IEnumerable
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateWrapper.cs
index cd9c722..c9c5a67 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpApplicationStateWrapper.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -39,6 +40,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpApplicationStateWrapper : HttpApplicationStateBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesBase.cs
index 8a13b3a..2a6376c 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesBase.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -39,6 +40,9 @@ using System.Web.UI;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpBrowserCapabilitiesBase : IFilterResolutionService
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesWrapper.cs
index 6ca7bd1..9185dae 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpBrowserCapabilitiesWrapper.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -39,6 +40,9 @@ using System.Web.UI;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpBrowserCapabilitiesWrapper : HttpBrowserCapabilitiesBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyBase.cs
index 324852b..6f99f89 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyBase.cs
@@ -31,12 +31,16 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpCachePolicyBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyWrapper.cs
index 337af5e..e604fc7 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpCachePolicyWrapper.cs
@@ -31,12 +31,16 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpCachePolicyWrapper : HttpCachePolicyBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs
index 117e55d..5b9d0de 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpContextBase.cs
@@ -31,6 +31,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -38,6 +39,9 @@ using System.Web.Profile;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpContextBase : IServiceProvider
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs
index 1607f0d..4476eaa 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpContextWrapper.cs
@@ -31,6 +31,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -38,6 +39,9 @@ using System.Web.Profile;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpContextWrapper : HttpContextBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionBase.cs
index 5e28c7a..d542aa3 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionBase.cs
@@ -32,12 +32,16 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpFileCollectionBase : NameObjectCollectionBase, ICollection, IEnumerable
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs
index e18799e..adabe2f 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpFileCollectionWrapper.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -39,6 +40,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpFileCollectionWrapper : HttpFileCollectionBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileBase.cs
index e2b9c32..96b59da 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileBase.cs
@@ -31,12 +31,16 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpPostedFileBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileWrapper.cs
index 7644e85..5aea5a5 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpPostedFileWrapper.cs
@@ -31,12 +31,16 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpPostedFileWrapper : HttpPostedFileBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpRequestBase.cs
index a838625..7330cca 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpRequestBase.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -41,6 +42,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpRequestBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs
index 6669481..5fe42d1 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpRequestWrapper.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -41,6 +42,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpRequestWrapper : HttpRequestBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpResponseBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpResponseBase.cs
index bcd2f1a..4feeaa4 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpResponseBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpResponseBase.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -41,6 +42,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpResponseBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs
index f6028c6..b196598 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpResponseWrapper.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Runtime.Serialization;
 using System.Security.Permissions;
 using System.Security.Principal;
@@ -41,6 +42,9 @@ using System.Web.Caching;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpResponseWrapper : HttpResponseBase
@@ -112,10 +116,8 @@ namespace System.Web
 			set { w.HeaderEncoding = value; }
 		}
 
-		[MonoTODO]
 		public override NameValueCollection Headers {
-			//get { return w.Headers; }
-			get { throw new NotImplementedException (); }
+			get { return w.Headers; }
 		}
 
 		public override bool IsClientConnected {
@@ -154,12 +156,9 @@ namespace System.Web
 			set { w.StatusDescription = value; }
 		}
 
-		[MonoTODO]
 		public override int SubStatusCode {
-			//get { return w.SubStatusCode; }
-			//set { w.SubStatusCode = value; }
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+			get { return w.SubStatusCode; }
+			set { w.SubStatusCode = value; }
 		}
 
 		public override bool SuppressContent {
@@ -167,12 +166,9 @@ namespace System.Web
 			set { w.SuppressContent = value; }
 		}
 
-		[MonoTODO]
 		public override bool TrySkipIisCustomErrors {
-			//get { return w.TrySkipIisCustomErrors; }
-			//set { w.TrySkipIisCustomErrors = value; }
-			get { throw new NotImplementedException (); }
-			set { throw new NotImplementedException (); }
+			get { return w.TrySkipIisCustomErrors; }
+			set { w.TrySkipIisCustomErrors = value; }
 		}
 
 		public override void AddCacheDependency (params CacheDependency [] dependencies)
@@ -260,11 +256,9 @@ namespace System.Web
 			w.Close ();
 		}
 
-		[MonoTODO]
 		public override void DisableKernelCache ()
 		{
-			// w.DisableKernelCache ();
-			throw new NotImplementedException ();
+			 w.DisableKernelCache ();
 		}
 
 		public override void End ()
@@ -292,11 +286,10 @@ namespace System.Web
 			w.Redirect (url, endResponse);
 		}
 
-		[MonoTODO]
 		public override void RemoveOutputCacheItem (string path)
 		{
-			// w.RemoveOutputCacheItem (path);
-			throw new NotImplementedException ();
+			 //w.RemoveOutputCacheItem (path);
+			 throw new NotImplementedException ();
 		}
 
 		public override void SetCookie (HttpCookie cookie)
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityBase.cs
index 6e56eb9..33cd857 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityBase.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.Profile;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpServerUtilityBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs
index 4dad3d0..8fef0a4 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpServerUtilityWrapper.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.Profile;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpServerUtilityWrapper : HttpServerUtilityBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateBase.cs
index 079a97b..1c15c2f 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateBase.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.SessionState;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpSessionStateBase : ICollection, IEnumerable
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateWrapper.cs
index cc33539..1495135 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpSessionStateWrapper.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.SessionState;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpSessionStateWrapper : HttpSessionStateBase
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionBase.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionBase.cs
index 20467aa..9f42597 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionBase.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionBase.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.SessionState;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HttpStaticObjectsCollectionBase : ICollection, IEnumerable
diff --git a/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionWrapper.cs b/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionWrapper.cs
index 905d6fa..5049968 100644
--- a/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionWrapper.cs
+++ b/mcs/class/System.Web.Abstractions/System.Web/HttpStaticObjectsCollectionWrapper.cs
@@ -33,6 +33,7 @@ using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.IO;
+using System.Runtime.CompilerServices;
 using System.Security.Permissions;
 using System.Security.Principal;
 using System.Web.Caching;
@@ -40,6 +41,9 @@ using System.Web.SessionState;
 
 namespace System.Web
 {
+#if NET_4_0
+        [TypeForwardedFrom ("System.Web.Abstractions, Version=3.5.0.0, Culture=Neutral, PublicKeyToken=31bf3856ad364e35")]
+#endif
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public class HttpStaticObjectsCollectionWrapper : HttpStaticObjectsCollectionBase
diff --git a/mcs/class/System.Web.Extensions/System.Web.Configuration/ChangeLog b/mcs/class/System.Web.Extensions/System.Web.Configuration/ChangeLog
new file mode 100644
index 0000000..19e32d9
--- /dev/null
+++ b/mcs/class/System.Web.Extensions/System.Web.Configuration/ChangeLog
@@ -0,0 +1,5 @@
+2009-08-17  Marek Habersack  <mhabersack at novell.com>
+
+	* ScriptingJsonSerializationSection.cs: MaxJsonLength default
+	value is 2097152 for .NET 3.5+
+
diff --git a/mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingJsonSerializationSection.cs b/mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingJsonSerializationSection.cs
index 9ee1775..ab3009b 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingJsonSerializationSection.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Configuration/ScriptingJsonSerializationSection.cs
@@ -43,7 +43,11 @@ namespace System.Web.Configuration
 			}
 		}
 
+#if NET_3_5
+		[ConfigurationPropertyAttribute ("maxJsonLength", DefaultValue = 2097152)]
+#else
 		[ConfigurationPropertyAttribute ("maxJsonLength", DefaultValue = 102400)]
+#endif
 		public int MaxJsonLength {
 			get {
 				return (int) this ["maxJsonLength"];
diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions_test.dll.sources b/mcs/class/System.Web.Extensions/System.Web.Extensions_test.dll.sources
index 69c5575..0f39630 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Extensions_test.dll.sources
+++ b/mcs/class/System.Web.Extensions/System.Web.Extensions_test.dll.sources
@@ -19,6 +19,7 @@
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/BaseWorkerRequest.cs
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/FakeMembershipProvider.cs
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/FormRequest.cs
+../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/Global.asax.cs
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/IForeignData.cs
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/HandlerInvoker.cs
 ../../System.Web/Test/mainsoft/NunitWeb/NunitWeb/MyHandler.cs
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/ChangeLog b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/ChangeLog
index 7b8511b..5cb6043 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/ChangeLog
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/ChangeLog
@@ -1,3 +1,15 @@
+2009-08-18  Marek Habersack  <mhabersack at novell.com>
+
+	* JavaScriptSerializer.cs: read converters from the config only if
+	explicitly requested.
+
+2009-08-17  Marek Habersack  <mhabersack at novell.com>
+
+	* JsonSerializer.cs: serialize fields before properties.
+
+	* JavaScriptSerializer.cs: MaxJsonLength default value for .NET
+	3.5 is 2097152
+
 2009-03-17  Marek Habersack  <mhabersack at novell.com>
 
 	* JavaScriptSerializer.cs: if conversion of IDictionary or
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
index b3847e3..7d2021d 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JavaScriptSerializer.cs
@@ -49,28 +49,60 @@ namespace System.Web.Script.Serialization
 		int _maxJsonLength;
 		int _recursionLimit;
 		JavaScriptTypeResolver _typeResolver;
-		internal static readonly JavaScriptSerializer DefaultSerializer = new JavaScriptSerializer ();
+		internal static readonly JavaScriptSerializer DefaultSerializer = new JavaScriptSerializer (null, false);
 
-		public JavaScriptSerializer () 
-			: this(null)
+		public JavaScriptSerializer () : this (null, false)
 		{
 		}
 
-		public JavaScriptSerializer (JavaScriptTypeResolver resolver) 
+		public JavaScriptSerializer (JavaScriptTypeResolver resolver) : this (resolver, false)
+		{
+		}
+		
+		internal JavaScriptSerializer (JavaScriptTypeResolver resolver, bool registerConverters)
 		{
 			_typeResolver = resolver;
 
 			ScriptingJsonSerializationSection section = (ScriptingJsonSerializationSection) ConfigurationManager.GetSection ("system.web.extensions/scripting/webServices/jsonSerialization");
 			if (section == null) {
+#if NET_3_5
+				_maxJsonLength = 2097152;
+#else
 				_maxJsonLength = 102400;
+#endif
 				_recursionLimit = 100;
-			}
-			else {
+			} else {
 				_maxJsonLength = section.MaxJsonLength;
 				_recursionLimit = section.RecursionLimit;
+
+				if (registerConverters) {
+					ConvertersCollection converters = section.Converters;
+					if (converters != null && converters.Count > 0) {
+						var cvtlist = new List <JavaScriptConverter> ();
+						Type type;
+						string typeName;
+						JavaScriptConverter jsc;
+						
+						foreach (Converter cvt in converters) {
+							typeName = cvt != null ? cvt.Type : null;
+							if (typeName == null)
+								continue;
+							
+							type = HttpApplication.LoadType (typeName, true);
+							if (type == null || !typeof (JavaScriptConverter).IsAssignableFrom (type))
+								continue;
+							
+							jsc = Activator.CreateInstance (type) as JavaScriptConverter;
+							cvtlist.Add (jsc);
+						}
+					
+						RegisterConverters (cvtlist);
+					}
+				}
 			}
 		}
 
+		
 		public int MaxJsonLength {
 			get {
 				return _maxJsonLength;
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonSerializer.cs b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonSerializer.cs
index e1f239e..c89d842 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonSerializer.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Serialization/JsonSerializer.cs
@@ -240,6 +240,9 @@ namespace System.Web.Script.Serialization
 		bool ShouldIgnoreMember (MemberInfo mi, out MethodInfo getMethod)
 		{
 			getMethod = null;
+			if (mi == null)
+				return true;
+			
 			if (mi.IsDefined (typeof (ScriptIgnoreAttribute), true))
 				return true;
 			
@@ -250,7 +253,7 @@ namespace System.Web.Script.Serialization
 			PropertyInfo pi = mi as PropertyInfo;
 			if (pi == null)
 				return true;
-
+			
 			getMethod = pi.GetGetMethod ();
 			if (getMethod == null || getMethod.GetParameters ().Length > 0) {
 				getMethod = null;
@@ -302,13 +305,20 @@ namespace System.Web.Script.Serialization
 				}
 			}
 
-			MemberInfo[] members = type.GetMembers (BindingFlags.Public | BindingFlags.Instance);
+			SerializeMembers <FieldInfo> (type.GetFields (BindingFlags.Public | BindingFlags.Instance), obj, output, ref first);
+			SerializeMembers <PropertyInfo> (type.GetProperties (BindingFlags.Public | BindingFlags.Instance), obj, output, ref first);
+
+			StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
+		}
+
+		void SerializeMembers <T> (T[] members, object obj, StringBuilder output, ref bool first) where T: MemberInfo
+		{
 			MemberInfo member;
 			MethodInfo getMethod;
 			string name;
 			
-			foreach (MemberInfo mi in members) {
-				if (ShouldIgnoreMember (mi, out getMethod))
+			foreach (T mi in members) {
+				if (ShouldIgnoreMember (mi as MemberInfo, out getMethod))
 					continue;
 
 				name = mi.Name;
@@ -321,8 +331,6 @@ namespace System.Web.Script.Serialization
 				if (first)
 					first = false;
 			}
-
-			StringBuilderExtensions.AppendCount (output, maxJsonLength, "}");
 		}
 		
 		void SerializeEnumerable (StringBuilder output, IEnumerable enumerable)
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Services/ChangeLog b/mcs/class/System.Web.Extensions/System.Web.Script.Services/ChangeLog
index 0dfeb10..ad93c06 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Services/ChangeLog
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Services/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-15  Marek Habersack  <mhabersack at novell.com>
+
+	* LogicalTypeInfo.cs: make sure JavaScriptSerializer instance used
+	here reads custom converters from web.config. Fixes bug #525589
+
 2009-06-14  Robert Jordan  <robertj at gmx.net>
 
 	* ScriptHandlerFactory.cs: handle precompiled web services.
diff --git a/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs b/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs
index 2692c6e..4c301e6 100644
--- a/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.Script.Services/LogicalTypeInfo.cs
@@ -196,7 +196,7 @@ return this._invoke({0}.get_path(), '{1}',{2},{{{3}}},succeededCallback,failedCa
 		readonly Hashtable _methodMap;
 		readonly Type _type;
 		readonly string _proxy;
-		static readonly JavaScriptSerializer JSSerializer = new JavaScriptSerializer ();
+		static readonly JavaScriptSerializer JSSerializer = new JavaScriptSerializer (null, true);
 
 		private LogicalTypeInfo (Type t, string filePath) {
 			_type = t;
diff --git a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ChangeLog
index 3bff03a..64b327f 100644
--- a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,17 @@
+2009-09-08  Marek Habersack  <mhabersack at novell.com>
+
+	* ListView.cs: if total row count has been retrieved from the
+	view, don't reset it to the number of items returned from the data
+	source. Fixes bug #535701
+
+2009-09-01  Marek Habersack  <mhabersack at novell.com>
+
+	* ListView.cs: LoadControlState must call OnTotalRowCountAvailable
+	after restoring the state, so that all parties subscribed to that
+	event are given chance to react accordingly.
+	SetPageProperties should use values stored in
+	PagePropertiesChangingEventArgs arguments after handler returns.
+
 2009-03-03  Marek Habersack  <mhabersack at novell.com>
 
 	* ListView.cs: SetPageProperties invoked the
diff --git a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListView.cs b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListView.cs
index 802b013..af08e38 100644
--- a/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListView.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.UI.WebControls/ListView.cs
@@ -814,11 +814,13 @@ namespace System.Web.UI.WebControls
 				}
 
 				pagedDataSource.TotalRowCount = totalRowCount;
+				_totalRowCount = totalRowCount;
 				DataKeyArray.Clear ();
 			} else {
 				if (!(dataSource is ICollection))
 					throw new InvalidOperationException ("dataSource does not implement the ICollection interface and dataBinding is false.");
 				pagedDataSource.TotalRowCount = 0;
+				_totalRowCount = -1;
 			}
 
 			pagedDataSource.StartRowIndex = StartRowIndex;
@@ -831,19 +833,19 @@ namespace System.Web.UI.WebControls
 					retList = CreateItemsWithoutGroups (pagedDataSource, dataBinding, InsertItemPosition, DataKeyArray);
 				else
 					retList = CreateItemsInGroups (pagedDataSource, dataBinding, InsertItemPosition, DataKeyArray);
-				
+
 				if (retList == null || retList.Count == 0)
 					emptySet = true;
 
-				if (haveDataToPage)
+				if (haveDataToPage) {
 					// Data source has paged data for us, so we must use its total row
 					// count
-					_totalRowCount = pagedDataSource.DataSourceCount;
-				else if (!emptySet)
+					_totalRowCount = pagedDataSource.TotalRowCount;
+				} else if (!emptySet && _totalRowCount > -1)
 					_totalRowCount = retList.Count;
-				else
+				else if (_totalRowCount > -1)
 					_totalRowCount = 0;
-
+				
 				OnTotalRowCountAvailable (new PageEventArgs (_startRowIndex, _maximumRows, _totalRowCount));
 			} else
 				emptySet = true;
@@ -1416,6 +1418,8 @@ namespace System.Web.UI.WebControls
 				_sortDirection = (SortDirection)o;
 			if ((o = state [CSTATE_SORTEXPRESSION]) != null)
 				_sortExpression = (string)o;
+			
+			OnTotalRowCountAvailable (new PageEventArgs (_startRowIndex, _maximumRows, _totalRowCount));
 		}
 	
 		protected override void LoadViewState (object savedState)
@@ -2002,11 +2006,14 @@ namespace System.Web.UI.WebControls
 				if (databind) {
 					var args = new PagePropertiesChangingEventArgs (startRowIndex, maximumRows);
 					OnPagePropertiesChanging (args);
+					_startRowIndex = args.StartRowIndex;
+					_maximumRows = args.MaximumRows;
+					
+				} else {
+					_startRowIndex = startRowIndex;
+					_maximumRows = maximumRows;
 				}
 
-				_startRowIndex = startRowIndex;
-				_maximumRows = maximumRows;
-
 				if (databind)
 					OnPagePropertiesChanged (EventArgs.Empty);
 			}
diff --git a/mcs/class/System.Web.Extensions/System.Web.UI/ChangeLog b/mcs/class/System.Web.Extensions/System.Web.UI/ChangeLog
index c434d46..3ae2cb6 100644
--- a/mcs/class/System.Web.Extensions/System.Web.UI/ChangeLog
+++ b/mcs/class/System.Web.Extensions/System.Web.UI/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-28  Marek Habersack  <mhabersack at novell.com>
+
+	* UpdatePanel.cs: RenderChildren stores the alternative writer in
+	a private property, for the benefit of nested child panels. Fixes
+	bug #542441
+
+	* ScriptManager.cs: don't render invisible panel IDs during async
+	request. Fixes bug #542533
+
 2009-04-23  Marek Habersack  <mhabersack at novell.com>
 
 	* AsyncPostBackTrigger.cs: HasTriggered () must look up the
diff --git a/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs b/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
index 2d98387..25f99ee 100644
--- a/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.UI/ScriptManager.cs
@@ -1097,9 +1097,18 @@ namespace System.Web.UI
 				writer.WriteLine ("//<![CDATA[");
 				writer.WriteLine ("Sys.WebForms.PageRequestManager._initialize('{0}', document.getElementById('{1}'));", UniqueID, Page.Form.ClientID);
 				if (IsMultiForm)
-					writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance($get(\"{0}\"))._updateControls([{1}], [{2}], [{3}], {4});", Page.Form.ClientID, FormatUpdatePanelIDs (_updatePanels, true), FormatListIDs (_asyncPostBackControls, true), FormatListIDs (_postBackControls, true), AsyncPostBackTimeout);
+					writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance($get(\"{0}\"))._updateControls([{1}], [{2}], [{3}], {4});",
+							  Page.Form.ClientID,
+							  FormatUpdatePanelIDs (_updatePanels, true),
+							  FormatListIDs (_asyncPostBackControls, true, false),
+							  FormatListIDs (_postBackControls, true, false),
+							  AsyncPostBackTimeout);
 				else
-					writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance()._updateControls([{0}], [{1}], [{2}], {3});", FormatUpdatePanelIDs (_updatePanels, true), FormatListIDs (_asyncPostBackControls, true), FormatListIDs (_postBackControls, true), AsyncPostBackTimeout);
+					writer.WriteLine ("Sys.WebForms.PageRequestManager.getInstance()._updateControls([{0}], [{1}], [{2}], {3});",
+							  FormatUpdatePanelIDs (_updatePanels, true),
+							  FormatListIDs (_asyncPostBackControls, true, false),
+							  FormatListIDs (_postBackControls, true, false),
+							  AsyncPostBackTimeout);
 				writer.WriteLine ("//]]");
 				writer.WriteLine ("</script>");
 			}
@@ -1111,21 +1120,29 @@ namespace System.Web.UI
 				return null;
 
 			StringBuilder sb = new StringBuilder ();
-			for (int i = 0; i < list.Count; i++) {
-				sb.AppendFormat ("{0}{1}{2}{0},", useSingleQuote ? "'" : String.Empty, list [i].ChildrenAsTriggers ? "t" : "f", list [i].UniqueID);
+			foreach (UpdatePanel panel in list) {
+				if (!panel.Visible)
+					continue;
+				
+				sb.AppendFormat ("{0}{1}{2}{0},", useSingleQuote ? "'" : String.Empty, panel.ChildrenAsTriggers ? "t" : "f", panel.UniqueID);
 			}
+			
 			if (sb.Length > 0)
 				sb.Length--;
 
 			return sb.ToString ();
 		}
 
-		static string FormatListIDs<T> (List<T> list, bool useSingleQuote) where T : Control {
+		static string FormatListIDs<T> (List<T> list, bool useSingleQuote, bool skipInvisible) where T : Control
+		{
 			if (list == null || list.Count == 0)
 				return null;
 
 			StringBuilder sb = new StringBuilder ();
 			for (int i = 0; i < list.Count; i++) {
+				if (skipInvisible && !list [i].Visible)
+					continue;
+				
 				sb.AppendFormat ("{0}{1}{0},", useSingleQuote ? "'" : String.Empty, list [i].UniqueID);
 			}
 			if (sb.Length > 0)
@@ -1291,7 +1308,7 @@ namespace System.Web.UI
 						needsUpdate = true;
 					else
 						needsUpdate = false;
-
+					
 					if (needsUpdate == false) {
 						Control parent = panel.Parent;
 						UpdatePanel parentPanel;
@@ -1306,7 +1323,7 @@ namespace System.Web.UI
 							parent = parent.Parent;
 						}
 					}
-
+					
 					panel.SetInPartialRendering (needsUpdate);
 					if (needsUpdate)
 						RegisterPanelForRefresh (panel);
@@ -1322,11 +1339,11 @@ namespace System.Web.UI
 				foreach (KeyValuePair <string, string> kvp in pageHiddenFields)
 					WriteCallbackOutput (output, hiddenField, kvp.Key, kvp.Value);
 			
-			WriteCallbackOutput (output, asyncPostBackControlIDs, null, FormatListIDs (_asyncPostBackControls, false));
-			WriteCallbackOutput (output, postBackControlIDs, null, FormatListIDs (_postBackControls, false));
+			WriteCallbackOutput (output, asyncPostBackControlIDs, null, FormatListIDs (_asyncPostBackControls, false, false));
+			WriteCallbackOutput (output, postBackControlIDs, null, FormatListIDs (_postBackControls, false, false));
 			WriteCallbackOutput (output, updatePanelIDs, null, FormatUpdatePanelIDs (_updatePanels, false));
-			WriteCallbackOutput (output, childUpdatePanelIDs, null, FormatListIDs (_childUpdatePanels, false));
-			WriteCallbackOutput (output, panelsToRefreshIDs, null, FormatListIDs (_panelsToRefresh, false));
+			WriteCallbackOutput (output, childUpdatePanelIDs, null, FormatListIDs (_childUpdatePanels, false, true));
+			WriteCallbackOutput (output, panelsToRefreshIDs, null, FormatListIDs (_panelsToRefresh, false, true));
 			WriteCallbackOutput (output, asyncPostBackTimeout, null, AsyncPostBackTimeout.ToString ());
 			if (!IsMultiForm)
 				WriteCallbackOutput (output, pageTitle, null, Page.Title);
@@ -1469,10 +1486,10 @@ namespace System.Web.UI
 			output = ((HtmlTextParser) output).ResponseOutput;
 			HtmlForm form = (HtmlForm) container;
 			HtmlTextWriter writer = new HtmlDropWriter (output);
+			
 			if (form.HasControls ()) {
-				for (int i = 0; i < form.Controls.Count; i++) {
-					form.Controls [i].RenderControl (writer);
-				}
+				foreach (Control control in form.Controls)
+					control.RenderControl (writer);
 			}
 		}
 
diff --git a/mcs/class/System.Web.Extensions/System.Web.UI/UpdatePanel.cs b/mcs/class/System.Web.Extensions/System.Web.UI/UpdatePanel.cs
index 52ca7c4..5df0322 100644
--- a/mcs/class/System.Web.Extensions/System.Web.UI/UpdatePanel.cs
+++ b/mcs/class/System.Web.Extensions/System.Web.UI/UpdatePanel.cs
@@ -200,6 +200,9 @@ namespace System.Web.UI
 				_updateMode = value;
 			}
 		}
+
+		// Used by nested panels (see bug #542441)
+		ScriptManager.AlternativeHtmlTextWriter RenderChildrenWriter { get; set; }
 		
 		protected virtual Control CreateContentTemplateContainer ()
 		{
@@ -257,22 +260,50 @@ namespace System.Web.UI
 			writer.RenderEndTag ();
 		}
 
+		UpdatePanel FindParentPanel ()
+		{
+			Control parent = Parent;
+			while (parent != null) {
+				UpdatePanel panel = parent as UpdatePanel;
+				if (panel != null)
+					return panel;
+
+				parent = parent.Parent;
+			}
+
+			return null;
+		}
+		
 		protected override void RenderChildren (HtmlTextWriter writer)
 		{
+			RenderChildrenWriter = null;
+			
 			if (IsInPartialRendering) {
 				ScriptManager.AlternativeHtmlTextWriter altWriter = writer as ScriptManager.AlternativeHtmlTextWriter;
 				if (altWriter == null)
 					altWriter = writer.InnerWriter as ScriptManager.AlternativeHtmlTextWriter;
+				
+				if (altWriter == null) {
+					UpdatePanel parentPanel = FindParentPanel ();
+					if (parentPanel != null)
+						altWriter = parentPanel.RenderChildrenWriter;
+				}
+
 				if (altWriter == null)
 					throw new InvalidOperationException ("Internal error. Invalid writer object.");
-					
-				HtmlTextWriter responseOutput = altWriter.ResponseOutput;
-				StringBuilder sb = new StringBuilder ();
-				HtmlTextWriter w = new HtmlTextWriter (new StringWriter (sb));
-				base.RenderChildren (w);
-				w.Flush ();
-					
-				ScriptManager.WriteCallbackPanel (responseOutput, this, sb);
+
+				// Used by nested panels (see bug #542441)
+				RenderChildrenWriter = altWriter;
+				try {
+					HtmlTextWriter responseOutput = altWriter.ResponseOutput;
+					StringBuilder sb = new StringBuilder ();
+					HtmlTextWriter w = new HtmlTextWriter (new StringWriter (sb));
+					base.RenderChildren (w);
+					w.Flush ();
+					ScriptManager.WriteCallbackPanel (responseOutput, this, sb);
+				} finally {
+					RenderChildrenWriter = null;
+				}
 			} else
 				base.RenderChildren (writer);
 		}
diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/ChangeLog b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/ChangeLog
index d1e26b9..c40bfea 100644
--- a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/ChangeLog
+++ b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-17  Marek Habersack  <mhabersack at novell.com>
+
+	* JavaScriptSerializerTest.cs: fixed broken tests
+
 2009-03-17  Marek Habersack  <mhabersack at novell.com>
 
 	* JavaScriptSerializerTest.cs: added tests for conversion to
diff --git a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs
index 3d057c5..d292623 100644
--- a/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs
+++ b/mcs/class/System.Web.Extensions/Test/System.Web.Script.Serialization/JavaScriptSerializerTest.cs
@@ -347,7 +347,11 @@ namespace Tests.System.Web.Script.Serialization
 		[Category ("NotDotNet")]
 		public void TestDefaults () {
 			JavaScriptSerializer ser = new JavaScriptSerializer ();
+#if NET_3_5
+			Assert.AreEqual (2097152, ser.MaxJsonLength);
+#else
 			Assert.AreEqual (102400, ser.MaxJsonLength);
+#endif
 			Assert.AreEqual (100, ser.RecursionLimit);
 			//List<JavaScriptConverter> l = new List<JavaScriptConverter> ();
 			//l.Add (new MyJavaScriptConverter ());
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog b/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog
index 772598c..f165cfe 100644
--- a/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog
+++ b/mcs/class/System.Web.Routing/System.Web.Routing/ChangeLog
@@ -1,3 +1,28 @@
+2009-11-09  Marek Habersack  <mhabersack at novell.com>
+
+	* RouteCollection.cs: GetVirtualPath doesn't append trailing slash
+	to application path blindly anymore. Fixes bug #553022
+
+2009-09-09  Marek Habersack  <mhabersack at novell.com>
+
+	* Route.cs: when Url is set to null, create a parser for empty
+	string. Fixes bug #537751
+
+	* PatternParser.cs: Parse allows for null/empty URLs. Fixes bug
+	#537751
+
+2009-09-08  Marek Habersack  <mhabersack at novell.com>
+
+	* UrlRoutingModule.cs: store original request path in
+	PostResolveRequestCache and restore it in
+	PostMapRequestHandler. Fixes bug #537089
+
+2009-08-19  Marek Habersack  <mhabersack at novell.com>
+
+	* Route.cs: GetRouteData adds contents of its DataTokens
+	dictionary to the returned RouteData.DataTokens dictionary. Fixes
+	bug #523330. Patch from Dax at daxxfiles.net, thanks!
+
 2009-06-25  Marek Habersack  <mhabersack at novell.com>
 
 	* PatternParser.cs: parameter name lookups must be
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs b/mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs
index 44f7e1a..59687e0 100644
--- a/mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs
+++ b/mcs/class/System.Web.Routing/System.Web.Routing/PatternParser.cs
@@ -68,21 +68,25 @@ namespace System.Web.Routing
 		void Parse ()
 		{
 			string url = Url;
-
-			if (String.IsNullOrEmpty (url))
-				throw new SystemException ("INTERNAL ERROR: it should not try to parse null or empty string");
-			if (url [0] == '~' || url [0] == '/')
-				throw new ArgumentException ("Url must not start with '~' or '/'");
-			if (url.IndexOf ('?') >= 0)
-				throw new ArgumentException ("Url must not contain '?'");
-
+			parameterNames = new Dictionary <string, bool> (StringComparer.OrdinalIgnoreCase);
+			
+			if (!String.IsNullOrEmpty (url)) {
+				if (url [0] == '~' || url [0] == '/')
+					throw new ArgumentException ("Url must not start with '~' or '/'");
+				if (url.IndexOf ('?') >= 0)
+					throw new ArgumentException ("Url must not contain '?'");
+			} else {
+				segments = new PatternSegment [0];
+				tokens = new PatternToken [0];
+				return;
+			}
+			
 			string[] parts = url.Split ('/');
 			int partsCount = segmentCount = parts.Length;
 			var allTokens = new List <PatternToken> ();
 			PatternToken tmpToken;
 			
-			segments = new PatternSegment [partsCount];			
-			parameterNames = new Dictionary <string, bool> (StringComparer.OrdinalIgnoreCase);
+			segments = new PatternSegment [partsCount];
 			
 			for (int i = 0; i < partsCount; i++) {
 				if (haveSegmentWithCatchAll)
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/Route.cs b/mcs/class/System.Web.Routing/System.Web.Routing/Route.cs
index 753d606..960a8d2 100644
--- a/mcs/class/System.Web.Routing/System.Web.Routing/Route.cs
+++ b/mcs/class/System.Web.Routing/System.Web.Routing/Route.cs
@@ -50,7 +50,7 @@ namespace System.Web.Routing
 
 		public string Url {
 			get { return url != null ? url.Url : String.Empty; }
-			set { url = value != null ? new PatternParser (value) : null; }
+			set { url = value != null ? new PatternParser (value) : new PatternParser (String.Empty); }
 		}
 
 		public Route (string url, IRouteHandler routeHandler)
@@ -105,6 +105,13 @@ namespace System.Web.Routing
 			
 			foreach (var p in values)
 				rdValues.Add (p.Key, p.Value);
+
+			RouteValueDictionary dataTokens = DataTokens;
+			if (dataTokens != null) {
+				RouteValueDictionary rdDataTokens = rd.DataTokens;
+				foreach (var token in dataTokens)
+					rdDataTokens.Add (token.Key, token.Value);
+			}
 			
 			return rd;
 		}
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs b/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs
index 920ed9c..0fb95cf 100644
--- a/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs
+++ b/mcs/class/System.Web.Routing/System.Web.Routing/RouteCollection.cs
@@ -163,7 +163,11 @@ namespace System.Web.Routing
 			}
 
 			if (vp != null) {
-				var pathWithApp = String.Concat (requestContext.HttpContext.Request.ApplicationPath, "/", vp.VirtualPath);
+				string appPath = requestContext.HttpContext.Request.ApplicationPath;
+				if (appPath != null && (appPath.Length == 0 || !appPath.EndsWith ("/", StringComparison.Ordinal)))
+					appPath += "/";
+				
+				string pathWithApp = String.Concat (appPath, vp.VirtualPath);
 				vp.VirtualPath = requestContext.HttpContext.Response.ApplyAppPathModifier (pathWithApp);
 				return vp;
 			}
diff --git a/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs b/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs
index f3c7b55..35d65a7 100644
--- a/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs
+++ b/mcs/class/System.Web.Routing/System.Web.Routing/UrlRoutingModule.cs
@@ -39,8 +39,9 @@ namespace System.Web.Routing
 	public class UrlRoutingModule : IHttpModule
 	{
 		RouteCollection routes;
-		object module_identity = new object ();
-
+		object module_identity_key = new object ();
+		object original_path_key = new object ();
+		
 		public RouteCollection RouteCollection {
 			get {
 				if (routes == null)
@@ -88,9 +89,13 @@ namespace System.Web.Routing
 				throw new ArgumentNullException ("context");
 
 			// FIXME: find out what it actually does.
-			IHttpHandler h = (IHttpHandler) context.Items [module_identity];
+			IHttpHandler h = (IHttpHandler) context.Items [module_identity_key];
 			if (h != null)
 				context.Handler = h;
+
+			string original_path = context.Items [original_path_key] as string;
+			if (!String.IsNullOrEmpty (original_path))
+				context.RewritePath (original_path);
 		}
 
 		[MonoTODO]
@@ -116,13 +121,12 @@ namespace System.Web.Routing
 			//var vpd = RouteCollection.GetVirtualPath (rc, rd.Values);
 			//context.RewritePath (vpd.VirtualPath);
 
-			// FIXME: use it somewhere.
-			string path = context.Request.Path;
+			context.Items [original_path_key] = context.Request.Path;
 
 			// default handler (forbidden in MVC/DynamicData projects)
 			context.RewritePath ("~/UrlRouting.axd");
 
-			context.Items [module_identity] = http;
+			context.Items [module_identity_key] = http;
 		}
 	}
 }
diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/ChangeLog b/mcs/class/System.Web.Routing/Test/System.Web.Routing/ChangeLog
index a37598d..e47802d 100644
--- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/ChangeLog
+++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-09  Marek Habersack  <mhabersack at novell.com>
+
+	* RouteTest.cs: added two tests for empty and null route URLs (bug
+	#537751)
+
 2009-06-25  Marek Habersack  <mhabersack at novell.com>
 
 	* RouteCollectionTest.cs, RouteTest.cs: added new tests for
diff --git a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs
index cf88935..2be319e 100644
--- a/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs
+++ b/mcs/class/System.Web.Routing/Test/System.Web.Routing/RouteTest.cs
@@ -667,7 +667,57 @@ namespace MonoTests.System.Web.Routing
 			Assert.AreEqual ("baz", rd.Values["baz"], "#4-2");
 			Assert.AreEqual ("blurb", rd.Values["blah"], "#4-3");
 		}
-		
+
+		[Test(Description = "Bug #523330")]
+		public void GetRouteData31()
+		{
+			var r = new Route("{controller}/{action}", null)
+			{
+				Defaults = new RouteValueDictionary(new { controller = "Home", action = "Index" }),
+				DataTokens = new RouteValueDictionary(new { foobar = "bar" })
+			};
+
+			var hc = new HttpContextStub("~/", String.Empty);
+			var rd = r.GetRouteData(hc);
+
+			Assert.IsNotNull(rd, "#1");
+			Assert.AreEqual(r, rd.Route, "#2");
+			Assert.AreEqual(1, rd.DataTokens.Count, "#3");
+			Assert.AreEqual(2, rd.Values.Count, "#4");
+			Assert.AreEqual("Home", rd.Values["controller"], "#4-1");
+			Assert.AreEqual("Index", rd.Values["action"], "#4-2");
+			Assert.IsNull(rd.Values["foobar"], "#4-3");
+			Assert.IsNotNull(rd.DataTokens, "#5");
+			Assert.AreEqual(1, rd.DataTokens.Count, "#6");
+			Assert.AreEqual("bar", rd.DataTokens["foobar"], "#6-1");
+		}
+
+		[Test (Description = "Bug #537751")]
+		public void GetRouteData32 ()
+		{
+			var r = new Route ("", null);
+			var hc = new HttpContextStub ("~/", String.Empty);
+			var rd = r.GetRouteData (hc);
+
+			Assert.IsNotNull (rd, "#1");
+			Assert.AreEqual (r, rd.Route, "#2");
+			Assert.AreEqual (0, rd.DataTokens.Count, "#3");
+			Assert.AreEqual (0, rd.Values.Count, "#4");
+		}
+
+		[Test (Description = "Bug #537751")]
+		public void GetRouteData33 ()
+		{
+			var r = new Route (null, null);
+			var hc = new HttpContextStub ("~/", String.Empty);
+			var rd = r.GetRouteData (hc);
+
+			Assert.IsNotNull (rd, "#1");
+			Assert.AreEqual (r, rd.Route, "#2");
+			Assert.AreEqual (0, rd.DataTokens.Count, "#3");
+			Assert.AreEqual (0, rd.Values.Count, "#4");
+		}
+
 		[Test]
 		[ExpectedException (typeof (ArgumentNullException))]
 		public void GetVirtualPathNullContext ()
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
index 88da965..1d2b4de 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* LogicalMethodInfo.cs: add CacheDuration property.
+	* WebServiceHandlerFactory.cs: use CacheDuration.
+	Fixes bug #524460.
+
 2009-05-05  Marek Habersack  <mhabersack at novell.com>
 
 	* Methods.cs: if SoapRpcMethodAttribute doesn't specify the action
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodInfo.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodInfo.cs
index bbf5d45..ab99d62 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodInfo.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/LogicalMethodInfo.cs
@@ -277,6 +277,24 @@ namespace System.Web.Services.Protocols {
 				return (attribute != null) ? attribute.EnableSession : false;
 			}
 		}
+		internal int CacheDuration {
+			get {
+				if (method_info == null)
+					return -1;
+
+				if (attribute == null) {
+					object [] o = method_info.GetCustomAttributes (false);
+					foreach (Attribute att in o) {
+						if (att is WebMethodAttribute) {
+							attribute = (WebMethodAttribute) att;
+							break;
+						}
+					}
+				}
+
+				return (attribute != null) ? attribute.CacheDuration : -1;
+			}
+		}
 		#endregion // Properties
 
 		#region Methods
diff --git a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
index e0d48b2..fd10eac 100644
--- a/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
+++ b/mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs
@@ -180,7 +180,10 @@ namespace System.Web.Services.Protocols
 		{
 			MethodStubInfo method = handler.GetRequestMethod (context);
 			if (method == null) return null;
-			
+
+			int cache_duration = method.MethodInfo.CacheDuration;
+			if (cache_duration > 0)
+				context.Response.ExpiresAbsolute = DateTime.Now.AddSeconds (cache_duration);
 			if (method.MethodInfo.EnableSession)
 				return new SessionWrapperHandler (handler);
 			else
diff --git a/mcs/class/System.Web/ChangeLog b/mcs/class/System.Web/ChangeLog
index 1261a7c..3656bb1 100644
--- a/mcs/class/System.Web/ChangeLog
+++ b/mcs/class/System.Web/ChangeLog
@@ -1,3 +1,42 @@
+2009-11-13  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile (TEST_RESOURCE_FILES): added
+	Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx
+	Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx.cs
+
+2009-10-05  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile ($(the_lib)): fixed a typo in dependency macro
+
+2009-09-07  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile (TEST_RESOURCE_FILES): added
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/sub_map_01.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_01.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_02.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_03.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_04.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_05.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_06.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_07.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_08.sitemap
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_09.sitemap
+
+2009-08-25  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile (TEST_RESOURCE_FILES): added
+	Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx
+
+2009-08-18  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile (TEST_RESOURCE_FILES): added
+	Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx
+
+2009-08-15  Marek Habersack  <mhabersack at novell.com>
+
+	* Makefile (TEST_RESOURCE_FILES): added
+	Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx
+
 2009-07-23  Marek Habersack  <mhabersack at novell.com>
 
 	* Makefile (TEST_RESOURCE_FILES): added
diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile
index 14228fd..af8efb0 100644
--- a/mcs/class/System.Web/Makefile
+++ b/mcs/class/System.Web/Makefile
@@ -72,14 +72,26 @@ RESOURCE_FILES_2 = \
 OTHER_RES = $(RESOURCE_FILES_1)
 TEST_RESOURCE_FILES = \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax \
-	Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax.cs \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/My.ashx \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/My.master \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage_1.1.aspx \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage.aspx.cs \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPageWithMaster.aspx \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config \
 	Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config.1.1 \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/sub_map_01.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_01.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_02.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_03.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_04.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_05.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_06.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_07.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_08.sitemap \
+	Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_09.sitemap \
+	Test/mainsoft/NunitWebResources/App_GlobalResources/Common.resx \
+	Test/mainsoft/NunitWebResources/App_GlobalResources/Common.fr-FR.resx \
 	Test/mainsoft/NunitWebResources/menuclass.aspx \
 	Test/mainsoft/NunitWebResources/FormView.aspx \
 	Test/mainsoft/NunitWebResources/PostBackMenuTest.aspx \
@@ -167,7 +179,13 @@ TEST_RESOURCE_FILES = \
 	Test/mainsoft/NunitWebResources/ServerControlInClientSideComment.aspx \
 	Test/mainsoft/NunitWebResources/UnquotedAngleBrackets.aspx \
 	Test/mainsoft/NunitWebResources/FullTagsInText.aspx \
-	Test/mainsoft/NunitWebResources/TagsExpressionsAndCommentsInText.aspx
+	Test/mainsoft/NunitWebResources/TagsExpressionsAndCommentsInText.aspx \
+	Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx \
+	Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx \
+	Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx \
+	Test/mainsoft/NunitWebResources/GlobalResourcesLocalization.aspx \
+	Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx \
+	Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx.cs
 
 RESX_DIST =  resources/TranslationResources.resx
 ifeq (net_2_0, $(PROFILE))
@@ -238,7 +256,7 @@ ifdef MONO_TRACE
 LIB_MCS_FLAGS += -define:TRACE -define:MONO_TRACE
 endif
 
-$(the_lib): $(RESX_RES) $(RESOURCE_FILES2) $(RESOURCE_FILES_1)
+$(the_lib): $(RESX_RES) $(RESOURCE_FILES_2) $(RESOURCE_FILES_1)
 
 $(RESX_RES): %.resources: %.resx
 	$(RESGEN) `echo $< | $(PLATFORM_CHANGE_SEPARATOR_CMD)`
diff --git a/mcs/class/System.Web/System.Web.Caching/Cache.cs b/mcs/class/System.Web/System.Web.Caching/Cache.cs
index 55f0c3c..0ffae60 100644
--- a/mcs/class/System.Web/System.Web.Caching/Cache.cs
+++ b/mcs/class/System.Web/System.Web.Caching/Cache.cs
@@ -212,7 +212,13 @@ namespace System.Web.Caching
 				
 				ci.LastChange = DateTime.Now;
 				if (ci.AbsoluteExpiration != NoAbsoluteExpiration) {
-					int remaining = Math.Max (0, (int)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
+					long remaining = Math.Max (0, (long)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
+					if (remaining > 4294967294L)
+						// Maximum due time for timer
+						// Item will expire properly anyway, as the timer will be
+						// rescheduled for the item's expiration time once that item is
+						// bubbled to the top of the priority queue.
+						remaining = 4294967294L;
 					ci.Timer = new Timer (new TimerCallback (ItemExpired), ci, remaining, Timeout.Infinite);
 				}
 			} finally {
@@ -319,10 +325,18 @@ namespace System.Web.Caching
 		
 		void ItemExpired(object cacheItem) {
 			CacheItem ci = (CacheItem)cacheItem;
-			ci.Timer.Dispose();
-			ci.Timer = null;
+			long remaining = Math.Max (0, (long)(ci.AbsoluteExpiration - DateTime.Now).TotalMilliseconds);
+			if (remaining > 4294967294L)
+				remaining = 4294967294L;
 
-			Remove (ci.Key, CacheItemRemovedReason.Expired, true);
+			if (remaining <= 0) {
+				ci.Timer.Dispose();
+				ci.Timer = null;
+
+				Remove (ci.Key, CacheItemRemovedReason.Expired, true);
+			}
+
+			ci.Timer.Change (remaining, Timeout.Infinite);
 		}
 		
 		internal void CheckDependencies ()
diff --git a/mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs b/mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs
index 3729f4f..d512070 100644
--- a/mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs
+++ b/mcs/class/System.Web/System.Web.Caching/CachedRawResponse.cs
@@ -3,8 +3,9 @@
 //
 // Author(s):
 //  Jackson Harper (jackson at ximian.com)
+//  Marek Habersack <mhabersack at novell.com>
 //
-// (C) 2003 Novell, Inc (http://www.novell.com)
+// (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -30,68 +31,126 @@
 
 
 using System;
-using System.Text;
 using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Text;
 
-namespace System.Web.Caching {
+#if NET_2_0
+using System.Collections.Generic;
+#endif
 
-	internal sealed class CachedRawResponse {
-		static readonly byte[] emptyBuffer = new byte[0];
+namespace System.Web.Caching
+{
+	sealed class CachedRawResponse
+	{
+		public sealed class DataItem
+		{
+			public readonly byte[] Buffer;
+			public readonly long Length;
+#if NET_2_0
+			public readonly HttpResponseSubstitutionCallback Callback;
+#endif
+			
+			public DataItem (byte[] buffer, long length)
+			{
+				Buffer = buffer;
+				Length = length;
+			}
+
+#if NET_2_0
+			public DataItem (HttpResponseSubstitutionCallback callback) : this (null, 0)
+			{
+				Callback = callback;
+			}
+#endif
+		}
+		
 		HttpCachePolicy policy;
 		CachedVaryBy varyby;
 		int status_code;
 		string status_desc;
 		int content_length;
-		ArrayList headers;
-		byte[] buffer;
+		NameValueCollection headers;
+#if NET_2_0
+		List <DataItem> data;
+#else
+		ArrayList data;
+#endif
+
+		IList Data {
+			get {
+				if (data == null) {
+#if NET_2_0
+					data = new List <DataItem> ();
+#else
+					data = new ArrayList ();
+#endif
+				}
+
+				return data;
+			}
+		}
 		
-		internal CachedRawResponse (HttpCachePolicy policy)
+		public CachedRawResponse (HttpCachePolicy policy)
 		{
 			this.policy = policy;
-			this.buffer = emptyBuffer;
 		}
 
-		internal HttpCachePolicy Policy {
+		public HttpCachePolicy Policy {
 			get { return policy; }
 			set { policy = value; }
 		}
 
-		internal CachedVaryBy VaryBy {
+		public CachedVaryBy VaryBy {
 			get { return varyby; }
 			set { varyby = value; }
 		}
 		
-		internal int StatusCode {
+		public int StatusCode {
 			get { return status_code; }
 			set { status_code = value; }
 		}
 
-		internal string StatusDescription {
+		public string StatusDescription {
 			get { return status_desc; }
 			set { status_desc = value; }
 		}
 
-		internal int ContentLength {
-			get { return content_length; }
-			set { content_length = value; }
-		}
-		
-		internal ArrayList Headers {
+		public NameValueCollection Headers {
 			get { return headers; }
 		}
 
-		internal void SetHeaders (ArrayList headers) {
+		public void SetHeaders (NameValueCollection headers)
+		{
 			this.headers = headers;
 		}
 
-		internal void SetData (byte[] buffer)
+		public void SetData (MemoryStream ms)
+		{
+			if (ms == null)
+				return;
+			
+			Data.Add (new DataItem (ms.GetBuffer (), ms.Length));
+		}
+
+#if NET_2_0
+		public void SetData (HttpResponseSubstitutionCallback callback)
 		{
-			this.buffer = buffer;
+			if (callback == null)
+				return;
+
+			Data.Add (new DataItem (callback));
 		}
+#endif
 		
-		internal byte[] GetData ()
+		public IList GetData ()
 		{
-			return buffer;
+			int count = data != null ? data.Count :0;
+			if (count == 0)
+				return null;
+
+			return data;
 		}
 	}
 }
diff --git a/mcs/class/System.Web/System.Web.Caching/CachedVaryBy.cs b/mcs/class/System.Web/System.Web.Caching/CachedVaryBy.cs
index 0d8e100..3ec78b5 100644
--- a/mcs/class/System.Web/System.Web.Caching/CachedVaryBy.cs
+++ b/mcs/class/System.Web/System.Web.Caching/CachedVaryBy.cs
@@ -33,6 +33,7 @@ using System;
 using System.Globalization;
 using System.Text;
 using System.Collections;
+using System.Web.Util;
 
 namespace System.Web.Caching {
 
@@ -81,7 +82,7 @@ namespace System.Web.Caching {
 					// FIXME: QueryString might contain a null key if a page gets called like this: page.aspx?arg (w/out the "=")
 					if (p == null) continue;
 					builder.Append ("VPQ:");
-					builder.Append (p.ToLower (CultureInfo.InvariantCulture));
+					builder.Append (p.ToLower (Helpers.InvariantCulture));
 					builder.Append ('=');
 					builder.Append (request.QueryString [p]);
 					builder.Append (newLine);
@@ -90,7 +91,7 @@ namespace System.Web.Caching {
 					// FIXME: can this be null, too?
 					if (p == null) continue;
 					builder.Append ("VPF:");
-					builder.Append (p.ToLower (CultureInfo.InvariantCulture));
+					builder.Append (p.ToLower (Helpers.InvariantCulture));
 					builder.Append ('=');
 					builder.Append (request.Form [p]);
 					builder.Append (newLine);
@@ -99,14 +100,14 @@ namespace System.Web.Caching {
 				for (int i=0; i<prms.Length; i++) {
 					if (request.QueryString [prms [i]] != null) {
 						builder.Append ("VPQ:");
-						builder.Append (prms [i].ToLower (CultureInfo.InvariantCulture));
+						builder.Append (prms [i].ToLower (Helpers.InvariantCulture));
 						builder.Append ('=');
 						builder.Append (request.QueryString [prms [i]]);
 						builder.Append (newLine);
 					}
 					if (request.Form [prms [i]] != null) {
 						builder.Append ("VPF:");
-						builder.Append (prms [i].ToLower (CultureInfo.InvariantCulture));
+						builder.Append (prms [i].ToLower (Helpers.InvariantCulture));
 						builder.Append ('=');
 						builder.Append (request.Form [prms [i]]);
 						builder.Append (newLine);
@@ -117,7 +118,7 @@ namespace System.Web.Caching {
 			if (headers != null) {
 				for (int i=0; i<headers.Length; i++) {
 					builder.Append ("VH:");
-					builder.Append (headers [i].ToLower (CultureInfo.InvariantCulture));
+					builder.Append (headers [i].ToLower (Helpers.InvariantCulture));
 					builder.Append ('=');
 					builder.Append (request.Headers [headers [i]]);
 					builder.Append (newLine);
diff --git a/mcs/class/System.Web/System.Web.Caching/ChangeLog b/mcs/class/System.Web/System.Web.Caching/ChangeLog
index 3fe7de8..2ed0fcd 100644
--- a/mcs/class/System.Web/System.Web.Caching/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Caching/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-20  Marek Habersack  <mhabersack at novell.com>
+
+	* OutputCacheModule.cs: keysCache and entriesToInvalidate
+	dictionaries are allocated only when they are
+	required. BuildManager's RemoveEntry envent is subscribed to only
+	if cache actually has some entries.
+	Added support for post-cache substitution.
+
+	* CachedRawResponse.cs: data is stored in a list of DataItem
+	instances instead of just in a single buffer. This enables support
+	for post-cache substitution.
+
+2009-10-05  Marek Habersack  <mhabersack at novell.com>
+
+	* Cache.cs: if item expiration time exceeds the maximum value
+	Timer accepts, use the latter - item will expire properly anyway,
+	as the timer will be rescheduled for the item's expiration time
+	once that item is bubbled to the top of the priority queue. Fixes
+	bug #544171
+
 2009-01-09  Marek Habersack  <mhabersack at novell.com>
 
 	* Cache.cs: System.Threading.Timer.Change takes a long, not an
diff --git a/mcs/class/System.Web/System.Web.Caching/OutputCacheModule.cs b/mcs/class/System.Web/System.Web.Caching/OutputCacheModule.cs
index 59a1d4d..af6afe5 100644
--- a/mcs/class/System.Web/System.Web.Caching/OutputCacheModule.cs
+++ b/mcs/class/System.Web/System.Web.Caching/OutputCacheModule.cs
@@ -3,8 +3,9 @@
 //
 // Authors:
 //  Jackson Harper (jackson at ximian.com)
+//  Marek Habersack <mhabersack at novell.com>
 //
-// (C) 2003 Novell, Inc (http://www.novell.com)
+// (C) 2003-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -28,11 +29,12 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Collections;
 using System.IO;
+using System.Text;
 using System.Web;
 using System.Web.UI;
 using System.Web.Util;
-using System.Collections;
 using System.Web.Compilation;
 
 #if NET_2_0
@@ -63,11 +65,6 @@ namespace System.Web.Caching {
 		{
 			context.ResolveRequestCache += new EventHandler(OnResolveRequestCache);
 			context.UpdateRequestCache += new EventHandler(OnUpdateRequestCache);
-#if NET_2_0
-			keysCache = new Dictionary <string, string> ();
-			entriesToInvalidate = new Dictionary <string, string> ();
-			BuildManager.RemoveEntry += new BuildManagerRemoveEntryEventHandler (OnBuildManagerRemoveEntry);
-#endif
 			response_removed = new CacheItemRemovedCallback (OnRawResponseRemoved);
 		}
 
@@ -83,9 +80,15 @@ namespace System.Web.Caching {
 					return;
 				
 				keysCache.Remove (entry);
-				if (context == null && !entriesToInvalidate.ContainsKey (entry)) {
-					entriesToInvalidate.Add (entry, cacheValue);
-					return;
+				if (context == null) {
+					if (entriesToInvalidate == null) {
+						entriesToInvalidate = new Dictionary <string, string> (StringComparer.Ordinal);
+						entriesToInvalidate.Add (entry, cacheValue);
+						return;
+					} else if (!entriesToInvalidate.ContainsKey (entry)) {
+						entriesToInvalidate.Add (entry, cacheValue);
+						return;
+					}
 				}
 			}
 
@@ -116,7 +119,7 @@ namespace System.Web.Caching {
 #if NET_2_0
 			lock (keysCacheLock) {
 				string invValue;
-				if (entriesToInvalidate.TryGetValue (vary_key, out invValue) && String.Compare (invValue, key, StringComparison.Ordinal) == 0) {
+				if (entriesToInvalidate != null && entriesToInvalidate.TryGetValue (vary_key, out invValue) && String.Compare (invValue, key, StringComparison.Ordinal) == 0) {
 					context.Cache.Remove (vary_key);
 					context.InternalCache.Remove (key);
 					entriesToInvalidate.Remove (vary_key);
@@ -158,15 +161,37 @@ namespace System.Web.Caching {
 					return;
 				}
 			}
-			
-			context.Response.ClearContent ();
-			context.Response.BinaryWrite (c.GetData (), 0, c.ContentLength);
 
-			context.Response.ClearHeaders ();
-			context.Response.SetCachedHeaders (c.Headers);
+			HttpResponse response = context.Response;			
+			response.ClearContent ();
+			IList cachedData = c.GetData ();
+			if (cachedData != null) {
+				Encoding outEnc = WebEncoding.ResponseEncoding;
+				
+				foreach (CachedRawResponse.DataItem d in cachedData) {
+					if (d.Length > 0) {
+						response.BinaryWrite (d.Buffer, 0, (int)d.Length);
+						continue;
+					}
+
+#if NET_2_0
+					if (d.Callback == null)
+						continue;
+
+					string s = d.Callback (context);
+					if (s == null || s.Length == 0)
+						continue;
 
-			context.Response.StatusCode = c.StatusCode;
-			context.Response.StatusDescription = c.StatusDescription;
+					byte[] bytes = outEnc.GetBytes (s);
+					response.BinaryWrite (bytes, 0, bytes.Length);
+#endif
+				}
+			}
+			
+			response.ClearHeaders ();
+			response.SetCachedHeaders (c.Headers);
+			response.StatusCode = c.StatusCode;
+			response.StatusDescription = c.StatusDescription;
 				
 			app.CompleteRequest ();
 		}
@@ -179,7 +204,6 @@ namespace System.Web.Caching {
 			if (context.Response.IsCached && context.Response.StatusCode == 200 && 
 			    !context.Trace.IsEnabled)
 				DoCacheInsert (context);
-
 		}
 
 		void DoCacheInsert (HttpContext context)
@@ -239,7 +263,11 @@ namespace System.Web.Caching {
 #if NET_2_0
 			if (cacheKey != null) {
 				lock (keysCacheLock) {
-					if (!keysCache.ContainsKey (cacheKey))
+					if (keysCache == null) {
+						BuildManager.RemoveEntry += new BuildManagerRemoveEntryEventHandler (OnBuildManagerRemoveEntry);
+						keysCache = new Dictionary <string, string> (StringComparer.Ordinal);
+						keysCache.Add (cacheKey, cacheValue);
+					} else if (!keysCache.ContainsKey (cacheKey))
 						keysCache.Add (cacheKey, cacheValue);
 				}
 			}
diff --git a/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs
index 2e6b315..e827aa6 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AppCodeCompiler.cs
@@ -614,7 +614,11 @@ namespace System.Web.Compilation
 		{
 			if (ps == null || !ps.Enabled)
 				return false;
-			if (!String.IsNullOrEmpty (ps.Inherits) || (ps.PropertySettings != null && ps.PropertySettings.Count > 0))
+
+			RootProfilePropertySettingsCollection props = ps.PropertySettings;
+			ProfileGroupSettingsCollection groups = props != null ? props.GroupSettings : null;
+			
+			if (!String.IsNullOrEmpty (ps.Inherits) || (props != null && props.Count > 0) || (groups != null && groups.Count > 0))
 				return true;
 
 			return false;
diff --git a/mcs/class/System.Web/System.Web.Compilation/AppResourceFilesCollection.cs b/mcs/class/System.Web/System.Web.Compilation/AppResourceFilesCollection.cs
index f1e7097..ff4dfaf 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AppResourceFilesCollection.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AppResourceFilesCollection.cs
@@ -32,6 +32,7 @@ using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
+using System.Web.Util;
 
 namespace System.Web.Compilation 
 {
@@ -156,7 +157,7 @@ namespace System.Web.Compilation
 
 		bool Acceptable (string extension, out AppResourceFileKind kind)
 		{
-			switch (extension.ToLower (CultureInfo.InvariantCulture))
+			switch (extension.ToLower (Helpers.InvariantCulture))
 			{
 				default:
 					kind = AppResourceFileKind.NotResource;
diff --git a/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs b/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs
index f302cc9..e417565 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AppResourcesAssemblyBuilder.cs
@@ -4,7 +4,7 @@
 // Authors:
 //   Marek Habersack (mhabersack at novell.com)
 //
-// (C) 2007 Novell, Inc
+// (C) 2007-2009 Novell, Inc (http://novell.com/)
 //
 
 //
@@ -32,14 +32,19 @@ using System;
 using System.CodeDom;
 using System.CodeDom.Compiler;
 using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.ComponentModel;
+using System.Diagnostics;
 using System.IO;
 using System.Reflection;
+using System.Text;
+using System.Threading;
 using System.Web;
 using System.Web.Configuration;
 
 namespace System.Web.Compilation
 {
-	internal class AppResourcesAssemblyBuilder
+	class AppResourcesAssemblyBuilder
 	{
 		CompilationSection config;
 		CompilerInfo ci;
@@ -90,22 +95,23 @@ namespace System.Web.Compilation
 		public void Build (CodeCompileUnit unit)
 		{
 			Dictionary <string, List <string>> cultures = appResourcesCompiler.CultureFiles;
-			string defaultAssemblyKey = AppResourcesCompiler.DefaultCultureKey;
+			List <string> defaultCultureFiles = appResourcesCompiler.DefaultCultureFiles;
+			
+			if (defaultCultureFiles != null)
+				BuildDefaultAssembly (defaultCultureFiles, unit);
 			
 			foreach (KeyValuePair <string, List <string>> kvp in cultures)
-				BuildAssembly (kvp.Key, kvp.Value, defaultAssemblyKey, unit);
+				BuildSatelliteAssembly (kvp.Key, kvp.Value);
 		}
 
-		void BuildAssembly (string cultureName, List <string> files, string defaultAssemblyKey, CodeCompileUnit unit)
+		void BuildDefaultAssembly (List <string> files, CodeCompileUnit unit)
 		{
-			bool defaultAssembly = cultureName == defaultAssemblyKey;			
 			AssemblyBuilder abuilder = new AssemblyBuilder (Provider);
-			if (unit != null && defaultAssembly)
+			if (unit != null)
 				abuilder.AddCodeCompileUnit (unit);
 			
-			string assemblyPath = defaultAssembly ? baseAssemblyPath : BuildAssemblyPath (cultureName, abuilder);
 			CompilerParameters cp = ci.CreateDefaultCompilerParameters ();
-			cp.OutputAssembly = assemblyPath;
+			cp.OutputAssembly = baseAssemblyPath;
 			cp.GenerateExecutable = false;
 			cp.TreatWarningsAsErrors = true;
 			cp.IncludeDebugInformation = config.Debug;
@@ -117,27 +123,145 @@ namespace System.Web.Compilation
 			if (results == null)
 				return;
 			
-			Assembly ret = null;
-			
 			if (results.NativeCompilerReturnValue == 0) {
-				ret = results.CompiledAssembly;
-				if (defaultAssembly) {
-					BuildManager.TopLevelAssemblies.Add (ret);
-					mainAssembly = ret;
-				}
+				mainAssembly = results.CompiledAssembly;
+				BuildManager.TopLevelAssemblies.Add (mainAssembly);
 			} else {
 				if (HttpContext.Current.IsCustomErrorEnabled)
 					throw new ApplicationException ("An error occurred while compiling global resources.");
 				throw new CompilationException (null, results.Errors, null);
 			}
 			
-			if (defaultAssembly) {
-				HttpRuntime.WritePreservationFile (ret, canonicAssemblyName);
-				HttpRuntime.EnableAssemblyMapping (true);
+			HttpRuntime.WritePreservationFile (mainAssembly, canonicAssemblyName);
+			HttpRuntime.EnableAssemblyMapping (true);
+		}
+
+		void BuildSatelliteAssembly (string cultureName, List <string> files)
+		{
+			string assemblyPath = BuildAssemblyPath (cultureName);
+			var info = new ProcessStartInfo ();
+			var al = new Process ();
+
+			string arguments = SetAlPath (info);
+			var sb = new StringBuilder (arguments);
+
+			sb.Append ("/c:\"" + cultureName + "\" ");
+			sb.Append ("/t:lib ");
+			sb.Append ("/out:\"" + assemblyPath + "\" ");
+			if (mainAssembly != null)
+				sb.Append ("/template:\"" + mainAssembly.Location + "\" ");
+			
+			string responseFilePath = assemblyPath + ".response";
+			using (FileStream fs = File.OpenWrite (responseFilePath)) {
+				using (StreamWriter sw = new StreamWriter (fs)) {
+					foreach (string f in files) 
+						sw.WriteLine ("/embed:\"" + f + "\" ");
+				}
+			}
+			sb.Append ("@\"" + responseFilePath + "\"");
+			
+			info.Arguments = sb.ToString ();
+			info.CreateNoWindow = true;
+			info.UseShellExecute = false;
+			info.RedirectStandardOutput = true;
+			info.RedirectStandardError = true;
+			
+			al.StartInfo = info;
+
+			var alOutput = new StringCollection ();
+			var alMutex = new Mutex ();
+			DataReceivedEventHandler outputHandler = (object sender, DataReceivedEventArgs args) => {
+				if (args.Data != null) {
+					alMutex.WaitOne ();
+					alOutput.Add (args.Data);
+					alMutex.ReleaseMutex ();
+				}
+			};
+			
+			al.ErrorDataReceived += outputHandler;
+			al.OutputDataReceived += outputHandler;
+
+			// TODO: consider using asynchronous processes
+			try {
+				al.Start ();
+			} catch (Exception ex) {
+				throw new HttpException (String.Format ("Error running {0}", al.StartInfo.FileName), ex);
+			}
+
+			Exception alException = null;
+			int exitCode = 0;
+			try {
+				al.BeginOutputReadLine ();
+				al.BeginErrorReadLine ();
+				al.WaitForExit ();
+				exitCode = al.ExitCode;
+			} catch (Exception ex) {
+				alException = ex;
+			} finally {
+				al.CancelErrorRead ();
+				al.CancelOutputRead ();
+				al.Close ();
+			}
+
+			if (exitCode != 0 || alException != null) {
+				// TODO: consider adding a new type of compilation exception,
+				// tailored for al
+				CompilerErrorCollection errors = null;
+				
+				if (alOutput.Count != 0) {
+					foreach (string line in alOutput) {
+						Console.WriteLine (line);
+						if (!line.StartsWith ("ALINK: error ", StringComparison.Ordinal))
+							continue;
+						if (errors == null)
+							errors = new CompilerErrorCollection ();
+
+						int colon = line.IndexOf (':', 13);
+						string errorNumber = colon != -1 ? line.Substring (13, colon - 13) : "Unknown";
+						string errorText = colon != -1 ? line.Substring (colon + 1) : line.Substring (13);
+						
+						errors.Add (new CompilerError (Path.GetFileName (assemblyPath), 0, 0, errorNumber, errorText));
+					}
+				}
+				
+				throw new CompilationException (Path.GetFileName (assemblyPath), errors, null);
 			}
 		}
 
-		string BuildAssemblyPath (string cultureName, AssemblyBuilder abuilder)
+		string SetAlPath (ProcessStartInfo info)
+		{			
+			if (HttpRuntime.RunningOnWindows) {
+				string alPath;
+				string monoPath;
+				PropertyInfo gac = typeof (Environment).GetProperty ("GacPath", BindingFlags.Static|BindingFlags.NonPublic);
+                                MethodInfo get_gac = gac.GetGetMethod (true);
+                                string p = Path.GetDirectoryName ((string) get_gac.Invoke (null, null));
+				monoPath = Path.Combine (Path.GetDirectoryName (Path.GetDirectoryName (p)), "bin\\mono.bat");
+                                if (!File.Exists (monoPath)) {
+                                        monoPath = Path.Combine (Path.GetDirectoryName (Path.GetDirectoryName (p)), "bin\\mono.exe");
+					if (!File.Exists (monoPath)) {
+						monoPath = Path.Combine (Path.GetDirectoryName (Path.GetDirectoryName (Path.GetDirectoryName (p))), "mono\\mono\\mini\\mono.exe");
+						if (!File.Exists (monoPath))
+							throw new FileNotFoundException ("Windows mono path not found: " + monoPath);
+					}
+				}
+				
+                                alPath = Path.Combine (p, "2.0\\al.exe");
+                                if (!File.Exists (alPath)) {
+                                        alPath = Path.Combine(Path.GetDirectoryName (p), "lib\\net_2_0\\al.exe");
+					if (!File.Exists (alPath))
+						throw new FileNotFoundException ("Windows al path not found: " + alPath);
+				}
+
+				info.FileName = monoPath;
+				return alPath;
+			} else {
+				info.FileName = "al2";
+				return String.Empty;
+			}
+		}
+		
+		string BuildAssemblyPath (string cultureName)
 		{
 			string baseDir = Path.Combine (baseAssemblyDirectory, cultureName);
 			if (!Directory.Exists (baseDir))
@@ -147,10 +271,6 @@ namespace System.Web.Compilation
 			string fileName = String.Concat (baseFileName, ".resources.dll");
 			fileName = Path.Combine (baseDir, fileName);
 
-			CodeCompileUnit assemblyInfo = GenerateAssemblyInfo (cultureName);
-			if (assemblyInfo != null)
-				abuilder.AddCodeCompileUnit (assemblyInfo);
-
 			return fileName;
 		}
 
diff --git a/mcs/class/System.Web/System.Web.Compilation/AppResourcesCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/AppResourcesCompiler.cs
index eb6c715..6c9743f 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AppResourcesCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AppResourcesCompiler.cs
@@ -39,6 +39,7 @@ using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Resources;
+using System.Text;
 using System.Web;
 using System.Web.Caching;
 using System.Web.Configuration;
@@ -208,13 +209,13 @@ namespace System.Web.Compilation
 		}
 		
 		const string cachePrefix = "@@LocalResourcesAssemblies";
-		public const string DefaultCultureKey = ".:!DefaultCulture!:.";
 		
 		bool isGlobal;
 		AppResourceFilesCollection files;
 		string tempDirectory;
 		string virtualPath;
 		Dictionary <string, List <string>> cultureFiles;
+		List <string> defaultCultureFiles;
 		
 		string TempDirectory {
 			get {
@@ -227,6 +228,50 @@ namespace System.Web.Compilation
 		public Dictionary <string, List <string>> CultureFiles {
 			get { return cultureFiles; }
 		}
+
+		public List <string> DefaultCultureFiles {
+			get { return defaultCultureFiles; }
+		}
+		
+		static AppResourcesCompiler ()
+		{
+			if (!BuildManager.IsPrecompiled)
+				return;
+
+			string[] binDirAssemblies = HttpApplication.BinDirectoryAssemblies;
+			if (binDirAssemblies == null || binDirAssemblies.Length == 0)
+				return;
+
+			string name;
+			Assembly asm;
+			foreach (string asmPath in binDirAssemblies) {
+				if (String.IsNullOrEmpty (asmPath))
+					continue;
+				
+				name = Path.GetFileName (asmPath);
+				if (name.StartsWith ("App_LocalResources.", StringComparison.OrdinalIgnoreCase)) {
+					string virtualPath = GetPrecompiledVirtualPath (asmPath);
+					if (String.IsNullOrEmpty (virtualPath))
+						continue;
+
+					asm = LoadAssembly (asmPath);
+					if (asm == null)
+						continue;
+					
+					AddAssemblyToCache (virtualPath, asm);
+					continue;
+				}
+
+				if (String.Compare (name, "App_GlobalResources.dll", StringComparison.OrdinalIgnoreCase) != 0)
+					continue;
+
+				asm = LoadAssembly (asmPath);
+				if (asm == null)
+					continue;
+
+				HttpContext.AppGlobalResourcesAssembly = asm;
+			}
+		}
 		
 		public AppResourcesCompiler (HttpContext context)
 		{
@@ -243,6 +288,34 @@ namespace System.Web.Compilation
 			this.files = new AppResourceFilesCollection (HttpContext.Current.Request.MapPath (virtualPath));
 			this.cultureFiles = new Dictionary <string, List <string>> ();
 		}
+
+		static Assembly LoadAssembly (string asmPath)
+		{
+			try {
+				return Assembly.LoadFrom (asmPath);
+			} catch (BadImageFormatException) {
+				// ignore
+				return null;
+			}
+		}
+		
+		static string GetPrecompiledVirtualPath (string asmPath)
+		{
+			string compiledFile = Path.ChangeExtension (asmPath, ".compiled");
+			
+			if (!File.Exists (compiledFile))
+				return null;
+
+			var pfile = new PreservationFile (compiledFile);
+			string virtualPath = pfile.VirtualPath;
+			if (String.IsNullOrEmpty (virtualPath))
+				return "/";
+
+			if (virtualPath.EndsWith ("/App_LocalResources/", StringComparison.OrdinalIgnoreCase))
+				virtualPath = virtualPath.Substring (0, virtualPath.Length - 19);
+			
+			return virtualPath;
+		}
 		
 		public Assembly Compile ()
 		{
@@ -341,7 +414,7 @@ namespace System.Web.Compilation
 			return cache [path];
 		}
 		
-		void AddAssemblyToCache (string path, Assembly asm)
+		static void AddAssemblyToCache (string path, Assembly asm)
 		{
 			Cache runtimeCache = HttpRuntime.InternalCache;
 			Dictionary <string, Assembly> cache;
@@ -388,16 +461,20 @@ namespace System.Web.Compilation
 				resfile = arfi.Info.FullName;
 			if (!String.IsNullOrEmpty (resfile)) {
 				string culture = IsFileCultureValid (resfile);
-				if (culture == null)
-					culture = DefaultCultureKey;
-				
 				List <string> cfiles;
-				if (cultureFiles.ContainsKey (culture))
-					cfiles = cultureFiles [culture];
-				else {
-					cfiles = new List <string> (1);
-					cultureFiles [culture] = cfiles;
+				if (culture != null) {
+					if (cultureFiles.ContainsKey (culture))
+						cfiles = cultureFiles [culture];
+					else {
+						cfiles = new List <string> (1);
+						cultureFiles [culture] = cfiles;
+					}
+				} else {
+					if (defaultCultureFiles == null)
+						defaultCultureFiles = new List <string> ();
+					cfiles = defaultCultureFiles;
 				}
+				
 				cfiles.Add (resfile);
 			}
 				
@@ -589,7 +666,7 @@ namespace System.Web.Compilation
 					
 					cmp = new CodeMemberProperty ();
 					cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static;
-					cmp.Name = SanitizeResourceName ((string)de.Key);
+					cmp.Name = SanitizeResourceName (provider, (string)de.Key);
 					cmp.HasGet = true;
 					CodePropertyResourceGet (cmp.GetStatements, (string)de.Key, type, classname);
 					cmp.Type = new CodeTypeReference (type);
@@ -605,9 +682,52 @@ namespace System.Web.Compilation
 			unit.Namespaces.Add (ns);
 		}
 
-		string SanitizeResourceName (string name)
+		static bool is_identifier_start_character (int c)
 		{
-			return name.Replace (' ', '_').Replace ('-', '_').Replace ('.', '_');
+			return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_' || Char.IsLetter ((char)c);
+		}
+
+		static bool is_identifier_part_character (char c)
+		{
+			if (c >= 'a' && c <= 'z')
+				return true;
+
+			if (c >= 'A' && c <= 'Z')
+				return true;
+
+			if (c == '_' || (c >= '0' && c <= '9'))
+				return true;
+
+			if (c < 0x80)
+				return false;
+
+			return Char.IsLetter (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation;
+		}
+		
+		string SanitizeResourceName (CodeDomProvider provider, string name)
+		{
+			if (provider.IsValidIdentifier (name))
+				return provider.CreateEscapedIdentifier (name);
+
+			var sb = new StringBuilder ();
+			char ch = name [0];
+			if (is_identifier_start_character (ch))
+				sb.Append (ch);
+			else {
+				sb.Append ('_');
+				if (ch >= '0' && ch <= '9')
+					sb.Append (ch);
+			}
+			
+			for (int i = 1; i < name.Length; i++) {
+				ch = name [i];
+				if (is_identifier_part_character (ch))
+					sb.Append (ch);
+				else
+					sb.Append ('_');
+			}
+			
+			return provider.CreateEscapedIdentifier (sb.ToString ());
 		}
 		
 		CodeObjectCreateExpression NewResourceManager (string name, string typename)
diff --git a/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs b/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
index 7cbb6f0..2296866 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AspComponentFoundry.cs
@@ -29,8 +29,10 @@
 //
 using System;
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
+using System.Web.Util;
 
 #if NET_2_0
 using System.Collections.Generic;
@@ -223,7 +225,7 @@ namespace System.Web.Compilation
 
 		void RegisterConfigControls ()
 		{
-			PagesSection pages = WebConfigurationManager.GetWebApplicationSection ("system.web/pages") as PagesSection;
+			PagesSection pages = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
 			if (pages == null)
 				return;
 
@@ -349,7 +351,7 @@ namespace System.Web.Compilation
 			{
 				source = null;
 				ns = null;
-				if (0 != String.Compare (componentName, tagName, true))
+				if (0 != String.Compare (componentName, tagName, true, Helpers.InvariantCulture))
 					return null;
 
 #if NET_2_0
diff --git a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs
index b2edfb2..cae0f60 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AspGenerator.cs
@@ -3,9 +3,10 @@
 //
 // Authors:
 //	Gonzalo Paniagua Javier (gonzalo at ximian.com)
+//      Marek Habersack <mhabersack at novell.com>
 //
 // (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
-// Copyright (c) 2004,2006 Novell, Inc (http://www.novell.com)
+// Copyright (c) 2004-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -42,6 +43,10 @@ using System.Web.UI;
 using System.Web.UI.HtmlControls;
 using System.Web.Util;
 
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
 namespace System.Web.Compilation
 {
 	class BuilderLocation
@@ -52,7 +57,7 @@ namespace System.Web.Compilation
 		public BuilderLocation (ControlBuilder builder, ILocation location)
 		{
 			this.Builder = builder;
-			this.Location = location;
+			this.Location = new Location (location);
 		}
 	}
 
@@ -165,7 +170,7 @@ namespace System.Web.Compilation
 			if (tags.Count == 0)
 				return false;
 
-			return 0 == String.Compare (tagid, (string) tags.Peek (), true, CultureInfo.InvariantCulture);
+			return 0 == String.Compare (tagid, (string) tags.Peek (), true, Helpers.InvariantCulture);
 		}
 		
 		public int Count {
@@ -177,6 +182,33 @@ namespace System.Web.Compilation
 		}
 	}
 
+	enum TextBlockType
+	{
+		Verbatim,
+		Expression,
+		Tag,
+		Comment
+	}
+	
+	sealed class TextBlock
+	{
+		public string Content;
+		public readonly TextBlockType Type;
+		public readonly int Length;
+		
+		public TextBlock (TextBlockType type, string content)
+		{
+			Content = content;
+			Type = type;
+			Length = content.Length;
+		}
+
+		public override string ToString ()
+		{
+			return this.GetType ().FullName + " [" + this.Type + "]";
+		}
+	}
+	
 	class AspGenerator
 	{
 #if NET_2_0
@@ -184,6 +216,25 @@ namespace System.Web.Compilation
 		
 		internal static Regex DirectiveRegex = new Regex (@"<%\s*@(\s*(?<attrname>\w[\w:]*(?=\W))(\s*(?<equal>=)\s*""(?<attrval>[^""]*)""|\s*(?<equal>=)\s*'(?<attrval>[^']*)'|\s*(?<equal>=)\s*(?<attrval>[^\s%>]*)|(?<equal>)(?<attrval>\s*?)))*\s*?%>", RegexOptions.Compiled | RegexOptions.IgnoreCase);
 #endif
+		static readonly Regex runatServer = new Regex (@"<[\w:\.]+.*?runat=[""']?server[""']?.*?/?>",
+							       RegexOptions.Compiled | RegexOptions.Singleline |
+							       RegexOptions.Multiline | RegexOptions.IgnoreCase |
+							       RegexOptions.CultureInvariant);
+		
+		static readonly Regex endOfTag = new Regex (@"</[\w:\.]+\s*?>",
+							    RegexOptions.Compiled | RegexOptions.Singleline |
+							    RegexOptions.Multiline | RegexOptions.IgnoreCase |
+							    RegexOptions.CultureInvariant);
+		
+		static readonly Regex expressionRegex = new Regex (@"<%.*?%>",
+								   RegexOptions.Compiled | RegexOptions.Singleline |
+								   RegexOptions.Multiline | RegexOptions.IgnoreCase |
+								   RegexOptions.CultureInvariant);
+
+		static readonly Regex clientCommentRegex = new Regex (@"<!--(.|\s)*?-->",
+								      RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase |
+								      RegexOptions.CultureInvariant);
+		
 		ParserStack pstack;
 		BuilderLocationStack stack;
 		TemplateParser tparser;
@@ -333,7 +384,7 @@ namespace System.Web.Compilation
 			if (matches == null || matches.Count == 0)
 				return null;
 
-			string wantedDirectiveName = tparser.DefaultDirectiveName.ToLower ();
+			string wantedDirectiveName = tparser.DefaultDirectiveName.ToLower (Helpers.InvariantCulture);
 			string directiveName;
 			GroupCollection groups;
 			CaptureCollection ccNames;
@@ -348,7 +399,7 @@ namespace System.Web.Compilation
 				if (String.IsNullOrEmpty (directiveName))
 					continue;
 				
-				if (String.Compare (directiveName.ToLower (), wantedDirectiveName, StringComparison.Ordinal) != 0)
+				if (String.Compare (directiveName.ToLower (Helpers.InvariantCulture), wantedDirectiveName, StringComparison.Ordinal) != 0)
 					continue;
 
 				var loc = new Location (null);
@@ -523,6 +574,60 @@ namespace System.Web.Compilation
 			InitParser (reader, filename);
 		}
 #endif
+
+		void CheckForDuplicateIds (ControlBuilder root, Stack scopes)
+		{
+			if (root == null)
+				return;
+			
+			if (scopes == null)
+				scopes = new Stack ();
+			
+#if NET_2_0
+			Dictionary <string, bool> ids;
+#else
+			Hashtable ids;
+#endif
+			
+			if (scopes.Count == 0 || root.IsNamingContainer) {
+#if NET_2_0
+				ids = new Dictionary <string, bool> (StringComparer.Ordinal);
+#else
+				ids = new Hashtable ();
+#endif
+				scopes.Push (ids);
+			} else {
+#if NET_2_0
+				ids = scopes.Peek () as Dictionary <string, bool>;
+#else
+				ids = scopes.Peek () as Hashtable;
+#endif
+			}
+			
+			if (ids == null)
+				return;
+
+			ControlBuilder cb;
+			string id;
+			ArrayList children = root.Children;
+			if (children != null) {
+				foreach (object o in children) {
+					cb = o as ControlBuilder;
+					if (cb == null)
+						continue;
+
+					id = cb.ID;
+					if (id == null || id.Length == 0)
+						continue;
+				
+					if (ids.ContainsKey (id))
+						throw new ParseException (cb.Location, "Id '" + id + "' is already used by another control.");
+
+					ids.Add (id, true);
+					CheckForDuplicateIds (cb, scopes);
+				}
+			}
+		}
 		
 		public void Parse (string file)
 		{
@@ -558,6 +663,7 @@ namespace System.Web.Compilation
 					throw new ParseException (stack.Builder.Location,
 								  "Expecting </" + stack.Builder.TagName + "> " + stack.Builder);
 
+				CheckForDuplicateIds (RootBuilder, null);
 			} finally {
 				if (reader != null)
 					reader.Close ();
@@ -643,8 +749,15 @@ namespace System.Web.Compilation
 				return type;
 			}
 
+#if NET_2_0
 			Parse ();
-
+#else
+			try {
+				Parse ();
+			} catch (ParseException ex) {
+				throw new HttpException ("Compilation failed.", ex);
+			}
+#endif
 			BaseCompiler compiler = GetCompilerFromType ();
 			
 			type = compiler.GetCompiledType ();
@@ -660,8 +773,8 @@ namespace System.Web.Compilation
 
 			string i = new string ('\t', indent);
 			Console.Write (i);
-			Console.WriteLine ("b: {0} id: {1} type: {2} parent: {3}",
-					   builder, builder.ID, builder.ControlType, builder.ParentBuilder);
+			Console.WriteLine ("b: {0}; naming container: {1}; id: {2}; type: {3}; parent: {4}",
+					   builder, builder.IsNamingContainer, builder.ID, builder.ControlType, builder.ParentBuilder);
 
 			if (builder.Children != null)
 			foreach (object o in builder.Children) {
@@ -698,10 +811,6 @@ namespace System.Web.Compilation
 		// The kludge supports only self-closing tags inside attributes.
 		//
 		// KLUDGE WARNING!!
-		static readonly Regex runatServer=new Regex (@"<[\w:\.]+.*?runat=[""']?server[""']?.*?/>",
-							     RegexOptions.Compiled | RegexOptions.Singleline |
-							     RegexOptions.Multiline | RegexOptions.IgnoreCase |
-							     RegexOptions.CultureInvariant);
 		bool ProcessTagsInAttributes (ILocation location, string tagid, TagAttributes attributes, TagType type)
 		{
 			if (attributes == null || attributes.Count == 0)
@@ -739,7 +848,7 @@ namespace System.Web.Compilation
 
 				TextParsed (location, String.Format (" {0}=\"{1}", key, index > 0 ? value.Substring (0, index) : String.Empty));;
 				FlushText ();
-				ParseAttributeTag (group.Value);
+				ParseAttributeTag (group.Value, location);
 				if (index + length < value.Length)
 					TextParsed (location, value.Substring (index + length) + "\"");
 				else
@@ -756,9 +865,9 @@ namespace System.Web.Compilation
 			return retval;
 		}
 
-		void ParseAttributeTag (string code)
+		void ParseAttributeTag (string code, ILocation location)
 		{
-			AspParser parser = new AspParser ("@@attribute_tag@@", new StringReader (code));
+			AspParser parser = new AspParser ("@@attribute_tag@@", new StringReader (code), location.BeginLine - 1, location as AspParser);
 			parser.Error += new ParseErrorHandler (ParseError);
 			parser.TagParsed += new TagParsedHandler (TagParsed);
 			parser.TextParsed += new TextParsedHandler (TextParsed);
@@ -793,9 +902,9 @@ namespace System.Web.Compilation
 				Directory.SetCurrentDirectory (origdir);
 				if (newdir [newdir.Length - 1] != '/')
 					newdir += "/";
-			} catch (DirectoryNotFoundException ex) {
+			} catch (DirectoryNotFoundException) {
 				return; // will be converted into 404
-			} catch (FileNotFoundException ex) {
+			} catch (FileNotFoundException) {
 				return; // as above
 			} catch (Exception ex) {
 				// better safe than sorry
@@ -805,6 +914,17 @@ namespace System.Web.Compilation
 			if (exception != null || !StrUtils.StartsWith (newdir, HttpRuntime.AppDomainAppPath))
 				throw new ParseException (Location, "Files above the application's root directory cannot be included.");
 		}
+
+		string ChopOffTagStart (ILocation location, string content, string tagid)
+		{
+			string tagstart = '<' + tagid;
+			if (content.StartsWith (tagstart)) {
+				TextParsed (location, tagstart);
+				content = content.Substring (tagstart.Length);
+			}
+
+			return content;
+		}
 		
 		void TagParsed (ILocation location, TagType tagtype, string tagid, TagAttributes attributes)
 		{
@@ -817,7 +937,7 @@ namespace System.Web.Compilation
 			if (text.Length != 0)
 				FlushText (lastTag == TagType.CodeRender);
 
-			if (0 == String.Compare (tagid, "script", true, CultureInfo.InvariantCulture)) {
+			if (0 == String.Compare (tagid, "script", true, Helpers.InvariantCulture)) {
 				bool in_script = (inScript || ignore_text);
 				if (in_script) {
 					if (ProcessScript (tagtype, attributes))
@@ -850,7 +970,7 @@ namespace System.Web.Compilation
 				{
 					string plainText = location.PlainText;
 					if (!ProcessTagsInAttributes (location, tagid, attributes, TagType.Tag))
-						TextParsed (location, plainText);
+						TextParsed (location, ChopOffTagStart (location, plainText, tagid));
 				}
 				break;
 			case TagType.Close:
@@ -865,7 +985,7 @@ namespace System.Web.Compilation
 				if (!ProcessTag (location, tagid, attributes, tagtype, out tagIgnored) && !tagIgnored) {
 					string plainText = location.PlainText;
 					if (!ProcessTagsInAttributes (location, tagid, attributes, TagType.SelfClosing))
-						TextParsed (location, plainText);
+						TextParsed (location, ChopOffTagStart (location, plainText, tagid));
 				} else if (stack.Count != count) {
 					CloseControl (tagid);
 				}
@@ -930,7 +1050,7 @@ namespace System.Web.Compilation
 
 			for (int idx = otags.Count - 1; idx >= 0; idx--) {
 				string otagid = (string) otags [idx];
-				if (0 == String.Compare (tagid, otagid, true, CultureInfo.InvariantCulture)) {
+				if (0 == String.Compare (tagid, otagid, true, Helpers.InvariantCulture)) {
 					do {
 						otags.RemoveAt (idx);
 					} while (otags.Count - 1 >= idx);
@@ -947,48 +1067,134 @@ namespace System.Web.Compilation
 
 			return Path.GetFullPath (Path.Combine (basedir, filename));
 		}
+
+		delegate bool CheckBlockEnd (string text);
 		
+		bool CheckTagEndNeeded (string text)
+		{
+			return !text.EndsWith ("/>");
+		}
+		
+#if NET_2_0
+		List <TextBlock>
+#else
+		ArrayList
+#endif
+		FindRegexBlocks (Regex rxStart, Regex rxEnd, CheckBlockEnd checkEnd, IList blocks, TextBlockType typeForMatches, bool discardBlocks)
+		{
+#if NET_2_0
+			var ret = new List <TextBlock> ();
+#else
+			ArrayList ret = new ArrayList ();
+#endif
+			
+			foreach (TextBlock block in blocks) {
+				if (block.Type != TextBlockType.Verbatim) {
+					ret.Add (block);
+					continue;
+				}
+
+				int lastIndex = 0, index;
+				MatchCollection matches = rxStart.Matches (block.Content);
+				bool foundMatches = matches.Count > 0;
+				foreach (Match match in matches) {
+					foundMatches = true;
+					index = match.Index;
+					if (lastIndex < index)
+						ret.Add (new TextBlock (TextBlockType.Verbatim, block.Content.Substring (lastIndex, index - lastIndex)));
+
+					string value = match.Value;
+					if (rxEnd != null && checkEnd (value)) {
+						int startFrom = index + value.Length;
+						Match m = rxEnd.Match (block.Content, startFrom);
+						if (m.Success)
+							value += block.Content.Substring (startFrom, m.Index - startFrom) + m.Value;
+					}
+
+					if (!discardBlocks)
+						ret.Add (new TextBlock (typeForMatches, value));
+					lastIndex = index + value.Length;
+				}
+
+				if (lastIndex > 0 && lastIndex < block.Content.Length)
+					ret.Add (new TextBlock (TextBlockType.Verbatim, block.Content.Substring (lastIndex)));
+
+				if (!foundMatches)
+					ret.Add (block);
+			}
+
+			return ret;
+		}
+		
+		IList SplitTextIntoBlocks (string text)
+		{
+#if NET_2_0
+			var ret = new List <TextBlock> ();
+#else
+			ArrayList ret = new ArrayList ();
+#endif
+
+			ret.Add (new TextBlock (TextBlockType.Verbatim, text));
+			ret = FindRegexBlocks (clientCommentRegex, null, null, ret, TextBlockType.Comment, false);
+			ret = FindRegexBlocks (runatServer, endOfTag, CheckTagEndNeeded, ret, TextBlockType.Tag, false);
+			ret = FindRegexBlocks (expressionRegex, null, null, ret, TextBlockType.Expression, false);
+
+			return ret;
+		}
+
 		void TextParsed (ILocation location, string text)
 		{
 			if (ignore_text)
 				return;
 
-			// And again... the first one wins - if we have expressions and server-side
-			// controls together in one block of plain text, tough luck...
-			if (text.IndexOf ("<%") != -1 && !inScript) {
-				if (this.text.Length > 0)
-					FlushText (true);
-				CodeRenderParser r = new CodeRenderParser (text, stack.Builder);
-				r.AddChildren (this);
+			if (inScript) {
+				this.text.Append (text);
+				FlushText (true);
 				return;
 			}
+			
+			IList blocks = SplitTextIntoBlocks (text);
+			foreach (TextBlock block in blocks) {
+				switch (block.Type) {
+					case TextBlockType.Verbatim:
+						this.text.Append (block.Content);
+						break;
 
-			int startIndex = 0, index = 0;
-			Match match;
-			int textLen = text.Length;
+					case TextBlockType.Expression:
+						if (this.text.Length > 0)
+							FlushText (true);
+						CodeRenderParser r = new CodeRenderParser (block.Content, stack.Builder, location);
+						r.AddChildren (this);
+						break;
 
-			while (index > -1 && startIndex < textLen) {
-				match = runatServer.Match (text, index);
-					
-				if (match.Success) {
-					string value = match.Value;
-					index = match.Index;
-					if (index > startIndex)
-						this.text.Append (text.Substring (startIndex, index - startIndex));
-					ParseAttributeTag (value);
-					index += value.Length;
-					startIndex = index;
-				} else
-					break;
+					case TextBlockType.Tag:
+						ParseAttributeTag (block.Content, location);
+						break;
 
-				if (index < textLen)
-					index = text.IndexOf ('<', index);
-				else
-					break;
+					case TextBlockType.Comment: {
+						this.text.Append ("<!--");
+						FlushText (true);
+						string blockToParse = block.Content.Substring (4, block.Length - 7);
+						bool condEndif;
+						if (blockToParse.EndsWith ("<![endif]")) {
+							blockToParse = blockToParse.Substring (0, blockToParse.Length - 9);
+							condEndif = true;
+						} else
+							condEndif = false;
+						
+						AspParser parser = new AspParser ("@@comment_code@@", new StringReader (blockToParse), location.BeginLine - 1, location as AspParser);
+						parser.Error += new ParseErrorHandler (ParseError);
+						parser.TagParsed += new TagParsedHandler (TagParsed);
+						parser.TextParsed += new TextParsedHandler (TextParsed);
+						parser.Parse ();
+						if (condEndif)
+							this.text.Append ("<![endif]");
+						this.text.Append ("-->");
+						FlushText (true);
+						break;
+					}
+				}
 			}
-			
-			this.text.Append (text.Substring (startIndex));
-			//PrintLocation (location);
 		}
 
 		void FlushText ()
@@ -1088,15 +1294,15 @@ namespace System.Web.Compilation
 		{
 			ignored = false;
 			if (isApplication) {
-				if (String.Compare (tagid, "object", true, CultureInfo.InvariantCulture) != 0)
+				if (String.Compare (tagid, "object", true, Helpers.InvariantCulture) != 0)
 					throw new ParseException (location, "Invalid tag for application file.");
 			}
 
 			ControlBuilder parent = stack.Builder;
 			ControlBuilder builder = null;
 			if (parent != null && parent.ControlType == typeof (HtmlTable) &&
-			    (String.Compare (tagid, "thead", true, CultureInfo.InvariantCulture) == 0 ||
-			     String.Compare (tagid, "tbody", true, CultureInfo.InvariantCulture) == 0)) {
+			    (String.Compare (tagid, "thead", true, Helpers.InvariantCulture) == 0 ||
+			     String.Compare (tagid, "tbody", true, Helpers.InvariantCulture) == 0)) {
 				ignored = true;
 				return true;
 			}
@@ -1202,7 +1408,7 @@ namespace System.Web.Compilation
 					CheckLanguage (language);
 					string src = (string) attributes ["src"];
 					if (src != null) {
-						if (src == "")
+						if (src.Length == 0)
 							throw new ParseException (Parser,
 								"src cannot be an empty string");
 
@@ -1226,7 +1432,14 @@ namespace System.Web.Compilation
 						Parser.VerbatimID = "script";
 						javascript = true;
 					}
-					TextParsed (location, location.PlainText);
+					string content = location.PlainText;
+					/* HACK, HACK, HACK */
+					if (content.StartsWith ("<script")) {
+						TextParsed (location, "<script");
+						content = content.Substring (7);
+					}
+
+					TextParsed (location, content);
 					return true;
 				}
 			}
@@ -1251,8 +1464,8 @@ namespace System.Web.Compilation
 		{
 			ControlBuilder current = stack.Builder;
 			string btag = current.OriginalTagName;
-			if (String.Compare (btag, "tbody", true, CultureInfo.InvariantCulture) != 0 &&
-			    String.Compare (tagid, "tbody", true, CultureInfo.InvariantCulture) == 0) {
+			if (String.Compare (btag, "tbody", true, Helpers.InvariantCulture) != 0 &&
+			    String.Compare (tagid, "tbody", true, Helpers.InvariantCulture) == 0) {
 				if (!current.ChildrenAsProperties) {
 					try {
 						TextParsed (location, location.PlainText);
@@ -1262,10 +1475,10 @@ namespace System.Web.Compilation
 				return true;
 			}
 
-			if (current.ControlType == typeof (HtmlTable) && String.Compare (tagid, "thead", true, CultureInfo.InvariantCulture) == 0)
+			if (current.ControlType == typeof (HtmlTable) && String.Compare (tagid, "thead", true, Helpers.InvariantCulture) == 0)
 				return true;
 			
-			if (0 != String.Compare (tagid, btag, true, CultureInfo.InvariantCulture))
+			if (0 != String.Compare (tagid, btag, true, Helpers.InvariantCulture))
 				return false;
 
 			// if (current is TemplateBuilder)
@@ -1348,7 +1561,7 @@ namespace System.Web.Compilation
 			if (lang == null || lang == "")
 				return;
 
-			if (String.Compare (lang, tparser.Language, true, CultureInfo.InvariantCulture) == 0)
+			if (String.Compare (lang, tparser.Language, true, Helpers.InvariantCulture) == 0)
 				return;
 
 #if NET_2_0
@@ -1369,11 +1582,13 @@ namespace System.Web.Compilation
 			string str;
 			ControlBuilder builder;
 			AspGenerator generator;
+			ILocation location;
 			
-			public CodeRenderParser (string str, ControlBuilder builder)
+			public CodeRenderParser (string str, ControlBuilder builder, ILocation location)
 			{
 				this.str = str;
 				this.builder = builder;
+				this.location = location;
 			}
 
 			public void AddChildren (AspGenerator generator)
@@ -1389,7 +1604,7 @@ namespace System.Web.Compilation
 			void DoParseExpressions (string str)
 			{
 				int startIndex = 0, index = 0;
-				Regex codeDirective = new Regex ("(<%(?!@)(?<code>.*?)%>)|(<[\\w:\\.]+.*?runat=[\"']?server[\"']?.*?/>)",
+				Regex codeDirective = new Regex ("(<%(?!@)(?<code>(.|\\s)*?)%>)|(<[\\w:\\.]+.*?runat=[\"']?server[\"']?.*?/>)",
 								 RegexOptions.Multiline | RegexOptions.Compiled | RegexOptions.CultureInvariant);
 				Match match;
 				int strLen = str.Length;
@@ -1420,7 +1635,7 @@ namespace System.Web.Compilation
 			
 			void DoParse (string str)
 			{
-				AspParser parser = new AspParser ("@@nested_tag@@", new StringReader (str));
+				AspParser parser = new AspParser ("@@code_render@@", new StringReader (str), location.BeginLine - 1, location as AspParser);
 				parser.Error += new ParseErrorHandler (ParseError);
 				parser.TagParsed += new TagParsedHandler (TagParsed);
 				parser.TextParsed += new TextParsedHandler (TextParsed);
diff --git a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
index 5c83cbd..472f100 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AspParser.cs
@@ -65,6 +65,9 @@ namespace System.Web.Compilation
 		string verbatimID;
 		string fileText;
 		StringReader fileReader;
+		bool _internal;
+		int _internalLineOffset;
+		AspParser outer;
 		
 		EventHandlerList events = new EventHandlerList ();
 		
@@ -95,9 +98,18 @@ namespace System.Web.Compilation
 			this.filename = filename;
 			this.fileText = input.ReadToEnd ();
 			this.fileReader = new StringReader (this.fileText);
+			this._internalLineOffset = 0;
 			tokenizer = new AspTokenizer (this.fileReader);
 		}
 
+		public AspParser (string filename, TextReader input, int startLineOffset, AspParser outer)
+			: this (filename, input)
+		{
+			this._internal = true;
+			this._internalLineOffset = startLineOffset;
+			this.outer = outer;
+		}
+		
 #if NET_2_0
 		public byte[] MD5Checksum {
 			get {
@@ -110,7 +122,12 @@ namespace System.Web.Compilation
 #endif
 		
 		public int BeginLine {
-			get { return beginLine; }
+			get {
+				if (Internal)
+					return beginLine + InternalLineOffset;
+
+				return beginLine;
+			}
 		}
 
 		public int BeginColumn {
@@ -118,19 +135,38 @@ namespace System.Web.Compilation
 		}
 
 		public int EndLine {
-			get { return endLine; }
+			get {
+				if (Internal)
+					return endLine + InternalLineOffset;
+				return endLine;
+			}
 		}
 
 		public int EndColumn {
 			get { return endColumn; }
 		}
 
+		public bool Internal {
+			get { return _internal; }
+			set { _internal = value; }
+		}
+
+		public int InternalLineOffset {
+			get { return _internalLineOffset; }
+			set { _internalLineOffset = value; }
+		}
+		
 		public string FileText {
 			get {
-				if (fileText != null)
-					return fileText;
+				string ret = null;
 				
-				return null;
+				if (Internal && outer != null)
+					ret = outer.FileText;
+				
+				if (ret == null && fileText != null)
+					ret = fileText;
+				
+				return ret;
 			}
 		}
 		
@@ -139,12 +175,31 @@ namespace System.Web.Compilation
 				if (beginPosition >= endPosition || fileText == null)
 					return null;
 
-				return fileText.Substring (beginPosition, endPosition - beginPosition);
+				string text = FileText;
+				int start, len;
+				
+				if (Internal && outer != null) {
+					start = beginPosition + InternalLineOffset;
+					len = (endPosition + InternalLineOffset) - start;
+				} else {
+					start = beginPosition;
+					len = endPosition - beginPosition;
+				}
+				
+				if (text != null)
+					return text.Substring (start, len);
+
+				return null;
 			}
 		}
 
 		public string Filename {
-			get { return filename; }
+			get {
+				if (Internal && outer != null)
+					return outer.Filename;
+				
+				return filename;
+			}
 		}
 
 		public string VerbatimID {
@@ -469,14 +524,14 @@ namespace System.Web.Compilation
 				token = tokenizer.get_token ();
 			}
 
-			end = end.ToLower (CultureInfo.InvariantCulture);
+			end = end.ToLower (Helpers.InvariantCulture);
 			int repeated = 0;
 			for (int k = 0; k < end.Length; k++)
 				if (end [0] == end [k])
 					repeated++;
 			
 			while (token != Token.EOF){
-				if (Char.ToLower ((char) token, CultureInfo.InvariantCulture) == end [i]){
+				if (Char.ToLower ((char) token, Helpers.InvariantCulture) == end [i]){
 					if (++i >= end.Length)
 						break;
 					tmp.Append ((char) token);
@@ -556,9 +611,18 @@ namespace System.Web.Compilation
 			bool databinding;
 			varname = Eat ('=');
 			databinding = !varname && Eat ('#');
-
+			string odds = tokenizer.Odds;
+			
 			tokenizer.Verbatim = true;
 			inside_tags = GetVerbatim (tokenizer.get_token (), "%>");
+			if (databinding && odds != null && odds.Length > 0) {
+				databinding = false;
+
+				// We encountered <% #something here %>, this should be passed
+				// verbatim to the compiler
+				inside_tags = '#' + inside_tags;
+			}			
+
 			tokenizer.Verbatim = false;
 			id = inside_tags;
 			attributes = null;
diff --git a/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs b/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs
index 7c354e7..ce997cc 100644
--- a/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs
@@ -449,7 +449,7 @@ namespace System.Web.Compilation {
 				return; // maybe better to throw an exception here?
 			ICodePragmaGenerator pragmaGenerator;
 			
-			switch (extension.ToLower ()) {
+			switch (extension.ToLowerInvariant ()) {
 				case "cs":
 					pragmaGenerator = new CSharpCodePragmaGenerator ();
 					break;
diff --git a/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs
index 143b8be..ebabedf 100644
--- a/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/BaseCompiler.cs
@@ -67,6 +67,19 @@ namespace System.Web.Compilation
 		protected CodeTypeReferenceExpression mainClassExpr;
 		protected static CodeThisReferenceExpression thisRef = new CodeThisReferenceExpression ();
 
+#if NET_2_0
+		VirtualPath inputVirtualPath;
+		
+		public VirtualPath InputVirtualPath {
+			get {
+				if (inputVirtualPath == null)
+					inputVirtualPath = new VirtualPath (VirtualPathUtility.Combine (parser.BaseVirtualDir, Path.GetFileName (parser.InputFile)));
+
+				return inputVirtualPath;
+			}
+		}
+#endif
+		
 		protected BaseCompiler (TemplateParser parser)
 		{
 			this.parser = parser;
@@ -236,7 +249,7 @@ namespace System.Web.Compilation
 			mainClass.TypeAttributes = TypeAttributes.Public;
 			mainNS.Types.Add (mainClass);
 
-			foreach (object o in parser.Imports) {
+			foreach (object o in parser.Imports.Keys) {
 				if (o is string)
 					mainNS.Imports.Add (new CodeNamespaceImport ((string) o));
 			}
@@ -328,11 +341,7 @@ namespace System.Web.Compilation
 				return;
 			if (!baseType.IsSubclassOf (typeof (System.Web.UI.TemplateControl)))
 				return;
-
-			string arvp = Path.Combine (parser.BaseVirtualDir, Path.GetFileName (parser.InputFile));
-			if (VirtualPathUtility.IsAbsolute (arvp))
-				arvp = VirtualPathUtility.ToAppRelative (arvp);
-
+			
 			CodeTypeReference baseTypeRef = new CodeTypeReference (baseType.FullName);
 			if (parser.BaseTypeIsGlobal)
 				baseTypeRef.Options |= CodeTypeReferenceOptions.GlobalReference;
@@ -341,7 +350,7 @@ namespace System.Web.Compilation
 			CodePropertyReferenceExpression arvpProp = new CodePropertyReferenceExpression (cast, "AppRelativeVirtualPath");
 			CodeAssignStatement arvpAssign = new CodeAssignStatement ();
 			arvpAssign.Left = arvpProp;
-			arvpAssign.Right = new CodePrimitiveExpression (VirtualPathUtility.RemoveTrailingSlash (arvp));
+			arvpAssign.Right = new CodePrimitiveExpression (VirtualPathUtility.RemoveTrailingSlash (InputVirtualPath.AppRelative));
 			ctor.Statements.Add (arvpAssign);
 		}
 #endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs b/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
index 0cdbb47..0e49194 100644
--- a/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs
@@ -319,6 +319,10 @@ namespace System.Web.Compilation {
 			remove { events.RemoveHandler (buildManagerRemoveEntryEvent, value); }
 		}
 		
+		internal static bool IsPrecompiled {
+			get { return is_precompiled; }
+		}
+		
 		static BuildManager ()
 		{
 			if (HttpRuntime.CaseInsensitive)
@@ -426,19 +430,28 @@ namespace System.Web.Compilation {
 		// Deal with precompiled sites deployed in a different virtual path
 		static void FixVirtualPaths ()
  		{
+ 			if (precompiled == null)
+ 				return;
+ 
 			string [] parts;
 			int skip = -1;
 			foreach (string vpath in precompiled.Keys) {
 				parts = vpath.Split ('/');
 				for (int i = 0; i < parts.Length; i++) {
-					string test_path = String.Join ("/", parts, i, parts.Length - i);
+					if (String.IsNullOrEmpty (parts [i]))
+						continue;
+					// The path must be rooted, otherwise PhysicalPath returned
+					// below will be relative to the current request path and
+					// File.Exists will return a false negative. See bug #546053
+					string test_path = "/" + String.Join ("/", parts, i, parts.Length - i);
 					VirtualPath result = GetAbsoluteVirtualPath (test_path);
 					if (result != null && File.Exists (result.PhysicalPath)) {
-						skip = i;
+						skip = i - 1;
 						break;
 					}
 				}
 			}
+			
 			string app_vpath = HttpRuntime.AppDomainAppVirtualPath;
 			if (skip == -1 || (skip == 0 && app_vpath == "/"))
 				return;
@@ -479,9 +492,13 @@ namespace System.Web.Compilation {
 					// 3 -> ascx, aspx
 					// 6 -> app_code - nothing to do here
 					// 8 -> global.asax
-					// 9 -> App_GlobalResources - nothing to do?
+					// 9 -> App_GlobalResources - set the assembly for HttpContext
 					if (reader.Name == "resultType" && (val == "2" || val == "3" || val == "8"))
-						LoadPageData (reader);
+						LoadPageData (reader, true);
+					else if (val == "9") {
+						PreCompilationData pd = LoadPageData (reader, false);
+						HttpContext.AppGlobalResourcesAssembly = Assembly.Load (pd.AssemblyFileName);
+					}
 				}
 			}
 		}
@@ -493,22 +510,25 @@ namespace System.Web.Compilation {
 			public Type Type;
 		}
 
-		static void LoadPageData (XmlTextReader reader)
+		static PreCompilationData LoadPageData (XmlTextReader reader, bool store)
 		{
 			PreCompilationData pc_data = new PreCompilationData ();
 
 			while (reader.MoveToNextAttribute ()) {
 				string name = reader.Name;
 				if (name == "virtualPath")
-					pc_data.VirtualPath = reader.Value;
+					pc_data.VirtualPath = VirtualPathUtility.RemoveTrailingSlash (reader.Value);
 				else if (name == "assembly")
 					pc_data.AssemblyFileName = reader.Value;
 				else if (name == "type")
 					pc_data.TypeName = reader.Value;
 			}
-			if (precompiled == null)
-				precompiled = new Dictionary<string, PreCompilationData> (comparer);
-			precompiled.Add (pc_data.VirtualPath, pc_data);
+			if (store) {
+				if (precompiled == null)
+					precompiled = new Dictionary<string, PreCompilationData> (comparer);
+				precompiled.Add (pc_data.VirtualPath, pc_data);
+			}
+			return pc_data;
 		}
 
 		static void AddAssembly (Assembly asm, List <Assembly> al)
@@ -566,10 +586,16 @@ namespace System.Web.Compilation {
 			if (!VirtualPathUtility.IsRooted (virtualPath)) {
 				HttpContext ctx = HttpContext.Current;
 				HttpRequest req = ctx != null ? ctx.Request : null;
-
-				if (req != null)
-					vp = VirtualPathUtility.Combine (VirtualPathUtility.GetDirectory (req.FilePath), virtualPath);
-				else
+				
+				if (req != null) {
+					string fileDir = req.FilePath;
+					if (!String.IsNullOrEmpty (fileDir) && String.Compare (fileDir, "/", StringComparison.Ordinal) != 0)
+						fileDir = VirtualPathUtility.GetDirectory (fileDir);
+					else
+						fileDir = "/";
+
+					vp = VirtualPathUtility.Combine (fileDir, virtualPath);
+				} else
 					throw new HttpException ("No context, cannot map paths.");
 			} else
 				vp = virtualPath;
@@ -598,7 +624,6 @@ namespace System.Web.Compilation {
 				}
 				return pc_data.Type;
 			}
-			//Console.WriteLine ("VPath not precompiled: {0}", virtualPath);
 			return null;
 		}
 
@@ -707,16 +732,21 @@ namespace System.Web.Compilation {
 				doBatch = false;
 			
 			if (doBatch) {
-				if (dir == null)
-					throw new HttpException (404, "Virtual directory '" + virtualPath.Directory + "' does not exist.");
-				
 				BuildKind fileKind;
-				foreach (VirtualFile file in dir.Files) {
-					if (!knownFileTypes.TryGetValue (VirtualPathUtility.GetExtension (file.Name), out fileKind))
-						continue;
-
-					if (kind == fileKind)
-						ret.Add (file);
+				if (dir == null) {
+					VirtualFile vf = vpp.GetFile (vpAbsolute);
+					if (vf == null)
+						throw new HttpException (404, "Virtual directory '" + virtualPath.Directory + "' does not exist. Virtual file '" + vpAbsolute + "' does not exist.");
+					if (knownFileTypes.TryGetValue (VirtualPathUtility.GetExtension (vpAbsolute), out fileKind) && fileKind == fileKind)
+						ret.Add (vf);
+				} else {
+					foreach (VirtualFile file in dir.Files) {
+						if (!knownFileTypes.TryGetValue (VirtualPathUtility.GetExtension (file.Name), out fileKind))
+							continue;
+
+						if (kind == fileKind)
+							ret.Add (file);
+					}
 				}
 			} else {
 				VirtualFile vf = vpp.GetFile (vpAbsolute);
@@ -1243,8 +1273,13 @@ namespace System.Web.Compilation {
 						try {
 							GenerateAssembly (abuilder, buildItems, virtualPath, buildKind);
 						} catch (Exception ex) {
-							if (requestBuildItem == null || abuilder != originalRequestAssemblyBuilder)
-								throw;
+							if (requestBuildItem == null || abuilder != originalRequestAssemblyBuilder) {
+								if (ex.GetType () == typeof (HttpException))
+									throw;
+								
+								throw new HttpException ("Compilation failed.", ex);
+							}
+							
 							// There will be another assembly containing
 							// just the requested virtual path, let's
 							// give it a chance
@@ -1253,7 +1288,15 @@ namespace System.Web.Compilation {
 
 						if (needToBuildRequestItemAlone) {
 							AssignToAssemblyBuilder (assemblyBaseName, virtualPath, requestBuildItem, assemblyBuilders, true);
-							GenerateAssembly (requestBuildItem.assemblyBuilder, buildItems, virtualPath, buildKind);
+							try {
+								GenerateAssembly (requestBuildItem.assemblyBuilder, buildItems, virtualPath, buildKind);
+							} catch (Exception ex) {
+								if (ex.GetType () == typeof (HttpException))
+									throw;
+								
+								throw new HttpException ("Compilation failed.", ex);
+							}
+							
 							needToBuildRequestItemAlone = false;
 						}
 					}
diff --git a/mcs/class/System.Web/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/System.Web.Compilation/ChangeLog
index d49b97c..295b69d 100644
--- a/mcs/class/System.Web/System.Web.Compilation/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Compilation/ChangeLog
@@ -1,14 +1,134 @@
+2009-11-10  Marek Habersack  <mhabersack at novell.com>
+
+	* BaseCompiler.cs: parser.Imports is a Dictionary <>/Hashtable
+	now.
+
+	* AspComponentFoundry.cs: system.web/pages section is not confined
+	to the top-level web.config
+
+2009-11-03  Marek Habersack  <mhabersack at novell.com>
+
+	* AppResourcesCompiler.cs: put default culture resources in a
+	separate collection, exposed by the DefaultCultureFiles property.
+
+	* AppResourcesAssemblyBuilder.cs: compile the default assembly
+	before the satellite ones. Use the default assembly as template
+	for generation of the satellite ones.
+
+2009-10-22  Marek Habersack  <mhabersack at novell.com>
+
+	* WsdlBuildProvider.cs: a different way to generate code from
+	wsdl. Code is generated in the top-level namespace to match .NET
+
+2009-10-12  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: make sure to construct correct physical path
+	for every precompiled key in FixVirtualPaths. Fixes bug #546053
+
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* BuildManager.cs: load/set the global resources assembly for
+	precompiled and merged sites correctly.
+
+2009-09-30  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: if precompilation file contains virtual path
+	with trailing slash (e.g. for themes), remove the slash. Fixes bug
+	#541271
+
+2009-09-28  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateControlCompiler.cs: ResourceProviderHasObject calls
+	HttpContext.GetResourceProvider with the current file's path, not
+	current request's. Fixes situations when localized control lives
+	in a master page or user control. Fixes bug #542484
+
+	* BaseCompiler.cs: introduced a helper property InputVirtualPath
+	which returns a VirtualPath object for the current control's
+	virtual path.
+
+2009-09-22  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateControlCompiler.cs: ResourceProviderHasObject needs to
+	close ResourceReader instance obtained from resource provider.
+
+	* DefaultResourceProvider.cs: implemented the ResourceReader
+	property. Fixes bug #520397
+
+2009-09-08  Marek Habersack  <mhabersack at novell.com>
+
+	* AppCodeCompiler.cs: HaveCustomProfile returns true for profiles
+	which don't contain top-level properties. Fixes bug #535655
+
+	* BuildManager.cs: added IsPrecompiled internal property.
+
+	* AppResourcesCompiler.cs: load precompiled site local and global
+	resource assemblies from static constructor. Fixes bugs #536138
+	and #536143
+
+2009-09-03  Marek Habersack  <mhabersack at novell.com>
+
+	* AppResourcesCompiler.cs: SanitizeResourceName uses VB/C# rules
+	to attempt to create valid identifiers from resource
+	names. Identifier is also escaped by the CodeDOM provider before
+	returning. Possible fix for bug #536364
+
+2009-08-27  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: when HttpRequest.FilePath is '/' in
+	GetAbsoluteVirtualPath, don't try to use
+	VirtualPathUtility.GetDirectory on it. Fixes bug #532679
+
+2009-08-25  Marek Habersack  <mhabersack at novell.com>
+
+	* AspGenerator.cs: correctly parse server-side tags nested in
+	client-side ones. Fixes bug #323719
+
+2009-08-18  Marek Habersack  <mhabersack at novell.com>
+
+	* AspParser.cs: added a constructor which creates an internal
+	parser, nested within the outer one, and adjusts its ILocation
+	members to report correct locations in the outer parser for better
+	error reporting. Inner parser also returns the outer's FileText,
+	if available.
+
+	* AspGenerator.cs: restored part of r138474 reverted in r138657,
+	r138658 and r138659 to fix bug #525104
+	BuilderLocation creates a copy of Location for its own use (since
+	the ILocation passed is actually AspParser, the line numbers
+	change between creating a BuilderLocation and using its Location
+	member).
+	The end of tag, expression and client comment regular expressions
+	now use lazy quantifiers. This fixes bugs #525104 and #517656
+	Client side comment blocks aren't ignored anymore, they are parsed
+	just as the other parts of the document. Fixes bug #524358
+	
+2009-08-15  Marek Habersack  <mhabersack at novell.com>
+
+	* AspGenerator.cs: CodeRenderParser.DoParseExpressions - match
+	newline characters inside expressions. Fixes bug #526449
+
+2009-08-14  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: when VirtualPathProvider reports a virtual
+	directory doesn't exist, try to get the requested virtual path
+	using VirtualPathProvider.GetFile. Fixes #525974
+
+2009-08-12  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: show source code when an error occurs while
+	compiling a page. Fixes bug #518987
+
+2009-07-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* BuildManager.cs: path fixup should work now for /foo running on
+	/foo. Fixes bug #526563.
+
 2009-07-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* BuildManager.cs: precompilation setup failed if the precompiled
 	virtual directory was / and it was deployed somewhere else.
 
-2009-07-13  Marek Habersack  <mhabersack at novell.com>
-
-	* AppCodeCompiler.cs: wrap HttpApplication.LoadTypeFromBin call in
-	try/catch, so that we can wrap the possible exception in
-	HttpException.
-
 2009-07-21  Marek Habersack  <mhabersack at novell.com>
 
 	* AspTokenizer.cs: in put_back, store inTag value as well.
@@ -19,6 +139,36 @@
 	includes all assemblies from bin/ for precompiled sites. Fixes bug
 	#502016
 
+2009-07-18  Marek Habersack  <mhabersack at novell.com>
+
+	* DefaultResourceProvider.cs: if GetResourceObject is passed a
+	null or empty classKey it just returns null.
+
+	* AppResourcesAssemblyBuilder.cs: satellite assemblies are now
+	built using al instead of gmcs - makes the build slightly faster.
+
+2009-07-13  Marek Habersack  <mhabersack at novell.com>
+
+	* AppCodeCompiler.cs: wrap HttpApplication.LoadTypeFromBin call in
+	try/catch, so that we can wrap the possible exception in
+	HttpException.
+
+2009-07-09  Marek Habersack  <mhabersack at novell.com>
+
+	* DefaultResourceProvider.cs, DefaultResourceProviderFactory.cs:
+	added
+
+2009-06-30  Marek Habersack  <mhabersack at novell.com>
+
+	* AspGenerator.cs: TextParsed must remove client-side comments
+	from the passed text before attempting to parse the text for
+	server side controls and expressions. Fixes bug #517656
+
+2009-06-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* TemplateControlCompiler.cs: use the 'Empty' field for Unit and
+	FontUnit.
+
 2009-06-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* BuildManager.cs: backport r131138.
@@ -29,6 +179,10 @@
 	already exist. This can happen when recursively parsing an include
 	file. Fixes bug #512028
 
+2009-06-12  Marek Habersack  <mhabersack at novell.com>
+
+	* BuildManager.cs: avoid a NREX in FixVirtualPath
+
 2009-06-11  Marek Habersack  <mhabersack at novell.com>
 
 	* PageCompiler.cs: if generating code to assign output cache
diff --git a/mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs b/mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs
index 9b23fa5..c140b77 100644
--- a/mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/ClientBuildManager.cs
@@ -39,6 +39,7 @@ using System.Globalization;
 using System.IO;
 using System.Web;
 using System.Web.Hosting;
+using System.Web.Util;
 
 namespace System.Web.Compilation {
 	public sealed class ClientBuildManager : MarshalByRefObject, IDisposable {
@@ -110,14 +111,14 @@ namespace System.Web.Compilation {
 				if (app_id != null)
 					hashcode ^= Int32.Parse (app_id);
 
-				app_id = hashcode.ToString (CultureInfo.InvariantCulture);
+				app_id = hashcode.ToString (Helpers.InvariantCulture);
 				host = manager.CreateHostWithCheck (app_id, virt_dir, phys_src_dir);
 				cache_path = "";
 				//cache_path = Path.Combine (Path.GetTempPath (),
 					//String.Format ("{0}-temp-aspnet-{1:x}", Environment.UserName, i));
 
 				int hash = virt_dir.GetHashCode () << 5 + phys_src_dir.GetHashCode ();
-				cache_path = Path.Combine (cache_path, hash.ToString (CultureInfo.InvariantCulture));
+				cache_path = Path.Combine (cache_path, hash.ToString (Helpers.InvariantCulture));
 				Directory.CreateDirectory (cache_path);
 				OnAppDomainStarted ();
 				return host;
diff --git a/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProvider.cs b/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProvider.cs
new file mode 100644
index 0000000..9f286a0
--- /dev/null
+++ b/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProvider.cs
@@ -0,0 +1,179 @@
+// DefaultResourceProvider.cs
+//
+// Authors:
+//	Marek Habersack (mhabersack at novell.com)
+//
+// (C) 2009 Novell, Inc (http://novell.com)
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Resources;
+using System.Reflection;
+using System.Web;
+
+namespace System.Web.Compilation
+{
+	sealed class DefaultResourceProvider : IResourceProvider
+	{
+		sealed class ResourceManagerCacheKey
+		{
+			readonly string _name;
+			readonly Assembly _asm;
+
+			public ResourceManagerCacheKey (string name, Assembly asm)
+			{
+				_name = name;
+				_asm = asm;
+			}
+
+			public override bool Equals (object obj)
+			{
+				if (!(obj is ResourceManagerCacheKey))
+					return false;
+				ResourceManagerCacheKey key = (ResourceManagerCacheKey) obj;
+				return key._asm == _asm && _name.Equals (key._name, StringComparison.Ordinal);
+			}
+
+			public override int GetHashCode ()
+			{
+				return _name.GetHashCode () + _asm.GetHashCode ();
+			}
+		}
+		
+		[ThreadStatic]
+		static Dictionary <ResourceManagerCacheKey, ResourceManager> resourceManagerCache;
+		
+		string resource;
+		bool isGlobal;
+		
+		public IResourceReader ResourceReader {
+			get {
+				Assembly asm;
+				string path;
+					
+				if (isGlobal) {
+					asm = HttpContext.AppGlobalResourcesAssembly;
+					path = resource;
+				} else {
+					asm = GetLocalResourcesAssembly ();
+					path = Path.GetFileName (resource);
+
+					if (String.IsNullOrEmpty (path))
+						return null;
+
+					path += ".resources";
+				}
+							
+				if (asm == null)
+					return null;
+
+				Stream ms = asm.GetManifestResourceStream (path);
+				if (ms == null)
+					return null;
+				
+				return new ResourceReader (ms);
+			}
+		}
+		
+		public DefaultResourceProvider (string resource, bool isGlobal)
+		{
+			if (String.IsNullOrEmpty (resource))
+				throw new ArgumentNullException ("resource");
+			
+			this.resource = resource;
+			this.isGlobal = isGlobal;
+		}
+
+		public object GetObject (string resourceKey, CultureInfo culture)
+		{
+ 			if (String.IsNullOrEmpty (resourceKey))
+				return null;
+			
+			ResourceManager rm = GetResourceManager ();
+			if (rm == null)
+				return null;
+
+			return rm.GetObject (resourceKey, culture);
+		}
+
+		Assembly GetLocalResourcesAssembly ()
+		{
+			string path;
+			Assembly asm;
+
+			path = VirtualPathUtility.GetDirectory (resource);
+			asm = AppResourcesCompiler.GetCachedLocalResourcesAssembly (path);
+			if (asm == null) {
+				AppResourcesCompiler ac = new AppResourcesCompiler (path);
+				asm = ac.Compile ();
+				if (asm == null)
+					throw new MissingManifestResourceException ("A resource object was not found at the specified virtualPath.");
+			}
+
+			return asm;
+		}
+		
+		ResourceManager GetResourceManager ()
+		{
+			string path;
+			Assembly asm;
+
+			if (isGlobal) {
+				asm = HttpContext.AppGlobalResourcesAssembly;
+				path = resource;
+			} else {
+				asm = GetLocalResourcesAssembly ();
+				path = Path.GetFileName (resource);
+
+				if (String.IsNullOrEmpty (path))
+					return null;
+			}
+
+			if (asm == null)
+				return null;
+			
+			ResourceManager rm;
+			try {
+				if (resourceManagerCache == null)
+					resourceManagerCache = new Dictionary <ResourceManagerCacheKey, ResourceManager> ();
+				
+				ResourceManagerCacheKey key = new ResourceManagerCacheKey (path, asm);
+				if (!resourceManagerCache.TryGetValue (key, out rm)) {
+					rm = new ResourceManager (path, asm);
+					rm.IgnoreCase = true;
+					resourceManagerCache.Add (key, rm);
+				}
+				
+				return rm;
+			} catch (MissingManifestResourceException) {
+				throw;
+			} catch (Exception ex) {
+				throw new HttpException ("Failed to retrieve the specified global resource object.", ex);
+			}
+		}
+	}
+}
+#endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProviderFactory.cs b/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProviderFactory.cs
new file mode 100644
index 0000000..60644eb
--- /dev/null
+++ b/mcs/class/System.Web/System.Web.Compilation/DefaultResourceProviderFactory.cs
@@ -0,0 +1,49 @@
+//
+// DefaultResourceProviderFactory.cs
+//
+// Authors:
+//	Marek Habersack (mhabersack at novell.com)
+//
+// (C) 2009 Novell, Inc (http://novell.com)
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+using System;
+using System.Resources;
+using System.Web;
+
+namespace System.Web.Compilation
+{
+	sealed class DefaultResourceProviderFactory : ResourceProviderFactory
+	{
+		public override IResourceProvider CreateGlobalResourceProvider (string classKey)
+		{
+			return new DefaultResourceProvider (classKey, true);
+		}
+
+		public override IResourceProvider CreateLocalResourceProvider (string virtualPath)
+		{
+			return new DefaultResourceProvider (virtualPath, false);
+		}
+	}
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Web/System.Web.Compilation/Directive.cs b/mcs/class/System.Web/System.Web.Compilation/Directive.cs
index fa02eb6..95f6e7b 100644
--- a/mcs/class/System.Web/System.Web.Compilation/Directive.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/Directive.cs
@@ -31,6 +31,7 @@
 using System;
 using System.Collections;
 using System.Globalization;
+using System.Web.Util;
 
 namespace System.Web.Compilation
 {
@@ -86,8 +87,8 @@ namespace System.Web.Compilation
 			StringComparer comparer = StringComparer.InvariantCultureIgnoreCase;
 			directivesHash = new Hashtable (comparer);
 #else
-			CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider (CultureInfo.InvariantCulture);
-			CaseInsensitiveComparer comparer =  new CaseInsensitiveComparer (CultureInfo.InvariantCulture);
+			CaseInsensitiveHashCodeProvider provider = new CaseInsensitiveHashCodeProvider (Helpers.InvariantCulture);
+			CaseInsensitiveComparer comparer =  new CaseInsensitiveComparer (Helpers.InvariantCulture);
 
 			directivesHash = new Hashtable (provider, comparer); 
 #endif
diff --git a/mcs/class/System.Web/System.Web.Compilation/GlobalAsaxCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/GlobalAsaxCompiler.cs
index 4cb947e..5f729c1 100644
--- a/mcs/class/System.Web/System.Web.Compilation/GlobalAsaxCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/GlobalAsaxCompiler.cs
@@ -32,6 +32,7 @@ using System;
 using System.Collections;
 using System.Globalization;
 using System.Web.UI;
+using System.Web.Util;
 
 namespace System.Web.Compilation
 {
@@ -81,11 +82,11 @@ namespace System.Web.Compilation
 					continue;
 				}
 				
-				if (String.Compare (tag.Scope, "session", true, CultureInfo.InvariantCulture) == 0) {
+				if (String.Compare (tag.Scope, "session", true, Helpers.InvariantCulture) == 0) {
 					sessionObjectTags.Add (tag);
 					CreateApplicationOrSessionPropertyForObject (tag.Type, tag.ObjectID,
 										     false, false);
-				} else if (String.Compare (tag.Scope, "application", true, CultureInfo.InvariantCulture) == 0) {
+				} else if (String.Compare (tag.Scope, "application", true, Helpers.InvariantCulture) == 0) {
 					applicationObjectTags.Add (tag);
 					CreateFieldForObject (tag.Type, tag.ObjectID);
 					CreateApplicationOrSessionPropertyForObject (tag.Type, tag.ObjectID,
diff --git a/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs b/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs
index 093e23e..fd0b17c 100644
--- a/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/TagAttributes.cs
@@ -30,6 +30,7 @@
 
 using System;
 using System.Collections;
+using System.Globalization;
 using System.Text;
 using System.Web.Util;
 
@@ -75,7 +76,7 @@ namespace System.Web.Compilation
 		public void Add (object key, object value)
 		{
 			if (key != null && value != null &&
-			    0 == String.Compare ((string) key,  "runat", true)) {
+			    0 == String.Compare ((string) key,  "runat", true, Helpers.InvariantCulture)) {
 			    	if (0 != String.Compare ((string) value,  "server", true))
 					throw new HttpException ("runat attribute must have a 'server' value");
 
@@ -114,7 +115,7 @@ namespace System.Web.Compilation
 		{
 			// Hope not to have many attributes when the tag is not a server tag...
 			for (int i = 0; i < keys.Count; i++){
-				if (0 == String.Compare ((string) keys [i], key, true))
+				if (0 == String.Compare ((string) keys [i], key, true, Helpers.InvariantCulture))
 					return i;
 			}
 			return -1;
@@ -172,7 +173,7 @@ namespace System.Web.Compilation
 			
 			tmp_hash.Clear ();
 			for (int i = keys.Count - 1; i >= 0; i--)
-				if (key == null || String.Compare (key, (string) keys [i], true) == 0)
+				if (key == null || String.Compare (key, (string) keys [i], true, Helpers.InvariantCulture) == 0)
 					tmp_hash [keys [i]] = values [i];
 
 			return tmp_hash;
diff --git a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
index ee928f8..d2a5af3 100644
--- a/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/TemplateControlCompiler.cs
@@ -659,13 +659,13 @@ namespace System.Web.Compilation
 		/*
 		static bool InvariantCompare (string a, string b)
 		{
-			return (0 == String.Compare (a, b, false, CultureInfo.InvariantCulture));
+			return (0 == String.Compare (a, b, false, Helpers.InvariantCulture));
 		}
 		*/
 
 		static bool InvariantCompareNoCase (string a, string b)
 		{
-			return (0 == String.Compare (a, b, true, CultureInfo.InvariantCulture));
+			return (0 == String.Compare (a, b, true, Helpers.InvariantCulture));
 		}
 
 		static MemberInfo GetFieldOrProperty (Type type, string name)
@@ -855,7 +855,7 @@ namespace System.Web.Compilation
 
 		bool ResourceProviderHasObject (string key)
 		{
-			IResourceProvider rp = HttpContext.GetResourceProvider (key, true);
+			IResourceProvider rp = HttpContext.GetResourceProvider (InputVirtualPath.Absolute, true);
 			if (rp == null)
 				return false;
 
@@ -863,19 +863,23 @@ namespace System.Web.Compilation
 			if (rr == null)
 				return false;
 
-			IDictionaryEnumerator ide = rr.GetEnumerator ();
-			if (ide == null)
-				return false;
+			try {
+				IDictionaryEnumerator ide = rr.GetEnumerator ();
+				if (ide == null)
+					return false;
 			
-			string dictKey;
-			while (ide.MoveNext ()) {
-				dictKey = ide.Key as string;
-				if (String.IsNullOrEmpty (dictKey))
-					continue;
-				if (String.Compare (key, dictKey, StringComparison.Ordinal) == 0)
-					return true;
+				string dictKey;
+				while (ide.MoveNext ()) {
+					dictKey = ide.Key as string;
+					if (String.IsNullOrEmpty (dictKey))
+						continue;
+					if (String.Compare (key, dictKey, StringComparison.Ordinal) == 0)
+						return true;
+				}
+			} finally {
+				rr.Close ();
 			}
-
+			
 			return false;
 		}
 		
@@ -973,7 +977,7 @@ namespace System.Web.Compilation
 			Type type = builder.ControlType;
 			
 			string attvalue = builder.GetAttribute (id);
-			if (id.Length > 2 && id.Substring (0, 2).ToUpper () == "ON"){
+			if (id.Length > 2 && String.Compare (id.Substring (0, 2), "ON", true, Helpers.InvariantCulture) == 0){
 				if (ev_info == null)
 					ev_info = type.GetEvents ();
 
@@ -993,7 +997,7 @@ namespace System.Web.Compilation
 			}
 
 #if NET_2_0
-			if (id.ToLower () == "meta:resourcekey") {
+			if (String.Compare (id, "meta:resourcekey", StringComparison.OrdinalIgnoreCase) == 0) {
 				AssignPropertiesFromResources (builder, attvalue);
 				return;
 			}
@@ -1963,7 +1967,7 @@ namespace System.Web.Compilation
 				return CreateNullableExpression (originalType,
 								 new CodePrimitiveExpression (
 									 Convert.ChangeType (preConverted ? convertedFromAttr : str,
-											     type, CultureInfo.InvariantCulture)),
+											     type, Helpers.InvariantCulture)),
 								 wasNullable);
 
 			if (type == typeof (string [])) {
@@ -2188,6 +2192,10 @@ namespace System.Web.Compilation
 		{
 			if (value is System.Web.UI.WebControls.Unit) {
 				System.Web.UI.WebControls.Unit s = (System.Web.UI.WebControls.Unit) value;
+				if (s.IsEmpty) {
+					FieldInfo f = typeof (Unit).GetField ("Empty");
+					return new InstanceDescriptor (f, null);
+				}
 				ConstructorInfo c = typeof(System.Web.UI.WebControls.Unit).GetConstructor (
 					BindingFlags.Instance | BindingFlags.Public,
 					null,
@@ -2199,6 +2207,10 @@ namespace System.Web.Compilation
 			
 			if (value is System.Web.UI.WebControls.FontUnit) {
 				System.Web.UI.WebControls.FontUnit s = (System.Web.UI.WebControls.FontUnit) value;
+				if (s.IsEmpty) {
+					FieldInfo f = typeof (FontUnit).GetField ("Empty");
+					return new InstanceDescriptor (f, null);
+				}
 
 				Type cParamType = null;
 				object cParam = null;
diff --git a/mcs/class/System.Web/System.Web.Compilation/WsdlBuildProvider.cs b/mcs/class/System.Web/System.Web.Compilation/WsdlBuildProvider.cs
index 0e21d08..5938a92 100644
--- a/mcs/class/System.Web/System.Web.Compilation/WsdlBuildProvider.cs
+++ b/mcs/class/System.Web/System.Web.Compilation/WsdlBuildProvider.cs
@@ -39,6 +39,7 @@ using System.Reflection;
 using System.Web.Configuration;
 using System.Web.UI;
 using System.Web.Services.Description;
+using System.Web.Services.Discovery;
 using System.Xml.Serialization;
 using System.Web.Util;
 
@@ -67,40 +68,25 @@ namespace System.Web.Compilation {
 		{
 		}
 
-		string GetNamespace ()
-		{
-			var vp = new System.Web.VirtualPath (VirtualPath);
-			string vpDirectory = vp.Directory;
-			string path;
-			
-			if (StrUtils.StartsWith (vpDirectory, "/App_Code/"))
-				path = vpDirectory.Substring (10);
-			else if (StrUtils.StartsWith (vpDirectory, "/App_WebReferences/"))
-				path = vpDirectory.Substring (19);
-			else
-				path = vpDirectory;
-
-			path = path.Replace ("/", ".");
-			if (path.EndsWith ("."))
-				return path.Substring (0, path.Length - 1);
-
-			return path;
-		}
-		
 		public override void GenerateCode (AssemblyBuilder assemblyBuilder)
 		{
 			CodeCompileUnit unit = new CodeCompileUnit ();
-			CodeNamespace proxyCode = new CodeNamespace (GetNamespace ());
-			unit.Namespaces.Add (proxyCode);			
+			CodeNamespace proxyCode = new CodeNamespace ();
+			unit.Namespaces.Add (proxyCode);	
+
+			var description = ServiceDescription.Read (OpenReader ());
+			var discCollection = new DiscoveryClientDocumentCollection () {
+					{VirtualPath, description}
+				};
+			
+			var webref = new WebReferenceCollection () {
+					new WebReference (discCollection, proxyCode)
+				};
+
+			var options = new WebReferenceOptions ();
+			options.Style = ServiceDescriptionImportStyle.Client;
+			ServiceDescriptionImporter.GenerateWebReferences (webref, assemblyBuilder.CodeDomProvider, unit, options);
 
-			ServiceDescription description = ServiceDescription.Read (OpenReader ());
-			ServiceDescriptionImporter importer = new ServiceDescriptionImporter ();
-				
-			importer.AddServiceDescription (description, null, null);
-			importer.Style = ServiceDescriptionImportStyle.Client;
-			importer.CodeGenerator = assemblyBuilder.CodeDomProvider;
-			importer.CodeGenerationOptions = CodeGenerationOptions.GenerateProperties | CodeGenerationOptions.GenerateNewAsync;
-			importer.Import (proxyCode, unit);
 			assemblyBuilder.AddCodeCompileUnit (unit);
 		}
 	}
diff --git a/mcs/class/System.Web/System.Web.Configuration/AuthConfig.cs b/mcs/class/System.Web/System.Web.Configuration/AuthConfig.cs
index 1b7778a..41b20a0 100644
--- a/mcs/class/System.Web/System.Web.Configuration/AuthConfig.cs
+++ b/mcs/class/System.Web/System.Web.Configuration/AuthConfig.cs
@@ -48,7 +48,7 @@ namespace System.Web.Configuration
 		bool has_parent;
 #if NET_1_1
 		bool requireSSL;
-		bool slidingExpiration;
+		bool slidingExpiration = true;
 #endif
 #if NET_2_0
 		string cookie_domain;
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRule.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRule.cs
index 398bfb1..c2e064a 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRule.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationRule.cs
@@ -35,6 +35,7 @@ using System.Configuration;
 using System.ComponentModel;
 using System.Xml;
 using System.Globalization;
+using System.Web.Util;
 
 #if NET_2_0
 
@@ -223,7 +224,7 @@ namespace System.Web.Configuration {
 		internal bool CheckVerb (string verb)
 		{
 			foreach (string v in Verbs) {
-				if (String.Compare (v, verb, true, CultureInfo.InvariantCulture) == 0)
+				if (String.Compare (v, verb, true, Helpers.InvariantCulture) == 0)
 					return true;
 			}
 			return false;
@@ -232,7 +233,7 @@ namespace System.Web.Configuration {
 		internal bool CheckUser (string user)
 		{
 			foreach (string u in Users) {
-				if (String.Compare (u, user, true, CultureInfo.InvariantCulture) == 0 ||
+				if (String.Compare (u, user, true, Helpers.InvariantCulture) == 0 ||
 				    u == "*" ||
 				    (u == "?" && user == ""))
 					return true;
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationSection.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationSection.cs
index a2e872c..521620a 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationSection.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/AuthorizationSection.cs
@@ -43,7 +43,7 @@ namespace System.Web.Configuration {
 
 		static AuthorizationSection ()
 		{
-			rulesProp = new ConfigurationProperty ("", typeof (AuthorizationRuleCollection), null,
+			rulesProp = new ConfigurationProperty (String.Empty, typeof (AuthorizationRuleCollection), null,
 							       null, PropertyHelper.DefaultValidator,
 							       ConfigurationPropertyOptions.IsDefaultCollection);
 			properties = new ConfigurationPropertyCollection ();
@@ -68,8 +68,7 @@ namespace System.Web.Configuration {
 
 		internal bool IsValidUser (IPrincipal user, string verb)
 		{
-			string username = (user == null) ? "" : user.Identity.Name;
-
+			string username = (user == null) ? String.Empty : user.Identity.Name;
 			foreach (AuthorizationRule rule in Rules) {
 				if (rule.Verbs.Count != 0 && !rule.CheckVerb (verb))
 					continue;
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog b/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
index 095838a..357af0c 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/ChangeLog
@@ -1,9 +1,77 @@
+2009-11-10  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: path passed to OpenWebConfiguration
+	from GetSection does not come from FindWebConfig.
+
+2009-11-09  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: there's no need to cache sections by
+	_file_ path - using section name and web.config path is more than
+	enough and it reduces the number of cache entries
+	considerably. Fixes bug #550730
+
+2009-10-07  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: GetSection doesn't perform string +
+	char + string concatenation to generate section cache key (by
+	Gonzalo Paniagua Javier) which gives an enormous performance boost
+	(processing time for mojoportal's default.aspx went down from
+	2.65s to 107ms on average). The key generation is performed
+	without any kind of string operation right now (except for
+	GetHashCode on 3 strings).
+	GetSectionCacheKey is called only once and sectionCache became a
+	dictionary.
+
+2009-08-20  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: GetSection does not use
+	FindWebConfig to get the virtual path to open configuration for -
+	doing so would make the configuration system ignore <location>
+	sections. Fixes bug #482181
+
+2009-07-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConfigurationManager.cs: avoid possible infinite loop when the
+	path starts with ~ and 1 file check.
+
+2009-07-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* AuthorizationSection.cs:
+	* HttpHandlerAction.cs:
+	* GlobalizationSection.cs: synch with HEAD.
+
+2009-07-15  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: another approach to suppressing
+	application reloads after the app writes to its root web.config
+	file. Leaving the previous code in place to get more
+	protection. It's a kludge, but it's the best option to avoid
+	all the races caused by System.Configuration+FileSystemWatcher
+	without rewriting large parts of System.Configuration (and
+	System.Web.Configuration). Fixes bug #522017
+
+2009-07-14  Marek Habersack  <mhabersack at novell.com>
+
+	* WebConfigurationManager.cs: added support for suppressing
+	application reload when the main config file is written to from
+	application.
+
+	* WebConfigurationHost.cs: added minimal implementation of
+	WriteCompleted, which checks if there's need to suppress
+	application reload.
+
 2009-07-13  Marek Habersack  <mhabersack at novell.com>
 
 	* ProvidersHelper.cs: InstantiateProvider doesn't have to
 	explicitly look for types in App_Code assemblies - this is done in
 	HttpApplication.LoadType.
 
+2009-07-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConfigurationManager.cs: when caching configuration and sections,
+	use the configuration file directory instead of the incoming request
+	path.
+
 2009-06-12 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* WebConfigurationHost.cs: workaround to avoid definition errors when
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/GlobalizationSection.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/GlobalizationSection.cs
index 5116d2a..3025cf5 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/GlobalizationSection.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/GlobalizationSection.cs
@@ -34,6 +34,7 @@ using System.Configuration;
 using System.Globalization;
 using System.Text;
 using System.Xml;
+using System.Web.Util;
 
 #if NET_2_0
 
@@ -209,7 +210,7 @@ namespace System.Web.Configuration {
 				auto = true;
 				if (culture.Length > 5 && culture[4] == ':')
 					return new CultureInfo (culture.Substring (5));
-				return CultureInfo.InvariantCulture;// (0x007f);
+				return Helpers.InvariantCulture;// (0x007f);
 			}
 
 			return new CultureInfo (culture);
@@ -217,12 +218,15 @@ namespace System.Web.Configuration {
 				
 		internal CultureInfo GetUICulture ()
 		{
-			if (cached_uiculture != UICulture) {
+			string uiculture = UICulture;
+			if (cached_uiculture != uiculture) {
 				try {
-					cached_uicultureinfo = GetSanitizedCulture (UICulture, ref autoUICulture);
+					cached_uicultureinfo = GetSanitizedCulture (uiculture, ref autoUICulture);
+					cached_uiculture = uiculture;
 				} catch {
-					CultureFailed ("UICulture", UICulture);
+					CultureFailed ("UICulture", uiculture);
 					cached_uicultureinfo = new CultureInfo (0x007f); // Invariant
+					cached_uiculture = null;
 				}
 			}
 
@@ -231,12 +235,15 @@ namespace System.Web.Configuration {
 
 		internal CultureInfo GetCulture ()
 		{
-			if (cached_culture != Culture) {
+			string culture = Culture;
+			if (cached_culture != culture) {
 				try {
-					cached_cultureinfo = GetSanitizedCulture (Culture, ref autoCulture);
+					cached_cultureinfo = GetSanitizedCulture (culture, ref autoCulture);
+					cached_culture = culture;
 				} catch {
-					CultureFailed ("Culture", Culture);
+					CultureFailed ("Culture", culture);
 					cached_cultureinfo = new CultureInfo (0x007f); // Invariant
+					cached_culture = null;
 				}
 			}
 
@@ -252,7 +259,7 @@ namespace System.Web.Configuration {
 			Encoding encoding = (Encoding)encodingHash [prop];
 			if (encoding == null || encoding.EncodingName != cached_encoding_name) {
 				try {
-					switch (cached_encoding_name.ToLower (CultureInfo.InvariantCulture)) {
+					switch (cached_encoding_name.ToLower (Helpers.InvariantCulture)) {
 					case "utf-16le":
 					case "utf-16":
 					case "ucs-2":
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs
index d3af7dd..5a4ea69 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/HttpHandlerAction.cs
@@ -174,7 +174,7 @@ namespace System.Web.Configuration
 		{
 			if (String.IsNullOrEmpty (pathToMatch))
 				return false;
-			
+
 			bool result = false;
 			string[] handlerPaths = Path.Split (',');
 			int slash = pathToMatch.LastIndexOf ('/');
@@ -251,7 +251,10 @@ namespace System.Web.Configuration
 					else
 						noLeadingSlashPathToMatch = origPathToMatch;
 				}
-					
+
+				if (pattern.IndexOf ('/') >= 0)
+					noLeadingSlashPathToMatch = AdjustPath (pattern, noLeadingSlashPathToMatch);
+
 				if (sp.IsMatch (noLeadingSlashPathToMatch)) {
 					result = true;
 					break;
@@ -261,6 +264,28 @@ namespace System.Web.Configuration
 			return result;
 		}
 
+		static string AdjustPath (string pattern, string path)
+		{
+			int nslashes = 0;
+			foreach (char c in pattern)
+				if (c == '/')
+					nslashes++;
+
+			int i;
+			for (i = path.Length - 1; i >= 0; i--) {
+				if (path [i] == '/') {
+					nslashes--;
+					if (nslashes == -1)
+						break;
+				}
+			}
+
+			if (nslashes >= 0 || i == 0)
+				return path;
+
+			return path.Substring (i + 1);
+		}
+
 		// Loads the handler, possibly delay-loaded.
 		internal object GetHandlerInstance ()
 		{
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs
index 6bfe659..cf1c750 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationHost.cs
@@ -411,6 +411,9 @@ namespace System.Web.Configuration
 
 		public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext)
 		{
+			string rootConfigPath = GetWebConfigFileName (HttpRuntime.AppDomainAppPath);
+			if (String.Compare (streamName, rootConfigPath, StringComparison.OrdinalIgnoreCase) == 0)
+				WebConfigurationManager.SuppressAppReload (true);
 			return new FileStream (streamName, FileMode.Create, FileAccess.Write);
 		}
 
@@ -438,7 +441,7 @@ namespace System.Web.Configuration
 		}
 
 		public virtual object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
-		{
+		{			
 			throw new NotImplementedException ();
 		}
 		
@@ -455,14 +458,22 @@ namespace System.Web.Configuration
 				throw new ConfigurationErrorsException ("The section can't be defined in this file (the allowed definition context is '" + allowDefinition + "').", errorInfo.Filename, errorInfo.LineNumber);
 		}
 		
-		[MonoTODO("Does nothing")]
 		public virtual void WriteCompleted (string streamName, bool success, object writeContext)
 		{
-		}
-		
-		[MonoTODO("Does nothing")]
+			WriteCompleted (streamName, success, writeContext, false);
+		}		
+
 		public virtual void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
 		{
+			// There are probably other things to be done here, but for the moment we
+			// just mark the completed write as one that should not cause application
+			// reload. Note that it might already be too late for suppression, since the
+			// FileSystemWatcher monitor might have already delivered the
+			// notification. If the stream has been open using OpenStreamForWrite then
+			// we're safe, though.
+			string rootConfigPath = GetWebConfigFileName (HttpRuntime.AppDomainAppPath);
+			if (String.Compare (streamName, rootConfigPath, StringComparison.OrdinalIgnoreCase) == 0)
+				WebConfigurationManager.SuppressAppReload (true);
 		}
 
 		public virtual bool SupportsChangeNotifications {
diff --git a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs
index 3435e7d..3f67aab 100644
--- a/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs
+++ b/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs
@@ -32,6 +32,7 @@
 using System;
 using System.IO;
 using System.Collections;
+using System.Collections.Generic;
 using System.Collections.Specialized;
 using System.Reflection;
 #if MONOWEB_DEP
@@ -42,18 +43,26 @@ using System.Configuration;
 using System.Configuration.Internal;
 using _Configuration = System.Configuration.Configuration;
 using System.Web.Util;
+using System.Threading;
 
 namespace System.Web.Configuration {
 
 	public static class WebConfigurationManager
 	{
+		const int SAVE_LOCATIONS_CHECK_INTERVAL = 6000; // milliseconds
+		
+		static readonly object suppressAppReloadLock = new object ();
+		static readonly object saveLocationsCacheLock = new object ();
+		
 #if !TARGET_J2EE
 		static IInternalConfigConfigurationFactory configFactory;
 		static Hashtable configurations = Hashtable.Synchronized (new Hashtable ());
-		static Hashtable sectionCache = new Hashtable ();
+		static Dictionary <int, object> sectionCache = new Dictionary <int, object> ();
 		static Hashtable configPaths = Hashtable.Synchronized (new Hashtable ());
+		static bool suppressAppReload;
 #else
 		const string AppSettingsKey = "WebConfigurationManager.AppSettings";
+		
 		static internal IInternalConfigConfigurationFactory configFactory
 		{
 			get{
@@ -100,13 +109,13 @@ namespace System.Web.Configuration {
 			}
 		}
 
-		static Hashtable sectionCache
+		static Dictionary <int, object> sectionCache
 		{
 			get
 			{
-				Hashtable sectionCache = (Hashtable) AppDomain.CurrentDomain.GetData ("sectionCache");
+				Dictionary <int, object> sectionCache = AppDomain.CurrentDomain.GetData ("sectionCache") as Dictionary <int, object>;
 				if (sectionCache == null) {
-					sectionCache = new Hashtable (StringComparer.OrdinalIgnoreCase);
+					sectionCache = new Dictionary <int, object> ();
 					AppDomain.CurrentDomain.SetData ("sectionCache", sectionCache);
 				}
 				return sectionCache;
@@ -139,7 +148,9 @@ namespace System.Web.Configuration {
 			}
 		}
 #endif
-
+		static Dictionary <string, DateTime> saveLocationsCache;
+		static Timer saveLocationsTimer;
+		
 		static ArrayList extra_assemblies = null;
 		static internal ArrayList ExtraAssemblies {
 			get {
@@ -161,10 +172,10 @@ namespace System.Web.Configuration {
 		
 		static WebConfigurationManager ()
 		{
-			PropertyInfo prop = typeof(ConfigurationManager).GetProperty ("ConfigurationFactory", BindingFlags.Static | BindingFlags.NonPublic);
-			if (prop != null)
-				configFactory = prop.GetValue (null, null) as IInternalConfigConfigurationFactory;
-
+			configFactory = ConfigurationManager.ConfigurationFactory;
+			_Configuration.SaveStart += ConfigurationSaveHandler;
+			_Configuration.SaveEnd += ConfigurationSaveHandler;
+			
 			// Part of fix for bug #491531
 			Type type = Type.GetType ("System.Configuration.CustomizableFileSettingsProvider, System", false);
 			if (type != null) {
@@ -174,6 +185,55 @@ namespace System.Web.Configuration {
 			}
 		}
 
+		static void ReenableWatcherOnConfigLocation (object state)
+		{
+			string path = state as string;
+			if (String.IsNullOrEmpty (path))
+				return;
+
+			DateTime lastWrite;
+			lock (saveLocationsCacheLock) {
+				if (!saveLocationsCache.TryGetValue (path, out lastWrite))
+					lastWrite = DateTime.MinValue;
+			}
+
+			DateTime now = DateTime.Now;
+			if (lastWrite == DateTime.MinValue || now.Subtract (lastWrite).TotalMilliseconds >= SAVE_LOCATIONS_CHECK_INTERVAL) {
+				saveLocationsTimer.Dispose ();
+				saveLocationsTimer = null;
+				HttpApplicationFactory.EnableWatcher (VirtualPathUtility.RemoveTrailingSlash (HttpRuntime.AppDomainAppPath), "?eb.?onfig");
+			} else
+				saveLocationsTimer.Change (SAVE_LOCATIONS_CHECK_INTERVAL, SAVE_LOCATIONS_CHECK_INTERVAL);
+		}
+		
+		static void ConfigurationSaveHandler (_Configuration sender, ConfigurationSaveEventArgs args)
+		{
+			lock (suppressAppReloadLock) {
+				string rootConfigPath = WebConfigurationHost.GetWebConfigFileName (HttpRuntime.AppDomainAppPath);
+				if (String.Compare (args.StreamPath, rootConfigPath, StringComparison.OrdinalIgnoreCase) == 0) {
+					SuppressAppReload (args.Start);
+					if (args.Start) {
+						HttpApplicationFactory.DisableWatcher (VirtualPathUtility.RemoveTrailingSlash (HttpRuntime.AppDomainAppPath), "?eb.?onfig");
+
+						lock (saveLocationsCacheLock) {
+							if (saveLocationsCache == null)
+								saveLocationsCache = new Dictionary <string, DateTime> (StringComparer.Ordinal);
+							if (saveLocationsCache.ContainsKey (rootConfigPath))
+								saveLocationsCache [rootConfigPath] = DateTime.Now;
+							else
+								saveLocationsCache.Add (rootConfigPath, DateTime.Now);
+
+							if (saveLocationsTimer == null)
+								saveLocationsTimer = new Timer (ReenableWatcherOnConfigLocation,
+												rootConfigPath,
+												SAVE_LOCATIONS_CHECK_INTERVAL,
+												SAVE_LOCATIONS_CHECK_INTERVAL);
+						}
+					}
+				}
+			}
+		}
+		
 		public static _Configuration OpenMachineConfiguration ()
 		{
 			return ConfigurationManager.OpenMachineConfiguration ();
@@ -243,9 +303,17 @@ namespace System.Web.Configuration {
 		
 		public static _Configuration OpenWebConfiguration (string path, string site, string locationSubPath, string server, string userName, string password)
 		{
-			if (path == null || path.Length == 0)
+			return OpenWebConfiguration (path, site, locationSubPath, server, null, null, false);
+		}
+
+		static _Configuration OpenWebConfiguration (string path, string site, string locationSubPath, string server, string userName, string password, bool fweb)
+		{
+			if (String.IsNullOrEmpty (path))
 				path = "/";
 
+			if (!fweb && !String.IsNullOrEmpty (path))
+				path = FindWebConfig (path);
+
 			string confKey = path + site + locationSubPath + server + userName + password;
 			_Configuration conf = null;
 			conf = (_Configuration) configurations [confKey];
@@ -324,20 +392,30 @@ namespace System.Web.Configuration {
 
 		internal static object GetSection (string sectionName, string path, HttpContext context)
 		{
-			object cachedSection = sectionCache [GetSectionCacheKey (sectionName, path)];
-			if (cachedSection != null)
+			// FindWebConfig must not be used here with its result being passed to
+			// OpenWebConfiguration below. The reason is that if we have a request for
+			// ~/somepath/, but FindWebConfig returns ~/ and the ~/web.config contains
+			// <location path="somepath"> then OpenWebConfiguration will NOT return the
+			// contents of <location>, thus leading to bugs (ignored authorization
+			// section for instance)
+			string config_vdir = FindWebConfig (path);
+			if (String.IsNullOrEmpty (config_vdir))
+				config_vdir = "/";
+
+			int sectionCacheKey = GetSectionCacheKey (sectionName, config_vdir);
+			object cachedSection;
+			if (sectionCache.TryGetValue (sectionCacheKey, out cachedSection) && cachedSection != null)
 				return cachedSection;
 
-			
 			HttpRequest req = context != null ? context.Request : null;
 			_Configuration c = OpenWebConfiguration (path, /* path */
 								 null, /* site */
 					 			 req != null ? VirtualPathUtility.GetDirectory (req.Path) : null, /* locationSubPath */
 								 null, /* server */
 								 null, /* userName */
-								 null  /* password */);
+								 null, /* password */
+								 false  /* path from FindWebConfig */);
 			ConfigurationSection section = c.GetSection (sectionName);
-
 			if (section == null)
 				return null;
 
@@ -349,7 +427,7 @@ namespace System.Web.Configuration {
 				value = collection;
 			}
 
-			AddSectionToCache (GetSectionCacheKey (sectionName, path), value);
+			AddSectionToCache (sectionCacheKey, value);
 			return value;
 #else
 #if MONOWEB_DEP
@@ -357,7 +435,7 @@ namespace System.Web.Configuration {
 #else
 			object value = null;
 #endif
-			AddSectionToCache (GetSectionCacheKey (sectionName, path), value);
+			AddSectionToCache (sectionCacheKey, value);
 			return value;
 #endif
 		}
@@ -434,7 +512,7 @@ namespace System.Web.Configuration {
 					break;
 				
 				curPath = GetParentDir (rootPath, curPath);
-				if (curPath == null) {
+				if (curPath == null || curPath == "~") {
 					curPath = rootPath;
 					break;
 				}
@@ -449,7 +527,19 @@ namespace System.Web.Configuration {
 			HttpRequest req = ctx != null ? ctx.Request : null;
 			return req != null ? req.Path : HttpRuntime.AppDomainAppVirtualPath;
 		}
+		
+		internal static bool SuppressAppReload (bool newValue)
+		{
+			bool ret;
+			
+			lock (suppressAppReloadLock) {
+				ret = suppressAppReload;
+				suppressAppReload = newValue;
+			}
 
+			return ret;
+		}
+		
 		internal static void RemoveConfigurationFromCache (HttpContext ctx)
 		{
 			configurations.Remove (GetCurrentPath (ctx));
@@ -481,20 +571,23 @@ namespace System.Web.Configuration {
 
 		static void AddSectionToCache (int key, object section)
 		{
-			if (sectionCache [key] != null)
+			object cachedSection;
+			if (sectionCache.TryGetValue (key, out cachedSection) && cachedSection != null)
 				return;
 
-			Hashtable tmpTable = (Hashtable) sectionCache.Clone ();
-			if (tmpTable.Contains (key))
+			// Not sure if it wouldn't be better to just use a lock here
+			var tmpTable = new Dictionary <int, object> (sectionCache);
+			if (tmpTable.ContainsKey (key))
 				return;
 
 			tmpTable.Add (key, section);
 			sectionCache = tmpTable;
 		}
 
-		static int GetSectionCacheKey (string sectionName, string path)
+		static int GetSectionCacheKey (string sectionName, string vdir)
 		{
-			return (sectionName != null ? sectionName.GetHashCode () : 0) ^ ((path != null ? path.GetHashCode () : 0) + 37);
+			return (sectionName != null ? sectionName.GetHashCode () : 0) ^
+				((vdir != null ? vdir.GetHashCode () : 0) + 37);
 		}
 
 		
@@ -631,7 +724,6 @@ namespace System.Web.Configuration {
 			// nothing. We need a context.
 		}
 	}
-
 #endregion
 }
 
diff --git a/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs b/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
index 5db7944..6d42eb8 100644
--- a/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
+++ b/mcs/class/System.Web/System.Web.Handlers/AssemblyResourceLoader.cs
@@ -38,6 +38,7 @@ using System.Security.Cryptography;
 using System.Text;
 using System.Text.RegularExpressions;
 using System.Web.Configuration;
+using System.Web.Util;
 
 namespace System.Web.Handlers {
 #if SYSTEM_WEB_EXTENSIONS
@@ -139,7 +140,7 @@ namespace System.Web.Handlers {
 			result = GetHexString (encryptor.TransformFinalBlock (bytes, 0, bytes.Length));
 			bytes = null;
 
-			return String.Concat ("d=", result.ToLower (CultureInfo.InvariantCulture));
+			return String.Concat ("d=", result.ToLower (Helpers.InvariantCulture));
 		}
 
 		static void DecryptAssemblyResource (string val, out string asmName, out string resName)
@@ -212,7 +213,6 @@ namespace System.Web.Handlers {
 			return href;
 		}
 
-	
 #if SYSTEM_WEB_EXTENSIONS
 		protected virtual void ProcessRequest (HttpContext context)
 #else
@@ -229,12 +229,12 @@ namespace System.Web.Handlers {
 			DecryptAssemblyResource (request.QueryString ["d"], out asmName, out resourceName);
 			if (resourceName == null)
 				throw new HttpException (404, "No resource name given");
-			
+
 			if (asmName == null || asmName == "s")
 				assembly = currAsm;
 			else
 				assembly = Assembly.Load (asmName);
-			
+
 			WebResourceAttribute wra = null;
 			WebResourceAttribute [] attrs = (WebResourceAttribute []) assembly.GetCustomAttributes (typeof (WebResourceAttribute), false);
 			for (int i = 0; i < attrs.Length; i++) {
@@ -270,7 +270,11 @@ namespace System.Web.Handlers {
 				if (atime > -1) {
 #endif
 					if (atime == File.GetLastWriteTimeUtc (assembly.Location).Ticks) {
+						response.Clear ();
 						response.StatusCode = 304;
+						response.ContentType = null;
+						response.CacheControl = "public"; // easier to set it to public as MS than remove it
+						context.ApplicationInstance.CompleteRequest ();
 						return;
 					}
 				}
@@ -288,9 +292,14 @@ namespace System.Web.Handlers {
 					} catch { }
 					if (modif != DateTime.MinValue)
 #endif
-						if (File.GetLastWriteTimeUtc (assembly.Location) <= modif)
+						if (File.GetLastWriteTimeUtc (assembly.Location) <= modif) {
+							response.Clear ();
 							response.StatusCode = 304;
+							response.ContentType = null;
+							response.CacheControl = "public"; // easier to set it to public as MS than remove it
+							context.ApplicationInstance.CompleteRequest ();
 							return;
+						}
 				} catch {}
 			}
 
@@ -310,8 +319,15 @@ namespace System.Web.Handlers {
 					TextWriter w = response.Output;
 					new PerformSubstitutionHelper (assembly).PerformSubstitution (r, w);
 				}
-			}
-			else {
+#if NET_2_0
+			} else if (response.OutputStream is HttpResponseStream) {
+				UnmanagedMemoryStream st = (UnmanagedMemoryStream) s;
+				HttpResponseStream hstream = (HttpResponseStream) response.OutputStream;
+				unsafe {
+					hstream.WritePtr (new IntPtr (st.PositionPointer), (int) st.Length);
+				}
+#endif
+			} else {
 				byte [] buf = new byte [1024];
 				Stream output = response.OutputStream;
 				int c;
diff --git a/mcs/class/System.Web/System.Web.Handlers/ChangeLog b/mcs/class/System.Web/System.Web.Handlers/ChangeLog
index e0793cb..f043396 100644
--- a/mcs/class/System.Web/System.Web.Handlers/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Handlers/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-08 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* AssemblyResourceLoader.cs: send minimal headers set and don't call
+	response.End.  When possible, write the resource using the unsafe
+	methods in HttpResponseStream.a
+
 2009-04-04 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* AssemblyResourceLoader.cs: MS sets cacheability to public. Add
diff --git a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
index 1b826df..c5a5b4d 100644
--- a/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
+++ b/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs
@@ -27,10 +27,12 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Configuration;
 using System.IO;
 using System.Security.Permissions;
 using System.Security.Policy;
 using System.Text;
+using System.Web.Configuration;
 
 namespace System.Web.Hosting {
 
@@ -192,9 +194,10 @@ namespace System.Web.Hosting {
 
 			setup.PrivateBinPath = BuildPrivateBinPath (physicalDir, bindirPath);
 			setup.PrivateBinPathProbe = "*";
+#if !NET_2_0
 			setup.ShadowCopyFiles = "true";
 			setup.ShadowCopyDirectories = setup.PrivateBinPath;
-
+#endif
 			string dynamic_dir = null;
 			string user = Environment.UserName;
 			int tempDirTag = 0;
@@ -225,6 +228,11 @@ namespace System.Web.Hosting {
 			//
 			string domain_id = (virtualDir.GetHashCode () + 1 ^ physicalDir.GetHashCode () + 2 ^ tempDirTag).ToString ("x");
 
+			// This is used by mod_mono's fail-over support
+			string domain_id_suffix = Environment.GetEnvironmentVariable ("__MONO_DOMAIN_ID_SUFFIX");
+			if (domain_id_suffix != null && domain_id_suffix.Length > 0)
+				domain_id += domain_id_suffix;
+			
 			setup.ApplicationName = domain_id;
 			setup.DynamicBase = dynamic_dir;
 			setup.CachePath = dynamic_dir;
@@ -254,10 +262,30 @@ namespace System.Web.Hosting {
 			appdomain.SetData (".hostingInstallDir", Path.GetDirectoryName (typeof (Object).Assembly.CodeBase));
 #if NET_2_0
 			appdomain.SetData ("DataDirectory", Path.Combine (physicalDir, "App_Data"));
+			HostingEnvironment.SetIsHosted (false);
 #endif
 			appdomain.SetData (MonoHostedDataKey, "yes");
 			
+#if NET_2_0
+			appdomain.DoCallBack (SetHostingEnvironment);
+#endif
 			return appdomain.CreateInstanceAndUnwrap (hostType.Module.Assembly.FullName, hostType.FullName);
 		}
+
+#if NET_2_0
+		static void SetHostingEnvironment ()
+		{
+			bool shadow_copy_enabled = true;
+			HostingEnvironmentSection he = WebConfigurationManager.GetWebApplicationSection ("system.web/hostingEnvironment") as HostingEnvironmentSection;
+			if (he != null)
+				shadow_copy_enabled = he.ShadowCopyBinAssemblies;
+
+			if (shadow_copy_enabled) {
+				AppDomain current = AppDomain.CurrentDomain;
+				current.SetShadowCopyFiles ();
+				current.SetShadowCopyPath (current.SetupInformation.PrivateBinPath);
+			}
+		}
+#endif
 	}
 }
diff --git a/mcs/class/System.Web/System.Web.Hosting/ChangeLog b/mcs/class/System.Web/System.Web.Hosting/ChangeLog
index afb1ec4..f0b767b 100644
--- a/mcs/class/System.Web/System.Web.Hosting/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Hosting/ChangeLog
@@ -1,3 +1,29 @@
+2009-10-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ApplicationHost.cs: set the shadow copy options calling the methods
+	in AppDomain, instead of setting them in a copy of the setup
+	information.
+
+2009-10-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ApplicationHost.cs: use shadowCopyBinAssemblies from
+	<hostingEnvironment>.
+
+2009-09-07  Marek Habersack  <mhabersack at novell.com>
+
+	* HostingEnvironment.cs: MapPath checks if HttpContext.Request
+	actually exists before using it.
+
+2009-07-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SimpleWorkerRequest.cs: move this back to an instance property.
+	Cache works now.
+
+2009-07-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SimpleWorkerRequest.cs: store the root web configuration path in a
+	static variable.
+
 2008-10-29  Marek Habersack  <mhabersack at novell.com>
 
 	* ApplicationHost.cs: set domain setup CachePath to the same value
diff --git a/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs b/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs
index 727b9c4..2d71bdd 100644
--- a/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs
+++ b/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs
@@ -46,8 +46,10 @@ namespace System.Web.Hosting {
 	public sealed class HostingEnvironment : MarshalByRefObject
 	{
 		static bool is_hosted;
+#pragma warning disable 0649
 		static string site_name;
 		static ApplicationShutdownReason shutdown_reason;
+#pragma warning restore 0649
 		internal static BareApplicationHost Host;
 		static VirtualPathProvider vpath_provider = (HttpRuntime.AppDomainAppVirtualPath == null) ? null :
 								new DefaultVirtualPathProvider ();
@@ -145,10 +147,11 @@ namespace System.Web.Hosting {
 				throw new ArgumentNullException ("virtualPath");
 			
 			HttpContext context = HttpContext.Current;
-			if (context == null)
+			HttpRequest req = context == null ? null : context.Request;
+			if (req == null)
 				return null;
 
-			return context.Request.MapPath (virtualPath);
+			return req.MapPath (virtualPath);
 		}
 
 		public static void RegisterObject (IRegisteredObject obj)
@@ -197,6 +200,11 @@ namespace System.Web.Hosting {
 				throw new ArgumentNullException ("obj");
 			Host.UnregisterObject (obj);
 		}
+
+		internal static void SetIsHosted (bool isHosted)
+		{
+			is_hosted = isHosted;
+		}
 	}
 }
 
diff --git a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
index f58209b..d83f591 100644
--- a/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
+++ b/mcs/class/System.Web/System.Web.Hosting/SimpleWorkerRequest.cs
@@ -57,7 +57,7 @@ namespace System.Web.Hosting {
 			
 		// computed
 		string raw_url;
-		
+
 		//
 		// Constructor used when the target application domain
 		// was created with ApplicationHost.CreateApplicationHost
diff --git a/mcs/class/System.Web/System.Web.Profile/ChangeLog b/mcs/class/System.Web/System.Web.Profile/ChangeLog
index 67af370..00c7475 100644
--- a/mcs/class/System.Web/System.Web.Profile/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Profile/ChangeLog
@@ -1,3 +1,26 @@
+2009-10-27  Marek Habersack  <mhabersack at novell.com>
+
+	* ProfileBase.cs: CreateSettingsProperty sets the returned
+	property's DefaultValue to String.Empty if no default is specified
+	through the DefaultSettingValue attribute and the associated
+	property type is String.
+
+2009-10-22  Marek Habersack  <mhabersack at novell.com>
+
+	* ProfileBase.cs: put named entries into SettingProperty's
+	Attributes collection based on custom attributes decorating the
+	associated profile property.
+
+	* CustomProviderDataAttribute.cs: implemented IsDefaultAttribute
+
+2009-09-08  Marek Habersack  <mhabersack at novell.com>
+
+	* ProfileParser.cs: GetProfileGroupType creates type name with
+	"ProfileGroup" prefix instead of "ProfileCommon". Fixes bug
+	#535655
+
+	* ProfileBase.cs: typo fix - renamed CreateSettingsPropery to
+	CreateSettingsProperty
 
 2008-12-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
diff --git a/mcs/class/System.Web/System.Web.Profile/CustomProviderDataAttribute.cs b/mcs/class/System.Web/System.Web.Profile/CustomProviderDataAttribute.cs
index 838f08c..0874e18 100644
--- a/mcs/class/System.Web/System.Web.Profile/CustomProviderDataAttribute.cs
+++ b/mcs/class/System.Web/System.Web.Profile/CustomProviderDataAttribute.cs
@@ -4,7 +4,7 @@
 // Authors:
 //	Chris Toshok (toshok at ximian.com)
 //
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -39,10 +39,9 @@ namespace System.Web.Profile
 			this.customProviderData = customProviderData;
 		}
 
-		[MonoTODO ("Not implemented")]
 		public override bool IsDefaultAttribute ()
 		{
-			throw new NotImplementedException ();
+			return String.IsNullOrEmpty (CustomProviderData);
 		}
 
 		public string CustomProviderData {
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileBase.cs b/mcs/class/System.Web/System.Web.Profile/ProfileBase.cs
index 7024b98..c752493 100644
--- a/mcs/class/System.Web/System.Web.Profile/ProfileBase.cs
+++ b/mcs/class/System.Web/System.Web.Profile/ProfileBase.cs
@@ -76,14 +76,14 @@ namespace System.Web.Profile
 				ProfilePropertySettingsCollection ppsc = pgs.PropertySettings;
 
 				for (int s = 0; s < ppsc.Count; s++) {
-					SettingsProperty settingsProperty = CreateSettingsPropery (pgs, ppsc [s]);
+					SettingsProperty settingsProperty = CreateSettingsProperty (pgs, ppsc [s]);
 					ValidateProperty (settingsProperty, ppsc [s].ElementInformation);
 					properties.Add (settingsProperty);
 				}
 			}
 
 			for (int s = 0; s < ps.Count; s++) {
-				SettingsProperty settingsProperty = CreateSettingsPropery (null, ps [s]);
+				SettingsProperty settingsProperty = CreateSettingsProperty (null, ps [s]);
 				ValidateProperty (settingsProperty, ps [s].ElementInformation);
 				properties.Add (settingsProperty);
 			}
@@ -96,7 +96,7 @@ namespace System.Web.Profile
 						PropertyInfo [] pi = properiesType.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly);
 						if (pi.Length > 0)
 							for (int i = 0; i < pi.Length; i++)
-								properties.Add (CreateSettingsPropery (pi [i]));
+								properties.Add (CreateSettingsProperty (pi [i]));
 
 						if (properiesType.BaseType == null || 
 							properiesType.BaseType == typeof (ProfileBase))
@@ -240,12 +240,13 @@ namespace System.Web.Profile
 					elementInfo.Source, elementInfo.LineNumber);
 		}
 
-		static SettingsProperty CreateSettingsPropery (PropertyInfo property)
+		static SettingsProperty CreateSettingsProperty (PropertyInfo property)
 		{
 			SettingsProperty sp = new SettingsProperty (property.Name);
-
-			Attribute [] attributes = (Attribute [])property.GetCustomAttributes (typeof (SettingsSerializeAsAttribute), false);
+			Attribute [] attributes = (Attribute [])property.GetCustomAttributes (false);
 			SettingsAttributeDictionary attDict = new SettingsAttributeDictionary();
+			bool defaultAssigned = false;
+			
 			sp.SerializeAs = SettingsSerializeAs.ProviderSpecific;
 			sp.PropertyType = property.PropertyType;
 			sp.IsReadOnly = false;
@@ -253,24 +254,23 @@ namespace System.Web.Profile
 			sp.ThrowOnErrorSerializing = true;
 
 			for (int i = 0; i < attributes.Length; i++) {
-				if (attributes [i] is DefaultSettingValueAttribute)
+				if (attributes [i] is DefaultSettingValueAttribute) {
 					sp.DefaultValue = ((DefaultSettingValueAttribute) attributes [i]).Value;
-
-				else if (attributes [i] is SettingsProviderAttribute) {
+					defaultAssigned = true;
+				} else if (attributes [i] is SettingsProviderAttribute) {
 					Type providerType = HttpApplication.LoadType (((SettingsProviderAttribute) attributes [i]).ProviderTypeName);
 					sp.Provider = (SettingsProvider) Activator.CreateInstance (providerType);
 					sp.Provider.Initialize (null, null);
-				}
-
-				else if (attributes [i] is SettingsSerializeAsAttribute)
+				} else if (attributes [i] is SettingsSerializeAsAttribute) {
 					sp.SerializeAs = ((SettingsSerializeAsAttribute) attributes [i]).SerializeAs;
-
-				else if (
-					attributes [i] is SettingsAllowAnonymousAttribute ||
-					attributes [i] is ApplicationScopedSettingAttribute ||
-					attributes [i] is UserScopedSettingAttribute ||
-					attributes [i] is SettingsDescriptionAttribute  ||
-					attributes [i] is SettingAttribute)
+				} else if (attributes [i] is SettingsAllowAnonymousAttribute) {
+					sp.Attributes ["AllowAnonymous"] = ((SettingsAllowAnonymousAttribute) attributes [i]).Allow;
+				} else if (attributes [i] is CustomProviderDataAttribute) {
+					sp.Attributes ["CustomProviderData"] = ((CustomProviderDataAttribute) attributes [i]).CustomProviderData;
+				} else if (attributes [i] is ApplicationScopedSettingAttribute ||
+					   attributes [i] is UserScopedSettingAttribute ||
+					   attributes [i] is SettingsDescriptionAttribute  ||
+					   attributes [i] is SettingAttribute)
 					attDict.Add (attributes [i].GetType (), attributes [i]);
 			}
 
@@ -280,11 +280,15 @@ namespace System.Web.Profile
 			if (sp.Attributes ["AllowAnonymous"] == null)
 				sp.Attributes ["AllowAnonymous"] = false;
 
+			if (!defaultAssigned && sp.PropertyType == typeof (string) && sp.DefaultValue == null)
+				sp.DefaultValue = String.Empty;
+			
 			return sp;
 		}
-		static SettingsProperty CreateSettingsPropery (ProfileGroupSettings pgs, ProfilePropertySettings pps)
+		
+		static SettingsProperty CreateSettingsProperty (ProfileGroupSettings pgs, ProfilePropertySettings pps)
 		{
-			string name = ((pgs == null) ? "" : pgs.Name + ".") + pps.Name;
+			string name = ((pgs == null) ? String.Empty : pgs.Name + ".") + pps.Name;
 			SettingsProperty sp = new SettingsProperty (name);
 
 			sp.Attributes.Add ("AllowAnonymous", pps.AllowAnonymous);
diff --git a/mcs/class/System.Web/System.Web.Profile/ProfileParser.cs b/mcs/class/System.Web/System.Web.Profile/ProfileParser.cs
index 2eb199c..f4722b3 100644
--- a/mcs/class/System.Web/System.Web.Profile/ProfileParser.cs
+++ b/mcs/class/System.Web/System.Web.Profile/ProfileParser.cs
@@ -61,10 +61,10 @@ namespace System.Web.Profile
 		{
 			string typeName;
 			if (AppCodeCompiler.DefaultAppCodeAssemblyName != null)
-				typeName = String.Concat ("ProfileCommon", groupName, ", ", AppCodeCompiler.DefaultAppCodeAssemblyName);
+				typeName = String.Concat ("ProfileGroup", groupName, ", ", AppCodeCompiler.DefaultAppCodeAssemblyName);
 			else
-				typeName = String.Concat ("ProfileCommon", groupName);
-			
+				typeName = String.Concat ("ProfileGroup", groupName);
+
 			Type profileGroupType = Type.GetType (typeName);
 			if (profileGroupType == null) {
 				//Compiler call
diff --git a/mcs/class/System.Web/System.Web.Profile/SqlProfileProvider.cs b/mcs/class/System.Web/System.Web.Profile/SqlProfileProvider.cs
index af62502..6faa040 100644
--- a/mcs/class/System.Web/System.Web.Profile/SqlProfileProvider.cs
+++ b/mcs/class/System.Web/System.Web.Profile/SqlProfileProvider.cs
@@ -40,6 +40,7 @@ using System.Collections.Specialized;
 using System.IO;
 using System.Text;
 using System.Web.Security;
+using System.Web.Util;
 
 namespace System.Web.Profile
 {
@@ -487,8 +488,8 @@ namespace System.Web.Profile
 				if (pp == null)
 					continue;
 
-				int pos = Int32.Parse (names [i + 2], CultureInfo.InvariantCulture);
-				int len = Int32.Parse (names [i + 3], CultureInfo.InvariantCulture);
+				int pos = Int32.Parse (names [i + 2], Helpers.InvariantCulture);
+				int len = Int32.Parse (names [i + 3], Helpers.InvariantCulture);
 
 				if (len == -1 && !pp.Property.PropertyType.IsValueType) {
 					pp.PropertyValue = null;
@@ -544,7 +545,7 @@ namespace System.Web.Profile
 						}
 					}
 
-					names.Append (pp.Name + ":" + ((propValue != null) ? "S" : "B") + ":" + pos.ToString (CultureInfo.InvariantCulture) + ":" + len.ToString (CultureInfo.InvariantCulture) + ":");
+					names.Append (pp.Name + ":" + ((propValue != null) ? "S" : "B") + ":" + pos.ToString (Helpers.InvariantCulture) + ":" + len.ToString (Helpers.InvariantCulture) + ":");
 
 					if (propValue != null)
 						values.Append (propValue);
diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog
index 420471a..55dd18d 100644
--- a/mcs/class/System.Web/System.Web.Security/ChangeLog
+++ b/mcs/class/System.Web/System.Web.Security/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SqliteMembershipProvider.cs:
+	* UrlAuthorizationModule.cs: use GetSection instead of
+	OpenWebConfiguration+GetSection.
+
 2009-05-28  Marek Habersack  <mhabersack at novell.com>
 
 	* FormsAuthenticationModule.cs: if forms authentication login URL
diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs
index e49f3e1..fd6a2ce 100644
--- a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs
+++ b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs
@@ -203,7 +203,7 @@ namespace System.Web.Security
 			if (context == null)
 				throw new HttpException ("Context is null!");
 
-			name = name.ToLower ();
+			name = name.ToLower (Helpers.InvariantCulture);
 #if NET_2_0
 			AuthenticationSection section = (AuthenticationSection) WebConfigurationManager.GetSection (authConfigPath);
 			FormsAuthenticationCredentials config = section.Forms.Credentials;
@@ -496,9 +496,9 @@ namespace System.Web.Security
 				throw new ArgumentNullException ("passwordFormat");
 
 			byte [] bytes;
-			if (String.Compare (passwordFormat, "MD5", true, CultureInfo.InvariantCulture) == 0) {
+			if (String.Compare (passwordFormat, "MD5", true, Helpers.InvariantCulture) == 0) {
 				bytes = MD5.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
-			} else if (String.Compare (passwordFormat, "SHA1", true, CultureInfo.InvariantCulture) == 0) {
+			} else if (String.Compare (passwordFormat, "SHA1", true, Helpers.InvariantCulture) == 0) {
 				bytes = SHA1.Create ().ComputeHash (Encoding.UTF8.GetBytes (password));
 			} else {
 				throw new ArgumentException ("The format must be either MD5 or SHA1", "passwordFormat");
diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs
index e468950..36df022 100644
--- a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs
+++ b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs
@@ -120,7 +120,7 @@ namespace System.Web.Security
 				loginPath = context.Request.MapPath (loginPage);
 			} catch {} // ignore
 
-			context.SkipAuthorization = String.Compare (reqPath, loginPath, HttpRuntime.CaseInsensitive, CultureInfo.InvariantCulture) == 0;
+			context.SkipAuthorization = String.Compare (reqPath, loginPath, HttpRuntime.CaseInsensitive, Helpers.InvariantCulture) == 0;
 			
 #if NET_2_0
 			//TODO: need to check that the handler is System.Web.Handlers.AssemblyResourceLoader type
diff --git a/mcs/class/System.Web/System.Web.Security/SqliteMembershipProvider.cs b/mcs/class/System.Web/System.Web.Security/SqliteMembershipProvider.cs
index c54b70e..f7be4be 100644
--- a/mcs/class/System.Web/System.Web.Security/SqliteMembershipProvider.cs
+++ b/mcs/class/System.Web/System.Web.Security/SqliteMembershipProvider.cs
@@ -140,8 +140,7 @@ namespace System.Web.Security
 			}
 
 			// Get encryption and decryption key information from the configuration.
-			System.Configuration.Configuration cfg = WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath);
-			m_MachineKey = (MachineKeySection)cfg.GetSection("system.web/machineKey");
+			m_MachineKey = (MachineKeySection)WebConfigurationManager.GetSection("system.web/machineKey", null);
 
 			if (!m_PasswordFormat.Equals(MembershipPasswordFormat.Clear))
 			{
diff --git a/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs b/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
index d2351c3..2357638 100644
--- a/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
+++ b/mcs/class/System.Web/System.Web.Security/UrlAuthorizationModule.cs
@@ -61,8 +61,7 @@ namespace System.Web.Security
 
 			HttpRequest req = context.Request;
 #if NET_2_0
-			global::System.Configuration.Configuration cfg = WebConfigurationManager.OpenWebConfiguration (req.Path, null, req.FilePath);			
-			AuthorizationSection config = (AuthorizationSection) cfg.GetSection ("system.web/authorization");
+			AuthorizationSection config = (AuthorizationSection) WebConfigurationManager.GetSection ("system.web/authorization", req.Path, context);
 #else
 			AuthorizationConfig config = (AuthorizationConfig) context.GetConfig ("system.web/authorization");
 			if (config == null)
diff --git a/mcs/class/System.Web/System.Web.UI.Adapters/ChangeLog b/mcs/class/System.Web/System.Web.UI.Adapters/ChangeLog
index 65fd446..c604ba2 100644
--- a/mcs/class/System.Web/System.Web.UI.Adapters/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.Adapters/ChangeLog
@@ -1,3 +1,9 @@
+2009-08-20  Marek Habersack  <mhabersack at novell.com>
+
+	* ControlAdapter.cs: check if Control isn't null before using it.
+	CreateChildControls () must forward call to the control. Fixes bug
+	#517172
+
 2008-01-15  Dean Brettle <dean at brettle.com> 
 
 	* ControlAdapter.cs: made control field internal so
diff --git a/mcs/class/System.Web/System.Web.UI.Adapters/ControlAdapter.cs b/mcs/class/System.Web/System.Web.UI.Adapters/ControlAdapter.cs
index 7eddb8a..bc22af6 100644
--- a/mcs/class/System.Web/System.Web.UI.Adapters/ControlAdapter.cs
+++ b/mcs/class/System.Web/System.Web.UI.Adapters/ControlAdapter.cs
@@ -47,7 +47,12 @@ namespace System.Web.UI.Adapters
 		protected HttpBrowserCapabilities Browser 
 		{
 			get {
-				return Page.Request.Browser;
+				Page page = Page;
+
+				if (page != null)
+					return page.Request.Browser;
+
+				return null;
 			}
 		}
 
@@ -55,14 +60,9 @@ namespace System.Web.UI.Adapters
 		
 		[Browsable (false)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
-		protected internal Control Control 
+		protected Control Control 
 		{
-			protected get {
-				return control;
-			}
-			set {
-				control = value;
-			}
+			get { return control; }
 		}
 
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
@@ -70,7 +70,12 @@ namespace System.Web.UI.Adapters
 		protected Page Page 
 		{
 			get {
-				return Control.Page;
+				Control control = Control;
+
+				if (control != null)
+					return control.Page;
+
+				return null;
 			}
 		}
 		
@@ -79,7 +84,12 @@ namespace System.Web.UI.Adapters
 		protected PageAdapter PageAdapter 
 		{
 			get {
-				return Control.Page.PageAdapter;
+				Page page = Page;
+
+				if (page != null)
+					return page.PageAdapter;
+
+				return null;
 			}
 		}
 
@@ -90,6 +100,9 @@ namespace System.Web.UI.Adapters
 
 		protected internal virtual void CreateChildControls ()
 		{
+			Control control = Control;
+			if (control != null)
+				control.CreateChildControls ();
 		}
 
 		protected internal virtual void EndRender (HtmlTextWriter w)
@@ -107,32 +120,50 @@ namespace System.Web.UI.Adapters
 
 		protected internal virtual void OnInit (EventArgs e)
 		{
-			Control.OnInit(e);
+			Control control = Control;
+
+			if (control != null)
+				control.OnInit(e);
 		}
 
 		protected internal virtual void OnLoad (EventArgs e)
 		{
-			Control.OnLoad(e);
+			Control control = Control;
+
+			if (control != null)
+				control.OnLoad(e);
 		}
 
 		protected internal virtual void OnPreRender (EventArgs e)
 		{
-			Control.OnPreRender(e);
+			Control control = Control;
+
+			if (control != null)
+				control.OnPreRender(e);
 		}
 
 		protected internal virtual void OnUnload (EventArgs e)
 		{
-			Control.OnUnload(e);
+			Control control = Control;
+
+			if (control != null)
+				control.OnUnload(e);
 		}
 
 		protected internal virtual void Render (HtmlTextWriter w)
 		{
-			Control.Render (w);
+			Control control = Control;
+
+			if (control != null)
+				control.Render (w);
 		}
 
 		protected internal virtual void RenderChildren (HtmlTextWriter w)
 		{
-			Control.RenderChildren (w);
+			Control control = Control;
+
+			if (control != null)
+				control.RenderChildren (w);
 		}
 
 		protected internal virtual object SaveAdapterControlState ()
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
index 809717f..14c3fbb 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
@@ -1,3 +1,26 @@
+2009-11-13  Marek Habersack  <mhabersack at novell.com>
+
+	* HtmlForm.cs: reverted part of the previous patch - action is not
+	set to the result of calling ResolveClientUrl(action)
+	anymore. Fixes bug #554324
+
+2009-10-30  Marek Habersack  <mhabersack at novell.com>
+
+	* HtmlForm.cs: action is built using Request.ClientFilePath
+	(instead of Request.FilePath) and ResolveClientUrl, so that it's
+	correct even if url rewriting is being used.
+
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HtmlSelectBuilder.cs: <option> allows the value of the 'selected'
+	attribute to be a boolean or the string "selected", which is treated
+	as "true".
+
+2009-06-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HtmlTitle.cs: HtmlTitle allows children that are not
+	LiteralControls. Fixes bug #511882.
+
 2009-05-15  Marek Habersack  <mhabersack at novell.com>
 
 	* HtmlForm.cs: if application isn't running on /, make sure we
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
index e9b088e..b78619f 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs
@@ -4,7 +4,7 @@
 // Author:
 //	Dick Porter  <dick at ximian.com>
 //
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -265,13 +265,16 @@ namespace System.Web.UI.HtmlControls
 #if NET_2_0
 			string customAction = Attributes ["action"];
 #endif
-			
+			Page p = Page;
+			HttpRequest req = p != null ? p.Request : null;
+			if (req == null)
+				throw new HttpException ("No current request, cannot continue rendering.");
 #if !TARGET_J2EE
 #if NET_2_0
 			if (String.IsNullOrEmpty (customAction)) {
 #endif
-				string file_path = Page.Request.FilePath;
-				string current_path = Page.Request.CurrentExecutionFilePath;
+				string file_path = req.ClientFilePath;
+				string current_path = req.CurrentExecutionFilePath;
 				if (file_path == current_path) {
 					// Just the filename will do
 					action = UrlUtils.GetFile (file_path);
@@ -309,12 +312,12 @@ namespace System.Web.UI.HtmlControls
 			} else
 				action = customAction;
 #endif
-			action += Page.Request.QueryStringRaw;
+			action += req.QueryStringRaw;
 #else
 			// Allow the page to transform action to a portlet action url
 			if (String.IsNullOrEmpty (customAction)) {
-				string queryString = Page.Request.QueryStringRaw;
-				action = CreateActionUrl (VirtualPathUtility.ToAppRelative (Page.Request.CurrentExecutionFilePath) +
+				string queryString = req.QueryStringRaw;
+				action = CreateActionUrl (VirtualPathUtility.ToAppRelative (req.CurrentExecutionFilePath) +
 					(string.IsNullOrEmpty (queryString) ? string.Empty : "?" + queryString));
 			}
 			else
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
index 7bf0cdf..eb91a5b 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
@@ -29,6 +29,7 @@
 using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls 
 {
@@ -110,7 +111,7 @@ namespace System.Web.UI.HtmlControls
 				if (border == null) {
 					return (-1);
 				} else {
-					return (Int32.Parse (border, CultureInfo.InvariantCulture));
+					return (Int32.Parse (border, Helpers.InvariantCulture));
 				}
 			}
 			set {
@@ -134,7 +135,7 @@ namespace System.Web.UI.HtmlControls
 				if (height == null) {
 					return (-1);
 				} else {
-					return (Int32.Parse (height, CultureInfo.InvariantCulture));
+					return (Int32.Parse (height, Helpers.InvariantCulture));
 				}
 			}
 			set {
@@ -186,7 +187,7 @@ namespace System.Web.UI.HtmlControls
 					return (-1);
 				}
 				else {
-					return (Int32.Parse (width, CultureInfo.InvariantCulture));
+					return (Int32.Parse (width, Helpers.InvariantCulture));
 				}
 			}
 			set {
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
index 65ec6c1..513a939 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
@@ -30,6 +30,7 @@ using System.ComponentModel;
 using System.Globalization;
 using System.Reflection;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -109,7 +110,7 @@ namespace System.Web.UI.HtmlControls {
 #endif
 			}
 			
-			if (String.Compare (Type, "reset", true, CultureInfo.InvariantCulture) != 0)
+			if (String.Compare (Type, "reset", true, Helpers.InvariantCulture) != 0)
 				OnServerClick (EventArgs.Empty);
 			else
 				ResetForm (FindForm ());
@@ -254,7 +255,7 @@ namespace System.Web.UI.HtmlControls {
 			if (Page == null || !CausesValidation)
 				return false;
 
-			CultureInfo inv = CultureInfo.InvariantCulture;
+			CultureInfo inv = Helpers.InvariantCulture;
 			string input_type = Type;
 			if (0 == String.Compare (input_type, "submit", true, inv) &&
 				Page.Validators.Count > 0)
@@ -271,7 +272,7 @@ namespace System.Web.UI.HtmlControls {
 		protected override void RenderAttributes (HtmlTextWriter writer)
 		{
 #if NET_2_0
-			CultureInfo inv = CultureInfo.InvariantCulture;
+			CultureInfo inv = Helpers.InvariantCulture;
 			string input_type = Type;
 			if (0 != String.Compare (input_type, "reset", true, inv) &&
 				((0 == String.Compare (input_type, "submit", true, inv)) ||
@@ -327,7 +328,7 @@ namespace System.Web.UI.HtmlControls {
 			options.ActionUrl = null;
 			options.Argument = String.Empty;
 			options.RequiresJavaScriptProtocol = false;
-			options.ClientSubmit = (0 != String.Compare (Type, "submit", true, CultureInfo.InvariantCulture));
+			options.ClientSubmit = (0 != String.Compare (Type, "submit", true, Helpers.InvariantCulture));
 			options.PerformValidation = CausesValidation && Page != null && Page.Validators.Count > 0;
 			if (options.PerformValidation)
 				options.ValidationGroup = ValidationGroup;
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
index cc7e883..3821c02 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
@@ -35,6 +35,7 @@ using System.Globalization;
 using System.Collections.Specialized;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -120,14 +121,14 @@ namespace System.Web.UI.HtmlControls {
 				string border = Attributes ["border"];
 				if (border == null)
 					return -1;
-				return Int32.Parse (border, CultureInfo.InvariantCulture);
+				return Int32.Parse (border, Helpers.InvariantCulture);
 			}
 			set {
 				if (value == -1) {
 					Attributes.Remove ("border");
 					return;
 				}
-				Attributes ["border"] = value.ToString (CultureInfo.InvariantCulture);
+				Attributes ["border"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
@@ -138,8 +139,8 @@ namespace System.Web.UI.HtmlControls {
 
 			if (x != null && x.Length != 0 &&
 					y != null && y.Length != 0) {
-				clicked_x = Int32.Parse (x, CultureInfo.InvariantCulture);
-				clicked_y = Int32.Parse (y, CultureInfo.InvariantCulture);
+				clicked_x = Int32.Parse (x, Helpers.InvariantCulture);
+				clicked_y = Int32.Parse (y, Helpers.InvariantCulture);
 				Page.RegisterRequiresRaiseEvent (this);
 				return true;
 			}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputSubmit.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputSubmit.cs
index 9430d0d..1fa8621 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputSubmit.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputSubmit.cs
@@ -51,7 +51,6 @@ namespace System.Web.UI.HtmlControls {
 		{
 		}
 		
-		[MonoTODO ("why our own version?")]
 		void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
 		{
 			base.RaisePostBackEvent (eventArgument);
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
index 25c2ec4..2540a42 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputText.cs
@@ -30,6 +30,7 @@ using System.ComponentModel;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -144,7 +145,7 @@ namespace System.Web.UI.HtmlControls {
 		protected override void RenderAttributes (HtmlTextWriter writer)
 		{
 			// the Type property can be, indirectly, changed by using the Attributes property
-			if (String.Compare (Type, 0, "password", 0, 8, true, CultureInfo.InvariantCulture) == 0) {
+			if (String.Compare (Type, 0, "password", 0, 8, true, Helpers.InvariantCulture) == 0) {
 				Attributes.Remove ("value");
 			}
 
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
index 52a665e..6a9c5a8 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelect.cs
@@ -341,7 +341,7 @@ namespace System.Web.UI.HtmlControls
 					return (-1);
 				}
 
-				return (Int32.Parse (size, CultureInfo.InvariantCulture));
+				return (Int32.Parse (size, Helpers.InvariantCulture));
 			}
 			set {
 				if (value == -1) {
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelectBuilder.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelectBuilder.cs
index e280dee..806f42c 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelectBuilder.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlSelectBuilder.cs
@@ -31,6 +31,7 @@ using System.Collections;
 using System.Security.Permissions;
 using System.Web.UI.WebControls;
 using System.Globalization;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls
 {
@@ -49,9 +50,12 @@ namespace System.Web.UI.HtmlControls
 
 		public override Type GetChildControlType (string tagName, IDictionary attribs) 
 		{
-			if (System.String.Compare (tagName, "option", true, CultureInfo.InvariantCulture) != 0)
+			if (String.Compare (tagName, "option", true, Helpers.InvariantCulture) != 0)
 				return null;
 
+			string selected = attribs ["selected"] as string;
+			if (selected != null && selected.Length > 0 && String.Compare (selected, "selected", true, Helpers.InvariantCulture) == 0)
+				attribs ["selected"] = "true";
 			return typeof (ListItem);
 		}
 	}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
index cf55ce1..ca90152 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
@@ -29,6 +29,7 @@
 using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -93,7 +94,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("border");
 				else
-					Attributes ["border"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["border"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
@@ -127,7 +128,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("cellpadding");
 				else
-					Attributes ["cellpadding"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["cellpadding"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
@@ -144,7 +145,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("cellspacing");
 				else
-					Attributes ["cellspacing"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["cellspacing"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
index 7c9bdcd..9873c45 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTableCell.cs
@@ -29,6 +29,7 @@
 using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -114,7 +115,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("colspan");
 				else
-					Attributes ["colspan"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["colspan"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
@@ -165,7 +166,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("rowspan");
 				else
-					Attributes ["rowspan"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["rowspan"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
index fac5b1e..6afdb8b 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTextArea.cs
@@ -30,6 +30,7 @@ using System.ComponentModel;
 using System.Collections.Specialized;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.HtmlControls {
 
@@ -65,7 +66,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("cols");
 				else
-					Attributes ["cols"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["cols"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
@@ -91,7 +92,7 @@ namespace System.Web.UI.HtmlControls {
 				if (value == -1)
 					Attributes.Remove ("rows");
 				else
-					Attributes ["rows"] = value.ToString (CultureInfo.InvariantCulture);
+					Attributes ["rows"] = value.ToString (Helpers.InvariantCulture);
 			}
 		}
 
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTitle.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTitle.cs
index f988015..b75921b 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTitle.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTitle.cs
@@ -44,12 +44,12 @@ namespace System.Web.UI.HtmlControls
 		{
 			LiteralControl lit = obj as LiteralControl;
 			if (lit != null) text = lit.Text;
+			else base.AddParsedSubObject (obj);
 		}
 
-		/* Appears in corcompare */
 		protected override ControlCollection CreateControlCollection ()
 		{
-			return (base.CreateControlCollection ());
+			return new ControlCollection (this);
 		}
 		
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
index d0b12f7..b7b2727 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
@@ -31,6 +31,7 @@ using System.Threading;
 using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -59,7 +60,7 @@ namespace System.Web.UI.WebControls {
 					case ValidationDataType.Date:
 						DateTimeFormatInfo dateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
 						string pattern = dateTimeFormat.ShortDatePattern;
-						string dateorder = (pattern.StartsWith ("y", true, CultureInfo.InvariantCulture) ? "ymd" : (pattern.StartsWith ("m", true, CultureInfo.InvariantCulture) ? "mdy" : "dmy"));
+						string dateorder = (pattern.StartsWith ("y", true, Helpers.InvariantCulture) ? "ymd" : (pattern.StartsWith ("m", true, Helpers.InvariantCulture) ? "mdy" : "dmy"));
 						RegisterExpandoAttribute (ClientID, "dateorder", dateorder);
 						RegisterExpandoAttribute (ClientID, "cutoffyear", dateTimeFormat.Calendar.TwoDigitYearMax.ToString ());
 						break;
@@ -123,7 +124,7 @@ namespace System.Web.UI.WebControls {
 			bool seen_year = false;
 			bool seen_month = false;
 
-			pattern = pattern.ToLower (CultureInfo.InvariantCulture);
+			pattern = pattern.ToLower (Helpers.InvariantCulture);
 
 			for (int i = 0; i < pattern.Length; i ++) {
 				char c = pattern[ i ];
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/BulletedList.cs
index 55f3ea0..fac29e6 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/BulletedList.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/BulletedList.cs
@@ -36,6 +36,7 @@ using System.Drawing;
 using System.ComponentModel;
 using System.ComponentModel.Design;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -146,7 +147,7 @@ namespace System.Web.UI.WebControls {
 
 				case BulletedListDisplayMode.LinkButton:
 					if (Enabled && item.Enabled)
-						writer.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackEventReference (GetPostBackOptions (index.ToString (CultureInfo.InvariantCulture)), true));
+						writer.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackEventReference (GetPostBackOptions (index.ToString (Helpers.InvariantCulture)), true));
 					else
 						writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
 					writer.RenderBeginTag (HtmlTextWriterTag.A);
@@ -207,7 +208,7 @@ namespace System.Web.UI.WebControls {
 			if (CausesValidation)
 				Page.Validate (ValidationGroup);
 			
-			this.OnClick (new BulletedListEventArgs (int.Parse (eventArgument, CultureInfo.InvariantCulture)));
+			this.OnClick (new BulletedListEventArgs (int.Parse (eventArgument, Helpers.InvariantCulture)));
 		}
 			
 	    [BrowsableAttribute (false)]
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
index c530ac1..15eb1fb 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Calendar.cs
@@ -36,6 +36,7 @@ using System.Drawing;
 using System.Security.Permissions;
 using System.Threading;
 using System.Text;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 	// CAS
@@ -1147,7 +1148,7 @@ namespace System.Web.UI.WebControls {
 		void WriteCaption (HtmlTextWriter writer)
 		{
 			if (CaptionAlign != TableCaptionAlign.NotSet)
-				writer.AddAttribute (HtmlTextWriterAttribute.Align, CaptionAlign.ToString (CultureInfo.InvariantCulture));
+				writer.AddAttribute (HtmlTextWriterAttribute.Align, CaptionAlign.ToString (Helpers.InvariantCulture));
 
 			writer.RenderBeginTag (HtmlTextWriterTag.Caption);
 			writer.Write (Caption);
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index 2d6f5ea..1a9e87f 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,114 @@
+2009-11-16  Marek Habersack  <mhabersack at novell.com>
+
+	* TreeNodeCollection.cs: whenever a node is added, let the owner
+	know about it.
+
+	* TreeNode.cs: added internal property HadChildrenBeforePopulating
+	which is used to let TreeView know about an error condition where
+	a populate-on-demand node contains children added outside the
+	OnTreeNodePopulate event
+
+	* TreeView.cs: if a node has any child nodes and PopulatOnDemand
+	is set, throw an exception from RenderNode. This is the behavior
+	of .NET
+
+2009-11-13  Marek Habersack  <mhabersack at novell.com>
+
+	* TableRowCollection.cs: added .NET compatibility NREX throws to
+	several methods.
+	Whenever a row is added/removed, its Container property is
+	set. Fixes bug #551666
+
+	* TableRow.cs: introduced an internal property, Container, which
+	is set by TableRowCollection whenever this row is added/removed
+	to/from the collection. This allows the row to notify the
+	collectio and, in consequence, collection owner that TableSection
+	has been set and thead/tbody/tfoot elements need to be
+	generated. Fixes bug #551666
+
+2009-11-10  Marek Habersack  <mhabersack at novell.com>
+
+	* PasswordRecovery.cs:
+	{Question,Success,UserName}TemplateContainer must all be populated
+	the first time the property is accessed, so that calling
+	FindControl on the container returns valid and expected
+	results. If the associated template is not defined, though,
+	populating is postponed till CreateChildControls is called -
+	that's where default, empty, template will be created. This is
+	required to fix YetAnotherForum's password recovery control.
+	Mail template used in SendPasswordByMail must match the one used
+	in .NET (it has to end with a newline) as YAF parses the message
+	to retrieve user name and password and breaks if the last line
+	doesn't end with a newline character.
+
+2009-10-30  Marek Habersack  <mhabersack at novell.com>
+
+	* PasswordRecovery.cs: mail message replacements should include <%
+	Password %> and <% UserName %> and matching should be
+	case-insensitive. Fixes bug #545370
+
+2009-10-28  Marek Habersack  <mhabersack at novell.com>
+
+	* ListControl.cs: OnDataBinding must call base implementation
+	before performing the binding, so that DataSource can be assigned
+	from within the handler.
+
+2009-10-13  Marek Safar  <marek.safar at novell.com>
+
+	* WebColorConverter.cs: Delegate ConvertFrom to
+	ColorTranslator.FromHtml, it is correctly implemented and knows
+	many more tricks.
+
+2009-10-13  Marek Habersack  <mhabersack at novell.com>
+
+	* WebColorConverter.cs: don't use a dictionary to check for valid
+	color names, use Color.IsKnownColor instead. Update for bug
+	#546173 fix.
+	Added more CSS2 color name mappings.
+
+2009-10-12  Marek Habersack  <mhabersack at novell.com>
+
+	* WebColorConverter.cs: when converting from color name, check if
+	the returned color's name is a member of the
+	System.Drawing.KnownColor enumeration to test for error condition,
+	as some colors might be #000000. Preserve the old error check as a
+	fallback only. 
+	Map "captiontext" and "background" color names to
+	"ActiveCaptionText" and "Desktop", respectively, before passing
+	them to Color.FromName (). Fixes bug #546173
+
+2009-09-28  Marek Habersack  <mhabersack at novell.com>
+
+	* DataBoundControl.cs: Initialize sets RequiresDataBinding
+	properly, only when we're not data-bound already, when we aren't
+	in postback or when we are in postback, but with viewstate
+	enabled. Fixes bug #542076
+
+2009-09-01  Marek Habersack  <mhabersack at novell.com>
+
+	* ObjectDataSourceView.cs: ExecuteSelect must call
+	QueryTotalRowCount after executing the select method (that's what
+	.NET does)
+
+2009-08-21  Marek Habersack  <mhabersack at novell.com>
+
+	* Menu.cs: separator image is rendered next to the item in
+	horizontal layout and is preceeded by 3px spacer (unless
+	itemSpacing is set) to make output match .NET. Fixes bug #474716
+
+	* TreeNodeCollection.cs: {Save,Load}ViewState now store/load the
+	type of the node, if node is a of a custom type. Fixes bug #475997
+
+2009-06-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Parameter.cs: add new DbType property.
+
+2009-06-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ContentControlBuilderInternal.cs: detect missing
+	ContentPlaceHolderID attribute when parsing instead of throwing a
+	nullref later on.
+
 2009-05-29  Marek Habersack  <mhabersack at novell.com>
 
 	* ListItem.cs: when tracking view state is turned on after
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
index 3f22b51..0646c5f 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBox.cs
@@ -31,6 +31,7 @@ using System.Collections.Specialized;
 using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 	// CAS
@@ -311,7 +312,7 @@ namespace System.Web.UI.WebControls {
 
 		static bool IsInputOrCommonAttr (string attname)
 		{
-			attname = attname.ToUpper (CultureInfo.InvariantCulture);
+			attname = attname.ToUpper (Helpers.InvariantCulture);
 			switch (attname) {
 			case "VALUE":
 			case "CHECKED":
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
index 2281c1c..4841fae 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxList.cs
@@ -30,6 +30,7 @@ using System.Globalization;
 using System.Collections.Specialized;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -167,7 +168,7 @@ namespace System.Web.UI.WebControls {
 			// find out when they are unchecked.
 			for (int i = 0; i < Items.Count; i++) {
 				if (Items [i].Selected) {
-					check_box.ID = i.ToString (CultureInfo.InvariantCulture);
+					check_box.ID = i.ToString (Helpers.InvariantCulture);
 					Page.RegisterRequiresPostBack (check_box);
 				}
 			}
@@ -223,7 +224,7 @@ namespace System.Web.UI.WebControls {
 			try {
 				string id = postDataKey.Substring (ClientID.Length + 1);
 				if (Char.IsDigit (id [0]))
-					checkbox = Int32.Parse (id, CultureInfo.InvariantCulture);
+					checkbox = Int32.Parse (id, Helpers.InvariantCulture);
 			} catch {
 				return false;
 			}
@@ -351,7 +352,7 @@ namespace System.Web.UI.WebControls {
 		{
 			ListItem item = Items [repeatIndex];
 
-			check_box.ID = repeatIndex.ToString (CultureInfo.InvariantCulture);
+			check_box.ID = repeatIndex.ToString (Helpers.InvariantCulture);
 			check_box.Text = item.Text;
 			check_box.AutoPostBack = AutoPostBack;
 			check_box.Checked = item.Selected;
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ContentControlBuilderInternal.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ContentControlBuilderInternal.cs
index e72f2a5..540dfca 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ContentControlBuilderInternal.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ContentControlBuilderInternal.cs
@@ -49,6 +49,8 @@ namespace System.Web.UI.WebControls
 		{
 			base.Init (parser, parentBuilder, type, tagName, ID, attribs);
 			placeHolderID = attribs ["ContentPlaceHolderID"] as string;
+			if (String.IsNullOrEmpty (placeHolderID))
+				throw new HttpException ("Missing required 'ContentPlaceHolderID' attribute");
 		}
 		
 		public string ContentPlaceHolderID {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs
index ed35092..7811e7b 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataBoundControl.cs
@@ -138,9 +138,11 @@ namespace System.Web.UI.WebControls {
 		void Initialize ()
 		{
 			Page page = Page;
-			if (page != null) {
+			if (page != null && !IsDataBound) {
 				// LAMESPEC: see the comment above OnPagePreLoad
-				if (!page.IsPostBack || (!IsDataBound && IsViewStateEnabled))
+				if (!page.IsPostBack)
+					RequiresDataBinding = true;
+				else if (IsViewStateEnabled)
 					RequiresDataBinding = true;
 			}
 			
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
index 2668d10..ec072ab 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataGrid.cs
@@ -757,7 +757,7 @@ namespace System.Web.UI.WebControls {
 				LinkButton link = new LinkButton ();
 				link.Text = "...";
 				link.CommandName = PageCommandName;
-				link.CommandArgument = start.ToString (CultureInfo.InvariantCulture);
+				link.CommandArgument = start.ToString (Helpers.InvariantCulture);
 				link.CausesValidation = false;
 				res.Controls.Add (link);
 				res.Controls.Add (new LiteralControl ("&nbsp;"));
@@ -765,7 +765,7 @@ namespace System.Web.UI.WebControls {
 
 			for (int i = start; i < end; i++) {
 				Control number = null;
-				string page = (i + 1).ToString (CultureInfo.InvariantCulture);
+				string page = (i + 1).ToString (Helpers.InvariantCulture);
 				if (i != paged.CurrentPageIndex) {
 					LinkButton link = new LinkButton ();
 					link.Text = page;
@@ -789,7 +789,7 @@ namespace System.Web.UI.WebControls {
 				LinkButton link = new LinkButton ();
 				link.Text = "...";
 				link.CommandName = PageCommandName;
-				link.CommandArgument = (end + 1).ToString (CultureInfo.InvariantCulture);
+				link.CommandArgument = (end + 1).ToString (Helpers.InvariantCulture);
 				link.CausesValidation = false;
 				res.Controls.Add (link);
 			}
@@ -1157,7 +1157,7 @@ namespace System.Web.UI.WebControls {
 				return false;
 
 			string cn = de.CommandName;
-			CultureInfo inv = CultureInfo.InvariantCulture;
+			CultureInfo inv = Helpers.InvariantCulture;
 
 			OnItemCommand (de);
 			if (String.Compare (cn, CancelCommandName, true, inv) == 0) {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
index 462c323..6745e64 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/DataList.cs
@@ -674,7 +674,7 @@ namespace System.Web.UI.WebControls {
 				return false;
 
 			string cn = dlca.CommandName;
-			CultureInfo inv = CultureInfo.InvariantCulture;
+			CultureInfo inv = Helpers.InvariantCulture;
 
 			OnItemCommand (dlca);
 			if (String.Compare (cn, CancelCommandName, true, inv) == 0) {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
index 9b78238..b512e2d 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/FontUnit.cs
@@ -31,6 +31,7 @@ using System.Threading;
 using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 	[TypeConverter  (typeof (FontUnitConverter))]
@@ -103,7 +104,7 @@ namespace System.Web.UI.WebControls {
 				return;
 			}
 
-			switch (value.ToLower (CultureInfo.InvariantCulture)){
+			switch (value.ToLower (Helpers.InvariantCulture)){
 			case "smaller": type = FontSize.Smaller; break;
 			case "larger": type = FontSize.Larger; break;
 			case "xxsmall": type = FontSize.XXSmall; break;
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
index d8ef435..2586a1e 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ListBox.cs
@@ -32,6 +32,7 @@ using System.Drawing;
 using System.Globalization;
 using System.Collections.Specialized;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -160,7 +161,7 @@ namespace System.Web.UI.WebControls {
 				writer.AddAttribute (HtmlTextWriterAttribute.Multiple,
 						"multiple", false);
 			writer.AddAttribute (HtmlTextWriterAttribute.Size,
-                                        Rows.ToString (CultureInfo.InvariantCulture));
+                                        Rows.ToString (Helpers.InvariantCulture));
 			
 			base.AddAttributesToRender (writer);
 		}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
index 275bb05..1c0ff03 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ListControl.cs
@@ -390,7 +390,6 @@ namespace System.Web.UI.WebControls {
 		protected override void OnDataBinding (EventArgs e)
 		{
 			base.OnDataBinding (e);
-
 #if !NET_2_0
 			IEnumerable list = DataSourceResolver.ResolveDataSource (DataSource, DataMember);
 			PerformDataBinding (list);
@@ -398,7 +397,6 @@ namespace System.Web.UI.WebControls {
 			IEnumerable list = GetData ().ExecuteSelect (DataSourceSelectArguments.Empty);
 			InternalPerformDataBinding (list);
 #endif
-
 		}
 
 #if NET_2_0
@@ -441,32 +439,34 @@ namespace System.Web.UI.WebControls {
 				Items.Clear ();
 
 			string format = DataTextFormatString;
-			if (format == "")
+			if (format.Length == 0)
 				format = null;
 
 			string text_field = DataTextField;
 			string value_field = DataValueField;
+
+			if (text_field.Length == 0)
+				text_field = null;
+			if (value_field.Length == 0)
+				value_field = null;
+			
 			ListItemCollection coll = Items;
 			foreach (object container in dataSource) {
 				string text;
 				string val;
 
 				text = val = null;
-				if (text_field != "") {
+				if (text_field != null)
 					text = DataBinder.GetPropertyValue (container, text_field, format);
-				}
-
-				if (value_field != "") {
+				
+				if (value_field != null)
 					val = DataBinder.GetPropertyValue (container, value_field).ToString ();
-				}
-				else if (text_field == "") {
+				else if (text_field == null) {
 					text = val = container.ToString ();
 					if (format != null)
 						text = String.Format (format, container);
-				}
-				else if (text != null) {
+				} else if (text != null)
 					val = text;
-				}
 
 				if (text == null)
 					text = val;
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Login.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Login.cs
index c6b72be..63fc76e 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Login.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Login.cs
@@ -34,6 +34,7 @@ using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
 using System.Web.Security;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -1340,7 +1341,7 @@ namespace System.Web.UI.WebControls {
 				return false;
 			string url = Page.Request.Url.AbsolutePath;
 			return (String.Compare (defaultLogin, 0, url, url.Length - defaultLogin.Length, defaultLogin.Length,
-				true, CultureInfo.InvariantCulture) == 0);
+				true, Helpers.InvariantCulture) == 0);
 		}
 
 		bool IsLoggedIn ()
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
index 010b7f0..6973243 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Menu.cs
@@ -1840,9 +1840,16 @@ namespace System.Web.UI.WebControls
 
 			writer.RenderEndTag ();	// TR
 			writer.RenderEndTag ();	// TABLE
+			
+			writer.RenderEndTag ();	// TD
 
+			if (!vertical && itemSpacing == Unit.Empty && (notLast || (displayChildren && !dynamicChildren))) {
+				writer.AddStyleAttribute ("width", "3px");
+				writer.RenderBeginTag (HtmlTextWriterTag.Td);
+				writer.RenderEndTag ();
+			}
+			
 			// Bottom separator image
-
 			string separatorImg = item.SeparatorImageUrl;
 			if (separatorImg.Length == 0) {
 				if (isDynamicItem)
@@ -1851,22 +1858,20 @@ namespace System.Web.UI.WebControls
 					separatorImg = StaticBottomSeparatorImageUrl;
 			}
 			if (separatorImg.Length > 0) {
+				if (!vertical)
+					writer.RenderBeginTag (HtmlTextWriterTag.Td);
 				writer.AddAttribute ("src", ResolveClientUrl (separatorImg));
 				writer.RenderBeginTag (HtmlTextWriterTag.Img);
 				writer.RenderEndTag ();	// IMG
+				if (!vertical)
+					writer.RenderEndTag (); // TD
 			}
 
-			writer.RenderEndTag ();	// TD
 			if (vertical)
 				writer.RenderEndTag ();	// TR
 
 			if (itemSpacing != Unit.Empty)
 				RenderMenuItemSpacing (writer, itemSpacing, vertical);
-			else if (!vertical && (notLast || (displayChildren && !dynamicChildren))) {
-					writer.AddStyleAttribute ("width", "3px");
-					writer.RenderBeginTag (HtmlTextWriterTag.Td);
-					writer.RenderEndTag ();
-			}
 
 			// Submenu
 
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceView.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceView.cs
index e5bbf6d..89dc4ce 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceView.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ObjectDataSourceView.cs
@@ -713,10 +713,7 @@ namespace System.Web.UI.WebControls
 				OnSelecting (args);
 				if (args.Cancel)
 					return new ArrayList ();
-
-				if (CanRetrieveTotalRowCount && arguments.RetrieveTotalRowCount)
-					arguments.TotalRowCount = QueryTotalRowCount (paramValues, arguments);
-
+				
 				if (CanPage) {
 					if (StartRowIndexParameterName.Length == 0)
 						throw new InvalidOperationException ("Paging is enabled, but the StartRowIndexParameterName property is not set.");
@@ -731,6 +728,9 @@ namespace System.Web.UI.WebControls
 
 				result = InvokeSelect (SelectMethod, paramValues);
 
+				if (CanRetrieveTotalRowCount && arguments.RetrieveTotalRowCount)
+					arguments.TotalRowCount = QueryTotalRowCount (MergeParameterValues (SelectParameters, null, null), arguments);
+				
 				if (owner.EnableCaching)
 					owner.Cache.SetCachedObject (SelectMethod, SelectParameters, result);
 			}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
index 13fee47..79a8d05 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
@@ -191,6 +191,25 @@ namespace System.Web.UI.WebControls {
 			}
 		}
 
+		[WebCategoryAttribute ("Parameter")]
+		[DefaultValueAttribute (DbType.Object)]
+		[WebSysDescriptionAttribute ("Parameter's DbType.")]
+		public DbType DbType
+		{
+			get {
+				object o = ViewState ["DbType"];
+				if (o == null)
+					return DbType.Object;
+				return (DbType) o;
+			}
+			set {
+				if (DbType != value) {
+					ViewState ["DbType"] = value;
+					OnParameterChanged ();
+				}
+			}
+		}
+
 		[DefaultValue (0)]
 		public int Size {
 			get { return ViewState.GetInt ("Size", 0); }
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/PasswordRecovery.cs b/mcs/class/System.Web/System.Web.UI.WebControls/PasswordRecovery.cs
index f56832e..708030e 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/PasswordRecovery.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/PasswordRecovery.cs
@@ -337,10 +337,14 @@ namespace System.Web.UI.WebControls
 
 		public Control QuestionTemplateContainer
 		{
-			get
-			{
-				if (_questionTemplateContainer == null)
+			get {
+				if (_questionTemplateContainer == null) {
 					_questionTemplateContainer = new QuestionContainer (this);
+					ITemplate template = QuestionTemplate;
+					if (template != null)
+						_questionTemplateContainer.InstantiateTemplate (template);
+				}
+				
 				return _questionTemplateContainer;
 			}
 		}
@@ -354,10 +358,14 @@ namespace System.Web.UI.WebControls
 
 		public Control SuccessTemplateContainer
 		{
-			get
-			{
-				if (_successTemplateContainer == null)
+			get {
+				if (_successTemplateContainer == null) {
 					_successTemplateContainer = new SuccessContainer (this);
+					ITemplate template = SuccessTemplate;
+					if (template != null)
+						_successTemplateContainer.InstantiateTemplate (template);
+				}
+				
 				return _successTemplateContainer;
 			}
 		}
@@ -373,8 +381,13 @@ namespace System.Web.UI.WebControls
 		{
 			get
 			{
-				if (_userNameTemplateContainer == null)
+				if (_userNameTemplateContainer == null) {
 					_userNameTemplateContainer = new UserNameContainer (this);
+					ITemplate template = UserNameTemplate;
+					if (template != null)
+						_userNameTemplateContainer.InstantiateTemplate (template);
+				}
+				
 				return _userNameTemplateContainer;
 			}
 		}
@@ -519,19 +532,22 @@ namespace System.Web.UI.WebControls
 		protected internal override void CreateChildControls ()
 		{
 			ITemplate userNameTemplate = UserNameTemplate;
-			if (userNameTemplate == null)
+			if (userNameTemplate == null) {
 				userNameTemplate = new UserNameDefaultTemplate (this);
-			((UserNameContainer) UserNameTemplateContainer).InstantiateTemplate (userNameTemplate);
-
+				((UserNameContainer) UserNameTemplateContainer).InstantiateTemplate (userNameTemplate);
+			}
+			
 			ITemplate questionTemplate = QuestionTemplate;
-			if (questionTemplate == null)
+			if (questionTemplate == null) {
 				questionTemplate = new QuestionDefaultTemplate (this);
-			((QuestionContainer) QuestionTemplateContainer).InstantiateTemplate (questionTemplate);
+				((QuestionContainer) QuestionTemplateContainer).InstantiateTemplate (questionTemplate);
+			}
 
 			ITemplate successTemplate = SuccessTemplate;
-			if (successTemplate == null)
+			if (successTemplate == null) {
 				successTemplate = new SuccessDefaultTemplate (this);
-			((SuccessContainer) SuccessTemplateContainer).InstantiateTemplate (successTemplate);
+				((SuccessContainer) SuccessTemplateContainer).InstantiateTemplate (successTemplate);
+			}
 
 			Controls.AddAt (0, UserNameTemplateContainer);
 			Controls.AddAt (1, QuestionTemplateContainer);
@@ -791,12 +807,16 @@ namespace System.Web.UI.WebControls
 			if (user == null)
 				return;
 
+			// DO NOT change format of the message - it has to be exactly the same as in
+			// .NET as some software (e.g. YetAnotherForum) depends on it.
 			string messageText = "Please return to the site and log in using the following information.\n" +
-				"User Name: <%USERNAME%>\nPassword: <%PASSWORD%>";
+				"User Name: <%USERNAME%>\nPassword: <%PASSWORD%>\n";
 
-			ListDictionary dictionary = new ListDictionary ();
+			ListDictionary dictionary = new ListDictionary (StringComparer.OrdinalIgnoreCase);
 			dictionary.Add ("<%USERNAME%>", username);
+			dictionary.Add ("<% UserName %>", username);
 			dictionary.Add ("<%PASSWORD%>", password);
+			dictionary.Add ("<% Password %>", password);
 
 			MailMessage message = null;
 			
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs b/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
index afe1aa8..2d82c3c 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/RangeValidator.cs
@@ -27,6 +27,7 @@
 using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 // Modeled after Nikhil Kothari's sample in "ASP Server Controls and Components", pp368
 
@@ -96,8 +97,8 @@ namespace System.Web.UI.WebControls {
 				RegisterExpandoAttribute (ClientID, "maximumvalue", MaximumValue, true);
 #else
 				writer.AddAttribute("evaluationfunction", "RangeValidatorEvaluateIsValid", false); // FIXME - we need to define this in client code
-				writer.AddAttribute("minimumValue", MinimumValue.ToString(CultureInfo.InvariantCulture));
-				writer.AddAttribute("maximumValue", MaximumValue.ToString(CultureInfo.InvariantCulture));
+				writer.AddAttribute("minimumValue", MinimumValue.ToString(Helpers.InvariantCulture));
+				writer.AddAttribute("maximumValue", MaximumValue.ToString(Helpers.InvariantCulture));
 #endif
 			}
 		}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
index 3f14136..91fe94c 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableCell.cs
@@ -30,6 +30,7 @@ using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
 using System.Text;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -201,11 +202,11 @@ namespace System.Web.UI.WebControls {
 
 			int i = ColumnSpan;
 			if (i > 0)
-				writer.AddAttribute (HtmlTextWriterAttribute.Colspan, i.ToString (CultureInfo.InvariantCulture), false);
+				writer.AddAttribute (HtmlTextWriterAttribute.Colspan, i.ToString (Helpers.InvariantCulture), false);
 
 			i = RowSpan;
 			if (i > 0)
-				writer.AddAttribute (HtmlTextWriterAttribute.Rowspan, i.ToString (CultureInfo.InvariantCulture), false);
+				writer.AddAttribute (HtmlTextWriterAttribute.Rowspan, i.ToString (Helpers.InvariantCulture), false);
 #if NET_2_0
 			string[] ahci = AssociatedHeaderCellID;
 			if (ahci.Length > 1) {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
index 86ec1e8..23e321c 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableRow.cs
@@ -47,6 +47,8 @@ namespace System.Web.UI.WebControls {
 		TableCellCollection cells;
 #if NET_2_0
 		bool tableRowSectionSet;
+
+		internal TableRowCollection Container { get; set; }
 #endif
 		
 		public TableRow ()
@@ -129,6 +131,9 @@ namespace System.Web.UI.WebControls {
 					throw new ArgumentOutOfRangeException ("TableSection");
 				ViewState ["TableSection"] = (int) value;
 				tableRowSectionSet = true;
+				TableRowCollection container = Container;
+				if (container != null)
+					container.RowTableSectionSet ();
 			}
 		}
 #endif
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
index c9a9624..2267cc8 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableRowCollection.cs
@@ -43,6 +43,9 @@ namespace System.Web.UI.WebControls {
 		
 		internal TableRowCollection (Table table)
 		{
+			if (table == null)
+				throw new ArgumentNullException ("table");
+			
 			cc = table.Controls;
 			owner = table;
 		}
@@ -69,9 +72,12 @@ namespace System.Web.UI.WebControls {
 
 		public int Add (TableRow row)
 		{
+			if (row == null)
+				throw new NullReferenceException (); // .NET compatibility
 #if NET_2_0
 			if (row.TableRowSectionSet)
 				owner.GenerateTableSections = true;
+			row.Container = this;
 #endif
 			int index = cc.IndexOf (row);
 			if (index < 0) {
@@ -83,10 +89,14 @@ namespace System.Web.UI.WebControls {
 
 		public void AddAt (int index, TableRow row)
 		{
+			if (row == null)
+				throw new NullReferenceException (); // .NET compatibility
+			
 			if (cc.IndexOf (row) < 0) {
 #if NET_2_0
 				if (row.TableRowSectionSet)
 					owner.GenerateTableSections = true;
+				row.Container = this;
 #endif
 				cc.AddAt (index, row);
 			}
@@ -95,10 +105,14 @@ namespace System.Web.UI.WebControls {
 		public void AddRange (TableRow[] rows)
 		{
 			foreach (TableRow tr in rows) {
+				if (tr == null)
+					throw new NullReferenceException (); // .NET compatibility
+				
 				if (cc.IndexOf (tr) < 0) {
 #if NET_2_0
 					if (tr.TableRowSectionSet)
 						owner.GenerateTableSections = true;
+					tr.Container = this;
 #endif
 					cc.Add (tr);
 				}
@@ -128,13 +142,30 @@ namespace System.Web.UI.WebControls {
 			return cc.IndexOf (row);
 		}
 
+#if NET_2_0
+		internal void RowTableSectionSet ()
+		{
+			owner.GenerateTableSections = true;
+		}
+#endif
+		
 		public void Remove (TableRow row)
 		{
+#if NET_2_0
+			if (row != null)
+				row.Container = null;
+#endif
 			cc.Remove (row);
 		}
 
 		public void RemoveAt (int index)
 		{
+#if NET_2_0
+			TableRow row = this [index] as TableRow;
+			if (row != null)
+				row.Container = null;
+#endif
+			
 			cc.RemoveAt (index);
 		}
 
@@ -156,28 +187,27 @@ namespace System.Web.UI.WebControls {
 
 		int IList.Add (object value)
 		{
-			cc.Add ((TableRow)value);
-			return cc.IndexOf ((TableRow)value);
+			return Add (value as TableRow);
 		}
 
 		bool IList.Contains (object value)
 		{
-			return cc.Contains ((TableRow)value);
+			return cc.Contains (value as TableRow);
 		}
 
 		int IList.IndexOf (object value)
 		{
-			return cc.IndexOf ((TableRow)value);
+			return cc.IndexOf (value as TableRow);
 		}
 
 		void IList.Insert (int index, object value)
 		{
-			cc.AddAt (index, (TableRow)value);
+			AddAt (index, value as TableRow);
 		}
 
 		void IList.Remove (object value)
 		{
-			cc.Remove ((TableRow)value);
+			Remove (value as TableRow);
 		}
 	}
 }
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
index 859cc6e..512d642 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TableStyle.cs
@@ -30,6 +30,7 @@ using System.ComponentModel;
 using System.Globalization;
 using System.Security.Permissions;
 using System.Web.UI;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -185,11 +186,11 @@ namespace System.Web.UI.WebControls {
 			// note: avoid calling properties multiple times
 			int i = CellPadding;
 			if (i != -1)
-				writer.AddAttribute (HtmlTextWriterAttribute.Cellpadding, i.ToString (CultureInfo.InvariantCulture), false);
+				writer.AddAttribute (HtmlTextWriterAttribute.Cellpadding, i.ToString (Helpers.InvariantCulture), false);
 			
 			i = CellSpacing;
 			if (i != -1) {
-				writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, i.ToString (CultureInfo.InvariantCulture), false);
+				writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, i.ToString (Helpers.InvariantCulture), false);
 				if (i == 0) {
 					writer.AddStyleAttribute(HtmlTextWriterStyle.BorderCollapse, "collapse");
 				}
@@ -231,7 +232,7 @@ namespace System.Web.UI.WebControls {
 			} else if (BorderWidth.IsEmpty) {
 				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1", false);
 			} else {
-				writer.AddAttribute (HtmlTextWriterAttribute.Border, BorderWidth.Value.ToString (CultureInfo.InvariantCulture));
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, BorderWidth.Value.ToString (Helpers.InvariantCulture));
 			}
 
 #if !NET_2_0
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
index a5c2c49..6f8fb1a 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
@@ -56,6 +56,8 @@ namespace System.Web.UI.WebControls
 		bool gotBinding;
 		TreeNodeBinding binding;
 		PropertyDescriptorCollection boundProperties;
+		bool populating;
+		bool hadChildrenBeforePopulating;
 		
 		internal TreeNode (TreeView tree)
 		{
@@ -252,6 +254,16 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
+		internal bool HadChildrenBeforePopulating {
+			get { return hadChildrenBeforePopulating; }
+			set {
+				if (populating)
+					return;
+
+				hadChildrenBeforePopulating = value;
+			}
+		}
+		
 		[DefaultValue (false)]
 		public bool PopulateOnDemand {
 			get {
@@ -261,6 +273,10 @@ namespace System.Web.UI.WebControls
 			}
 			set {
 				ViewState ["PopulateOnDemand"] = value;
+				if (value && nodes != null && nodes.Count > 0)
+					HadChildrenBeforePopulating = true;
+				else
+					HadChildrenBeforePopulating = false;
 			}
 		}
 
@@ -451,8 +467,10 @@ namespace System.Web.UI.WebControls
 			if (tree == null)
 				return;
 
-			Populated = true;
+			populating = true;
 			tree.NotifyPopulateRequired (this);
+			populating = false;
+			Populated = true;
 		}
 		
 		public void Collapse ()
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs
index f412d53..57bae9d 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs
@@ -78,6 +78,9 @@ namespace System.Web.UI.WebControls
 		internal void Add (TreeNode child, bool updateParent)
 		{
 			int index = items.Add (child);
+
+			if (parent != null)
+				parent.HadChildrenBeforePopulating = true;
 			
 			if (!updateParent)
 				return;
@@ -196,16 +199,29 @@ namespace System.Web.UI.WebControls
 				items.Clear ();
 
 				for (int n = 1; n < its.Length; n++) {
-					TreeNode item = new TreeNode ();
+					var pair = its [n] as Pair;
+					if (pair == null)
+						throw new InvalidOperationException ("Broken view state (item " + n + ")");
+					
+					TreeNode item;
+					Type type = pair.First as Type;
+
+					if (type == null)
+						item = new TreeNode ();
+					else
+						item = Activator.CreateInstance (pair.First as Type) as TreeNode;
 					Add (item);
-					object ns = its [n];
+					object ns = pair.Second;
 					if (ns != null)
 						((IStateManager) item).LoadViewState (ns);
 				}
 			}
 			else {
 				for (int n = 1; n < its.Length; n++) {
-					Pair pair = (Pair) its [n];
+					var pair = its [n] as Pair;
+					if (pair  == null)
+						throw new InvalidOperationException ("Broken view state " + n + ")");
+					
 					int oi = (int) pair.First;
 					TreeNode node = (TreeNode) items [oi];
 					((IStateManager) node).LoadViewState (pair.Second);
@@ -227,7 +243,8 @@ namespace System.Web.UI.WebControls
 					for (int n = 0; n < items.Count; n++) {
 						TreeNode node = items [n] as TreeNode;
 						object ns = ((IStateManager) node).SaveViewState ();
-						state [n + 1] = ns;
+						Type type = node.GetType ();
+						state [n + 1] = new Pair (type == typeof (TreeNode) ? null : type, ns);
 					}
 				}
 			} else {
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs b/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
index 4180484..e517c37 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
@@ -1289,6 +1289,9 @@ namespace System.Web.UI.WebControls
 		
  		void RenderNode (HtmlTextWriter writer, TreeNode node, int level, ArrayList levelLines, bool hasPrevious, bool hasNext)
 		{
+			if (node.PopulateOnDemand && node.HadChildrenBeforePopulating)
+				throw new InvalidOperationException ("PopulateOnDemand cannot be set to true on a node that already has children.");
+			
 			DecorateNode(node);
 			
 			string nodeImage;
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs b/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
index 030fbe5..70dedfd 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/Unit.cs
@@ -30,6 +30,7 @@
 using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
@@ -238,7 +239,7 @@ namespace System.Web.UI.WebControls {
 				if (unitLen == 1 && input [unitStart] == '%')
 					type = UnitType.Percentage;
 				else {
-					switch (input.Substring (unitStart, unitLen).ToLower (CultureInfo.InvariantCulture)) {
+					switch (input.Substring (unitStart, unitLen).ToLower (Helpers.InvariantCulture)) {
 						case "in": type = UnitType.Inch; break;
 						case "cm": type = UnitType.Cm; break;
 						case "mm": type = UnitType.Mm; break;
@@ -376,7 +377,7 @@ namespace System.Web.UI.WebControls {
 			
 		public override string ToString ()
 		{
-			return ToString (CultureInfo.InvariantCulture);
+			return ToString (Helpers.InvariantCulture);
 		}
 
 #if NET_2_0
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
index c075091..f2965a3 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/WebColorConverter.cs
@@ -21,103 +21,32 @@
 //
 // Authors:
 //	Peter Bartok	(pbartok at novell.com)
+//	Marek Safar     (marek.safar at gmail.com) 
 //
 //
 
+using System.Collections;
 using System.Drawing;
 using System.Globalization;
 using System.ComponentModel;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI.WebControls {
 
 	// CAS
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class WebColorConverter : ColorConverter {
-
+	public class WebColorConverter : ColorConverter
+	{
 		// Converts from string to Color
 		public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) 
 		{
-			if (value is string) 
-			{
-				string	s;
-
-				s = ((string)value).Trim();
-				if (s.Length == 0) 
-				{
-					return Color.Empty;
-				}
-
-				if (culture == null) {
-					culture = CultureInfo.InvariantCulture;
-				}
-
-				if (s[0] == '#') 
-				{
-					// Hex
-
-					// MS throws a generic exception, wrapping the specific exception, who knows why...
-					try 
-					{
-						if (s.Length == 7) 
-						{
-							int	v;
-							v = Int32.Parse(s.Substring(1), NumberStyles.HexNumber, culture);
-
-							return Color.FromArgb(255, (v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff);
-						} 
-						else 
-						{
-							return Color.FromArgb(Int32.Parse(s.Substring(1), NumberStyles.HexNumber, culture));
-						}
-					}
-
-					catch (FormatException e) 
-					{
-						throw new Exception(s + "is not a valid color value", e);
-					}
-					catch (System.OverflowException e) 
-					{
-						throw new Exception(s + " is not a valid color value", e);
-					}
-				} 
-				else 
-				{
-					// Name or decimal
-					int	n = 0;
-
-					try 
-					{
-						n = Int32.Parse(s, NumberStyles.Integer, culture);
-					}
-
-					catch (FormatException e) 
-					{
-						Color c;
-
-						c = Color.FromName(s);
-						if ((c.A != 0) || (c.R != 0) || (c.G != 0) || (c.B != 0)) 
-						{
-							return c;
-						}
-
-						throw new Exception(s + " is not a valid color value", e);
-					}
-
-					catch (System.OverflowException e) 
-					{
-						throw new Exception(s + " is not a valid color value", e);
-					}
-
-					catch 
-					{
-						throw;
-					}
-
-					return Color.FromArgb(n);
-				}
+			if (value is string) {
+				string	s = ((string)value).Trim();
+				return ColorTranslator.FromHtml (s);
 			}
+			
 			return base.ConvertFrom (context, culture, value);
 		}
 
@@ -130,7 +59,7 @@ namespace System.Web.UI.WebControls {
 			Color c = (Color) value;
 
 			if (culture == null)
-				culture = CultureInfo.InvariantCulture;
+				culture = Helpers.InvariantCulture;
 
 			string s = c.ToKnownColor ().ToString ();
 			if (s != "0")
diff --git a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs
index dd32374..55f75c6 100644
--- a/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/ApplicationFileParser.cs
@@ -30,9 +30,11 @@
 //
 using System;
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Web;
 using System.Web.Compilation;
+using System.Web.Util;
 
 namespace System.Web.UI
 {
@@ -91,9 +93,9 @@ namespace System.Web.UI
 
 		internal override void AddDirective (string directive, Hashtable atts)
 		{
-			if (String.Compare (directive, "application", true) != 0 &&
-			    String.Compare (directive, "Import", true) != 0 &&
-			    String.Compare (directive, "Assembly", true) != 0)
+			if (String.Compare (directive, "application", true, Helpers.InvariantCulture) != 0 &&
+			    String.Compare (directive, "Import", true, Helpers.InvariantCulture) != 0 &&
+			    String.Compare (directive, "Assembly", true, Helpers.InvariantCulture) != 0)
 				ThrowParseException ("Invalid directive: " + directive);
 
 			base.AddDirective (directive, atts);
diff --git a/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs b/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
index 8516923..f1599ac 100644
--- a/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI/AttributeCollection.cs
@@ -31,6 +31,7 @@
 using System.Collections;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI {
 
@@ -140,7 +141,7 @@ namespace System.Web.UI {
 
 		public void Add (string key, string value)
 		{
-			if (0 == String.Compare (key, StyleAttribute, true, CultureInfo.InvariantCulture)) {
+			if (0 == String.Compare (key, StyleAttribute, true, Helpers.InvariantCulture)) {
 				CssStyle.Value = value;
 				return;
 			}
@@ -163,7 +164,7 @@ namespace System.Web.UI {
 
 		public void Remove (string key)
 		{
-			if (0 == String.Compare (key, StyleAttribute, true, CultureInfo.InvariantCulture)) {
+			if (0 == String.Compare (key, StyleAttribute, true, Helpers.InvariantCulture)) {
 				CssStyle.Clear ();
 				return;
 			}
diff --git a/mcs/class/System.Web/System.Web.UI/BaseParser.cs b/mcs/class/System.Web/System.Web.UI/BaseParser.cs
index ecca948..f8a013d 100644
--- a/mcs/class/System.Web/System.Web.UI/BaseParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/BaseParser.cs
@@ -33,6 +33,7 @@ using System.IO;
 using System.Security.Permissions;
 using System.Web.Compilation;
 using System.Web.Configuration;
+using System.Globalization;
 using System.Web.Util;
 
 namespace System.Web.UI
@@ -80,9 +81,9 @@ namespace System.Web.UI
 			hash.Remove (key);
 
 			bool result = false;
-			if (String.Compare (val, "true", true) == 0)
+			if (String.Compare (val, "true", true, Helpers.InvariantCulture) == 0)
 				result = true;
-			else if (String.Compare (val, "false", true) != 0)
+			else if (String.Compare (val, "false", true, Helpers.InvariantCulture) != 0)
 				ThrowParseException ("Invalid value for " + key);
 
 			return result;
@@ -156,7 +157,7 @@ namespace System.Web.UI
 			VirtualPath vpath = VirtualPath;
 			string vp = vpath != null ? vpath.Absolute : null;
 			if (vp == null)
-				return WebConfigurationManager.GetWebApplicationSection (section) as TSection;
+				return WebConfigurationManager.GetSection (section) as TSection;
 			else
 				return WebConfigurationManager.GetSection (section, vp) as TSection;
 		}
diff --git a/mcs/class/System.Web/System.Web.UI/ChangeLog b/mcs/class/System.Web/System.Web.UI/ChangeLog
index c099277..9594445 100644
--- a/mcs/class/System.Web/System.Web.UI/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI/ChangeLog
@@ -1,3 +1,64 @@
+2009-11-14  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateControl.cs: if writer is null in
+	WriteUTF8ResourceString, use output.Write, not writer.Write. Fixes
+	bug #547015
+
+2009-11-10  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateParser.cs: AddImports is called from LoadConfigDefaults
+	so that it reads configuration from the correct .config file (it
+	needs to be called after this.VirtualPath has been
+	initialized). Fixes an issue with MVC apps which put configuration
+	in Views/web.config etc. Fixes bug #552457
+
+	* ControlBuilder.cs, Page.cs: system.web/pages section is not
+	confined to the top-level web.config
+
+2009-10-30  Marek Habersack  <mhabersack at novell.com>
+
+	* Control.cs: ResolveClientUrl takes base path from
+	Request.ClientFilePath, so that it works correctly for rewritten
+	urls.
+
+2009-10-27  Marek Habersack  <mhabersack at novell.com>
+
+	* ObjectStateFormatter.cs: do not use a type converter to
+	serialize an object if the converter is an instance of
+	TypeConverter itself - its reported capability of converting to
+	string is not useful here.
+
+2009-10-12  Marek Habersack  <mhabersack at novell.com>
+
+	* ObjectStateFormatter.cs: if a type is associated with a type
+	converter, do not check if the converter can convert FROM the type
+	in question, as this is implied. Fixes bug #545979
+
+2009-09-22  Marek Habersack  <mhabersack at novell.com>
+
+	* WebServiceParser.cs: GetCompiledType uses BuildManager on the
+	2.0 profile. Fixes bug #533166
+
+2009-09-15  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateParser.cs: FindNamespaceInAssembly must catch
+	ReflectionTypeLoadException so that it doesn't break on invalid
+	assemblies.
+
+2009-08-18  Marek Habersack  <mhabersack at novell.com>
+
+	* ControlBuilder.cs: Location property makes a copy of assigned
+	ILocation now.
+
+2009-08-14  Marek Habersack  <mhabersack at novell.com>
+
+	* ControlBuilder.cs: when CreateSubBuilder is called on a builder
+	which is supposed to treat its children as properties and the
+	default property builder is defined, first check if the tag which
+	has just been parsed isn't a template property. If it is, don't
+	use the default property builder, instead create a template
+	property builder directly. Fixes bug #527753
+
 2009-07-23  Marek Habersack  <mhabersack at novell.com>
 
 	* ControlBuilder.cs: added an internal helper property
diff --git a/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs b/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
index 1f24124..e7d4a7c 100644
--- a/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
+++ b/mcs/class/System.Web/System.Web.UI/ClientScriptManager.cs
@@ -802,7 +802,7 @@ return true;
 
 				return sb.ToString ();
 			} else if (ob is bool) {
-				return ob.ToString ().ToLower (CultureInfo.InvariantCulture);
+				return ob.ToString ().ToLower (Helpers.InvariantCulture);
 			} else {
 				return ob.ToString ();
 			}
diff --git a/mcs/class/System.Web/System.Web.UI/Control.cs b/mcs/class/System.Web/System.Web.UI/Control.cs
index ae13fb9..9184a89 100644
--- a/mcs/class/System.Web/System.Web.UI/Control.cs
+++ b/mcs/class/System.Web/System.Web.UI/Control.cs
@@ -160,7 +160,7 @@ namespace System.Web.UI
 				if (!did_adapter_lookup) {
 					adapter = ResolveAdapter ();
 					if (adapter != null)
-						adapter.Control = this;
+						adapter.control = this;
 					did_adapter_lookup = true;
 				}
 				return adapter;
@@ -1406,12 +1406,13 @@ namespace System.Web.UI
 				return relativeUrl;
 
 			HttpContext context = Context;
-			if (context != null && context.Request != null) {
+			HttpRequest req = context != null ? context.Request : null;
+			if (req != null) {
 				string templateSourceDirectory = TemplateSourceDirectory;
 				if (templateSourceDirectory == null || templateSourceDirectory.Length == 0)
 					return relativeUrl;
 
-				string basePath = context.Request.FilePath;
+				string basePath = req.ClientFilePath;
 
 				if (basePath.Length > 1 && basePath [basePath.Length - 1] != '/')
 					basePath = VirtualPathUtility.GetDirectory (basePath, false);
diff --git a/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs b/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
index 16aac32..a971e13 100644
--- a/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
+++ b/mcs/class/System.Web/System.Web.UI/ControlBuilder.cs
@@ -38,6 +38,9 @@ using System.Web.Compilation;
 using System.Web.Configuration;
 using System.IO;
 using System.Web.UI.WebControls;
+using System.Web.Util;
+
+using _Location = System.Web.Compilation.Location;
 
 namespace System.Web.UI {
 
@@ -169,7 +172,7 @@ namespace System.Web.UI {
 
 		internal ILocation Location {
 			get { return location; }
-			set { location = value; }
+			set { location = new _Location (value); }
 		}
 	
 		internal ArrayList OtherTags {
@@ -473,7 +476,7 @@ namespace System.Web.UI {
 			if (tagType == null)
 				return null;
 			
-			PagesSection ps = WebConfigurationManager.GetWebApplicationSection ("system.web/pages") as PagesSection;
+			PagesSection ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
 			if (ps == null)
 				return tagType;
 
@@ -634,7 +637,7 @@ namespace System.Web.UI {
 		{
 			this.parser = parser;
 			if (parser != null)
-				this.location = parser.Location;
+				this.Location = parser.Location;
 
 			this.parentBuilder = parentBuilder;
 			this.type = type;
@@ -704,22 +707,29 @@ namespace System.Web.UI {
 				if (defaultPropertyBuilder == null)
 					childBuilder = CreatePropertyBuilder (tagid, parser, atts);
 				else {
-					if (String.Compare (defaultPropertyBuilder.TagName, tagid, true, CultureInfo.InvariantCulture) == 0) {
+					if (String.Compare (defaultPropertyBuilder.TagName, tagid, true, Helpers.InvariantCulture) == 0) {
 						// The child tag is the same what our default property name. Act as if there was
 						// no default property builder, or otherwise we'll end up with invalid nested
 						// builder call.
 						defaultPropertyBuilder = null;
 						childBuilder = CreatePropertyBuilder (tagid, parser, atts);
-					} else
-						childBuilder = defaultPropertyBuilder.CreateSubBuilder (tagid, atts,
-													null, parser,
-													location);
+					} else {
+						Type ct = ControlType;
+						MemberInfo[] mems = ct != null ? ct.GetMember (tagid, MemberTypes.Property, FlagsNoCase) : null;
+						PropertyInfo prop = mems != null && mems.Length > 0 ? mems [0] as PropertyInfo : null;
+
+						if (prop != null && typeof (ITemplate).IsAssignableFrom (prop.PropertyType)) {
+							childBuilder = CreatePropertyBuilder (tagid, parser, atts);
+							defaultPropertyBuilder = null;
+						} else
+							childBuilder = defaultPropertyBuilder.CreateSubBuilder (tagid, atts, null, parser, location);
+					}
 				}
 
 				return childBuilder;
 			}
 
-			if (String.Compare (tagName, tagid, true, CultureInfo.InvariantCulture) == 0)
+			if (String.Compare (tagName, tagid, true, Helpers.InvariantCulture) == 0)
 				return null;
 			
 			childType = GetChildControlType (tagid, atts);
diff --git a/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs b/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs
index 0077363..76c72fc 100644
--- a/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs
+++ b/mcs/class/System.Web/System.Web.UI/CssStyleCollection.cs
@@ -34,6 +34,7 @@ using System.Security.Permissions;
 using System.Text;
 using System.Collections.Specialized;
 using System.Globalization;
+using System.Web.Util;
 
 namespace System.Web.UI {
 
@@ -120,7 +121,7 @@ namespace System.Web.UI {
 			    value.Length >= 3 && String.Compare ("url", 0, value, 0, 3, StringComparison.OrdinalIgnoreCase) != 0)
 #else
 			if (key == "background-image" && 0 != String.Compare ("url", value.Substring (0, 3), true,
-									      CultureInfo.InvariantCulture))
+									      Helpers.InvariantCulture))
 #endif
 				sb.AppendFormat ("{0}:url({1});", key, HttpUtility.UrlPathEncode (value));
 			else
diff --git a/mcs/class/System.Web/System.Web.UI/Html32TextWriter.cs b/mcs/class/System.Web/System.Web.UI/Html32TextWriter.cs
index 82ad839..35035c9 100644
--- a/mcs/class/System.Web/System.Web.UI/Html32TextWriter.cs
+++ b/mcs/class/System.Web/System.Web.UI/Html32TextWriter.cs
@@ -32,6 +32,7 @@ using System.Collections;
 using System.Globalization;
 using System.IO;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web.UI
 {
@@ -89,7 +90,7 @@ namespace System.Web.UI
 			    !Enum.IsDefined (typeof (HtmlTextWriterTag), tagKey))
 				return "";
 
-			return tagKey.ToString ().ToLower (CultureInfo.InvariantCulture);
+			return tagKey.ToString ().ToLower (Helpers.InvariantCulture);
 			/* The code below is here just in case we need to split things up
 			switch (tagkey) {
 			case HtmlTextWriterTag.Unknown:
diff --git a/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs b/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs
index 2ded2b8..b4deee5 100644
--- a/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/MasterPageParser.cs
@@ -92,10 +92,10 @@ namespace System.Web.UI
 
 		internal override void AddDirective (string directive, Hashtable atts)
 		{
-			if (String.Compare ("MasterType", directive, true) == 0) {
+			if (String.Compare ("MasterType", directive, StringComparison.OrdinalIgnoreCase) == 0) {
 				PageParserFilter pfilter = PageParserFilter;
 				if (pfilter != null)
-					pfilter.PreprocessDirective (directive.ToLower (CultureInfo.InvariantCulture), atts);
+					pfilter.PreprocessDirective (directive.ToLowerInvariant (), atts);
 				
 				string type = GetString (atts, "TypeName", null);
 				if (type != null) {
diff --git a/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs b/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
index c9d0d0c..11ecd5c 100644
--- a/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
+++ b/mcs/class/System.Web/System.Web.UI/ObjectStateFormatter.cs
@@ -432,11 +432,15 @@ namespace System.Web.UI {
 										t,
 										converter != null ? converter.CanConvertFrom (t) : false));
 #endif
-						if (converter == null ||
-						    !converter.CanConvertTo (typeof (string)) ||
-						    !converter.CanConvertFrom (t)) {
+						// Do not use the converter if it's an instance of
+						// TypeConverter itself - it reports it is able to
+						// convert to string, but it's only a conversion
+						// consisting of a call to ToString() with no
+						// reverse conversion supported. This leads to
+						// problems when deserializing the object.
+						if (converter == null || converter.GetType () == typeof (TypeConverter) || !converter.CanConvertTo (typeof (string)))
 							fmt = binaryObjectFormatter;
-						} else {
+						else {
 							typeConverterFormatter.Converter = converter;
 							fmt = typeConverterFormatter;
 						}
@@ -1001,7 +1005,7 @@ namespace System.Web.UI {
 			{
 				w.Write (PrimaryId);
 				ObjectFormatter.WriteObject (w, o.GetType (), ctx);
-				string v = (string) converter.ConvertTo (null, CultureInfo.InvariantCulture,
+				string v = (string) converter.ConvertTo (null, Helpers.InvariantCulture,
 									 o, typeof (string));
 				base.Write (w, v, ctx);
 			}
@@ -1012,7 +1016,7 @@ namespace System.Web.UI {
 				converter = TypeDescriptor.GetConverter (t);
 				token = r.ReadByte ();
 				string v = (string) base.Read (token, r, ctx);
-				return converter.ConvertFrom (null, CultureInfo.InvariantCulture, v);
+				return converter.ConvertFrom (null, Helpers.InvariantCulture, v);
 			}
 			
 			protected override Type Type {
diff --git a/mcs/class/System.Web/System.Web.UI/Page.cs b/mcs/class/System.Web/System.Web.UI/Page.cs
index 5289cc3..ed46c86 100644
--- a/mcs/class/System.Web/System.Web.UI/Page.cs
+++ b/mcs/class/System.Web/System.Web.UI/Page.cs
@@ -187,7 +187,7 @@ public partial class Page : TemplateControl, IHttpHandler
 		ID = "__Page";
 		
 #if NET_2_0
-		PagesSection ps = WebConfigurationManager.GetWebApplicationSection ("system.web/pages") as PagesSection;
+		PagesSection ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
 		if (ps != null) {
 			asyncTimeout = ps.AsyncTimeout;
 			viewStateEncryptionMode = ps.ViewStateEncryptionMode;
@@ -618,7 +618,7 @@ public partial class Page : TemplateControl, IHttpHandler
 	void InitializeStyleSheet ()
 	{
 		if (_styleSheetTheme == null) {
-			PagesSection ps = WebConfigurationManager.GetWebApplicationSection ("system.web/pages") as PagesSection;
+			PagesSection ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
 			if (ps != null)
 				_styleSheetTheme = ps.StyleSheetTheme;
 		}
@@ -855,7 +855,7 @@ public partial class Page : TemplateControl, IHttpHandler
 			return null;
 
 		NameValueCollection coll = null;
-		if (0 == String.Compare (Request.HttpMethod, "POST", true, CultureInfo.InvariantCulture)
+		if (0 == String.Compare (Request.HttpMethod, "POST", true, Helpers.InvariantCulture)
 #if TARGET_J2EE
 			|| !_context.IsServletRequest
 #endif
diff --git a/mcs/class/System.Web/System.Web.UI/PageParser.cs b/mcs/class/System.Web/System.Web.UI/PageParser.cs
index 23467df..29e75e6 100644
--- a/mcs/class/System.Web/System.Web.UI/PageParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/PageParser.cs
@@ -168,11 +168,11 @@ namespace System.Web.UI
 			// attribute is processed case-insensitive
 			string enabless = GetString (atts, "EnableSessionState", null);
 			if (enabless != null) {
-				if (String.Compare (enabless, "readonly", true) == 0)
+				if (String.Compare (enabless, "readonly", true, Helpers.InvariantCulture) == 0)
 					enableSessionState = PagesEnableSessionState.ReadOnly;
-				else if (String.Compare (enabless, "true", true) == 0)
+				else if (String.Compare (enabless, "true", true, Helpers.InvariantCulture) == 0)
 					enableSessionState = PagesEnableSessionState.True;
-				else if (String.Compare (enabless, "false", true) == 0)
+				else if (String.Compare (enabless, "false", true, Helpers.InvariantCulture) == 0)
 					enableSessionState = PagesEnableSessionState.False;
 				else
 					ThrowParseException ("Invalid value for enableSessionState: " + enabless);
@@ -320,7 +320,7 @@ namespace System.Web.UI
 				ClientTarget ct = null;
 				
 				if ((ct = sec.ClientTargets [clientTarget]) == null)
-					clientTarget = clientTarget.ToLower (CultureInfo.InvariantCulture);
+					clientTarget = clientTarget.ToLowerInvariant ();
 				
 				if (ct == null && (ct = sec.ClientTargets [clientTarget]) == null) {
 					ThrowParseException (String.Format (
@@ -337,7 +337,7 @@ namespace System.Web.UI
 				if (coll != null) {
 					ct = coll [clientTarget];
 					if (ct == null)
-						ct = coll [clientTarget.ToLower ()];
+						ct = coll [clientTarget.ToLower (Helpers.InvariantCulture)];
 				}
 				
 				if (ct == null) {
@@ -399,7 +399,7 @@ namespace System.Web.UI
 			if (isMasterType || isPreviousPageType) {
 				PageParserFilter pfilter = PageParserFilter;
 				if (pfilter != null)
-					pfilter.PreprocessDirective (directive.ToLower (CultureInfo.InvariantCulture), atts);
+					pfilter.PreprocessDirective (directive.ToLowerInvariant (), atts);
 				
 				typeName = GetString (atts, "TypeName", null);
 				virtualPath = GetString (atts, "VirtualPath", null);
diff --git a/mcs/class/System.Web/System.Web.UI/PageThemeFileParser.cs b/mcs/class/System.Web/System.Web.UI/PageThemeFileParser.cs
index 77a6b95..34830ac 100644
--- a/mcs/class/System.Web/System.Web.UI/PageThemeFileParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/PageThemeFileParser.cs
@@ -52,7 +52,7 @@ namespace System.Web.UI
 
 		internal override void AddDirective (string directive, Hashtable atts)
 		{
-			int cmp = String.Compare ("Register", directive, true);
+			int cmp = String.Compare ("Register", directive, StringComparison.OrdinalIgnoreCase);
 			if (cmp == 0) {
 				base.AddDirective (directive, atts);
 				return;
diff --git a/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs b/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
index 7d8e4ff..33de536 100644
--- a/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/SimpleWebHandlerParser.cs
@@ -29,6 +29,7 @@
 
 using System.CodeDom.Compiler;
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Security.Permissions;
@@ -225,9 +226,9 @@ namespace System.Web.UI
 			if (tagtype != System.Web.Compilation.TagType.Directive)
 				throw new ParseException (location, "Unexpected tag");
 
-			if (tagid == null || tagid.Length == 0 || String.Compare (tagid, DefaultDirectiveName, true) == 0) {
+			if (tagid == null || tagid.Length == 0 || String.Compare (tagid, DefaultDirectiveName, true, Helpers.InvariantCulture) == 0) {
 				AddDefaultDirective (location, attributes);
-			} else if (String.Compare (tagid, "Assembly", true) == 0) {
+			} else if (String.Compare (tagid, "Assembly", true, Helpers.InvariantCulture) == 0) {
 				AddAssemblyDirective (location, attributes);
 			} else {
 				throw new ParseException (location, "Unexpected directive: " + tagid);
@@ -287,8 +288,8 @@ namespace System.Web.UI
 			
 			string d = GetAndRemove (attributes, "debug");
 			if (d != null) {
-				debug = (String.Compare (d, "true", true) == 0);
-				if (debug == false && String.Compare (d, "false", true) != 0)
+				debug = (String.Compare (d, "true", true, Helpers.InvariantCulture) == 0);
+				if (debug == false && String.Compare (d, "false", true, Helpers.InvariantCulture) != 0)
 					throw new ParseException (null, "Invalid value for Debug attribute");
 			} else
 				debug = compConfig.Debug;
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
index 5804de2..63503e8 100644
--- a/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
+++ b/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
@@ -486,10 +486,11 @@ namespace System.Web.UI {
 			//TODO: fAsciiOnly?
 			IntPtr ptr = AddOffset (resource_data.Ptr, offset);
 			HttpWriter writer = output.GetHttpWriter ();
+			
 			if (writer == null || writer.Response.ContentEncoding.CodePage != 65001) {
 				byte [] bytes = new byte [size];
 				Marshal.Copy (ptr, bytes, 0, size);
-				writer.Write (Encoding.UTF8.GetString (bytes));
+				output.Write (Encoding.UTF8.GetString (bytes));
 				bytes = null;
 				return;
 			}
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
index bfffc7a..e48c9d0 100644
--- a/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/TemplateControlParser.cs
@@ -28,6 +28,7 @@
 //
 
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Security.Permissions;
@@ -116,7 +117,7 @@ namespace System.Web.UI {
 
 		internal override void AddDirective (string directive, Hashtable atts)
 		{
-			int cmp = String.Compare ("Register", directive, true);
+			int cmp = String.Compare ("Register", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				string tagprefix = GetString (atts, "TagPrefix", null);
 				if (tagprefix == null || tagprefix.Trim () == "")
@@ -159,7 +160,7 @@ namespace System.Web.UI {
 				return;
 			}
 
-			cmp = String.Compare ("Reference", directive, true);
+			cmp = String.Compare ("Reference", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				string vp = null;
 				string page = GetString (atts, "Page", null);
diff --git a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
index 1b8d4ed..f4eadce 100644
--- a/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/TemplateParser.cs
@@ -89,11 +89,11 @@ namespace System.Web.UI {
 #if NET_2_0
 		string[] binDirAssemblies;
 		Dictionary <string, bool> namespacesCache;
-		List <string> imports;
+		Dictionary <string, bool> imports;
 		List <string> interfaces;
 		List <ServerSideScript> scripts;
 #else
-		ArrayList imports;
+		Hashtable imports;
 		ArrayList interfaces;
 		ArrayList scripts;
 #endif
@@ -118,7 +118,6 @@ namespace System.Web.UI {
 #endif
 		bool oc_shared;
 		OutputCacheLocation oc_location;
-		CultureInfo invariantCulture = CultureInfo.InvariantCulture;
 #if NET_2_0
 		// Kludge needed to support pre-parsing of the main directive (see
 		// AspNetGenerator.GetRootBuilderType)
@@ -147,27 +146,25 @@ namespace System.Web.UI {
 
 		internal TemplateParser ()
 		{
-			LoadConfigDefaults ();
 #if NET_2_0
-			imports = new List <string> ();
-			AddNamespaces (imports);
+			imports = new Dictionary <string, bool> (StringComparer.Ordinal);
 #else
-			imports = new ArrayList ();
-			imports.Add ("System");
-			imports.Add ("System.Collections");
-			imports.Add ("System.Collections.Specialized");
-			imports.Add ("System.Configuration");
-			imports.Add ("System.Text");
-			imports.Add ("System.Text.RegularExpressions");
-			imports.Add ("System.Web");
-			imports.Add ("System.Web.Caching");
-			imports.Add ("System.Web.Security");
-			imports.Add ("System.Web.SessionState");
-			imports.Add ("System.Web.UI");
-			imports.Add ("System.Web.UI.WebControls");
-			imports.Add ("System.Web.UI.HtmlControls");
+			imports = new Hashtable ();
+			imports.Add ("System", true);
+			imports.Add ("System.Collections", true);
+			imports.Add ("System.Collections.Specialized", true);
+			imports.Add ("System.Configuration", true);
+			imports.Add ("System.Text", true);
+			imports.Add ("System.Text.RegularExpressions", true);
+			imports.Add ("System.Web", true);
+			imports.Add ("System.Web.Caching", true);
+			imports.Add ("System.Web.Security", true);
+			imports.Add ("System.Web.SessionState", true);
+			imports.Add ("System.Web.UI", true);
+			imports.Add ("System.Web.UI.WebControls", true);
+			imports.Add ("System.Web.UI.HtmlControls", true);
 #endif
-
+			LoadConfigDefaults ();
 			assemblies = new ArrayList ();
 #if NET_2_0
 			CompilationSection compConfig = CompilationConfig;
@@ -175,10 +172,6 @@ namespace System.Web.UI {
 				if (info.Assembly != "*")
 					AddAssemblyByName (info.Assembly);
 			}
-
-			foreach (NamespaceInfo info in PagesConfig.Namespaces) {
-				imports.Add (info.Namespace);
-			}
 #else
 			CompilationConfiguration compConfig = CompilationConfig;
 			
@@ -194,6 +187,9 @@ namespace System.Web.UI {
 
 		internal virtual void LoadConfigDefaults ()
 		{
+#if NET_2_0
+			AddNamespaces (imports);
+#endif
 			debug = CompilationConfig.Debug;
 		}
 		
@@ -219,10 +215,10 @@ namespace System.Web.UI {
 			generator.AddControl (type, attributes);
 		}
 		
-		void AddNamespaces (List <string> imports)
+		void AddNamespaces (Dictionary <string, bool> imports)
 		{
 			if (BuildManager.HaveResources)
-				imports.Add ("System.Resources");
+				imports.Add ("System.Resources", true);
 			
 			PagesSection pages = PagesConfig;
 			if (pages == null)
@@ -231,9 +227,14 @@ namespace System.Web.UI {
 			NamespaceCollection namespaces = pages.Namespaces;
 			if (namespaces == null || namespaces.Count == 0)
 				return;
-
-			foreach (NamespaceInfo nsi in namespaces)
-				imports.Add (nsi.Namespace);
+			
+			foreach (NamespaceInfo nsi in namespaces) {
+				string ns = nsi.Namespace;
+				if (imports.ContainsKey (ns))
+					continue;
+				
+				imports.Add (ns, true);
+			}
 		}
 #endif
 		
@@ -261,7 +262,7 @@ namespace System.Web.UI {
 			if (!fileExists)
 				ThrowParseFileNotFound (src);
 
-			if (String.Compare (realpath, inputFile, false, invariantCulture) == 0)
+			if (String.Compare (realpath, inputFile, false, Helpers.InvariantCulture) == 0)
                                 return;
 			
 #if NET_2_0
@@ -321,7 +322,7 @@ namespace System.Web.UI {
 #if NET_2_0
 			var pageParserFilter = PageParserFilter;
 #endif
-			if (String.Compare (directive, DefaultDirectiveName, true) == 0) {
+			if (String.Compare (directive, DefaultDirectiveName, true, Helpers.InvariantCulture) == 0) {
 #if NET_2_0
 				bool allowMainDirective = allowedMainDirectives > 0;
 #else
@@ -335,7 +336,7 @@ namespace System.Web.UI {
 					return;
 				
 				if (pageParserFilter != null)
-					pageParserFilter.PreprocessDirective (directive.ToLower (CultureInfo.InvariantCulture), atts);
+					pageParserFilter.PreprocessDirective (directive.ToLower (Helpers.InvariantCulture), atts);
 #endif
 				
 				mainAttributes = atts;
@@ -344,10 +345,10 @@ namespace System.Web.UI {
 			}
 #if NET_2_0
 			else if (pageParserFilter != null)
-				pageParserFilter.PreprocessDirective (directive.ToLower (CultureInfo.InvariantCulture), atts);
+				pageParserFilter.PreprocessDirective (directive.ToLower (Helpers.InvariantCulture), atts);
 #endif
 				
-			int cmp = String.Compare ("Assembly", directive, true);
+			int cmp = String.Compare ("Assembly", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				string name = GetString (atts, "Name", null);
 				string src = GetString (atts, "Src", null);
@@ -370,7 +371,7 @@ namespace System.Web.UI {
 				return;
 			}
 
-			cmp = String.Compare ("Import", directive, true);
+			cmp = String.Compare ("Import", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				string namesp = GetString (atts, "Namespace", null);
 				if (atts.Count > 0)
@@ -380,7 +381,7 @@ namespace System.Web.UI {
 				return;
 			}
 
-			cmp = String.Compare ("Implements", directive, true);
+			cmp = String.Compare ("Implements", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				string ifacename = GetString (atts, "Interface", "");
 
@@ -398,7 +399,7 @@ namespace System.Web.UI {
 				return;
 			}
 
-			cmp = String.Compare ("OutputCache", directive, true);
+			cmp = String.Compare ("OutputCache", directive, true, Helpers.InvariantCulture);
 			if (cmp == 0) {
 				HttpResponse response = HttpContext.Current.Response;
 				if (response != null)
@@ -415,7 +416,10 @@ namespace System.Web.UI {
 
 				foreach (DictionaryEntry entry in atts) {
 					string key = (string) entry.Key;
-					switch (key.ToLower ()) {
+					if (key == null)
+						continue;
+					
+					switch (key.ToLower (Helpers.InvariantCulture)) {
 						case "duration":
 							oc_duration = Int32.Parse ((string) entry.Value);
 							if (oc_duration < 1)
@@ -449,7 +453,7 @@ namespace System.Web.UI {
 #endif
 						case "varybyparam":
 							oc_param = (string) entry.Value;
-							if (String.Compare (oc_param, "none") == 0)
+							if (String.Compare (oc_param, "none", true, Helpers.InvariantCulture) == 0)
 								oc_param = null;
 							break;
 						case "varybyheader":
@@ -568,16 +572,16 @@ namespace System.Web.UI {
 			
 			if (imports == null) {
 #if NET_2_0
-				imports = new List <string> ();
+				imports = new Dictionary <string, bool> (StringComparer.Ordinal);
 #else
-				imports = new ArrayList ();
+				imports = new Hashtable ();
 #endif
 			}
 			
-			if (imports.Contains (namesp))
+			if (imports.ContainsKey (namesp))
 				return;
 			
-			imports.Add (namesp);
+			imports.Add (namesp, true);
 #if NET_2_0
 			AddAssemblyForNamespace (namesp);
 #endif
@@ -618,7 +622,16 @@ namespace System.Web.UI {
 
 		bool FindNamespaceInAssembly (Assembly asm, string namesp)
 		{
-			foreach (Type type in asm.GetTypes ()) {
+			Type[] asmTypes;
+
+			try {
+				asmTypes = asm.GetTypes ();
+			} catch (ReflectionTypeLoadException) {
+				// ignore
+				return false;
+			}
+			
+			foreach (Type type in asmTypes) {
 				if (String.Compare (type.Namespace, namesp, StringComparison.Ordinal) == 0) {
 					namespacesCache.Add (namesp, true);
 					AddAssembly (asm, true);
@@ -891,7 +904,7 @@ namespace System.Web.UI {
 		{
 			MemberInfo mi = null;
 			bool missing = false;
-			string memberName = name.Trim ().ToLower (CultureInfo.InvariantCulture);
+			string memberName = name.Trim ().ToLower (Helpers.InvariantCulture);
 			Type parent = codeFileBaseClassType;
 
 			if (parent == null)
@@ -980,8 +993,11 @@ namespace System.Web.UI {
 					parent = LoadType (type);
 #endif				
 
-				if (parent == null)
+				if (parent == null) {
+					Console.WriteLine ("inputFile == {0}", inputFile);
+					Console.WriteLine (Environment.StackTrace);
 					ThrowParseException ("Cannot find type " + type);
+				}
 
 				if (!DefaultBaseType.IsAssignableFrom (parent))
 					ThrowParseException ("The parent type '" + type + "' does not derive from " + DefaultBaseType);
@@ -1275,7 +1291,7 @@ namespace System.Web.UI {
 				}
 				
 				if (StrUtils.StartsWith (inFile, physPath))
-					className = inputFile.Substring (physPath.Length).ToLower (CultureInfo.InvariantCulture);
+					className = inputFile.Substring (physPath.Length).ToLower (Helpers.InvariantCulture);
 				else
 #endif
 					className = Path.GetFileName (inputFile);
@@ -1294,7 +1310,7 @@ namespace System.Web.UI {
 			}
 		}
 
-		internal List <string> Imports {
+		internal Dictionary <string, bool> Imports {
 			get { return imports; }
 		}
 
@@ -1311,7 +1327,7 @@ namespace System.Web.UI {
 			}
 		}
 
-		internal ArrayList Imports {
+		internal Hashtable Imports {
 			get { return imports; }
 		}
 
diff --git a/mcs/class/System.Web/System.Web.UI/WebServiceParser.cs b/mcs/class/System.Web/System.Web.UI/WebServiceParser.cs
index 63c72fc..c6b44eb 100644
--- a/mcs/class/System.Web/System.Web.UI/WebServiceParser.cs
+++ b/mcs/class/System.Web/System.Web.UI/WebServiceParser.cs
@@ -57,6 +57,9 @@ namespace System.Web.UI {
 
 		public static Type GetCompiledType (string inputFile, HttpContext context)
 		{
+#if NET_2_0
+			return BuildManager.GetCompiledType (inputFile);
+#else
 			string physPath;
 			HttpRequest req = context != null ? context.Request : null;
 			
@@ -71,6 +74,7 @@ namespace System.Web.UI {
 				return type;
 
 			return WebServiceCompiler.CompileIntoType (parser);
+#endif
 		}
 
 		protected override string DefaultDirectiveName {
diff --git a/mcs/class/System.Web/System.Web.Util/FileUtils.cs b/mcs/class/System.Web/System.Web.Util/FileUtils.cs
index e5dbe7e..c0f5f7b 100644
--- a/mcs/class/System.Web/System.Web.Util/FileUtils.cs
+++ b/mcs/class/System.Web/System.Web.Util/FileUtils.cs
@@ -67,7 +67,7 @@ namespace System.Web.Util
 
                                 path = Path.Combine (tempdir,
 						     String.Format ("{0}{1}{2}", (prefix != null) ? prefix + "." : "",
-								    num.ToString ("x", CultureInfo.InvariantCulture),
+								    num.ToString ("x", Helpers.InvariantCulture),
 								    (extension != null) ? "." + extension : ""));
                                         
                                 try {
diff --git a/mcs/class/System.Web/System.Web.Util/Helpers.cs b/mcs/class/System.Web/System.Web.Util/Helpers.cs
new file mode 100644
index 0000000..2026a96
--- /dev/null
+++ b/mcs/class/System.Web/System.Web.Util/Helpers.cs
@@ -0,0 +1,38 @@
+//
+// System.Web.Util.Helpers
+//
+// Authors:
+//	Marek Habersack (mhabersack at novell.com)
+//
+// (C) 2009 Novell, Inc (http://novell.com)
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.Globalization;
+
+namespace System.Web.Util
+{
+	class Helpers
+	{
+		public static readonly CultureInfo InvariantCulture = CultureInfo.InvariantCulture;
+	}
+}
diff --git a/mcs/class/System.Web/System.Web.Util/StrUtils.cs b/mcs/class/System.Web/System.Web.Util/StrUtils.cs
index 8130615..3776a83 100644
--- a/mcs/class/System.Web/System.Web.Util/StrUtils.cs
+++ b/mcs/class/System.Web/System.Web.Util/StrUtils.cs
@@ -35,7 +35,6 @@ using System.Text;
 namespace System.Web.Util {
 	internal sealed class StrUtils 
 	{
-		static CultureInfo invariant = CultureInfo.InvariantCulture;
 		StrUtils () { }
 		
 		public static bool StartsWith (string str1, string str2)
@@ -53,7 +52,7 @@ namespace System.Web.Util {
 			if (l2 > l1)
 				return false;
 
-			return (0 == String.Compare (str1, 0, str2, 0, l2, ignore_case, invariant));
+			return (0 == String.Compare (str1, 0, str2, 0, l2, ignore_case, Helpers.InvariantCulture));
 		}
 
 		public static bool EndsWith (string str1, string str2)
@@ -71,7 +70,7 @@ namespace System.Web.Util {
 			if (l2 > l1)
 				return false;
 
-			return (0 == String.Compare (str1, l1 - l2, str2, 0, l2, ignore_case, invariant));
+			return (0 == String.Compare (str1, l1 - l2, str2, 0, l2, ignore_case, Helpers.InvariantCulture));
 		}
 
 		public static string EscapeQuotesAndBackslashes (string attributeValue)
diff --git a/mcs/class/System.Web/System.Web.Util/TimeUtil.cs b/mcs/class/System.Web/System.Web.Util/TimeUtil.cs
index ee1fe97..37a4606 100644
--- a/mcs/class/System.Web/System.Web.Util/TimeUtil.cs
+++ b/mcs/class/System.Web/System.Web.Util/TimeUtil.cs
@@ -40,7 +40,7 @@ namespace System.Web.Util {
 		internal static string ToUtcTimeString (DateTime dt)
 		{
 			return dt.ToUniversalTime ().ToString ("ddd, d MMM yyyy HH:mm:ss ",
-				CultureInfo.InvariantCulture) + "GMT";
+				Helpers.InvariantCulture) + "GMT";
 		}
 	}
 }
diff --git a/mcs/class/System.Web/System.Web.dll.sources b/mcs/class/System.Web/System.Web.dll.sources
index 189450f..4f418e1 100644
--- a/mcs/class/System.Web/System.Web.dll.sources
+++ b/mcs/class/System.Web/System.Web.dll.sources
@@ -62,6 +62,8 @@ System.Web.Compilation/ClientBuildManager.cs
 System.Web.Compilation/CompilationException.cs
 System.Web.Compilation/CompilerType.cs
 System.Web.Compilation/ConnectionStringsExpressionBuilder.cs
+System.Web.Compilation/DefaultResourceProviderFactory.cs
+System.Web.Compilation/DefaultResourceProvider.cs
 System.Web.Compilation/DesignTimeResourceProviderFactoryAttribute.cs
 System.Web.Compilation/Directive.cs
 System.Web.Compilation/ExpressionBuilderContext.cs
@@ -1181,6 +1183,7 @@ System.Web.Util/AltSerialization.cs
 System.Web.Util/DataSourceHelper.cs
 System.Web.Util/DataSourceResolver.cs
 System.Web.Util/FileUtils.cs
+System.Web.Util/Helpers.cs
 System.Web.Util/ICalls.cs
 System.Web.Util/IWebObjectFactory.cs
 System.Web.Util/IWebPropertyAccessor.cs
diff --git a/mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs b/mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs
index 758af29..b41f4bd 100644
--- a/mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs
+++ b/mcs/class/System.Web/System.Web/ApplicationShutdownReason.cs
@@ -46,6 +46,10 @@ namespace System.Web
                 HttpRuntimeClose = 12,
                 InitializationError = 13,
                 MaxRecompilationsReached = 14
+
+		#if NET_3_5
+		, BuildManagerChange = 15
+		#endif 		
         }
 }
 #endif
diff --git a/mcs/class/System.Web/System.Web/BrowserCapabilities.cs b/mcs/class/System.Web/System.Web/BrowserCapabilities.cs
index 6e99494..c1d10c4 100644
--- a/mcs/class/System.Web/System.Web/BrowserCapabilities.cs
+++ b/mcs/class/System.Web/System.Web/BrowserCapabilities.cs
@@ -34,6 +34,7 @@ using System.Globalization;
 using System.Web.Configuration;
 using System.Web.UI;
 using System.Security.Permissions;
+using System.Web.Util;
 
 #if NET_2_0
 namespace System.Web.Configuration {
@@ -554,7 +555,7 @@ namespace System.Web {
 				throw CreateCapabilityNotFoundException (key);
 			}
 
-			return (String.Compare (v, "True", true, CultureInfo.InvariantCulture) == 0);
+			return (String.Compare (v, "True", true, Helpers.InvariantCulture) == 0);
 		}
 
 		int ReadInt32 (string key)
diff --git a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
index b194770..0414a52 100644
--- a/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
+++ b/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
@@ -39,6 +39,7 @@ using System.Globalization;
 using System.IO;
 using System.Text.RegularExpressions;
 using System.Web.Configuration;
+using System.Web.Util;
 
 namespace System.Web
 {
@@ -109,7 +110,7 @@ namespace System.Web
 			((ArrayList) tbl ["browsers"]).Add (tbl["browser"]);
 
 			foreach (string key in data.Keys)
-				tbl [key.ToLower (CultureInfo.InvariantCulture).Trim ()] = data [key];
+				tbl [key.ToLower (Helpers.InvariantCulture).Trim ()] = data [key];
 			
 			return tbl;
 		}
@@ -141,7 +142,7 @@ namespace System.Web
 				if (text [0] != expression [0] ||
 				    String.Compare (text, 1, expression, 1,
 				    		    text.Length - 1, false,
-						    CultureInfo.InvariantCulture) != 0) {
+						    Helpers.InvariantCulture) != 0) {
 					return false;
 				}
 				expression = expression.Substring (text.Length);
@@ -488,7 +489,7 @@ namespace System.Web
 			
 			while ((str = input.ReadLine ()) != null && str.Length != 0) {
 				keyvalue = str.Split (eq, 2);
-				key = keyvalue [0].ToLower (CultureInfo.InvariantCulture).Trim ();
+				key = keyvalue [0].ToLower (Helpers.InvariantCulture).Trim ();
 				if (key.Length == 0)
 					continue;
 				data.Add (key, keyvalue [1]);
diff --git a/mcs/class/System.Web/System.Web/ChangeLog b/mcs/class/System.Web/System.Web/ChangeLog
index 64a6f2c..a2c99f9 100644
--- a/mcs/class/System.Web/System.Web/ChangeLog
+++ b/mcs/class/System.Web/System.Web/ChangeLog
@@ -1,3 +1,155 @@
+2009-11-16  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: RewritePath now treats non-rooted and
+	app-relative paths correctly - the former are formed by
+	concatenating base virtual path with the passed file path and the
+	latter by calling VirtualPathUtility.ToAbsolute. Rooted and
+	absolute paths are left unmodified. Fixes bug #550103
+
+2009-11-13  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpResponse.cs: added parameter checks to Redirect ().
+	If the passed url starts with http:, https:, file: or ftp: then it
+	is treated as a fully qualified one and no attempt to rewrite the
+	url to the fully qualified form (if system.web/httpRuntime
+	UseFullyQualifiedRedirectUrl is true) is made.
+
+2009-11-09  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpCookie.cs: made HttpCookie.CookieNVC serializable. Patch
+	from Sean Foy <sean.foy+novell at gmail.com>, thanks! Fixes bug
+	#553063
+
+	* HttpCookieCollection.cs: Add allows for duplicate cookie
+	names. Fixes bug #553150
+
+2009-10-30  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpRequest.cs: added internal property ClientFilePath, which
+	may have a different value than FilePath when virtual path has
+	been rewritten, but the caller specified that the client paths
+	should still be constructed using the original url.
+
+	* HttpContext.cs: RewritePath always sets Request.FilePath,
+	Request.ClientFilePath is set only when setClientFilePath is
+	true. This makes client urls work correctly when url rewriting is
+	being used.
+
+2009-10-20  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpResponse.cs: implemented the WriteSubstitution method,
+	thus enabling post-cache substitution.
+
+2009-10-12  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpResponse.cs: actually _use_ the url passed to Redirect when
+	fully qualified redirect url is requested, doh. Fixes bug #542846
+
+2009-10-07 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* StaticFileHandler.cs: it's the last flush even when a VPP is used.
+
+2009-09-29  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpResponse.cs: use full url in redirect if
+	UseFullyQualifiedRedirectUrl is set to true in httpRuntime
+	configuration section. Patch from Brett Kiefer
+	<brett at fogcreek.com>, thanks! Fixes bug #542846
+
+2009-09-28  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: GetResourceProvider - renamed the 'key' argument
+	to 'virtualPath' in order to reflects its purpose better. Local
+	resource providers are created for the passed virtualPath and not
+	for the current request's path. Fixes bug #542484
+
+2009-09-25  Marek Habersack  <mhabersack at novell.com>
+
+	* StaticSiteMapProvider.cs: MapUrl must normalize paths. Fixes bug
+	#541969
+
+	* XmlSiteMapProvider.cs: siteMapFile parameter must be mapped in
+	Initialize. Fixes bug #541969
+
+2009-09-24  Marek Habersack  <mhabersack at novell.com>
+
+	* XmlSiteMapProvider.cs: added "securityTrimmingEnabled" to the
+	list of supported attributes in Initialize. Fixes bug #541607
+
+2009-09-07  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: when creating local resource provider, pass the
+	current file's virtual path to CreateLocalResourceProvider. Fixes
+	bug #536757
+
+	* XmlSiteMapProvider.cs: do not allow the provider to be
+	intialized more than once.
+	Initialize throws if it finds unknown attributes in the
+	'attributes' collection.
+	AddNode checks its arguments and throws if they are null or aren't
+	from the same provider.
+	FindStartingNode throws exceptions in several erroneous situations
+	now.
+	Added private method GetConfigDocument which performs several
+	checks on the source .sitemap file and throws exceptions if it
+	finds any errors.
+	BuildSiteMap clears provider state before building the map.
+	BuildSiteMapRecursive correctly deals with custom providers. Fixes
+	bug #465696
+	FindSiteMapNode maps url before searching. Fixes bug #465696
+
+	* VirtualPathUtility.cs: Combine a bit more efficient
+
+	* StaticSiteMapProvider.cs: FindSiteMap node checks if rawUrl is
+	relative to application root and if yes, makes it absolute.
+	MapUrl converts both rooted and not rooted urls to absolute.
+
+	* SiteMapProvider.cs: check if HttpContext.Request exists before
+	using it in FindSiteMapnode
+
+	* SiteMap.cs: Providers collection must be read-only.
+
+2009-09-04  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpRuntime.cs: retrieve real Mono version from the runtime and
+	store it in the MonoVersion internal static property.
+
+	* HttpException.cs: report real Mono version when backtrace is
+	displayed.
+
+2009-07-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpApplicationFactory.cs: allow subclasses of EventHandler for
+	event handlers in global.asax.
+	Fixes bug #525743.
+
+2009-07-23  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpException.cs: if an exception is processed which refers to
+	internal "files", don't show the internal name.
+
+2009-07-18  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: GetGlobalResourceObject must look for resources
+	in the 'Resources' "namespace" - it was a regression from the
+	previous change to that method.
+
+2009-07-15  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpApplicationFactory.cs: added internal methods to
+	enable/disable specific watchers. Part of fix for bug #522017
+
+2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ApplicationShutdownReason.cs: add new 3.5 value.
+	* ParserErrorCollection.cs: add setter for ParserError.
+	Patch from Daniel Gagne.
+
+2009-07-14  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpApplicationFactory.cs: OnFileChanged doesn't reload
+	application if reload suppression is active.
+
 2009-07-13  Marek Habersack  <mhabersack at novell.com>
 
 	* HttpApplication.cs: LoadType - wrap call to LoadTypeFromBin in
@@ -6,10 +158,28 @@
 	BadImageException exceptions as they don't matter in this
 	context.
 
-2009-07-23  Marek Habersack  <mhabersack at novell.com>
+2009-07-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
-	* HttpException.cs: if an exception is processed which refers to
-	internal "files", don't show the internal name.
+	* HttpContext.cs:
+	* HttpRuntime.cs:
+	* HttpApplication.cs: backported from HEAD.
+
+2009-07-09  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: fall back to default resource provider factory
+	if the factory provided by user doesn't have the required object
+	in Get{Global,Local}ResourceObject. Fixes bug #520397
+	Refactored the GetResourceObject method and the
+	ResourceManagerCacheKey class to DefaultResourceProvider.
+
+2009-07-07 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ParserError.cs: add 3 missing setters. Patch from Daniel Gagne.
+
+2009-06-15  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpCachePolicy.cs: SetHeaders adds max-age when MaxAge is set
+	to TimeSpan.Zero by calling SetMaxAge. Fixes bug #513000
 
 2009-06-05  Marek Habersack  <mhabersack at novell.com>
 
diff --git a/mcs/class/System.Web/System.Web/HttpApplication.cs b/mcs/class/System.Web/System.Web/HttpApplication.cs
index ec7f076..87d75b8 100644
--- a/mcs/class/System.Web/System.Web/HttpApplication.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplication.cs
@@ -76,6 +76,7 @@ using System.Web.Caching;
 using System.Web.Configuration;
 using System.Web.SessionState;
 using System.Web.UI;
+using System.Web.Util;
 
 #if TARGET_J2EE
 using Mainsoft.Web;
@@ -856,7 +857,7 @@ namespace System.Web {
 			if (custom == null) // Sigh
 				throw new NullReferenceException ();
 
-			if (0 == String.Compare (custom, "browser", true, CultureInfo.InvariantCulture))
+			if (0 == String.Compare (custom, "browser", true, Helpers.InvariantCulture))
 				return context.Request.Browser.Type;
 
 			return null;
@@ -1177,6 +1178,9 @@ namespace System.Web {
 			if (stop_processing)
 				yield return true;
 
+#if NET_2_0
+			context.MapRequestHandlerDone = false;
+#endif
 			StartTimer ("BeginRequest");
 			eventHandler = Events [BeginRequestEvent];
 			if (eventHandler != null) {
@@ -1243,6 +1247,7 @@ namespace System.Web {
 				foreach (bool stop in RunHooks (eventHandler))
 					yield return stop;
 			StopTimer ();
+			context.MapRequestHandlerDone = true;
 #endif
 			
 			StartTimer ("GetHandler");
@@ -1481,7 +1486,9 @@ namespace System.Web {
 			cfg = GlobalizationConfiguration.GetInstance (null);
 			if (cfg != null) {
 				app_culture = cfg.Culture;
+				autoCulture = false; // to hush the warning
 				appui_culture = cfg.UICulture;
+				autoUICulture = false; // to hush the warning
 			}
 #endif
 
@@ -1492,14 +1499,14 @@ namespace System.Web {
 			if (app_culture != null) {
 				prev_app_culture = th.CurrentCulture;
 				CultureInfo new_app_culture = GetThreadCulture (Request, app_culture, autoCulture);
-				if (!new_app_culture.Equals (CultureInfo.InvariantCulture))
+				if (!new_app_culture.Equals (Helpers.InvariantCulture))
 					th.CurrentCulture = new_app_culture;
 			}
 
 			if (appui_culture != null) {
 				prev_appui_culture = th.CurrentUICulture;
 				CultureInfo new_app_culture = GetThreadCulture (Request, appui_culture, autoUICulture);
-				if (!new_app_culture.Equals (CultureInfo.InvariantCulture))
+				if (!new_app_culture.Equals (Helpers.InvariantCulture))
 					th.CurrentUICulture = new_app_culture;
 			}
 
@@ -1596,8 +1603,7 @@ namespace System.Web {
 
 			bool allowCache;
 #if NET_2_0
-			global::System.Configuration.Configuration cfg = WebConfigurationManager.OpenWebConfiguration (req.Path, null, req.FilePath);
-			HttpHandlersSection httpHandlersSection = cfg.GetSection ("system.web/httpHandlers") as HttpHandlersSection;
+			HttpHandlersSection httpHandlersSection = WebConfigurationManager.GetSection ("system.web/httpHandlers", req.Path, req.Context) as HttpHandlersSection;
 			ret = httpHandlersSection.LocateHandler (verb, url, out allowCache);
 #else
 			HandlerFactoryConfiguration factory_config = (HandlerFactoryConfiguration) HttpContext.GetAppConfig ("system.web/httpHandlers");
diff --git a/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs b/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
index bb88024..6a5db1d 100644
--- a/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
+++ b/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs
@@ -28,6 +28,7 @@
 //
 using System;
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Web.UI;
@@ -109,7 +110,7 @@ namespace System.Web {
 				return false;
 
 			if (pi [0].ParameterType != typeof (object) ||
-			    pi [1].ParameterType != typeof (EventArgs))
+			    !typeof (EventArgs).IsAssignableFrom (pi [1].ParameterType))
 				return false;
 			
 			return true;
@@ -701,6 +702,34 @@ namespace System.Web {
 			}
 		}
 
+		internal static void DisableWatcher (string virtualPath, string filter)
+		{
+			EnableWatcherEvents (virtualPath, filter, false);
+		}
+
+		internal static void EnableWatcher (string virtualPath, string filter)
+		{
+			EnableWatcherEvents (virtualPath, filter, true);
+		}
+		
+		static void EnableWatcherEvents (string virtualPath, string filter, bool enable)
+		{
+			lock (watchers_lock) {
+				foreach (FileSystemWatcher watcher in watchers) {
+					if (
+#if NET_2_0
+						String.Compare (watcher.Path, virtualPath, StringComparison.Ordinal) != 0 || String.Compare (watcher.Filter, filter, StringComparison.Ordinal) != 0
+#else
+						String.Compare (watcher.Path, virtualPath) != 0 || String.Compare (watcher.Filter, filter) != 0
+#endif
+					)
+						continue;
+					
+					watcher.EnableRaisingEvents = enable;
+				}
+			}
+		}
+		
 		internal static void EnableWatchers ()
 		{
 			lock (watchers_lock) {
@@ -717,10 +746,13 @@ namespace System.Web {
 	        static void OnFileChanged(object sender, FileSystemEventArgs args)
 	        {
 			string name = args.Name;
+			bool isConfig = false;
+			
 			if (StrUtils.EndsWith (name, "onfig", true)) {
-				if (String.Compare (Path.GetFileName (name), "web.config", true) != 0)
+				if (String.Compare (Path.GetFileName (name), "web.config", true, Helpers.InvariantCulture) != 0)
 					return;
-			} else if (StrUtils.EndsWith (name, "lobal.asax", true) && String.Compare (name, "global.asax", true) != 0)
+				isConfig = true;
+			} else if (StrUtils.EndsWith (name, "lobal.asax", true) && String.Compare (name, "global.asax", true, Helpers.InvariantCulture) != 0)
 				return;
 
 			// {Inotify,FAM}Watcher will notify about events for a directory regardless
@@ -729,8 +761,19 @@ namespace System.Web {
 			// not removing it and instead working around the issue here. Fix for bug
 			// #495011
 			FileSystemWatcher watcher = sender as FileSystemWatcher;
-			if (watcher != null && String.Compare (watcher.Filter, "?eb.?onfig", true) == 0 && Directory.Exists (name))
+			if (watcher != null && String.Compare (watcher.Filter, "?eb.?onfig", true, Helpers.InvariantCulture) == 0 && Directory.Exists (name))
 				return;
+
+#if NET_2_0
+			// We re-enable suppression here since WebConfigurationManager will disable
+			// it after save is done. WebConfigurationManager is called twice by
+			// Configuration - just after opening the target file and just after closing
+			// it. For that reason we will receive two change notifications and if we
+			// disabled suppression here, it would reload the application on the second
+			// change notification.
+			if (isConfig && WebConfigurationManager.SuppressAppReload (true))
+				return;
+#endif
 			
 	        	lock (watchers_lock) {
 				if(app_shutdown)
diff --git a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs b/mcs/class/System.Web/System.Web/HttpCachePolicy.cs
index eb54ee9..c6e415b 100644
--- a/mcs/class/System.Web/System.Web/HttpCachePolicy.cs
+++ b/mcs/class/System.Web/System.Web/HttpCachePolicy.cs
@@ -28,6 +28,7 @@
 //
 
 using System.Collections;
+using System.Collections.Specialized;
 using System.ComponentModel;
 using System.Globalization;
 using System.IO;
@@ -81,11 +82,9 @@ namespace System.Web
 		bool set_no_store;
 		bool set_no_transform;
 		bool valid_until_expires;
-
-		// always false in 1.x
-		bool omit_vary_star;
-
 #if NET_2_0
+		bool omit_vary_star;
+		
 		public HttpCacheVaryByContentEncodings VaryByContentEncodings {
 			get { return vary_by_content_encodings; }
 		}
@@ -122,7 +121,13 @@ namespace System.Web
 
 		// always false in 1.x
 		internal bool OmitVaryStar {
-			get { return omit_vary_star; }
+			get {
+#if NET_2_0
+				return omit_vary_star;
+#else
+				return false;
+#endif
+			}
 		}
 
 		internal bool ValidUntilExpires {
@@ -271,6 +276,7 @@ namespace System.Web
 				return;
 
 			ProxyMaxAge = delta;
+			HaveProxyMaxAge = true;
 		}
 
 		public void SetRevalidation (HttpCacheRevalidation revalidation)
@@ -315,7 +321,7 @@ namespace System.Web
 				allow_response_in_browser_history = allow;
 		}
 
-		internal void SetHeaders (HttpResponse response, ArrayList headers)
+		internal void SetHeaders (HttpResponse response, NameValueCollection headers)
 		{
 			bool noCache = false;
 			string cc = null;
@@ -341,16 +347,16 @@ namespace System.Web
 			if (noCache) {
 				response.CacheControl = cc;
 				if (!allow_response_in_browser_history) {
-					headers.Add (new UnknownResponseHeader ("Expires", "-1"));
-					headers.Add (new UnknownResponseHeader ("Pragma", "no-cache"));
+					headers.Add ("Expires", "-1");
+					headers.Add ("Pragma", "no-cache");
 				}
 			} else {
-				if (MaxAge.TotalSeconds != 0)
+				if (HaveMaxAge)
 					cc = String.Concat (cc, ", max-age=", ((long) MaxAge.TotalSeconds).ToString ());
 
 				if (have_expire_date) {
 					string expires = TimeUtil.ToUtcTimeString (expire_date);
-					headers.Add (new UnknownResponseHeader ("Expires", expires));
+					headers.Add ("Expires", expires);
 				}
 			}
 
@@ -359,22 +365,21 @@ namespace System.Web
 			if (set_no_transform)
 				cc = String.Concat (cc, ", no-transform");
 
-			headers.Add (new UnknownResponseHeader ("Cache-Control", cc));
+			headers.Add ("Cache-Control", cc);
 
 			if (last_modified_from_file_dependencies || etag_from_file_dependencies)
 				HeadersFromFileDependencies (response);
 
 			if (etag != null)
-				headers.Add (new UnknownResponseHeader ("ETag", etag));
+				headers.Add ("ETag", etag);
 
 			if (have_last_modified)
-				headers.Add (new UnknownResponseHeader ("Last-Modified",
-							     TimeUtil.ToUtcTimeString (last_modified)));
+				headers.Add ("Last-Modified", TimeUtil.ToUtcTimeString (last_modified));
 
 			if (!vary_by_params.IgnoreParams) {
-				BaseResponseHeader vb = vary_by_params.GetResponseHeader ();
+				string vb = vary_by_params.GetResponseHeaderValue ();
 				if (vb != null)
-					headers.Add (vb);
+					headers.Add ("Vary", vb);
 			}
 		}
 
diff --git a/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs b/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
index 0eabbed..aadb875 100644
--- a/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
+++ b/mcs/class/System.Web/System.Web/HttpCacheVaryByParams.cs
@@ -63,9 +63,9 @@ namespace System.Web {
 			return names;
 		}
 
-		internal BaseResponseHeader GetResponseHeader ()
+		internal string GetResponseHeaderValue ()
 		{
-			StringBuilder builder = new StringBuilder ("");
+			StringBuilder builder = new StringBuilder ();
 
 			foreach (string parm in parms.Keys) {
 				builder.Append (parm);
@@ -75,7 +75,7 @@ namespace System.Web {
 			if (builder.Length == 0)
 				return null;
 
-			return new UnknownResponseHeader ("Vary", builder.ToString());
+			return builder.ToString();
 		}
 
 		public bool IgnoreParams {
diff --git a/mcs/class/System.Web/System.Web/HttpClientCertificate.cs b/mcs/class/System.Web/System.Web/HttpClientCertificate.cs
index bcbc2ba..65c7bf9 100644
--- a/mcs/class/System.Web/System.Web/HttpClientCertificate.cs
+++ b/mcs/class/System.Web/System.Web/HttpClientCertificate.cs
@@ -29,6 +29,7 @@
 using System.Collections.Specialized;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web {
 
@@ -164,7 +165,7 @@ namespace System.Web {
 				return 0;
 
 			try {
-				return Int32.Parse (s, CultureInfo.InvariantCulture);
+				return Int32.Parse (s, Helpers.InvariantCulture);
 			}
 			catch {
 				return 0;
diff --git a/mcs/class/System.Web/System.Web/HttpContext.cs b/mcs/class/System.Web/System.Web/HttpContext.cs
index c6552d4..54b46d0 100644
--- a/mcs/class/System.Web/System.Web/HttpContext.cs
+++ b/mcs/class/System.Web/System.Web/HttpContext.cs
@@ -41,10 +41,10 @@ using System.Web.Configuration;
 using System.Web.SessionState;
 using System.Web.UI;
 using System.Web.Util;
+using System.Reflection;
 #if NET_2_0
 using System.Collections.Generic;
 using System.IO;
-using System.Reflection;
 using System.Resources;
 using System.Web.Compilation;
 using System.Web.Profile;
@@ -78,6 +78,10 @@ namespace System.Web {
 #if NET_2_0
 		[ThreadStatic]
 		static ResourceProviderFactory provider_factory;
+
+		[ThreadStatic]
+		static DefaultResourceProviderFactory default_provider_factory;
+		
 		[ThreadStatic]
 		static Dictionary <string, IResourceProvider> resource_providers;
 		
@@ -88,12 +92,18 @@ namespace System.Web {
 			set { AppDomain.CurrentDomain.SetData (app_global_res_key, value); }
 		}
 #else
-		[ThreadStatic]
-		static Dictionary <ResourceManagerCacheKey, ResourceManager> resourceManagerCache;
 		internal static Assembly AppGlobalResourcesAssembly;
 #endif
 		ProfileBase profile = null;
 		LinkedList<IHttpHandler> handlers;
+
+		static DefaultResourceProviderFactory DefaultProviderFactory {
+			get {
+				if (default_provider_factory == null)
+					default_provider_factory = new DefaultResourceProviderFactory ();
+				return default_provider_factory;
+			}
+		}
 #endif
 		
 		public HttpContext (HttpWorkerRequest wr)
@@ -226,18 +236,7 @@ namespace System.Web {
 		}
 #if !TARGET_JVM
 		public bool IsDebuggingEnabled {
-			get {
-#if NET_2_0
-				CompilationSection section = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
-				return section.Debug;
-#else
-				try {
-					return CompilationConfiguration.GetInstance (this).Debug;
-				} catch {
-					return false;
-				}
-#endif
-			}
+			get { return HttpRuntime.IsDebuggingEnabled; }
 		}
 #endif
 		public IDictionary Items {
@@ -311,6 +310,11 @@ namespace System.Web {
 		}
 
 #if NET_2_0
+		internal bool MapRequestHandlerDone {
+			get;
+			set;
+		}
+		
 		// The two properties below are defined only when the IIS7 integrated mode is used.
 		// They are useless under Mono
 		public RequestNotification CurrentNotification {
@@ -443,28 +447,6 @@ namespace System.Web {
 		}
 
 #if NET_2_0
-		static object GetResourceObject (string classKey, string resourceKey, CultureInfo culture, Assembly assembly)
-		{
-			ResourceManager rm;
-			try {
-				if (resourceManagerCache == null)
-					resourceManagerCache = new Dictionary <ResourceManagerCacheKey, ResourceManager> ();
-				
-				ResourceManagerCacheKey key = new ResourceManagerCacheKey (classKey, assembly);
-				if (!resourceManagerCache.TryGetValue (key, out rm)) {
-					rm = new ResourceManager (classKey, assembly);
-					rm.IgnoreCase = true;
-					resourceManagerCache.Add (key, rm);
-				}
-				
-				return rm.GetObject (resourceKey, culture);
-			} catch (MissingManifestResourceException) {
-				throw;
-			} catch (Exception ex) {
-				throw new HttpException ("Failed to retrieve the specified global resource object.", ex);
-			}
-		}
-		
 		public static object GetGlobalResourceObject (string classKey, string resourceKey)
 		{
 			return GetGlobalResourceObject (classKey, resourceKey, Thread.CurrentThread.CurrentUICulture);
@@ -474,43 +456,64 @@ namespace System.Web {
 		{
 			if (resource_providers == null)
 				resource_providers = new Dictionary <string, IResourceProvider> ();
-			
+
 			if (provider_factory != null)
 				return true;
-
+			
 			GlobalizationSection gs = WebConfigurationManager.GetSection ("system.web/globalization") as GlobalizationSection;
 
 			if (gs == null)
 				return false;
 
 			String rsfTypeName = gs.ResourceProviderFactoryType;
-			if (String.IsNullOrEmpty (rsfTypeName))
-				return false;
+			bool usingDefault = false;
+			if (String.IsNullOrEmpty (rsfTypeName)) {
+				usingDefault = true;
+				rsfTypeName = typeof (DefaultResourceProviderFactory).AssemblyQualifiedName;
+			}
 			
 			Type rsfType = HttpApplication.LoadType (rsfTypeName, true);
 			ResourceProviderFactory rpf = Activator.CreateInstance (rsfType) as ResourceProviderFactory;
 			
-			if (rpf == null)
+			if (rpf == null && usingDefault)
 				return false;
 
 			provider_factory = rpf;
+			if (usingDefault)
+				default_provider_factory = rpf as DefaultResourceProviderFactory;
+			
 			return true;
 		}
 		
-		internal static IResourceProvider GetResourceProvider (string key, bool isLocal)
+		internal static IResourceProvider GetResourceProvider (string virtualPath, bool isLocal)
 		{
 			if (!EnsureProviderFactory ())
 				return null;
 
+			// TODO: check if it makes sense to cache the providers and, if yes, maybe
+			// we should expire the entries (or just store them in InternalCache?)
 			IResourceProvider rp = null;
-			if (!resource_providers.TryGetValue (key, out rp)) {
-				if (isLocal)
-					rp = provider_factory.CreateLocalResourceProvider (key);
-				else
-					rp = provider_factory.CreateGlobalResourceProvider (key);
-				if (rp == null)
-					return null;
-				resource_providers.Add (key, rp);
+			if (!resource_providers.TryGetValue (virtualPath, out rp)) {
+				if (isLocal) {
+					HttpContext ctx = HttpContext.Current;
+					HttpRequest req = ctx != null ? ctx.Request : null;
+					rp = provider_factory.CreateLocalResourceProvider (virtualPath);
+				} else
+					rp = provider_factory.CreateGlobalResourceProvider (virtualPath);
+				
+				if (rp == null) {
+					if (isLocal) {
+						HttpContext ctx = HttpContext.Current;
+						HttpRequest req = ctx != null ? ctx.Request : null;
+						rp = DefaultProviderFactory.CreateLocalResourceProvider (virtualPath);
+					} else
+						rp = DefaultProviderFactory.CreateGlobalResourceProvider (virtualPath);
+
+					if (rp == null)
+						return null;
+				}
+				
+				resource_providers.Add (virtualPath, rp);
 			}
 
 			return rp;
@@ -528,14 +531,7 @@ namespace System.Web {
 		
 		public static object GetGlobalResourceObject (string classKey, string resourceKey, CultureInfo culture)
 		{
-			object ret = GetGlobalObjectFromFactory (classKey, resourceKey, culture);
-			if (ret != null)
-				return ret;
-			
-			if (AppGlobalResourcesAssembly == null)
-				return null;
-
-			return GetResourceObject ("Resources." + classKey, resourceKey, culture, AppGlobalResourcesAssembly);
+			return GetGlobalObjectFromFactory ("Resources." + classKey, resourceKey, culture);
 		}
 
 		public static object GetLocalResourceObject (string virtualPath, string resourceKey)
@@ -557,52 +553,13 @@ namespace System.Web {
 			if (!VirtualPathUtility.IsAbsolute (virtualPath))
 				throw new ArgumentException ("The specified virtualPath was not rooted.");
 
-			object ret = GetLocalObjectFromFactory (virtualPath, resourceKey, culture);
-			if (ret != null)
-				return ret;
-			
-			string path = VirtualPathUtility.GetDirectory (virtualPath);
-			Assembly asm = AppResourcesCompiler.GetCachedLocalResourcesAssembly (path);
-			if (asm == null) {
-				AppResourcesCompiler ac = new AppResourcesCompiler (path);
-				asm = ac.Compile ();
-				if (asm == null)
-					throw new MissingManifestResourceException ("A resource object was not found at the specified virtualPath.");
-			}
-			
-			path = Path.GetFileName (virtualPath);
-			return GetResourceObject (path, resourceKey, culture, asm);
+			return GetLocalObjectFromFactory (virtualPath, resourceKey, culture);
 		}
 
 		public object GetSection (string name)
 		{
 			return WebConfigurationManager.GetSection (name);
 		}
-
-		sealed class ResourceManagerCacheKey
-		{
-			readonly string _name;
-			readonly Assembly _asm;
-
-			public ResourceManagerCacheKey (string name, Assembly asm)
-			{
-				_name = name;
-				_asm = asm;
-			}
-
-			public override bool Equals (object obj)
-			{
-				if (!(obj is ResourceManagerCacheKey))
-					return false;
-				ResourceManagerCacheKey key = (ResourceManagerCacheKey) obj;
-				return key._asm == _asm && _name.Equals (key._name, StringComparison.Ordinal);
-			}
-
-			public override int GetHashCode ()
-			{
-				return _name.GetHashCode () + _asm.GetHashCode ();
-			}
-		}
 #endif
 		object IServiceProvider.GetService (Type service)
 		{
@@ -649,6 +606,15 @@ namespace System.Web {
 			return null;
 		}
 
+#if NET_2_0
+		public void RemapHandler (IHttpHandler handler)
+		{
+			if (MapRequestHandlerDone)
+				throw new InvalidOperationException ("The RemapHandler method was called after the MapRequestHandler event occurred.");
+			Handler = handler;
+		}
+#endif
+		
 		public void RewritePath (string path)
 		{
 #if NET_2_0
@@ -672,7 +638,7 @@ namespace System.Web {
 		{
 			int qmark = path.IndexOf ('?');
 			if (qmark != -1)
-				RewritePath (path.Substring (0, qmark), "", path.Substring (qmark + 1), rebaseClientPath);
+				RewritePath (path.Substring (0, qmark), String.Empty, path.Substring (qmark + 1), rebaseClientPath);
 			else
 				RewritePath (path, null, null, rebaseClientPath);
 		}
@@ -691,34 +657,33 @@ namespace System.Web {
 
 			bool pathRelative = VirtualPathUtility.IsAppRelative (filePath);
 			bool pathAbsolute = pathRelative ? false : VirtualPathUtility.IsAbsolute (filePath);
+			HttpRequest req = Request;
+			if (req == null)
+				return;
+			
 			if (pathRelative || pathAbsolute) {
-				bool needSubstring = false;
-
-				if (pathRelative && filePath.Length > 1)
-					needSubstring = true;
-
-				string bvd = Request.BaseVirtualDir;
-				if (bvd.Length > 1)
-					bvd += "/";
-
-				string canonizedFilePath = VirtualPathUtility.Canonize (filePath);
-				filePath = VirtualPathUtility.Combine (bvd, needSubstring ? canonizedFilePath.Substring (2) : canonizedFilePath);
-			} else 
-				filePath = VirtualPathUtility.Combine (VirtualPathUtility.GetDirectory (Request.FilePath), filePath);
+				if (pathRelative)
+					filePath = VirtualPathUtility.ToAbsolute (filePath);
+				else
+					filePath = filePath;
+			} else
+				filePath = VirtualPathUtility.AppendTrailingSlash (req.BaseVirtualDir) + filePath;
 			
 			if (!StrUtils.StartsWith (filePath, HttpRuntime.AppDomainAppVirtualPath))
 				throw new HttpException (404, "The virtual path '" + HttpUtility.HtmlEncode (filePath) + "' maps to another application.", filePath);
-			
-			Request.SetCurrentExePath (filePath);
+
+			req.SetCurrentExePath (filePath);
+			req.SetFilePath (filePath);
+
 			if (setClientFilePath)
-				Request.SetFilePath (filePath);
+				req.ClientFilePath = filePath;
 			
 			// A null pathInfo or queryString is ignored and previous values remain untouched
 			if (pathInfo != null)
-				Request.SetPathInfo (pathInfo);
+				req.SetPathInfo (pathInfo);
 
 			if (queryString != null)
-				Request.QueryStringRaw = queryString;
+				req.QueryStringRaw = queryString;
 		}
 
 #region internals
diff --git a/mcs/class/System.Web/System.Web/HttpCookie.cs b/mcs/class/System.Web/System.Web/HttpCookie.cs
index b59574d..278b10f 100644
--- a/mcs/class/System.Web/System.Web/HttpCookie.cs
+++ b/mcs/class/System.Web/System.Web/HttpCookie.cs
@@ -78,9 +78,9 @@ namespace System.Web {
 			Value = value;
 		}
 
-		internal BaseResponseHeader GetCookieHeader ()
+		internal string GetCookieHeaderValue ()
 		{
-			StringBuilder builder = new StringBuilder ("");
+			StringBuilder builder = new StringBuilder ();
 
 			builder.Append (name);
 			builder.Append ("=");
@@ -109,7 +109,7 @@ namespace System.Web {
 				builder.Append ("; HttpOnly");
 			}
 
-			return new UnknownResponseHeader ("Set-Cookie", builder.ToString());
+			return builder.ToString ();
 		}
 
 		public string Domain {
@@ -226,6 +226,7 @@ namespace System.Web {
 		 * to get the desired behavior for
 		 * HttpCookie.Values
 		 */
+		[Serializable]
 		class CookieNVC : NameValueCollection
 		{
 #if NET_2_0
diff --git a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs b/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
index 6792001..9ec484c 100644
--- a/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
+++ b/mcs/class/System.Web/System.Web/HttpCookieCollection.cs
@@ -92,9 +92,6 @@ namespace System.Web {
 
 		public void Add (HttpCookie cookie)
 		{
-			if (BaseGet (cookie.Name) != null)
-				return;
-
 			BaseAdd (cookie.Name, cookie);
 		}
 
diff --git a/mcs/class/System.Web/System.Web/HttpException.cs b/mcs/class/System.Web/System.Web/HttpException.cs
index c6e8fc1..07ab454 100644
--- a/mcs/class/System.Web/System.Web/HttpException.cs
+++ b/mcs/class/System.Web/System.Web/HttpException.cs
@@ -94,7 +94,9 @@ namespace System.Web
 		HttpException (SerializationInfo info, StreamingContext context)
 			: base (info, context)
 		{
+#if NET_2_0
 			http_code = info.GetInt32 ("_httpCode");
+#endif
 		}
 
 #if NET_2_0
@@ -217,7 +219,8 @@ table.sampleCode {{width: 100%; background-color: #ffffcc; }}
 		{
 			if (showTrace) {
 				builder.Append ("<hr style=\"color: silver\"/>");
-				builder.AppendFormat ("<strong>Version information: </strong> Mono Version: {0}; ASP.NET Version: {0}</body></html>\r\n", Environment.Version);
+				builder.AppendFormat ("<strong>Version information: </strong> Runtime: <tt>{0}</tt>; ASP.NET Version: <tt>{1}</tt></body></html>\r\n",
+						      HttpRuntime.MonoVersion, Environment.Version);
 			
 				string trace, message;
 				bool haveTrace;
diff --git a/mcs/class/System.Web/System.Web/HttpRequest.cs b/mcs/class/System.Web/System.Web/HttpRequest.cs
index 1c4cbbc..00c00e4 100644
--- a/mcs/class/System.Web/System.Web/HttpRequest.cs
+++ b/mcs/class/System.Web/System.Web/HttpRequest.cs
@@ -5,6 +5,7 @@
 // Author:
 //	Miguel de Icaza (miguel at novell.com)
 //	Gonzalo Paniagua Javier (gonzalo at novell.com)
+//      Marek Habersack <mhabersack at novell.com>
 //
 
 //
@@ -62,7 +63,7 @@ namespace System.Web {
 		// On-demand computed values
 		//
 		HttpBrowserCapabilities browser_capabilities;
-		string file_path, base_virtual_dir, root_virtual_dir;
+		string file_path, base_virtual_dir, root_virtual_dir, client_file_path;
 		string content_type;
 		int content_length = -1;
 		Encoding encoding;
@@ -449,7 +450,30 @@ namespace System.Web {
 				return file_path;
 			}
 		}
+		
+		internal string ClientFilePath {
+			get {
+				if (client_file_path == null) {
+					if (worker_request == null)
+						return "/";
+#if NET_2_0
+					return UrlUtils.Canonic (ApplyUrlMapping (worker_request.GetFilePath ()));
+#else
+					return UrlUtils.Canonic (worker_request.GetFilePath ());
+#endif
+				}
+				
+				return client_file_path;
+			}
 
+			set {
+				if (value == null || value.Length == 0)
+					client_file_path = null;
+				else
+					client_file_path = value;
+			}
+		}
+		
 		internal string BaseVirtualDir {
 			get {
 				if (base_virtual_dir == null){
@@ -623,7 +647,7 @@ namespace System.Web {
 			if (starts_with)
 				return StrUtils.StartsWith (ContentType, ct, true);
 
-			return String.Compare (ContentType, ct, true, CultureInfo.InvariantCulture) == 0;
+			return String.Compare (ContentType, ct, true, Helpers.InvariantCulture) == 0;
 		}
 		
 		public NameValueCollection Form {
diff --git a/mcs/class/System.Web/System.Web/HttpResponse.cs b/mcs/class/System.Web/System.Web/HttpResponse.cs
index 5d36e9d..5a94918 100644
--- a/mcs/class/System.Web/System.Web/HttpResponse.cs
+++ b/mcs/class/System.Web/System.Web/HttpResponse.cs
@@ -68,8 +68,7 @@ namespace System.Web {
 		CachedRawResponse cached_response;
 		string user_cache_control = "private";
 		string redirect_location;
-		
-		UnknownResponseHeader version_header;
+		string version_header;
 		bool version_header_checked;
 		
 		//
@@ -82,9 +81,10 @@ namespace System.Web {
 		// The list of the headers that we will send back to the client, except
 		// the headers that we compute here.
 		//
-		ArrayList headers = new ArrayList ();
+
+		NameValueCollection headers;
 		bool headers_sent;
-		ArrayList cached_headers;
+		NameValueCollection cached_headers;
 
 		//
 		// Transfer encoding state
@@ -133,7 +133,7 @@ namespace System.Web {
 			return prev;
 		}
 
-		internal UnknownResponseHeader VersionHeader {
+		internal string VersionHeader {
 			get {
 				if (!version_header_checked && version_header == null) {
 					version_header_checked = true;
@@ -142,10 +142,8 @@ namespace System.Web {
 #else
 					HttpRuntimeConfig config = HttpContext.GetAppConfig ("system.web/httpRuntime") as HttpRuntimeConfig;
 #endif
-					if (config != null && config.EnableVersionHeader) {
-						string version = Environment.Version.ToString (3);
-						version_header = new UnknownResponseHeader ("X-AspNet-Version", version);
-					}
+					if (config != null && config.EnableVersionHeader)
+						version_header = Environment.Version.ToString (3);
 				}
 
 				return version_header;
@@ -315,7 +313,21 @@ namespace System.Web {
 				headerEncoding = value;
 			}
 		}
+
+		public
+#else
+		internal
 #endif
+		NameValueCollection Headers {
+			get {
+				if (headers == null)
+					headers = new NameValueCollection ();
+
+				return headers;
+			}
+		}
+
+		
 		public bool IsClientConnected {
 			get {
 				if (WorkerRequest == null)
@@ -380,6 +392,21 @@ namespace System.Web {
 			}
 		}
 
+#if NET_2_0
+		// We ignore the two properties on Mono as they are for use with IIS7, but there is
+		// no point in throwing PlatformNotSupportedException. We might find a use for them
+		// some day.
+		public int SubStatusCode {
+			get;
+			set;
+		}
+
+		public bool TrySkipIisCustomErrors {
+			get;
+			set;
+		}
+#endif
+		
 		public int StatusCode {
 			get {
 				return status_code;
@@ -488,32 +515,32 @@ namespace System.Web {
 				throw new HttpException ("headers have been already sent");
 			
 #if !TARGET_J2EE
-			if (String.Compare (name, "content-length", true, CultureInfo.InvariantCulture) == 0){
+			if (String.Compare (name, "content-length", true, Helpers.InvariantCulture) == 0){
 				content_length = (long) UInt64.Parse (value);
 				use_chunked = false;
 				return;
 			}
 #endif
 
-			if (String.Compare (name, "content-type", true, CultureInfo.InvariantCulture) == 0){
+			if (String.Compare (name, "content-type", true, Helpers.InvariantCulture) == 0){
 				ContentType = value;
 				return;
 			}
 
 #if !TARGET_J2EE
-			if (String.Compare (name, "transfer-encoding", true, CultureInfo.InvariantCulture) == 0){
+			if (String.Compare (name, "transfer-encoding", true, Helpers.InvariantCulture) == 0){
 				transfer_encoding = value;
 				use_chunked = false;
 				return;
 			}
 #endif
 
-			if (String.Compare (name, "cache-control", true, CultureInfo.InvariantCulture) == 0){
+			if (String.Compare (name, "cache-control", true, Helpers.InvariantCulture) == 0){
 				user_cache_control = value;
 				return;
 			}
 
-			headers.Add (new UnknownResponseHeader (name, value));
+			Headers.Add (name, value);
 		}
 
 		[AspNetHostingPermission (SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Medium)]
@@ -528,7 +555,7 @@ namespace System.Web {
 			if (virtualPath == null)
 				return null;
 		
-			if (virtualPath == "")
+			if (virtualPath.Length == 0)
 				return context.Request.RootVirtualDir;
 
 			if (UrlUtils.IsRelativeUrl (virtualPath)) {
@@ -587,7 +614,6 @@ namespace System.Web {
 			content_length = -1;
 			content_type = "text/html";
 			transfer_encoding = null;
-			user_cache_control = null;
 			user_cache_control = "private";
 			if (cache_policy != null)
 				cache_policy.Cacheability = HttpCacheability.Private;
@@ -611,6 +637,13 @@ namespace System.Web {
 			closed = true;
 		}
 
+#if NET_2_0
+		public void DisableKernelCache ()
+		{
+			// does nothing in Mono
+		}
+#endif
+		
 		public void End ()
 		{
 			if (context == null)
@@ -633,31 +666,31 @@ namespace System.Web {
 		//   Transfer-Encoding (chunked)
 		//   Cache-Control
 		//   X-AspNet-Version
-		void AddHeadersNoCache (ArrayList write_headers, bool final_flush)
+		void AddHeadersNoCache (NameValueCollection write_headers, bool final_flush)
 		{
 #if !TARGET_J2EE
 			//
 			// Transfer-Encoding
 			//
 			if (use_chunked)
-				write_headers.Add (new UnknownResponseHeader ("Transfer-Encoding", "chunked"));
+				write_headers.Add ("Transfer-Encoding", "chunked");
 			else if (transfer_encoding != null)
-				write_headers.Add (new UnknownResponseHeader ("Transfer-Encoding", transfer_encoding));
+				write_headers.Add ("Transfer-Encoding", transfer_encoding);
 #endif
 			if (redirect_location != null)
-				write_headers.Add (new UnknownResponseHeader ("Location", redirect_location));
+				write_headers.Add ("Location", redirect_location);
 			
 #if !TARGET_J2EE
-			UnknownResponseHeader vh = VersionHeader;
+			string vh = VersionHeader;
 			if (vh != null)
-				write_headers.Add (version_header);
+				write_headers.Add ("X-AspNet-Version", vh);
 
 			//
 			// If Content-Length is set.
 			//
 			if (content_length >= 0) {
-				write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderContentLength,
-								      content_length.ToString (CultureInfo.InvariantCulture)));
+				write_headers.Add (HttpWorkerRequest.GetKnownResponseHeaderName (HttpWorkerRequest.HeaderContentLength),
+						   content_length.ToString (Helpers.InvariantCulture));
 			} else if (BufferOutput) {
 				if (final_flush) {					
 					//
@@ -665,15 +698,15 @@ namespace System.Web {
 					// we know the content-length.
 					//
 					content_length = output_stream.total;
-					write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderContentLength,
-									      content_length.ToString (CultureInfo.InvariantCulture)));
+					write_headers.Add (HttpWorkerRequest.GetKnownResponseHeaderName (HttpWorkerRequest.HeaderContentLength),
+							   content_length.ToString (Helpers.InvariantCulture));
 				} else {
 					//
 					// We are buffering, and this is a flush in the middle.
 					// If we are not chunked, we need to set "Connection: close".
 					//
 					if (use_chunked){
-						write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderConnection, "close"));
+						write_headers.Add (HttpWorkerRequest.GetKnownResponseHeaderName (HttpWorkerRequest.HeaderConnection), "close");
 					}
 				}
 			} else {
@@ -682,7 +715,7 @@ namespace System.Web {
 				// close at the end.
 				//
 				if (use_chunked){
-					write_headers.Add (new KnownResponseHeader (HttpWorkerRequest.HeaderConnection, "close"));
+					write_headers.Add (HttpWorkerRequest.GetKnownResponseHeaderName (HttpWorkerRequest.HeaderConnection), "close");
 				}
 			}
 #endif
@@ -693,7 +726,7 @@ namespace System.Web {
 			if (cache_policy != null)
 				cache_policy.SetHeaders (this, headers);
 			else
-				write_headers.Add (new UnknownResponseHeader ("Cache-Control", CacheControl));
+				write_headers.Add ("Cache-Control", CacheControl);
 			
 			//
 			// Content-Type
@@ -709,13 +742,13 @@ namespace System.Web {
 					}
 				}
 				
-				write_headers.Add (new UnknownResponseHeader ("Content-Type", header));
+				write_headers.Add ("Content-Type", header);
 			}
 
 			if (cookies != null && cookies.Count != 0){
 				int n = cookies.Count;
 				for (int i = 0; i < n; i++)
-					write_headers.Add (cookies.Get (i).GetCookieHeader ());
+					write_headers.Add ("Set-Cookie", cookies.Get (i).GetCookieHeaderValue ());
 #if TARGET_J2EE
 				// For J2EE Portal support emulate cookies by storing them in the session.
 				context.Request.SetSessionCookiesForPortal (cookies);
@@ -744,18 +777,35 @@ namespace System.Web {
 
 			// If this page is cached use the cached headers
 			// instead of the standard headers	
-			ArrayList write_headers = headers;
+			NameValueCollection write_headers;
 			if (cached_headers != null)
 				write_headers = cached_headers;
-			else
+			else {
+				write_headers = Headers;
 				AddHeadersNoCache (write_headers, final_flush);
-
+			}
+			
 			if (WorkerRequest != null)
 				WorkerRequest.SendStatus (status_code, StatusDescription);
 
 			if (WorkerRequest != null) {
-				foreach (BaseResponseHeader header in write_headers){
-					header.SendContent (WorkerRequest);
+				string header_name;
+				string[] values;
+				int header_index;
+				
+				for (int i = 0; i < write_headers.Count; i++) {
+					header_name = write_headers.GetKey (i);
+					header_index = HttpWorkerRequest.GetKnownResponseHeaderIndex (header_name);
+					values = write_headers.GetValues (i);
+					if (values == null)
+						continue;
+					
+					foreach (string val in values) {
+						if (header_index > -1)
+							WorkerRequest.SendKnownResponseHeader (header_index, val);
+						else
+							WorkerRequest.SendUnknownResponseHeader (header_name, val);
+					}
 				}
 			}
 		}
@@ -793,11 +843,8 @@ namespace System.Web {
 					app_instance.TriggerPreSendRequestContent ();
 			}
 
-			if (IsCached) {
-				MemoryStream ms = output_stream.GetData ();
-				cached_response.ContentLength = (int) ms.Length;
-				cached_response.SetData (ms.GetBuffer ());
-			}
+			if (IsCached)
+				cached_response.SetData (output_stream.GetData ());
 
 			if (WorkerRequest != null)
 				output_stream.Flush (WorkerRequest, final_flush);
@@ -820,9 +867,14 @@ namespace System.Web {
 
 		public void Redirect (string url, bool endResponse)
 		{
+			if (url == null)
+				throw new ArgumentNullException ("url");
+			
 			if (headers_sent)
 				throw new HttpException ("Headers have already been sent");
 
+			if (url.IndexOf ('\n') != -1)
+				throw new ArgumentException ("Redirect URI cannot contain newline characters.", "url");
 #if NET_2_0
 			is_request_being_redirected = true;
 #endif
@@ -831,6 +883,29 @@ namespace System.Web {
 			
 			StatusCode = 302;
 			url = ApplyAppPathModifier (url);
+#if NET_2_0
+			bool isFullyQualified;
+			if (StrUtils.StartsWith (url, "http:", true) ||
+			    StrUtils.StartsWith (url, "https:", true) ||
+			    StrUtils.StartsWith (url, "file:", true) ||
+			    StrUtils.StartsWith (url, "ftp:", true))
+				isFullyQualified = true;
+			else
+				isFullyQualified = false;
+
+			if (!isFullyQualified) {
+				HttpRuntimeSection config = WebConfigurationManager.GetWebApplicationSection ("system.web/httpRuntime") as HttpRuntimeSection;
+				if (config != null && config.UseFullyQualifiedRedirectUrl) {
+					var ub = new UriBuilder (context.Request.Url);
+					ub.Path = url;
+					ub.Fragment = null;
+					ub.Password = null;
+					ub.Query = null;
+					ub.UserName = null;
+					url = ub.Uri.ToString ();
+				}
+			}
+#endif
 			redirect_location = url;
 
 			// Text for browsers that can't handle location header
@@ -975,10 +1050,32 @@ namespace System.Web {
 			Flush ();
 		}
 #if NET_2_0
-		[MonoTODO ("Not implemented")]
 		public void WriteSubstitution (HttpResponseSubstitutionCallback callback)
 		{
-			throw new NotImplementedException ();
+			// Emulation of .NET behavior
+			if (callback == null)
+				throw new NullReferenceException ();
+
+			object target = callback.Target;
+			if (target != null && target.GetType () == typeof (Control))
+				throw new ArgumentException ("callback");
+
+			string s = callback (context);
+			if (!IsCached) {
+				Write (s);
+				return;
+			}
+
+			Cache.Cacheability = HttpCacheability.Server;
+			Flush ();
+			if (WorkerRequest == null)
+				Write (s); // better this than nothing
+			else {
+				byte[] bytes = WebEncoding.ResponseEncoding.GetBytes (s);
+				WorkerRequest.SendResponseFromMemory (bytes, bytes.Length);
+			}
+			
+			cached_response.SetData (callback);
 		}
 #endif
 		//
@@ -1002,6 +1099,13 @@ namespace System.Web {
 		}
 
 #if NET_2_0
+		public void TransmitFile (string filename, long offset, long length)
+		{
+			output_stream.WriteFile (filename, offset, length);
+			output_stream.ApplyFilter (false);
+			Flush (false);
+		}
+		
 		internal void TransmitFile (VirtualFile vf)
 		{
 			TransmitFile (vf, false);
@@ -1040,9 +1144,10 @@ namespace System.Web {
 #endregion
 		
 #region Cache Support
-		internal void SetCachedHeaders (ArrayList headers)
+		internal void SetCachedHeaders (NameValueCollection headers)
 		{
 			cached_headers = headers;
+			
 		}
 
 		internal bool IsCached {
@@ -1083,13 +1188,13 @@ namespace System.Web {
 				if (value == null || value == "") {
 					Cache.SetCacheability (HttpCacheability.NoCache);
 					user_cache_control = null;
-				} else if (String.Compare (value, "public", true, CultureInfo.InvariantCulture) == 0) {
+				} else if (String.Compare (value, "public", true, Helpers.InvariantCulture) == 0) {
 					Cache.SetCacheability (HttpCacheability.Public);
 					user_cache_control = "public";
-				} else if (String.Compare (value, "private", true, CultureInfo.InvariantCulture) == 0) {
+				} else if (String.Compare (value, "private", true, Helpers.InvariantCulture) == 0) {
 					Cache.SetCacheability (HttpCacheability.Private);
 					user_cache_control = "private";
-				} else if (String.Compare (value, "no-cache", true, CultureInfo.InvariantCulture) == 0) {
+				} else if (String.Compare (value, "no-cache", true, Helpers.InvariantCulture) == 0) {
 					Cache.SetCacheability (HttpCacheability.NoCache);
 					user_cache_control = "no-cache";
 				} else
diff --git a/mcs/class/System.Web/System.Web/HttpRuntime.cs b/mcs/class/System.Web/System.Web/HttpRuntime.cs
index d1ac5d4..ee49c1d 100644
--- a/mcs/class/System.Web/System.Web/HttpRuntime.cs
+++ b/mcs/class/System.Web/System.Web/HttpRuntime.cs
@@ -62,6 +62,8 @@ namespace System.Web {
 		static bool caseInsensitive;
 		static bool runningOnWindows;
 		static bool isunc;
+		static string monoVersion;
+		
 #if TARGET_J2EE
 		static QueueManager queue_manager { get { return _runtime._queue_manager; } }
 		static TraceManager trace_manager { get { return _runtime._trace_manager; } }
@@ -143,7 +145,8 @@ namespace System.Web {
 
 			if (runningOnWindows) {
 				caseInsensitive = true;
-				isunc = new Uri (AppDomainAppPath).IsUnc;
+				if (AppDomainAppPath != null)
+					isunc = new Uri (AppDomainAppPath).IsUnc;
 			} else {
 				string mono_iomap = Environment.GetEnvironmentVariable ("MONO_IOMAP");
 				if (mono_iomap != null) {
@@ -160,6 +163,17 @@ namespace System.Web {
 					}
 				}
 			}
+
+			Type monoRuntime = Type.GetType ("Mono.Runtime", false);
+			monoVersion = null;
+			if (monoRuntime != null) {
+				MethodInfo mi = monoRuntime.GetMethod ("GetDisplayName", BindingFlags.Static | BindingFlags.NonPublic);
+				if (mi != null)
+					monoVersion = mi.Invoke (null, new object [0]) as string;
+			}
+
+			if (monoVersion == null)
+				monoVersion = Environment.Version.ToString ();
 			
 #if !TARGET_J2EE
 			firstRun = true;
@@ -731,10 +745,15 @@ namespace System.Web {
 					AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler (ResolveAssemblyHandler);
 				else
 					AppDomain.CurrentDomain.AssemblyResolve -= new ResolveEventHandler (ResolveAssemblyHandler);
+				assemblyMappingEnabled = enable;
 			}
 		}
 #endif // #if !TARGET_J2EE
 #endif
+		internal static string MonoVersion {
+			get { return monoVersion; }
+		}
+		
 		internal static bool RunningOnWindows {
 			get { return runningOnWindows; }
 		}
@@ -743,7 +762,24 @@ namespace System.Web {
 			get { return caseInsensitive; }
 		}
 
-        
+		internal static bool IsDebuggingEnabled {
+			get {
+#if NET_2_0
+				CompilationSection cs = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
+				if (cs != null)
+					return cs.Debug;
+
+				return false;
+#else
+				try {
+					return CompilationConfiguration.GetInstance (HttpContext.Current).Debug;
+				} catch {
+					return false;
+				}
+#endif
+			}
+		}
+		
 		internal static TraceManager TraceManager {
 			get {
 				return trace_manager;
diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs
index fe54758..c54070a 100644
--- a/mcs/class/System.Web/System.Web/HttpUtility.cs
+++ b/mcs/class/System.Web/System.Web/HttpUtility.cs
@@ -851,7 +851,7 @@ namespace System.Web {
 				if (c == '&') {
 					state = 1;
 					if (have_trailing_digits) {
-						entity.Append (number.ToString (CultureInfo.InvariantCulture));
+						entity.Append (number.ToString (Helpers.InvariantCulture));
 						have_trailing_digits = false;
 					}
 
@@ -891,7 +891,7 @@ namespace System.Web {
 					if (c == ';') {
 						if (number > 65535) {
 							output.Append ("&#");
-							output.Append (number.ToString (CultureInfo.InvariantCulture));
+							output.Append (number.ToString (Helpers.InvariantCulture));
 							output.Append (";");
 						} else {
 							output.Append ((char) number);
@@ -905,7 +905,7 @@ namespace System.Web {
 					} else {
 						state = 2;
 						if (have_trailing_digits) {
-							entity.Append (number.ToString (CultureInfo.InvariantCulture));
+							entity.Append (number.ToString (Helpers.InvariantCulture));
 							have_trailing_digits = false;
 						}
 						entity.Append (c);
@@ -916,7 +916,7 @@ namespace System.Web {
 			if (entity.Length > 0) {
 				output.Append (entity.ToString ());
 			} else if (have_trailing_digits) {
-				output.Append (number.ToString (CultureInfo.InvariantCulture));
+				output.Append (number.ToString (Helpers.InvariantCulture));
 			}
 			return output.ToString ();
 		}
@@ -981,7 +981,7 @@ namespace System.Web {
 					if (s [i] > 159) {
 #endif
 						output.Append ("&#");
-						output.Append (((int) s [i]).ToString (CultureInfo.InvariantCulture));
+						output.Append (((int) s [i]).ToString (Helpers.InvariantCulture));
 						output.Append (";");
 					} else {
 						output.Append (s [i]);
diff --git a/mcs/class/System.Web/System.Web/ParserError.cs b/mcs/class/System.Web/System.Web/ParserError.cs
index 21c8fb0..ea0d237 100644
--- a/mcs/class/System.Web/System.Web/ParserError.cs
+++ b/mcs/class/System.Web/System.Web/ParserError.cs
@@ -54,14 +54,17 @@ namespace System.Web {
 
 		public string ErrorText {
 			get { return _errorText; }
+			set { _errorText = value; }
 		}
 		
 		public string VirtualPath {
 			get { return _virtualPath; }
+			set { _virtualPath = value; }
 		}
 
 		public int Line {
 			get { return _line; }
+			set { _line = value; }
 		}
 	}
 }
diff --git a/mcs/class/System.Web/System.Web/ParserErrorCollection.cs b/mcs/class/System.Web/System.Web/ParserErrorCollection.cs
index e7a6bd7..6be1953 100644
--- a/mcs/class/System.Web/System.Web/ParserErrorCollection.cs
+++ b/mcs/class/System.Web/System.Web/ParserErrorCollection.cs
@@ -50,6 +50,7 @@ namespace System.Web {
 		public ParserError this [int index]
 		{
 			get { return (ParserError) InnerList [index]; }
+			set { InnerList[index] = value; }
 		}
 		
 		public int Add (ParserError error)
diff --git a/mcs/class/System.Web/System.Web/ServerVariablesCollection.cs b/mcs/class/System.Web/System.Web/ServerVariablesCollection.cs
index 84fb121..1bfd69a 100644
--- a/mcs/class/System.Web/System.Web/ServerVariablesCollection.cs
+++ b/mcs/class/System.Web/System.Web/ServerVariablesCollection.cs
@@ -35,6 +35,7 @@ using System.Collections.Specialized;
 using System.Runtime.Serialization;
 using System.Globalization;
 using System.Security.Permissions;
+using System.Web.Util;
 
 namespace System.Web
 {
@@ -59,7 +60,7 @@ namespace System.Web
 			//
 			if (standard){
 				sb.Append ("HTTP_");
-				sb.Append (key.ToUpper (CultureInfo.InvariantCulture).Replace ('-', '_'));
+				sb.Append (key.ToUpper (Helpers.InvariantCulture).Replace ('-', '_'));
 				sb.Append (":");
 			} else {
 				sb.Append (key);
@@ -103,7 +104,7 @@ namespace System.Web
 				if (null != hvalue && hvalue.Length > 0) {
 					hname = HttpWorkerRequest.GetKnownRequestHeaderName (i);
 					if (null != hname && hname.Length > 0)
-						Add ("HTTP_" + hname.ToUpper (CultureInfo.InvariantCulture).Replace ('-', '_'), hvalue);
+						Add ("HTTP_" + hname.ToUpper (Helpers.InvariantCulture).Replace ('-', '_'), hvalue);
 				}
 			}
 
@@ -115,7 +116,7 @@ namespace System.Web
 					if (hname == null)
 						continue;
 					hvalue = unknown [i][1];
-					Add ("HTTP_" + hname.ToUpper (CultureInfo.InvariantCulture).Replace ('-', '_'), hvalue);
+					Add ("HTTP_" + hname.ToUpper (Helpers.InvariantCulture).Replace ('-', '_'), hvalue);
 				}
 			}
 		}
@@ -202,7 +203,7 @@ namespace System.Web
 		{
 			if ((name == null) || (this._request == null))
 				return null;
-			name = name.ToUpper (CultureInfo.InvariantCulture);
+			name = name.ToUpper (Helpers.InvariantCulture);
 			switch (name) {
 				case "AUTH_TYPE":
 					if (null != _request.Context.User && _request.Context.User.Identity.IsAuthenticated)
diff --git a/mcs/class/System.Web/System.Web/SiteMap.cs b/mcs/class/System.Web/System.Web/SiteMap.cs
index 6d3b810..7d852dc 100644
--- a/mcs/class/System.Web/System.Web/SiteMap.cs
+++ b/mcs/class/System.Web/System.Web/SiteMap.cs
@@ -49,6 +49,7 @@ namespace System.Web {
 						throw new InvalidOperationException ("This feature is currently disabled.  Please enable it in the system.web/siteMap section in the web.config file.");
 
 					providers = section.ProvidersInternal;
+					providers.SetReadOnly ();
 					provider = providers[section.DefaultProvider];
 
 					if (provider == null)
diff --git a/mcs/class/System.Web/System.Web/SiteMapProvider.cs b/mcs/class/System.Web/System.Web/SiteMapProvider.cs
index b0b41df..47d1c5d 100644
--- a/mcs/class/System.Web/System.Web/SiteMapProvider.cs
+++ b/mcs/class/System.Web/System.Web/SiteMapProvider.cs
@@ -74,10 +74,14 @@ namespace System.Web {
 		{
 			if (context == null)
 				return null;
+
+			HttpRequest req = context.Request;
+			if (req == null)
+				return null;
 			
-			SiteMapNode ret = this.FindSiteMapNode (context.Request.RawUrl);
+			SiteMapNode ret = this.FindSiteMapNode (req.RawUrl);
 			if (ret == null)
-				ret = this.FindSiteMapNode (context.Request.Path);
+				ret = this.FindSiteMapNode (req.Path);
 			return ret;
 		}
 
diff --git a/mcs/class/System.Web/System.Web/StaticFileHandler.cs b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
index d1feb09..c1f9665 100644
--- a/mcs/class/System.Web/System.Web/StaticFileHandler.cs
+++ b/mcs/class/System.Web/System.Web/StaticFileHandler.cs
@@ -67,7 +67,7 @@ namespace System.Web
 					throw new HttpException (404, "Path '" + vpath + "' was not found.", vpath);
 
 				response.ContentType = MimeTypes.GetMimeType (vpath);
-				response.TransmitFile (vf);
+				response.TransmitFile (vf, true);
 				return;
 			}
 #endif
diff --git a/mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs b/mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs
index c2e763f..705fecc 100644
--- a/mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs
+++ b/mcs/class/System.Web/System.Web/StaticSiteMapProvider.cs
@@ -33,6 +33,7 @@
 
 #if NET_2_0
 using System.Collections.Generic;
+using System.Web.Util;
 
 namespace System.Web
 {
@@ -69,7 +70,7 @@ namespace System.Web
 							"StaticSiteMapProvider requires that sitemap nodes have unique URLs.",
 							node.Url
 						));
-				
+
 					urlToNode.Add (url, node);
 				}
 				keyToNode.Add (node.Key, node);
@@ -110,7 +111,12 @@ namespace System.Web
 			
 			BuildSiteMap();
 			SiteMapNode node;
-			urlToNode.TryGetValue (MapUrl (rawUrl), out node);
+			if (VirtualPathUtility.IsAppRelative (rawUrl))
+				rawUrl = VirtualPathUtility.ToAbsolute (rawUrl, HttpRuntime.AppDomainAppVirtualPath, false);
+			
+			if (!urlToNode.TryGetValue (rawUrl, out node))
+				return null;
+			
 			return CheckAccessibility (node);
 		}
 
@@ -202,12 +208,19 @@ namespace System.Web
 			return (node != null && IsAccessibleToUser (HttpContext.Current, node)) ? node : null;
 		}
 
-		string MapUrl (string url)
+		internal string MapUrl (string url)
 		{
+			if (String.IsNullOrEmpty (url))
+				return url;
+
+			string appVPath = HttpRuntime.AppDomainAppVirtualPath;
+			if (String.IsNullOrEmpty (appVPath))
+				appVPath = "/";
+			
 			if (VirtualPathUtility.IsAppRelative (url))
-				return VirtualPathUtility.ToAbsolute (url);
+				return VirtualPathUtility.ToAbsolute (url, appVPath, true);
 			else
-				return url;
+				return VirtualPathUtility.ToAbsolute (UrlUtils.Combine (appVPath, url), appVPath, true);
 		}
 	}
 }
diff --git a/mcs/class/System.Web/System.Web/TraceData.cs b/mcs/class/System.Web/System.Web/TraceData.cs
index c9e2489..1807fb0 100644
--- a/mcs/class/System.Web/System.Web/TraceData.cs
+++ b/mcs/class/System.Web/System.Web/TraceData.cs
@@ -31,6 +31,7 @@
 
 using System;
 using System.Collections;
+using System.Globalization;
 using System.IO;
 using System.Text;
 using System.Web.UI;
@@ -354,7 +355,7 @@ namespace System.Web {
 
 			if (TraceMode == TraceMode.SortByCategory) {
 				List<InfoTraceData> list = new List<InfoTraceData> (info);
-				list.Sort (delegate (InfoTraceData x, InfoTraceData y) { return String.Compare (x.Category, y.Category); });
+				list.Sort (delegate (InfoTraceData x, InfoTraceData y) { return String.Compare (x.Category, y.Category, StringComparison.Ordinal); });
 				enumerable = list;
 			}
 
diff --git a/mcs/class/System.Web/System.Web/VirtualPathUtility.cs b/mcs/class/System.Web/System.Web/VirtualPathUtility.cs
index ea166c0..b7dd5ba 100644
--- a/mcs/class/System.Web/System.Web/VirtualPathUtility.cs
+++ b/mcs/class/System.Web/System.Web/VirtualPathUtility.cs
@@ -78,13 +78,13 @@ namespace System.Web {
 			if (IsRooted (relativePath))
 				return Normalize (relativePath);
 
-			if (basePath [basePath.Length - 1] != '/') {
-				if (basePath.Length > 1) {
+			int basePathLen = basePath.Length;
+			if (basePath [basePathLen - 1] != '/') {
+				if (basePathLen > 1) {
 					int lastSlash = basePath.LastIndexOf ('/');
 					if (lastSlash >= 0)
 						basePath = basePath.Substring (0, lastSlash + 1);
-				}
-				else { // "~" only
+				} else { // "~" only
 					basePath += "/";
 				}
 			}
diff --git a/mcs/class/System.Web/System.Web/WebPageTraceListener.cs b/mcs/class/System.Web/System.Web/WebPageTraceListener.cs
index 6967708..2b49504 100644
--- a/mcs/class/System.Web/System.Web/WebPageTraceListener.cs
+++ b/mcs/class/System.Web/System.Web/WebPageTraceListener.cs
@@ -34,6 +34,7 @@ using System.Globalization;
 using System.Security.Permissions;
 using System.Text;
 using System.Web;
+using System.Web.Util;
 
 namespace System.Web
 {
@@ -52,7 +53,7 @@ namespace System.Web
 
 		public override void TraceEvent (TraceEventCache eventCache, string source, TraceEventType severity, int id, string format, params object[] args)
 		{
-			TraceEvent (eventCache, source, severity, id, string.Format (CultureInfo.InvariantCulture, format, args));
+			TraceEvent (eventCache, source, severity, id, string.Format (Helpers.InvariantCulture, format, args));
 		}
 
 		public override void Write (string message)
diff --git a/mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs b/mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs
index 9c4e5be..26a8769 100644
--- a/mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs
+++ b/mcs/class/System.Web/System.Web/XmlSiteMapProvider.cs
@@ -4,9 +4,10 @@
 // Authors:
 //	Ben Maurer (bmaurer at users.sourceforge.net)
 //	Lluis Sanchez Gual (lluis at novell.com)
+//	Marek Habersack <mhabersack at novell.com>
 //
 // (C) 2003 Ben Maurer
-// (C) 2005 Novell, Inc (http://www.novell.com)
+// (C) 2005-2009 Novell, Inc (http://www.novell.com)
 //
 
 //
@@ -39,6 +40,7 @@ using System.Configuration.Provider;
 using System.Globalization;
 using System.Text;
 using System.Xml;
+using System.Web.Hosting;
 using System.Web.Util;
 using System.IO;
 
@@ -49,8 +51,7 @@ namespace System.Web
 		static readonly char [] seperators = { ';', ',' };
 		static readonly StringComparison stringComparison = HttpRuntime.RunningOnWindows ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal;
 		
-		bool building;
-		string file;
+		bool initialized;
 		string fileVirtualPath;
 		SiteMapNode root = null;
 		List <FileSystemWatcher> watchers;
@@ -77,9 +78,33 @@ namespace System.Web
 		
 		protected internal override void AddNode (SiteMapNode node, SiteMapNode parentNode)
 		{
-			base.AddNode (node, parentNode);
+			if (node == null)
+				throw new ArgumentNullException ("node");
+
+			if (parentNode == null)
+				throw new ArgumentNullException ("parentNode");
+
+			SiteMapProvider nodeProvider = node.Provider;
+			if (nodeProvider != this)
+				throw new ArgumentException ("SiteMapNode '" + node + "' cannot be found in current provider, only nodes in the same provider can be added.",
+							     "node");
+
+			SiteMapProvider parentNodeProvider = parentNode.Provider;
+			if (nodeProvider != parentNodeProvider)
+				throw new ArgumentException ("SiteMapNode '" + parentNode + "' cannot be found in current provider, only nodes in the same provider can be added.",
+							     "parentNode");
+
+			AddNodeNoCheck (node, parentNode);
 		}
 
+		void AddNodeNoCheck (SiteMapNode node, SiteMapNode parentNode)
+		{
+			base.AddNode (node, parentNode);
+			SiteMapProvider nodeProvider = node.Provider;
+			if (nodeProvider != this)
+				RegisterChildProvider (nodeProvider.Name, nodeProvider);
+		}
+		
 		protected virtual void AddProvider (string providerName, SiteMapNode parentNode)
 		{
 			if (parentNode == null)
@@ -107,65 +132,195 @@ namespace System.Web
 			ChildProviders.Add (smp);
 		}
 		
-		XmlNode FindStartingNode (string file, string virtualPath, out bool enableLocalization)
+		XmlNode FindStartingNode (string virtualPath, out bool enableLocalization)
 		{
-			if (String.Compare (Path.GetExtension (file), ".sitemap", stringComparison) != 0)
-				throw new InvalidOperationException (
-					String.Format ("The file {0} has an invalid extension, only .sitemap files are allowed in XmlSiteMapProvider.",
-						       String.IsNullOrEmpty (virtualPath) ? Path.GetFileName (file) : virtualPath));
-			if (!File.Exists (file))
-				throw new InvalidOperationException (
-					String.Format ("The file '{0}' required by XmlSiteMapProvider does not exist.",
-						       String.IsNullOrEmpty (virtualPath) ? Path.GetFileName (file) : virtualPath));
-			
-			XmlDocument d = new XmlDocument ();
-			d.Load (file);
+			XmlDocument d = GetConfigDocument (virtualPath);
+			XmlElement docElement = d.DocumentElement;
 
-			XmlNode enloc = d.DocumentElement.Attributes ["enableLocalization"];
+			if (String.Compare ("siteMap", docElement.Name, StringComparison.Ordinal) != 0)
+				throw new ConfigurationErrorsException ("Top element must be 'siteMap'");
+			
+			XmlNode enloc = docElement.Attributes ["enableLocalization"];
 			if (enloc != null && !String.IsNullOrEmpty (enloc.Value))
 				enableLocalization = (bool) Convert.ChangeType (enloc.Value, typeof (bool));
 			else
 				enableLocalization = false;
-					
-			XmlNode nod = d.DocumentElement ["siteMapNode"];
-			if (nod == null)
-				throw new HttpException ("Invalid site map file: " + Path.GetFileName (file));
 
-			return nod;
+			XmlNodeList childNodes = docElement.ChildNodes;
+			XmlNode node = null;
+			
+			foreach (XmlNode child in childNodes) {
+				if (String.Compare ("siteMapNode", child.Name, StringComparison.Ordinal) != 0)
+					// Only <siteMapNode> is allowed at the top
+					throw new ConfigurationErrorsException ("Only <siteMapNode> elements are allowed at the document top level.");
+				
+				if (node != null)
+					// Only one <siteMapNode> is allowed at the top
+					throw new ConfigurationErrorsException ("Only one <siteMapNode> element is allowed at the document top level.");
+				
+				node = child;
+			}
+			
+			if (node == null)
+				throw new ConfigurationErrorsException ("Missing <siteMapNode> element at the document top level.");
+			
+			return node;
 		}
-		
+
+		XmlDocument GetConfigDocument (string virtualPath)
+		{
+			if (String.IsNullOrEmpty (virtualPath))
+				throw new ArgumentException ("The siteMapFile attribute must be specified on the XmlSiteMapProvider");
+			
+			string file = HostingEnvironment.MapPath (virtualPath);
+			if (file == null)
+				throw new HttpException ("Virtual path '" + virtualPath + "' cannot be mapped to physical path.");
+			
+			if (String.Compare (Path.GetExtension (file), ".sitemap", stringComparison) != 0)
+				throw new InvalidOperationException (String.Format ("The file {0} has an invalid extension, only .sitemap files are allowed in XmlSiteMapProvider.",
+										    String.IsNullOrEmpty (virtualPath) ? Path.GetFileName (file) : virtualPath));
+			
+			if (!File.Exists (file))
+				throw new InvalidOperationException (String.Format ("The file '{0}' required by XmlSiteMapProvider does not exist.",
+										    String.IsNullOrEmpty (virtualPath) ? Path.GetFileName (file) : virtualPath));
+
+			ResourceKey = Path.GetFileName (file);
+			CreateWatcher (file);
+			
+			XmlDocument d = new XmlDocument ();
+			d.Load (file);
+
+			return d;
+		}
+
 		public override SiteMapNode BuildSiteMap ()
 		{
 			if (root != null)
 				return root;
+			
 			// Whenever you call AddNode, it tries to find dups, and will call this method
 			// Is this a bug in MS??
-			if (building)
-				return null;
-			
 			lock (this_lock) {
-				try {
-					building = true;
-					if (root != null)
-						return root;
-
-					bool enableLocalization;
-					XmlNode node = FindStartingNode (file, fileVirtualPath, out enableLocalization);
-					EnableLocalization = enableLocalization;
-					SiteMapNode builtRoot = BuildSiteMapRecursive (node, EnableLocalization);
-
-					if (builtRoot != root) {
-						root = builtRoot;
-						AddNode (root);
-					}
-				} finally {
-					building = false;
+				if (root != null)
+					return root;
+
+				Clear ();
+				bool enableLocalization;
+				XmlNode node = FindStartingNode (fileVirtualPath, out enableLocalization);
+				EnableLocalization = enableLocalization;
+				BuildSiteMapRecursive (node, null);
+
+				// if (builtRoot != root) {
+				// 	root = builtRoot;
+				// 	AddNode (root);
+				// }
+
+				return root;
+			}
+		}
+
+		SiteMapNode ConvertToSiteMapNode (XmlNode xmlNode)
+		{
+			bool localize = EnableLocalization;
+			string url = GetOptionalAttribute (xmlNode, "url");
+			string title = GetOptionalAttribute (xmlNode, "title");
+			string description = GetOptionalAttribute (xmlNode, "description");
+			string roles = GetOptionalAttribute (xmlNode, "roles");
+			string implicitResourceKey = GetOptionalAttribute (xmlNode, "resourceKey");
+				
+			// var keywordsList = new List <string> ();
+			// if (keywords != null && keywords.Length > 0) {
+			// 	foreach (string s in keywords.Split (seperators)) {
+			// 		string ss = s.Trim ();
+			// 		if (ss.Length > 0)
+			// 			keywordsList.Add (ss);
+			// 	}
+			// }
+				
+			var rolesList = new List <string> ();
+			if (roles != null && roles.Length > 0) {
+				foreach (string s in roles.Split (seperators)) {
+					string ss = s.Trim ();
+					if (ss.Length > 0)
+						rolesList.Add (ss);
 				}
+			}
+
+			url = base.MapUrl (url);
+
+			NameValueCollection attributes = null;
+			NameValueCollection explicitResourceKeys = null;
+			if (localize)
+				CollectLocalizationInfo (xmlNode, ref title, ref description, ref attributes, ref explicitResourceKeys);
+			else
+				foreach (XmlNode att in xmlNode.Attributes)
+					PutInCollection (att.Name, att.Value, ref attributes);
+
+			string key = Guid.NewGuid ().ToString ();
+			return new SiteMapNode (this, key, url, title, description, rolesList.AsReadOnly (),
+						attributes, explicitResourceKeys, implicitResourceKey);		
+		}
+
+		void BuildSiteMapRecursive (XmlNode xmlNode, SiteMapNode parent)
+		{
+			if (xmlNode.Name != "siteMapNode")
+				throw new ConfigurationException ("incorrect element name", xmlNode);
+			
+			string attrValue = GetNonEmptyOptionalAttribute (xmlNode, "provider");
+			if (attrValue != null) {
+				SiteMapProvider provider = SiteMap.Providers [attrValue];
+				if (provider == null)
+					throw new ProviderException ("Provider with name [" + attrValue + "] was not found.");
+
+				provider.ParentProvider = this;
+				SiteMapNode providerRoot = provider.GetRootNodeCore();
+
+				if (parent == null)
+					root = providerRoot;
+				else
+					AddNodeNoCheck (providerRoot, parent);
+				return;
+			}
+
+			attrValue = GetNonEmptyOptionalAttribute (xmlNode, "siteMapFile");
+			if (attrValue != null) {
+				var nvc = new NameValueCollection ();
+				nvc.Add ("siteMapFile", attrValue);
+
+				string description = GetOptionalAttribute (xmlNode, "description");
+				if (!String.IsNullOrEmpty (description))
+					nvc.Add ("description", description);
+
+				string name = MapUrl (attrValue);				
+				var provider = new XmlSiteMapProvider ();
+				provider.Initialize (name, nvc);
 				
-				return root;
+				SiteMapNode providerRoot = provider.GetRootNodeCore ();
+				if (parent == null)
+					root = providerRoot;
+				else
+					AddNodeNoCheck (providerRoot, parent);
+				return;
+			}
+
+			SiteMapNode curNode = ConvertToSiteMapNode (xmlNode);
+			if (parent == null)
+				root = curNode;
+			else
+				AddNodeNoCheck (curNode, parent);
+			
+			XmlNodeList childNodes = xmlNode.ChildNodes;
+			if (childNodes == null || childNodes.Count < 1)
+				return;
+			
+			foreach (XmlNode child in childNodes) {
+				if (child.NodeType != XmlNodeType.Element)
+					continue;
+
+				BuildSiteMapRecursive (child, curNode);
 			}
 		}
-		
+
 		string GetNonEmptyOptionalAttribute (XmlNode n, string name)
 		{
 			return System.Web.Configuration.HandlersUtil.ExtractAttributeValue (name, n, true);
@@ -247,90 +402,6 @@ namespace System.Web
 				PutInCollection (att.Name, value, ref attributes);
 			}
 		}
-		
-		SiteMapNode BuildSiteMapRecursive (XmlNode xmlNode, bool localize)
-		{
-			if (xmlNode.Name != "siteMapNode")
-				throw new ConfigurationException ("incorrect element name", xmlNode);
-			
-			string provider = GetNonEmptyOptionalAttribute (xmlNode, "provider");
-			string siteMapFile = GetNonEmptyOptionalAttribute (xmlNode, "siteMapFile");
-			
-			if (provider != null) {
-				SiteMapProvider smp = SiteMap.Providers [provider];
-				if (smp == null)
-					throw new ProviderException ("Provider with name [" + provider + "] was not found.");
-
-				smp.ParentProvider = this;
-				SiteMapNode root = smp.GetRootNodeCore();
-				RegisterChildProvider (provider, smp);
-				
-				return root;
-			} else if (siteMapFile != null) {
-				if (file.Length == 0)
-					throw new InvalidOperationException ("The 'siteMapFile' attribute cannot be an empty string.");
-				string realPath = HttpContext.Current.Request.MapPath (siteMapFile);
-				bool enableLocalization;
-				XmlNode node = FindStartingNode (realPath, siteMapFile, out enableLocalization);
-
-				CreateWatcher (realPath);
-				return BuildSiteMapRecursive (node, enableLocalization);
-			} else {
-				string url = GetOptionalAttribute (xmlNode, "url");
-				string title = GetOptionalAttribute (xmlNode, "title");
-				string description = GetOptionalAttribute (xmlNode, "description");
-				string keywords = GetOptionalAttribute (xmlNode, "keywords");
-				string roles = GetOptionalAttribute (xmlNode, "roles");
-				string implicitResourceKey = GetOptionalAttribute (xmlNode, "resourceKey");
-				
-				ArrayList keywordsList = new ArrayList ();
-				if (keywords != null && keywords.Length > 0) {
-					foreach (string s in keywords.Split (seperators)) {
-						string ss = s.Trim ();
-						if (ss.Length > 0)
-							keywordsList.Add (ss);
-					}
-				}
-				
-				ArrayList rolesList = new ArrayList ();
-				if (roles != null && roles.Length > 0) {
-					foreach (string s in roles.Split (seperators)) {
-						string ss = s.Trim ();
-						if (ss.Length > 0)
-							rolesList.Add (ss);
-					}
-				}
-
-				if (!string.IsNullOrEmpty (url)) {
-					if (UrlUtils.IsRelativeUrl (url))
-						url = UrlUtils.Combine (HttpRuntime.AppDomainAppVirtualPath, url);
-				}
-
-				NameValueCollection attributes = null;
-				NameValueCollection explicitResourceKeys = null;
-				if (localize)
-					CollectLocalizationInfo (xmlNode, ref title, ref description, ref attributes,
-								 ref explicitResourceKeys);
-				else
-					foreach (XmlNode att in xmlNode.Attributes)
-						PutInCollection (att.Name, att.Value, ref attributes);
-
-				string key = Guid.NewGuid ().ToString ();
-				SiteMapNode node = new SiteMapNode (this, key, url, title, description,
-								    ArrayList.ReadOnly (rolesList),
-								    attributes,
-								    explicitResourceKeys,
-								    implicitResourceKey);
-					
-				foreach (XmlNode child in xmlNode.ChildNodes) {
-					if (child.NodeType != XmlNodeType.Element)
-						continue;
-					AddNode (BuildSiteMapRecursive (child, EnableLocalization), node);
-				}
-				
-				return node;
-			}
-		}
 
 		protected override void Clear ()
 		{
@@ -356,12 +427,13 @@ namespace System.Web
 		
 		public override SiteMapNode FindSiteMapNode (string rawUrl)
 		{
-			SiteMapNode node = base.FindSiteMapNode (rawUrl);
+			string url = base.MapUrl (rawUrl);
+			SiteMapNode node = base.FindSiteMapNode (url);
 			if (node != null)
 				return node;
 
 			foreach (SiteMapProvider smp in ChildProviders) {
-				node = smp.FindSiteMapNode (rawUrl);
+				node = smp.FindSiteMapNode (url);
 				if (node != null)
 					return node;
 			}
@@ -386,23 +458,28 @@ namespace System.Web
 
 		public override void Initialize (string name, NameValueCollection attributes)
 		{
-			base.Initialize (name, attributes);
-			fileVirtualPath = attributes ["siteMapFile"];
-			if (String.IsNullOrEmpty (fileVirtualPath))
-				throw new ArgumentException ("The siteMapFile attribute must be specified on the XmlSiteMapProvider.");
-
-			HttpContext ctx = HttpContext.Current;
-			HttpRequest req = ctx != null ? ctx.Request : null;
-			
-			if (req != null)
-				file = req.MapPath (fileVirtualPath, HttpRuntime.AppDomainAppVirtualPath, false);
-			else
-				throw new InvalidOperationException ("Request is missing - cannot map paths.");
-
-			if (File.Exists (file)) {
-				ResourceKey = Path.GetFileName (file);
-				CreateWatcher (file);
+			if (initialized)
+				throw new InvalidOperationException ("XmlSiteMapProvider cannot be initialized twice.");
+
+			initialized = true;
+			if (attributes != null) {
+				foreach (string key in attributes.AllKeys) {
+					switch (key) {
+						case "siteMapFile":
+							fileVirtualPath = base.MapUrl (attributes ["siteMapFile"]);
+							break;
+
+						case "description":
+						case "securityTrimmingEnabled":
+							break;
+							
+						default:
+							throw new ConfigurationErrorsException ("The attribute '" + key + "' is unexpected in the configuration of the '" + name + "' provider.");
+					}
+				}
 			}
+			
+			base.Initialize (name, attributes != null ? attributes : new NameValueCollection ());
 		}
 
 		void CreateWatcher (string file)
diff --git a/mcs/class/System.Web/System.Web_test.dll.sources b/mcs/class/System.Web/System.Web_test.dll.sources
index e0ae432..50201fe 100644
--- a/mcs/class/System.Web/System.Web_test.dll.sources
+++ b/mcs/class/System.Web/System.Web_test.dll.sources
@@ -20,10 +20,12 @@ mainsoft/NunitWeb/NunitWeb/BaseWorkerRequest.cs
 mainsoft/NunitWeb/NunitWeb/CustomSection.cs
 mainsoft/NunitWeb/NunitWeb/FakeMembershipProvider.cs
 mainsoft/NunitWeb/NunitWeb/FormRequest.cs
+mainsoft/NunitWeb/NunitWeb/Global.asax.cs
 mainsoft/NunitWeb/NunitWeb/IForeignData.cs
 mainsoft/NunitWeb/NunitWeb/HandlerInvoker.cs
 mainsoft/NunitWeb/NunitWeb/MyHandler.cs
 mainsoft/NunitWeb/NunitWeb/MyHost.cs
+mainsoft/NunitWeb/NunitWeb/MyPage_1.1.cs
 mainsoft/NunitWeb/NunitWeb/MyPageHandlerFactory.cs
 mainsoft/NunitWeb/NunitWeb/MyTemplateControls.cs
 mainsoft/NunitWeb/NunitWeb/PageDelegates.cs
@@ -33,6 +35,8 @@ mainsoft/NunitWeb/NunitWeb/PostableWorkerRequest.cs
 mainsoft/NunitWeb/NunitWeb/Response.cs
 mainsoft/NunitWeb/NunitWeb/StandardUrl.cs
 mainsoft/NunitWeb/NunitWeb/WebTest.cs
+mainsoft/NunitWeb/NunitWeb/Tests/TagsNestedInClientTag.cs
+mainsoft/NunitWeb/NunitWeb/Tests/TestSiteMapProvider.cs
 System.Web/AppBrowsersTest.cs
 System.Web/HttpBrowserCapabilitiesTest.cs
 System.Web/HttpCacheVaryByContentEncodingsTest.cs
@@ -54,6 +58,7 @@ System.Web/TraceContextRecordTest.cs
 System.Web.Compilation/ClientBuildManagerParameterTest.cs
 System.Web.Compilation/TemplateControlCompilerTest.cs
 System.Web.Compilation/AppSettingsExpressionBuilderTest.cs
+System.Web.Compilation/AppResourcesCompilerTest.cs
 System.Web.Configuration/AnonymousIdentificationSectionTest.cs
 System.Web.Configuration/AssemblyCollectionTest.cs
 System.Web.Configuration/AssemblyInfoTest.cs
@@ -515,3 +520,4 @@ System.Web.UI.WebControls/XmlDataSourceCas.cs
 System.Web.Util/TransactionsCas.cs
 System.Web.Util/UrlUtilsTest.cs
 System.Web.Util/WorkItemCas.cs
+System.Web/XmlSiteMapProviderTest.cs
diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/AppResourcesCompilerTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/AppResourcesCompilerTest.cs
new file mode 100644
index 0000000..2529adb
--- /dev/null
+++ b/mcs/class/System.Web/Test/System.Web.Compilation/AppResourcesCompilerTest.cs
@@ -0,0 +1,61 @@
+//
+// AppResourcesCompilerTest.cs
+//
+// Author:
+//      Marek Habersack <mhabersack at novell.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.Web;
+using System.Web.Compilation;
+using System.Threading;
+
+using NUnit.Framework;
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
+
+namespace MonoTests.System.Web.Compilation
+{
+	[TestFixture]
+	public class AppResourcesCompilerTest
+	{
+		[TestFixtureSetUp]
+		public void SetUp ()
+		{
+			WebTest.CopyResource (this.GetType (), "GlobalResourcesLocalization.aspx", "GlobalResourcesLocalization.aspx");
+		}
+
+		[Test (Description="Bug #548768")]
+		public void GlobalResourcesLocalization ()
+		{
+			string pageHtml = new WebTest ("GlobalResourcesLocalization.aspx").Run ();
+                        string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+                        string originalHtml = "<input type=\"submit\" name=\"button1\" value=\"Recharger\" id=\"button1\" />";
+                        
+                        HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+		}
+	}
+}
+#endif
diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog b/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog
index 06b3dfa..67ec399 100644
--- a/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog
+++ b/mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog
@@ -1,3 +1,12 @@
+2009-08-25  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateControlCompilerTest.cs: added test for bug #323719
+
+2009-08-18  Marek Habersack  <mhabersack at novell.com>
+
+	* TemplateControlCompilerTest.cs: added test for bug #525104 and
+	improved test for bug #517656
+
 2009-06-30  Marek Habersack  <mhabersack at novell.com>
 
 	* TemplateControlCompilerTest.cs: added test for bug #517656
diff --git a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
index 115cac7..24a5aa2 100644
--- a/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
@@ -58,7 +58,10 @@ namespace MonoTests.System.Web.Compilation {
 			WebTest.CopyResource (GetType (), "UnquotedAngleBrackets.aspx", "UnquotedAngleBrackets.aspx");
 			WebTest.CopyResource (GetType (), "FullTagsInText.aspx", "FullTagsInText.aspx");
 			WebTest.CopyResource (GetType (), "TagsExpressionsAndCommentsInText.aspx", "TagsExpressionsAndCommentsInText.aspx");
+			WebTest.CopyResource (GetType (), "NewlineInCodeExpression.aspx", "NewlineInCodeExpression.aspx");
+			WebTest.CopyResource (GetType (), "TagsNestedInClientTag.aspx", "TagsNestedInClientTag.aspx");
 #if NET_2_0
+			WebTest.CopyResource (GetType (), "DuplicateControlsInClientComment.aspx", "DuplicateControlsInClientComment.aspx");
 			WebTest.CopyResource (GetType (), "InvalidPropertyBind1.aspx", "InvalidPropertyBind1.aspx");
 			WebTest.CopyResource (GetType (), "InvalidPropertyBind2.aspx", "InvalidPropertyBind2.aspx");
 			WebTest.CopyResource (GetType (), "InvalidPropertyBind3.aspx", "InvalidPropertyBind3.aspx");
@@ -195,13 +198,45 @@ namespace MonoTests.System.Web.Compilation {
 			string originalHtml = @"<script type=""text/javascript"">alert (escape(""reporting/location?report=ViewsByDate&minDate=minDate&maxDate=maxDate""));</script>";
 			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
 		}
+
+		[Test (Description="Bug #526449")]
+		public void NewlineInCodeExpression ()
+		{
+			string pageHtml = new WebTest ("NewlineInCodeExpression.aspx").Run ();
+			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+			string originalHtml = "<a href=\"test\">bla</a>";
+			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+		}
+
+		[Test (Description="Bug #524358")]
+		[ExpectedException ("System.Web.Compilation.ParseException")]
+		public void DuplicateControlsInClientComment ()
+		{
+			// Just test if it throws an exception
+			new WebTest ("DuplicateControlsInClientComment.aspx").Run ();
+		}
 #endif
 
+		[Test (Description="Bug #323719")]
+		public void TagsNestedInClientTag ()
+		{
+			string pageHtml = new WebTest ("TagsNestedInClientTag.aspx").Run ();
+			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+			string originalHtml = @"<script language=""javascript"" src=""/js/test.js"" type=""text/javascript""></script>
+<sometag language=""javascript"" src=""/js/test.js"" type=""text/javascript""></sometag>";
+
+			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+		}
+		
 		[Test (Description="Bug #517656")]
 		public void ServerControlInClientSideComment ()
 		{
-			// We just test if it doesn't throw an exception
-			new WebTest ("ServerControlInClientSideComment.aspx").Run ();
+			string pageHtml = new WebTest ("ServerControlInClientSideComment.aspx").Run ();
+			string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+			string originalHtml = @"<!-- comment start
+  <input id=""testBox"" type=""checkbox"" name=""testBox"" />
+comment end -->";
+			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
 		}
 
 		[Test]
diff --git a/mcs/class/System.Web/Test/System.Web.UI.Adapters/ChangeLog b/mcs/class/System.Web/Test/System.Web.UI.Adapters/ChangeLog
index 2e32c90..49ab994 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.Adapters/ChangeLog
+++ b/mcs/class/System.Web/Test/System.Web.UI.Adapters/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-20  Marek Habersack  <mhabersack at novell.com>
+
+	* ControlAdapterTest.cs: added test for bug #517172
+
 2008-01-12  Dean Brettle <dean at brettle.com> 
 
 	* PageAdapterTest.cs: added tests for PageAdapter.
diff --git a/mcs/class/System.Web/Test/System.Web.UI.Adapters/ControlAdapterTest.cs b/mcs/class/System.Web/Test/System.Web.UI.Adapters/ControlAdapterTest.cs
index a686cae..db1df1e 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.Adapters/ControlAdapterTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.Adapters/ControlAdapterTest.cs
@@ -46,6 +46,14 @@ namespace MonoTests.System.Web.UI.Adapters
 	[TestFixture]
 	public class ControlAdapterTest
 	{
+		[Test (Description="Bug #517172")]
+		public void CreateChildControls ()
+		{
+			MyControl c = new MyControl ();
+			c.AdapterCallCreateChildControls ();
+			Assert.IsTrue (c.create_child_controls_called, "CreateChildControls #1");
+		}
+		
 		[Test]
 		public void BeginRender ()
 		{
@@ -214,6 +222,12 @@ namespace MonoTests.System.Web.UI.Adapters
 
 		class MyControl : Control
 		{
+			internal bool create_child_controls_called;
+			protected override void CreateChildControls ()
+			{
+				create_child_controls_called = true;
+			}
+			
 			internal bool render_called = false;
 			protected override void Render (HtmlTextWriter w)
 			{
@@ -266,6 +280,11 @@ namespace MonoTests.System.Web.UI.Adapters
 				((MyControlAdapter)Adapter).CallRenderChildren (w);
 			}
 
+			internal void AdapterCallCreateChildControls ()
+			{
+				((MyControlAdapter)Adapter).CallCreateChildControls ();
+			}
+			
 			internal void AdapterCallOnInit (EventArgs e)
 			{
 				((MyControlAdapter)Adapter).CallOnInit (e);
@@ -307,6 +326,11 @@ namespace MonoTests.System.Web.UI.Adapters
 			internal MyControlAdapter () : base ()
 			{
 			}
+
+			internal void CallCreateChildControls ()
+			{
+				CreateChildControls ();
+			}
 			
 			internal void CallBeginRender (HtmlTextWriter w)
 			{
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
index 2d31993..c6ba9e7 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,17 @@
+2009-11-16  Marek Habersack  <mhabersack at novell.com>
+
+	* TreeNodeTest.cs: added test for a situation when a
+	node already contains children when the PopulateOnDemand property
+	is set.
+
+2009-11-13  Marek Habersack  <mhabersack at novell.com>
+
+	* GridViewTest.cs: added test for bug #551666
+
+2009-10-13  Marek Habersack  <mhabersack at novell.com>
+
+	* WebColorConverterTest.cs: added test for bug #546173
+
 2009-03-17  Marek Habersack  <mhabersack at novell.com>
 
 	* UnitTest.cs: added a test for equality with Unit.Empty
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs
index 61738a9..04222e5 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/GridViewTest.cs
@@ -438,9 +438,13 @@ namespace MonoTests.System.Web.UI.WebControls
 #if VISUAL_STUDIO
 			WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.GridViewUpdate.aspx", "GridViewUpdate.aspx");
 			WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.NoEventValidation.aspx", "NoEventValidation.aspx");
+			WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.TableSections_Bug551666.aspx", "TableSections_Bug551666.aspx");
+			WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.TableSections_Bug551666.aspx.cs", "TableSections_Bug551666.aspx.cs");
 #else
 			WebTest.CopyResource (GetType (), "GridViewUpdate.aspx", "GridViewUpdate.aspx");
 			WebTest.CopyResource (GetType (), "NoEventValidation.aspx", "NoEventValidation.aspx");
+			WebTest.CopyResource (GetType (), "TableSections_Bug551666.aspx", "TableSections_Bug551666.aspx");
+			WebTest.CopyResource (GetType (), "TableSections_Bug551666.aspx.cs", "TableSections_Bug551666.aspx.cs");
 #endif
 		}
 
@@ -1884,10 +1888,41 @@ namespace MonoTests.System.Web.UI.WebControls
 			HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingButtonField");
 		}
 
-	
-	
-
-
+		[Test (Description="Bug #551666")]
+		public void TableSections_Bug551666 ()
+		{
+			string html = new WebTest ("TableSections_Bug551666.aspx").Run ();
+			string renderedHtml = HtmlDiff.GetControlFromPageHtml (html);
+			string originalHtml = @"<div>
+	<table id=""GridView1"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+			<thead>
+				<tr>
+					<th scope=""col"">Dosage</th><th scope=""col"">Drug</th><th scope=""col"">Patient</th><th scope=""col"">Date</th>
+				</tr>
+			</thead><tbody>
+
+				<tr>
+					<td>25</td><td>Indocin</td><td>David</td><td>2009-11-13</td>
+				</tr><tr>
+					<td>50</td><td>Enebrel</td><td>Sam</td><td>2009-11-13</td>
+				</tr><tr>
+
+					<td>10</td><td>Hydralazine</td><td>Christoff</td><td>2009-11-13</td>
+				</tr><tr>
+					<td>21</td><td>Combivent</td><td>Janet</td><td>2009-11-13</td>
+				</tr><tr>
+					<td>100</td><td>Dilantin</td><td>Melanie</td><td>2009-11-13</td>
+
+				</tr>
+			</tbody><tfoot>
+
+			</tfoot>
+		</table>
+	</div>";
+			
+			HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+		}
+		
 		[Test]
 		public void GridView_RenderingTemplateField ()
 		{
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs
index 9607a37..614cdb9 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/TreeNodeTest.cs
@@ -232,6 +232,25 @@ namespace MonoTests.System.Web.UI.WebControls {
 		}
 
 		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void PopulateOnDemand_With_ChildNodes ()
+		{
+			WebTest t = new WebTest (PageInvoker.CreateOnLoad (PopulateOnDemand_With_ChildNodes_OnLoad));
+			t.Run ();
+		}
+
+		protected static void PopulateOnDemand_With_ChildNodes_OnLoad (Page p)
+		{
+			TreeView tv = new TreeView ();
+			TreeNode node = new TreeNode ("text", "value", "imageUrl", "navigateUrl", "target");
+			node.PopulateOnDemand = true;
+			node.ChildNodes.Add (new TreeNode ("text", "value", "imageUrl", "navigateUrl", "target"));
+			tv.Nodes.Add (node);
+
+			p.Form.Controls.Add (tv);
+		}
+		
+		[Test]
 		public void TreeNode_ToggleExpandState ()
 		{
 			TreeNode node = new TreeNode ("node");
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WebColorConverterTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WebColorConverterTest.cs
index 8b3ea4f..40a12a5 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/WebColorConverterTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/WebColorConverterTest.cs
@@ -175,5 +175,127 @@ namespace MonoTests.System.Web.UI.WebControls
 			Assert.AreEqual(Color.FromArgb(255, 254, 254, 254), conv.ConvertFrom(null, null, "garbage"), "M7");
 		}
 
+		[Test (Description="Bug #546173")]
+		public void NamedColorsCSS2 ()
+		{
+			WebColorConverter wcc = new WebColorConverter ();
+			Color c;
+
+			c = (Color)wcc.ConvertFrom (null, null, "ActiveBorder");
+			Assert.IsTrue (c.IsKnownColor, "#A1");
+			Assert.AreEqual ("ActiveBorder", c.Name, "#A1-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ActiveCaption");
+			Assert.IsTrue (c.IsKnownColor, "#A2");
+			Assert.AreEqual ("ActiveCaption", c.Name, "#A2-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "AppWorkspace");
+			Assert.IsTrue (c.IsKnownColor, "#A3");
+			Assert.AreEqual ("AppWorkspace", c.Name, "#A3-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "Background");
+			Assert.IsTrue (c.IsKnownColor, "#A4");
+			Assert.AreEqual ("Desktop", c.Name, "#A1-4");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ButtonFace");
+			Assert.IsTrue (c.IsKnownColor, "#A5");
+			Assert.AreEqual ("Control", c.Name, "#A5-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ButtonHighlight");
+			Assert.IsTrue (c.IsKnownColor, "#A6");
+			Assert.AreEqual ("ControlLightLight", c.Name, "#A6-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ButtonShadow");
+			Assert.IsTrue (c.IsKnownColor, "#A7");
+			Assert.AreEqual ("ControlDark", c.Name, "#A7-1");
+			
+			c = (Color)wcc.ConvertFrom (null, null, "ButtonText");
+			Assert.IsTrue (c.IsKnownColor, "#A8");
+			Assert.AreEqual ("ControlText", c.Name, "#A8-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "CaptionText");
+			Assert.IsTrue (c.IsKnownColor, "#A9");
+			Assert.AreEqual ("ActiveCaptionText", c.Name, "#A9-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "GrayText");
+			Assert.IsTrue (c.IsKnownColor, "#A10");
+			Assert.AreEqual ("GrayText", c.Name, "#A10-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "Highlight");
+			Assert.IsTrue (c.IsKnownColor, "#A11");
+			Assert.AreEqual ("Highlight", c.Name, "#A11-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "HighlightText");
+			Assert.IsTrue (c.IsKnownColor, "#A12");
+			Assert.AreEqual ("HighlightText", c.Name, "#A12-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "InactiveBorder");
+			Assert.IsTrue (c.IsKnownColor, "#A13");
+			Assert.AreEqual ("InactiveBorder", c.Name, "#A13-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "InactiveCaption");
+			Assert.IsTrue (c.IsKnownColor, "#A14");
+			Assert.AreEqual ("InactiveCaption", c.Name, "#A14-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "InactiveCaptionText");
+			Assert.IsTrue (c.IsKnownColor, "#A15");
+			Assert.AreEqual ("InactiveCaptionText", c.Name, "#A15-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "InfoBackground");
+			Assert.IsTrue (c.IsKnownColor, "#A16");
+			Assert.AreEqual ("Info", c.Name, "#A16-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "InfoText");
+			Assert.IsTrue (c.IsKnownColor, "#A17");
+			Assert.AreEqual ("InfoText", c.Name, "#A17-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "Menu");
+			Assert.IsTrue (c.IsKnownColor, "#A18");
+			Assert.AreEqual ("Menu", c.Name, "#A18-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "MenuText");
+			Assert.IsTrue (c.IsKnownColor, "#A19");
+			Assert.AreEqual ("MenuText", c.Name, "#A19-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ScrollBar");
+			Assert.IsTrue (c.IsKnownColor, "#A20");
+			Assert.AreEqual ("ScrollBar", c.Name, "#A20-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ThreeDDarkShadow");
+			Assert.IsTrue (c.IsKnownColor, "#A21");
+			Assert.AreEqual ("ControlDarkDark", c.Name, "#A21-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ThreeDFace");
+			Assert.IsTrue (c.IsKnownColor, "#A22");
+			Assert.AreEqual ("Control", c.Name, "#A22-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ThreeDHighlight");
+			Assert.IsTrue (c.IsKnownColor, "#A23");
+			Assert.AreEqual ("ControlLight", c.Name, "#A23-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "ThreeDLightShadow");
+			Assert.IsTrue (c.IsKnownColor, "#A24");
+			Assert.AreEqual ("ControlLightLight", c.Name, "#A24-1");
+
+			Exception ex = null;
+			try {
+				c = (Color)wcc.ConvertFrom (null, null, "ThreeDShadow");
+			} catch (Exception e) {
+				ex = e;
+			}			
+			Assert.IsNotNull (ex, "#A25");
+
+			c = (Color)wcc.ConvertFrom (null, null, "Window");
+			Assert.IsTrue (c.IsKnownColor, "#A26");
+			Assert.AreEqual ("Window", c.Name, "#A26-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "WindowFrame");
+			Assert.IsTrue (c.IsKnownColor, "#A27");
+			Assert.AreEqual ("WindowFrame", c.Name, "#A27-1");
+
+			c = (Color)wcc.ConvertFrom (null, null, "WindowText");
+			Assert.IsTrue (c.IsKnownColor, "#A28");
+			Assert.AreEqual ("WindowText", c.Name, "#A28-1");
+		}
 	}
 }
diff --git a/mcs/class/System.Web/Test/System.Web/ChangeLog b/mcs/class/System.Web/Test/System.Web/ChangeLog
index d12818a..f5d75c1 100644
--- a/mcs/class/System.Web/Test/System.Web/ChangeLog
+++ b/mcs/class/System.Web/Test/System.Web/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-16  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpContext.cs: added some tests for RewritePath
+
+2009-11-09  Marek Habersack  <mhabersack at novell.com>
+
+	* HttpCookieTest.cs: added test for bug #553063
+
+	* HttpCookieCollectionTest.cs: added test for bug #553150
+
+2009-09-07  Marek Habersack  <mhabersack at novell.com>
+
+	* XmlSiteMapProviderTest.cs: added
+
+	* StaticSiteMapProviderTest.cs: added test for FindSiteMapNode
+
 2009-05-28  Marek Habersack  <mhabersack at novell.com>
 
 	* HttpUtilityTest.cs: added test for bug #507666
diff --git a/mcs/class/System.Web/Test/System.Web/HttpContext.cs b/mcs/class/System.Web/Test/System.Web/HttpContext.cs
index a5e2ccd..640c540 100644
--- a/mcs/class/System.Web/Test/System.Web/HttpContext.cs
+++ b/mcs/class/System.Web/Test/System.Web/HttpContext.cs
@@ -28,8 +28,11 @@
 using System;
 using System.Text;
 using System.Web;
+using System.Web.UI;
 using System.Collections.Specialized;
 using NUnit.Framework;
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
 
 namespace MonoTests.System.Web {
 
@@ -86,5 +89,61 @@ namespace MonoTests.System.Web {
 			Assert.IsNotNull (ctx.Request, "Request");
 			Assert.IsNotNull (ctx.Response, "Response");
 		}
+
+		[Test]
+		public void RewritePath ()
+		{
+			WebTest t = new WebTest (PageInvoker.CreateOnInit (RewritePath_OnInit));
+			string html = t.Run ();
+		}
+
+		protected static void RewritePath_OnInit (Page p)
+		{
+			HttpContext ctx = HttpContext.Current;
+			HttpRequest req = p.Request;
+			string origPath = req.FilePath;
+
+			ctx.RewritePath ("/NunitWeb/file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/file.html", req.FilePath, "#A1");
+			ctx.RewritePath (origPath, null, null, true);
+
+			ctx.RewritePath ("~/file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/file.html", req.FilePath, "#A2");
+			ctx.RewritePath (origPath, null, null, true);
+
+			ctx.RewritePath ("file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/file.html", req.FilePath, "#A3");
+			ctx.RewritePath (origPath, null, null, true);
+
+			try {
+				ctx.RewritePath ("/file.html", null, null, true);
+				Assert.Fail ("#A4");
+			} catch (HttpException ex) {
+				// The virtual path '/file.html' maps to another application.
+				//
+				// success
+			}
+			
+			ctx.RewritePath ("/NunitWeb/sub/file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/sub/file.html", req.FilePath, "#B1");
+			ctx.RewritePath (origPath, null, null, true);
+
+			ctx.RewritePath ("~/sub/file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/sub/file.html", req.FilePath, "#B2");
+			ctx.RewritePath (origPath, null, null, true);
+
+			ctx.RewritePath ("sub/file.html", null, null, true);
+			Assert.AreEqual ("/NunitWeb/sub/file.html", req.FilePath, "#B3");
+			ctx.RewritePath (origPath, null, null, true);
+
+			try {
+				ctx.RewritePath ("/sub/file.html", null, null, true);
+				Assert.Fail ("#B4");
+			} catch (HttpException ex) {
+				// The virtual path '/file.html' maps to another application.
+				//
+				// success
+			}
+		}
 	}
 }
diff --git a/mcs/class/System.Web/Test/System.Web/HttpCookieCollectionTest.cs b/mcs/class/System.Web/Test/System.Web/HttpCookieCollectionTest.cs
index 85240c5..7e19656 100644
--- a/mcs/class/System.Web/Test/System.Web/HttpCookieCollectionTest.cs
+++ b/mcs/class/System.Web/Test/System.Web/HttpCookieCollectionTest.cs
@@ -64,6 +64,19 @@ namespace MonoTests.System.Web
 
 			col.Set (cookie2);
 			Assert.AreEqual ("value2", col["cookie"].Value, "set should use last used cookie");
+
+			col.Clear ();
+			col.Add (cookie1);
+			col.Add (cookie2);
+
+			// Bug #553150
+			HttpCookie tmp = col.Get (0);
+			Assert.AreEqual ("cookie", tmp.Name, "#A1");
+			Assert.AreEqual ("value1", tmp.Value, "#A1-1");
+
+			tmp = col.Get (1);
+			Assert.AreEqual ("cookie", tmp.Name, "#A2");
+			Assert.AreEqual ("value2", tmp.Value, "#A2-1");
 		}
 
 		[Test]
diff --git a/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs b/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs
index 8417e4e..1698487 100644
--- a/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs
+++ b/mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs
@@ -27,6 +27,8 @@
 //
 
 using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 using System.Web;
 
 using NUnit.Framework;
@@ -65,6 +67,18 @@ namespace MonoTests.System.Web {
 			Assert.IsFalse (cookie.HasKeys);
 		}
 
+		[Test (Description="Bug #553063")]
+		public void CookieValuesSerialization ()
+		{
+			BinaryFormatter bf = new BinaryFormatter();
+			HttpCookie c = new HttpCookie ("stuff", "value1");
+		
+			using (var ms = new MemoryStream()) {
+				bf.Serialize(ms, c.Values);
+				ms.Seek(0, SeekOrigin.Begin);
+			}
+		}
+		
 		[Test]
 		public void PropertySetters ()
 		{
diff --git a/mcs/class/System.Web/Test/System.Web/StaticSiteMapProviderTest.cs b/mcs/class/System.Web/Test/System.Web/StaticSiteMapProviderTest.cs
index b7653d1..19ed9a9 100644
--- a/mcs/class/System.Web/Test/System.Web/StaticSiteMapProviderTest.cs
+++ b/mcs/class/System.Web/Test/System.Web/StaticSiteMapProviderTest.cs
@@ -37,6 +37,8 @@ using System.Diagnostics;
 using MonoTests.SystemWeb.Framework;
 using System.Web.UI;
 
+using Tests;
+
 namespace MonoTests.System.Web {
 	
 	class StaticPoker : StaticSiteMapProvider
@@ -177,6 +179,32 @@ namespace MonoTests.System.Web {
 			Assert.IsTrue (b, "#1");
 		}
 
+		[Test]
+		public void FindSiteMapNode_01 ()
+		{
+			new WebTest (PageInvoker.CreateOnLoad (FindSiteMapNode_01_OnLoad)).Run ();
+		}
+
+		public static void FindSiteMapNode_01_OnLoad (Page p)
+		{
+			var provider = new TestSiteMapProvider ();
+			Assert.IsNotNull (provider.RootNode, "#A1");
+			Assert.AreEqual ("default.aspx", provider.RootNode.Url, "#A1-1");
+
+			SiteMapNode node = provider.FindSiteMapNode ("default.aspx");
+			Assert.IsNull (node, "#A2");
+
+			node = provider.FindSiteMapNode ("/NunitWeb/default.aspx");
+			Assert.IsNotNull (node, "#A3");
+			Assert.AreEqual ("default.aspx", node.Url, "#A3-1");
+			Assert.AreEqual ("Test", node.Title, "#A3-2");
+
+			node = provider.FindSiteMapNode ("~/default.aspx");
+			Assert.IsNotNull (node, "#A4");
+			Assert.AreEqual ("default.aspx", node.Url, "#A4-1");
+			Assert.AreEqual ("Test", node.Title, "#A4-2");
+		}
+		
 		[TestFixtureTearDown]
 		public void TearDown ()
 		{
diff --git a/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs b/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs
new file mode 100644
index 0000000..a69be8a
--- /dev/null
+++ b/mcs/class/System.Web/Test/System.Web/XmlSiteMapProviderTest.cs
@@ -0,0 +1,503 @@
+//
+// System.Web.SiteMapProviderTest.cs - Unit tests for System.Web.SiteMapProvider
+//
+// Author:
+//	Marek Habersack <mhabersack at novell.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Configuration;
+using System.Configuration.Provider;
+using System.Diagnostics;
+using System.Reflection;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.Web.Hosting;
+using NUnit.Framework;
+
+using MonoTests.stand_alone.WebHarness;
+using MonoTests.SystemWeb.Framework;
+
+using Tests;
+
+namespace MonoTests.System.Web
+{
+	[TestFixture]
+	public class XmlSiteMapProviderTest
+	{
+
+		[TestFixtureSetUp]
+		public void SetUp ()
+		{
+			Type myType = GetType ();
+#if VISUAL_STUDIO
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_01.sitemap", "test_map_01.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_02.sitemap", "test_map_02.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_03.sitemap", "test_map_03.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_04.sitemap", "test_map_04.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_05.sitemap", "test_map_05.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_06.sitemap", "test_map_06.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_07.sitemap", "test_map_07.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_08.sitemap", "test_map_08.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.test_map_09.sitemap", "test_map_09.sitemap");
+			WebTest.CopyResource (myType, "System.Web_test.mainsoft.NunitWeb.NunitWeb.Resources.sub_map_01.sitemap", "sub_map_01.sitemap");
+#else
+			WebTest.CopyResource (myType, "test_map_01.sitemap", "test_map_01.sitemap");
+			WebTest.CopyResource (myType, "test_map_02.sitemap", "test_map_02.sitemap");
+			WebTest.CopyResource (myType, "test_map_03.sitemap", "test_map_03.sitemap");
+			WebTest.CopyResource (myType, "test_map_04.sitemap", "test_map_04.sitemap");
+			WebTest.CopyResource (myType, "test_map_05.sitemap", "test_map_05.sitemap");
+			WebTest.CopyResource (myType, "test_map_06.sitemap", "test_map_06.sitemap");
+			WebTest.CopyResource (myType, "test_map_07.sitemap", "test_map_07.sitemap");
+			WebTest.CopyResource (myType, "test_map_08.sitemap", "test_map_08.sitemap");
+			WebTest.CopyResource (myType, "test_map_09.sitemap", "test_map_09.sitemap");
+			WebTest.CopyResource (myType, "sub_map_01.sitemap", "sub_map_01.sitemap");
+#endif
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void AddNode_Null_1 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var node = new SiteMapNode (provider, "/test.aspx");
+
+			provider.DoAddNode (null, node);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void AddNode_Null_2 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var node = new SiteMapNode (provider, "/test.aspx");
+
+			provider.DoAddNode (node, null);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void AddNode_DifferentProviders_01 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var node = new SiteMapNode (new TestSiteMapProvider (), "/test.aspx");
+			var parentNode = new SiteMapNode (provider, "/test2.aspx");
+
+			// SiteMapNode  cannot be found in current provider, only nodes in the same provider can be added.
+			provider.DoAddNode (node, parentNode);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void AddNode_DifferentProviders_02 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var node = new SiteMapNode (provider, "/test.aspx");
+			var parentNode = new SiteMapNode (new TestSiteMapProvider (), "/test2.aspx");
+
+			// SiteMapNode  cannot be found in current provider, only nodes in the same provider can be added.
+			provider.DoAddNode (node, parentNode);
+		}
+
+		[Test]
+		[ExpectedException (typeof (HttpException))]
+		public void AddNode_01 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var node = new SiteMapNode (provider, "/test.aspx");
+			var parentNode = new SiteMapNode (provider, "/test2.aspx");
+
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_01.sitemap");
+			provider.Initialize ("TestMap", nvc);
+
+			// The application relative virtual path '~/test_map_01.sitemap' cannot be made absolute, because the path to the application is not known.
+			provider.DoAddNode (node, parentNode);
+		}
+
+		[Test]
+		public void AddNode_02 ()
+		{
+			new WebTest (PageInvoker.CreateOnLoad (AddNode_02_OnLoad)).Run ();
+		}
+
+		public static void AddNode_02_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			provider.CallTrace = null;
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_01.sitemap");
+			provider.Initialize ("TestMap", nvc);
+
+			SiteMapNode rootNode = provider.RootNode;
+			provider.CallTrace = null;
+
+			var node = new SiteMapNode (provider, "test3.aspx", "~/test3.aspx");
+			provider.DoAddNode (node, rootNode);
+
+			Assert.IsNotNull (provider.CallTrace, "#A1");
+			Assert.Greater (provider.CallTrace.Length, 1, "#A1-1");
+			Assert.AreEqual (provider.CallTrace[0].Name, "BuildSiteMap", "#A1-2");
+		}
+
+		[Test]
+		public void Initialize_1 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+
+			provider.Initialize ("TestMap", null);
+			Assert.AreEqual ("TestMap", provider.Name, "#A1");
+		}
+
+		[Test]
+		public void Initialize_2 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+
+			provider.Initialize ("TestMap", new NameValueCollection ());
+			Assert.AreEqual ("TestMap", provider.Name, "#A1");
+		}
+
+		[Test]
+		public void Initialize_3 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "test.sitemap");
+			provider.Initialize ("TestMap", nvc);
+			Assert.AreEqual ("TestMap", provider.Name, "#A1");
+		}
+
+		[Test]
+		public void Initialize_4 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "test.sitemap");
+			nvc.Add ("description", "Test XML provider");
+			provider.Initialize ("TestMap", nvc);
+			Assert.AreEqual ("TestMap", provider.Name, "#A1");
+			Assert.AreEqual ("Test XML provider", provider.Description, "#A2");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ConfigurationErrorsException))]
+		public void Initialize_5 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "test.sitemap");
+			nvc.Add ("description", "Test XML provider");
+
+			// The attribute 'acme' is unexpected in the configuration of the 'TestMap' provider.
+			nvc.Add ("acme", "test provider");
+			provider.Initialize ("TestMap", nvc);
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void Initialize_6 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+
+			provider.Initialize ("TestMap", null);
+
+			// XmlSiteMapProvider cannot be initialized twice
+			provider.Initialize ("TestMap2", null);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void RootNode_1 ()
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+
+			// Thrown from internal GetConfigDocument ():
+			// The siteMapFile attribute must be specified on the XmlSiteMapProvider
+			provider.Initialize ("TestMap", null);
+			var rn = provider.RootNode;
+		}
+
+		[Test]
+		public void RootNode_2 ()
+		{
+			new WebTest (PageInvoker.CreateOnLoad (RootNode_2_OnLoad)).Run ();
+		}
+
+		public static void RootNode_2_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			provider.CallTrace = null;
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_01.sitemap");
+			provider.CallTrace = null;
+			provider.Initialize ("TestMap", nvc);
+			Assert.IsNotNull (provider.RootNode, "#A1");
+			Assert.AreEqual (provider.RootNode.Provider, provider, "#A2");
+			Assert.IsNotNull (provider.CallTrace, "#A3");
+			Assert.Greater (provider.CallTrace.Length, 1, "#A3-1");
+			Assert.AreEqual (provider.CallTrace[0].Name, "BuildSiteMap", "#A3-2");
+			Assert.AreEqual (provider.CallTrace[1].Name, "get_RootNode", "#A3-3");
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void InvalidFileExtension ()
+		{
+			// The file /NunitWeb/test_map_01.extension has an invalid extension, only .sitemap files are allowed in XmlSiteMapProvider.
+			new WebTest (PageInvoker.CreateOnLoad (InvalidFileExtension_OnLoad)).Run ();
+		}
+
+		public static void InvalidFileExtension_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_01.extension");
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void MissingMapFile ()
+		{
+			new WebTest (PageInvoker.CreateOnLoad (MissingMapFile_OnLoad)).Run ();
+		}
+
+		public static void MissingMapFile_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/missing_map_file.sitemap");
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+		}
+
+		[Test]
+		public void NodeWithSiteMapFile_01 ()
+		{
+			var test = new WebTest (PageInvoker.CreateOnLoad (NodeWithSiteMapFile_01_OnLoad)).Run ();
+		}
+
+		public static void NodeWithSiteMapFile_01_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_02.sitemap");
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+
+			string expectedTreeString = "UNTITLED_0[0]; Test 1[1]; Sub 1 [/NunitWeb/sub_map_01.sitemap][1]; Sub Sub 1 [/NunitWeb/sub_map_01.sitemap][2]";
+			string treeString = provider.GetTreeString ();
+
+			Assert.AreEqual (expectedTreeString, treeString, "#A1");
+		}
+
+		[Test]
+		public void NodeWithProvider_01 ()
+		{
+			var test = new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				NodeWithProvider_OnLoad ("~/test_map_07.sitemap", p);
+			})).Run ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (ProviderException))]
+		public void NodeWithProvider_02 ()
+		{
+			new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				NodeWithProvider_OnLoad ("~/test_map_08.sitemap", p);
+			})).Run ();
+		}
+
+		public static void NodeWithProvider_OnLoad (string filePath, Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", filePath);
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+
+			string expectedTreeString = "UNTITLED_0[0]; Test 1[1]; Test [TestSiteMapProvider][1]";
+			string treeString = provider.GetTreeString ();
+			Assert.AreEqual (expectedTreeString, treeString, "#A1");
+
+			SiteMapNode node = provider.FindSiteMapNode ("default.aspx");
+			Assert.IsNotNull (node, "#B1");
+			Assert.AreEqual ("Test", node.Title, "#B1-1");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ConfigurationErrorsException))]
+		public void InvalidMapFile_01 ()
+		{
+			// Top element must be siteMap.
+			new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				InvalidMapFile_OnLoad ("~/test_map_03.sitemap", p);
+			})).Run ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (ConfigurationErrorsException))]
+		public void InvalidMapFile_02 ()
+		{
+			// Only <siteMapNode> elements are allowed at this location.
+			var test = new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				InvalidMapFile_OnLoad ("~/test_map_04.sitemap", p);
+			})).Run ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (ConfigurationErrorsException))]
+		public void InvalidMapFile_03 ()
+		{
+			// Only <siteMapNode> elements are allowed at this location.
+			var test = new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				InvalidMapFile_OnLoad ("~/test_map_05.sitemap", p);
+			})).Run ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (ConfigurationErrorsException))]
+		public void InvalidMapFile_04 ()
+		{
+			// Only <siteMapNode> elements are allowed at this location.
+			var test = new WebTest (PageInvoker.CreateOnLoad ((Page p) => {
+				InvalidMapFile_OnLoad ("~/test_map_06.sitemap", p);
+			})).Run ();
+		}
+
+		public static void InvalidMapFile_OnLoad (string filePath, Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", filePath);
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+		}
+
+		[Test]
+		public void MapFileWithNonStandardAttributes ()
+		{
+			// Only <siteMapNode> elements are allowed at this location.
+			new WebTest (PageInvoker.CreateOnLoad (MapFileWithNonStandardAttributes_OnLoad)).Run ();
+		}
+
+		public static void MapFileWithNonStandardAttributes_OnLoad (Page p)
+		{
+			var provider = new XmlSiteMapProviderPoker ();
+			var nvc = new NameValueCollection ();
+			nvc.Add ("siteMapFile", "~/test_map_09.sitemap");
+
+			provider.Initialize ("TestMap", nvc);
+			var rn = provider.RootNode;
+
+			//TODO: find out what happens to non-standard attributes
+			//SiteMapNode node = rn.ChildNodes[0];
+			//Assert.IsNotNull (node, "#A1");
+			//Assert.AreEqual ("some, keyword, another, one", node["keywords"], "#A1-1");
+
+			//node = rn.ChildNodes[1];
+			//Assert.IsNotNull (node, "#B1");
+			//Assert.AreEqual("value", node["someattribute"], "#B1-1");
+		}
+	}
+
+	class XmlSiteMapProviderPoker : XmlSiteMapProvider
+	{
+		public MethodBase[] CallTrace { get; set; }
+
+		public void DoAddNode (SiteMapNode node, SiteMapNode parentNode)
+		{
+			AddNode (node, parentNode);
+		}
+
+		public override SiteMapNode BuildSiteMap ()
+		{
+			StoreCallTrace ();
+			return base.BuildSiteMap ();
+		}
+
+		public string GetTreeString ()
+		{
+			var sb = new StringBuilder ();
+			int untitled_counter = 0;
+			BuildTreeString (RootNode, sb, 0, ref untitled_counter);
+			return sb.ToString ();
+		}
+
+		void BuildTreeString (SiteMapNode top, StringBuilder sb, int level, ref int untitled_counter)
+		{
+			string title = top.Title;
+
+			if (String.IsNullOrEmpty (title))
+				title = "UNTITLED_" + untitled_counter++;
+
+			SiteMapProvider provider = top.Provider;
+			if (provider != this) {
+				if (provider == null)
+					title += " [NULL_PROVIDER]";
+				else {
+					string name = provider.Name;
+					if (String.IsNullOrEmpty (name))
+						title += " [" + provider.GetType () + "]";
+					else
+						title += " [" + name + "]";
+				}
+			}
+
+			if (sb.Length > 0)
+				sb.Append ("; ");
+			sb.Append (title + "[" + level + "]");
+			SiteMapNodeCollection childNodes = top.ChildNodes;
+			if (childNodes != null && childNodes.Count > 0) {
+				foreach (SiteMapNode child in childNodes)
+					BuildTreeString (child, sb, level + 1, ref untitled_counter);
+			}
+		}
+
+		void StoreCallTrace ()
+		{
+			CallTrace = null;
+			StackFrame[] frames = new StackTrace (1).GetFrames ();
+			var frameMethods = new List<MethodBase> ();
+
+			int i = 0;
+			foreach (StackFrame sf in frames)
+				frameMethods.Add (sf.GetMethod ());
+			CallTrace = frameMethods.ToArray ();
+		}
+	}
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/ChangeLog b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/ChangeLog
index 4c92282..eef49ac 100644
--- a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/ChangeLog
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-04  Marek Habersack  <mhabersack at novell.com>
+
+	* WebTest.cs: include App_GlobalResources only when compiling
+	System.Web tests.
+
+2009-09-07  Marek Habersack  <mhabersack at novell.com>
+
+	* Tests/TestSiteMapProvider.cs: added
+
 2008-12-30  Raja R Harinath  <harinath at hurrynot.org>
 
 	* CustomSection.cs: Only enable in the 2.0 profile.
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Global.asax.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Global.asax.cs
new file mode 100644
index 0000000..529604d
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Global.asax.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace MainsoftWebApp
+{
+	public partial class Global : System.Web.HttpApplication
+	{
+		protected void Application_Error (object sender, EventArgs e)
+		{
+			// Code that runs when an unhandled error occurs
+			Exception objErr = Server.GetLastError ().GetBaseException ();
+			MonoTests.SystemWeb.Framework.WebTest.RegisterException (objErr);
+			Server.ClearError ();
+		}
+
+		protected void Application_OnEndRequest (object sender, EventArgs e) {
+			// Ensure the headers are sent
+			MonoTests.SystemWeb.Framework.WebTest.CurrentTest.SendHeaders ();
+		}
+	}
+}
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/MyPage_1.1.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/MyPage_1.1.cs
new file mode 100644
index 0000000..0f38a94
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/MyPage_1.1.cs
@@ -0,0 +1,29 @@
+#if !NET_2_0
+#if TARGET_JVM
+#define BUG_78521_FIXED
+#endif
+
+using System;
+using System.Web.UI;
+using MonoTests.SystemWeb.Framework;
+
+public class MyPage : System.Web.UI.Page
+{
+	//FIXME: mono defines its own constructor here
+#if BUG_78521_FIXED
+	public MyPage ()
+#else
+	protected override void OnInit (EventArgs e)
+#endif
+	{
+		WebTest t = WebTest.CurrentTest;
+		if (t != null)
+			t.Invoke (this);
+	}
+		
+	public override void VerifyRenderingInServerForm (Control c)
+	{
+
+	}
+}
+#endif
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax
index bb6b26b..8d384e7 100644
--- a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax
@@ -1 +1 @@
-<%@ Application Language="C#" Inherits="MainsoftWebApp20.Global" CodeFile="Global.asax.cs" %>
+<%@ Application Language="C#" Inherits="MainsoftWebApp.Global" %>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax.cs
deleted file mode 100644
index 9ef7daa..0000000
--- a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Global.asax.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System;
-
-namespace MainsoftWebApp20
-{
-	public partial class Global : System.Web.HttpApplication
-	{
-		protected void Application_Error (object sender, EventArgs e)
-		{
-			// Code that runs when an unhandled error occurs
-			Exception objErr = Server.GetLastError ().GetBaseException ();
-			MonoTests.SystemWeb.Framework.WebTest.RegisterException (objErr);
-			Server.ClearError ();
-		}
-
-		protected void Application_OnEndRequest (object sender, EventArgs e) {
-			// Ensure the headers are sent
-			MonoTests.SystemWeb.Framework.WebTest.CurrentTest.SendHeaders ();
-		}
-	}
-}
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage_1.1.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage_1.1.aspx
new file mode 100644
index 0000000..559c7af
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/MyPage_1.1.aspx
@@ -0,0 +1,16 @@
+<%@ Page Language="C#" AutoEventWireup="true" Inherits="MyPage" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head id="Head1" runat="server">
+    <title>Untitled Page</title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+    
+    </div>
+    </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config
index ef10d83..e0e8696 100755
--- a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/Web.mono.config
@@ -30,7 +30,11 @@
   </CustomTags>
   
   <system.web>
-    <siteMap enabled="true"/>
+    <siteMap enabled="true">
+      <providers>
+          <add name="TestSiteMapProvider" type="Tests.TestSiteMapProvider" />
+      </providers>
+    </siteMap>
     <compilation debug="true" batch="false">
 	<assemblies>
 		<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/sub_map_01.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/sub_map_01.sitemap
new file mode 100644
index 0000000..4f6d364
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/sub_map_01.sitemap
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode url="sub1.aspx" title="Sub 1"  description="">
+        <siteMapNode url="sub_sub1.aspx" title="Sub Sub 1"  description="" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_01.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_01.sitemap
new file mode 100644
index 0000000..9586f37
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_01.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode url="test2.aspx" title="Test 2"  description="Test Two" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_02.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_02.sitemap
new file mode 100644
index 0000000..8403438
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_02.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode siteMapFile="~/sub_map_01.sitemap" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_03.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_03.sitemap
new file mode 100644
index 0000000..b4b2937
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_03.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode url="test2.aspx" title="Test 2"  description="Test Two" />
+    </siteMapNode>
+
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_04.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_04.sitemap
new file mode 100644
index 0000000..1818325
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_04.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNodeBroken>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode url="test2.aspx" title="Test 2"  description="Test Two" />
+    </siteMapNodeBroken>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_05.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_05.sitemap
new file mode 100644
index 0000000..b2efc65
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_05.sitemap
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode url="test2.aspx" title="Test 2"  description="Test Two" />
+    </siteMapNode>
+
+    <siteMapNode>
+        <siteMapNode url="test3.aspx" title="Test 3"  description="Test Three" />
+        <siteMapNode url="test4.aspx" title="Test 4"  description="Test Four" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_06.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_06.sitemap
new file mode 100644
index 0000000..0c92e0b
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_06.sitemap
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_07.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_07.sitemap
new file mode 100644
index 0000000..01f07ea
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_07.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode provider="TestSiteMapProvider" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_08.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_08.sitemap
new file mode 100644
index 0000000..c2870ca
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_08.sitemap
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" />
+        <siteMapNode provider="NonExistentSiteMapProvider" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_09.sitemap b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_09.sitemap
new file mode 100644
index 0000000..33b8ac0
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Resources/test_map_09.sitemap
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
+    <siteMapNode>
+        <siteMapNode url="test1.aspx" title="Test 1"  description="Test One" 
+         keywords="some, keyword, another, one" />
+        <siteMapNode url="test2.aspx" title="Test 2"  description="Test Two" 
+         someattribute="value" />
+    </siteMapNode>
+</siteMap>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TagsNestedInClientTag.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TagsNestedInClientTag.cs
new file mode 100644
index 0000000..7d3061b
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TagsNestedInClientTag.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Data;
+using System.Data.Common;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Tests {
+	public class TagsNestedInClientTag : System.Web.UI.Page
+	{
+		protected Literal languageLiteral;
+		protected Literal typeLiteral;
+		protected Literal srcLiteral;
+		protected Literal languageLiteral1;
+		protected Literal typeLiteral1;
+		protected Literal srcLiteral1;
+		
+		protected void Page_Load(object sender, EventArgs e)
+		{
+			languageLiteral.Text = "language=\"javascript\"";
+			typeLiteral.Text = "type=\"text/javascript\"";
+			srcLiteral.Text = "src=\"/js/test.js\"";
+			
+			languageLiteral1.Text = "language=\"javascript\"";
+			typeLiteral1.Text = "type=\"text/javascript\"";
+			srcLiteral1.Text = "src=\"/js/test.js\"";
+		}
+	}
+}
+
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TestSiteMapProvider.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TestSiteMapProvider.cs
new file mode 100644
index 0000000..4b76f45
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/Tests/TestSiteMapProvider.cs
@@ -0,0 +1,37 @@
+#if NET_2_0
+using System;
+using System.Collections.Specialized;
+using System.Web;
+
+namespace Tests {
+	public class TestSiteMapProvider : StaticSiteMapProvider {
+		object rootNodeLock = new object();
+		SiteMapNode rootNode = null;
+
+		public override SiteMapNode RootNode {
+			get { return BuildSiteMap(); }
+		}
+
+		protected override SiteMapNode GetRootNodeCore() {
+			return BuildSiteMap();
+		}
+
+		protected override void Clear() {
+			lock (rootNodeLock) {
+				rootNode = null;
+				base.Clear();
+			}
+		}
+		
+		public override SiteMapNode BuildSiteMap () {
+			lock (rootNodeLock) {
+				if(rootNode == null) {
+					rootNode = new SiteMapNode(this, "Test", "default.aspx", "Test");
+					AddNode(rootNode);
+				}
+				return rootNode;
+			}
+		}
+	}
+}
+#endif
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs
index 2d67288..5e3d8eb 100644
--- a/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/WebTest.cs
@@ -502,7 +502,6 @@ namespace MonoTests.SystemWeb.Framework
 		{
 			CopyResource (typeof (WebTest), "My.ashx", "My.ashx");
 			CopyResource (typeof (WebTest), "Global.asax", "Global.asax");
-			CopyResource (typeof (WebTest), "Global.asax.cs", "Global.asax.cs");
 #if VISUAL_STUDIO
 			CopyResource (typeof (WebTest),
 				"MonoTests.SystemWeb.Framework.Resources.Web.config",
@@ -521,12 +520,17 @@ namespace MonoTests.SystemWeb.Framework
 				"My.master");
 #else
 #if NET_2_0
+#if INSIDE_SYSTEM_WEB
+			CopyResource (typeof (WebTest), "Common.resx", "App_GlobalResources/Common.resx");
+			CopyResource (typeof (WebTest), "Common.fr-FR.resx", "App_GlobalResources/Common.fr-FR.resx");
+#endif
 			CopyResource (typeof (WebTest), "Web.mono.config", "Web.config");
+			CopyResource (typeof (WebTest), "MyPage.aspx", "MyPage.aspx");
+			CopyResource (typeof (WebTest), "MyPage.aspx.cs", "MyPage.aspx.cs");
 #else
+			CopyResource (typeof (WebTest), "MyPage_1.1.aspx", "MyPage.aspx");
 			CopyResource (typeof (WebTest), "Web.mono.config.1.1", "Web.config");
 #endif
-			CopyResource (typeof (WebTest), "MyPage.aspx", "MyPage.aspx");
-			CopyResource (typeof (WebTest), "MyPage.aspx.cs", "MyPage.aspx.cs");
 			CopyResource (typeof (WebTest), "MyPageWithMaster.aspx", "MyPageWithMaster.aspx");
 			CopyResource (typeof (WebTest), "My.master", "My.master");
 #endif
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.fr-FR.resx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.fr-FR.resx
new file mode 100644
index 0000000..9e7f171
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.fr-FR.resx
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="AdvancedParameters" xml:space="preserve">
+    <value>Paramètres avancés</value>
+  </data>
+  <data name="Anonymous" xml:space="preserve">
+    <value>Anonyme</value>
+  </data>
+  <data name="Authorizations" xml:space="preserve">
+    <value>Autorisations</value>
+  </data>
+  <data name="Cache" xml:space="preserve">
+    <value>Cache</value>
+  </data>
+  <data name="Close" xml:space="preserve">
+    <value>Fermer</value>
+  </data>
+  <data name="Display" xml:space="preserve">
+    <value>Affichage</value>
+  </data>
+  <data name="General" xml:space="preserve">
+    <value>Général</value>
+  </data>
+  <data name="Home" xml:space="preserve">
+    <value>Accueil</value>
+  </data>
+  <data name="Loading" xml:space="preserve">
+    <value>Chargement...</value>
+  </data>
+  <data name="Password" xml:space="preserve">
+    <value>Mot de passe</value>
+  </data>
+  <data name="Preferences" xml:space="preserve">
+    <value>Préférences</value>
+  </data>
+  <data name="Reload" xml:space="preserve">
+    <value>Recharger</value>
+  </data>
+  <data name="Save" xml:space="preserve">
+    <value>Enregistrer</value>
+  </data>
+  <data name="User" xml:space="preserve">
+    <value>Utilisateur</value>
+  </data>
+  <data name="Users" xml:space="preserve">
+    <value>Utilisateurs</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.resx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.resx
new file mode 100644
index 0000000..b78c3ee
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_GlobalResources/Common.resx
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <data name="AdvancedParameters" xml:space="preserve">
+    <value>Advanced parameters</value>
+  </data>
+  <data name="Anonymous" xml:space="preserve">
+    <value>Anonymous</value>
+  </data>
+  <data name="Authorizations" xml:space="preserve">
+    <value>Authorizations</value>
+  </data>
+  <data name="Cache" xml:space="preserve">
+    <value>Cache</value>
+  </data>
+  <data name="Close" xml:space="preserve">
+    <value>Close</value>
+  </data>
+  <data name="Display" xml:space="preserve">
+    <value>Display</value>
+  </data>
+  <data name="General" xml:space="preserve">
+    <value>Général</value>
+  </data>
+  <data name="Home" xml:space="preserve">
+    <value>Home</value>
+  </data>
+  <data name="Loading" xml:space="preserve">
+    <value>Loading...</value>
+  </data>
+  <data name="Password" xml:space="preserve">
+    <value>Password</value>
+  </data>
+  <data name="Preferences" xml:space="preserve">
+    <value>Preferences</value>
+  </data>
+  <data name="Reload" xml:space="preserve">
+    <value>Reload</value>
+  </data>
+  <data name="Save" xml:space="preserve">
+    <value>Save</value>
+  </data>
+  <data name="User" xml:space="preserve">
+    <value>User</value>
+  </data>
+  <data name="Users" xml:space="preserve">
+    <value>Users</value>
+  </data>
+</root>
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx
new file mode 100644
index 0000000..951c36c
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx
@@ -0,0 +1,24 @@
+<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+    <title></title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+    Hello World of mono lovers
+                <!--    <asp:Literal ID="form1" runat="server" />
+
+                        <br>                            -->
+    </div>
+    <asp:Repeater runat="server" id="r1">
+    <ItemTemplate>
+    <asp:Literal ID="form2" runat="server" />
+    </ItemTemplate>
+    </asp:Repeater>
+    </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/GlobalResourcesLocalization.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/GlobalResourcesLocalization.aspx
new file mode 100644
index 0000000..e852180
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/GlobalResourcesLocalization.aspx
@@ -0,0 +1,14 @@
+<%@ Page Language="C#" UICulture="fr-FR" Culture="fr-FR" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head runat="server">
+	<title>Default</title>
+</head>
+<body>
+	<form id="form1" runat="server">
+		Culture: <%= System.Globalization.CultureInfo.CurrentCulture %>
+		UICulture: <%= System.Globalization.CultureInfo.CurrentUICulture %>
+		<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:Button id="button1" runat="server" Text="<%$ Resources:Common,Reload %>" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+	</form>
+</body>
+</html>
\ No newline at end of file
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx
new file mode 100644
index 0000000..12c8965
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx
@@ -0,0 +1,17 @@
+<%@ Page Language="C#" AutoEventWireup="true" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title></title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+    <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><a href="<%= "test"
+        %>">bla</a><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+    </div>
+    </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ServerControlInClientSideComment.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ServerControlInClientSideComment.aspx
index 84d2f5b..e37928e 100644
--- a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ServerControlInClientSideComment.aspx
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/ServerControlInClientSideComment.aspx
@@ -1,6 +1,10 @@
 <%@ Page Language = "C#" %>
 
 <html><head><title>Bug 517656</title><head><body>
+<form runat="server">
+<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><!-- comment start
+  <asp:Checkbox id="testBox" runat="server" />
+comment end --><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
 <p>ASP.NET repeater control to follow...</p>
 <asp:Repeater id="censusRepeater" runat="server">
 	<HeaderTemplate />
@@ -33,4 +37,5 @@
 	</ItemTemplate>
 	<FooterTemplate />
 </asp:Repeater>
+</form>
 </body></html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx
new file mode 100644
index 0000000..32c89bb
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx
@@ -0,0 +1,19 @@
+<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="TableSections_Bug551666.aspx.cs" Inherits="_Default" %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+    <title>Bug #551666</title>
+</head>
+<body>
+    <form id="form1" runat="server">
+    <div>
+       
+        <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView ID="GridView1" runat="server">
+            
+        </asp:GridView><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+    </div>
+    </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx.cs b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx.cs
new file mode 100644
index 0000000..7dc31f5
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TableSections_Bug551666.aspx.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Configuration;
+using System.Data;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.HtmlControls;
+using System.Web.UI.WebControls;
+using System.Web.UI.WebControls.WebParts;
+
+
+public partial class _Default : System.Web.UI.Page 
+{
+    protected void Page_Load(object sender, EventArgs e)
+    {
+        DataSet ds = new DataSet();
+        ds.Tables.Add(GetTable());
+       
+        GridView1.DataSource = ds.Tables[0].DefaultView;
+        GridView1.UseAccessibleHeader = true;
+
+        
+        GridView1.DataBind();
+        GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;
+
+        GridView1.FooterRow.TableSection = TableRowSection.TableFooter;
+
+
+        
+    }
+
+    public DataTable GetTable()
+    {
+        //
+        // Here we create a DataTable with four columns.
+        //
+        DataTable table = new DataTable();
+        table.Columns.Add("Dosage", typeof(int));
+        table.Columns.Add("Drug", typeof(string));
+        table.Columns.Add("Patient", typeof(string));
+        table.Columns.Add("Date", typeof(string));
+
+        //
+        // Here we add five DataRows.
+        //
+        DateTime dt = new DateTime (2009, 11, 13);
+        table.Rows.Add(25, "Indocin", "David", "2009-11-13");
+        table.Rows.Add(50, "Enebrel", "Sam", "2009-11-13");
+        table.Rows.Add(10, "Hydralazine", "Christoff", "2009-11-13");
+        table.Rows.Add(21, "Combivent", "Janet", "2009-11-13");
+        table.Rows.Add(100, "Dilantin", "Melanie", "2009-11-13");
+        return table;
+    }
+
+}
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx
new file mode 100644
index 0000000..3b72d7e
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx
@@ -0,0 +1,15 @@
+<%@ Page Language="C#" 
+         AutoEventWireup="true" 
+         Inherits="Tests.TagsNestedInClientTag" %>
+<html>
+<head runat="server"><title>Bug #323719</title></head>
+<body>
+
+<p>
+This is a test to see if mono can handle a control embedded in a script tag; which MS is able to deal with.
+</p>
+
+<%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><script <asp:Literal ID="languageLiteral" runat="server" EnableViewState="false" /> <asp:Literal ID="srcLiteral" runat="server" EnableViewState="false" /> <asp:Literal ID="typeLiteral" runat="server" EnableViewState="false" />></script>
+<sometag <asp:Literal ID="languageLiteral1" runat="server" EnableViewState="false" /> <asp:Literal ID="srcLiteral1" runat="server" EnableViewState="false" /> <asp:Literal ID="typeLiteral1" runat="server" EnableViewState="false"/>></sometag></sometag><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+</body>
+</html>
diff --git a/mcs/class/System.Web/resources/WebUIValidation_2.0.js b/mcs/class/System.Web/resources/WebUIValidation_2.0.js
index 085f08d..5f23ef2 100644
--- a/mcs/class/System.Web/resources/WebUIValidation_2.0.js
+++ b/mcs/class/System.Web/resources/WebUIValidation_2.0.js
@@ -4,7 +4,7 @@
  * Authors:
  *   Chris Toshok (toshok at ximian.com)
  *
- * (c) 2005 Novell, Inc. (http://www.novell.com)
+ * (c) 2005-2009 Novell, Inc. (http://www.novell.com)
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -43,23 +43,25 @@ webForm.ValidatorOnLoad = function  ()
 		webForm.have_validation_summaries = true;
 	}
 
-	for (var v = 0; v < webForm.Page_Validators.length; v++) {
-		var vo = webForm.Page_Validators [v];
+	if (typeof (webForm.Page_Validators) != 'undefined' || webForm.Page_Validators != null) {
+		for (var v = 0; v < webForm.Page_Validators.length; v++) {
+			var vo = webForm.Page_Validators [v];
 
-		if (typeof(vo.isvalid) == "string" && vo.isvalid == "False")
-			vo._isvalid = false;
-		else
-			vo._isvalid = true;
+			if (typeof(vo.isvalid) == "string" && vo.isvalid == "False")
+				vo._isvalid = false;
+			else
+				vo._isvalid = true;
 
-		if (typeof(vo.enabled) == "string" && vo.enabled == "False")
-			vo._enabled = false;
-		else
-			vo._enabled = true;
+			if (typeof(vo.enabled) == "string" && vo.enabled == "False")
+				vo._enabled = false;
+			else
+				vo._enabled = true;
 			
-		if (typeof(vo.evaluationfunction) == "string")
-			vo.evaluationfunction = webForm [vo.evaluationfunction];
+			if (typeof(vo.evaluationfunction) == "string")
+				vo.evaluationfunction = webForm [vo.evaluationfunction];
+		}
 	}
-
+	
 	webForm.Page_ValidationActive = true;
 }
 
@@ -206,29 +208,32 @@ webForm.Page_ClientValidate = function (group)
 	}
 	
 	var invalidControlHasBeenFocused = false;
-	for (var v = 0; v < webForm.Page_Validators.length; v++) {
-		var vo = webForm.Page_Validators [v];
-		var evalfunc = vo.evaluationfunction;
-		var result = false;
-
-		if (!vo._enabled || !webForm.IsValidationGroupMatch(vo, group)) {
-			result = true;
-			webForm.ValidatorSucceeded (vo);
-		}
-		else {
-			result = evalfunc.call (this, vo);
-		}
+	if (typeof (webForm.Page_Validators) != 'undefined' || webForm.Page_Validators != null) {
+		for (var v = 0; v < webForm.Page_Validators.length; v++) {
+			var vo = webForm.Page_Validators [v];
+			var evalfunc = vo.evaluationfunction;
+			var result = false;
+
+			if (!vo._enabled || !webForm.IsValidationGroupMatch(vo, group)) {
+				result = true;
+				webForm.ValidatorSucceeded (vo);
+			}
+			else {
+				result = evalfunc.call (this, vo);
+			}
 
-		if (!result) {
-			webForm.validation_result = false;
-			if (!invalidControlHasBeenFocused && typeof(vo.focusOnError) == "string" && vo.focusOnError == "t") {
-				invalidControlHasBeenFocused = webForm.ValidatorSetFocus(vo);
+			if (!result) {
+				webForm.validation_result = false;
+				if (!invalidControlHasBeenFocused && typeof(vo.focusOnError) == "string" && vo.focusOnError == "t") {
+					invalidControlHasBeenFocused = webForm.ValidatorSetFocus(vo);
+				}
 			}
-		}
 		
-		vo._isvalid = result;
+			vo._isvalid = result;
+		}
+		webForm.ValidationSummaryOnSubmit(group);
 	}
-    webForm.ValidationSummaryOnSubmit(group);
+	
 	return webForm.validation_result;
 }
 
diff --git a/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs b/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs
index 1120dcf..876be40 100644
--- a/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs
+++ b/mcs/class/System.Xml.Linq/System.Xml.XPath/Extensions.cs
@@ -61,6 +61,8 @@ namespace System.Xml.XPath
 		public static XElement XPathSelectElement (this XNode node, string xpath, IXmlNamespaceResolver nsResolver)
 		{
 			XPathNavigator nav = CreateNavigator (node).SelectSingleNode (xpath, nsResolver);
+			if (nav == null)
+				return null;
 			return nav.UnderlyingObject as XElement;
 		}
 
diff --git a/mcs/class/System/System.CodeDom/ChangeLog b/mcs/class/System/System.CodeDom/ChangeLog
index d3e4111..3320b3b 100644
--- a/mcs/class/System/System.CodeDom/ChangeLog
+++ b/mcs/class/System/System.CodeDom/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-22 Lluis Sanchez Gual <lluis at novell.com>
+
+	* CodeNamespaceImportCollection.cs: Properly update the internal
+	keys hashtable when there are changes in the items.
+
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* CodeNamespace.cs:
+	* CodeTypeReference.cs:
+	* CodeMemberMethod.cs:
+	* CodeCompileUnit.cs:
+	* CodeNamespaceImportCollection.cs:
+	* CodeTypeDeclaration.cs: renamed/added fields so that we're
+	compatible with MS serialization.
+
+2009-08-13  Marek Habersack  <mhabersack at novell.com>
+
+	* CodeTypeReference.cs: generic types specialized on arrays must
+	not be treated as array declarations. Fixes bug #523341
+
 2008-02-10  Juraj Skripsky  <js at hotfeet.ch>
 
 	* CodeObject.cs: Add empty Visit method implementation.
diff --git a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
index 680ccc0..539139a 100644
--- a/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
+++ b/mcs/class/System/System.CodeDom/CodeCompileUnit.cs
@@ -40,9 +40,9 @@ namespace System.CodeDom
 	public class CodeCompileUnit
 		: CodeObject
 	{
-		private CodeAttributeDeclarationCollection assemblyCustomAttributes;
+		private CodeAttributeDeclarationCollection attributes;
 		private CodeNamespaceCollection namespaces;
-		private StringCollection referencedAssemblies;
+		private StringCollection assemblies;
 
 		//
 		// Constructors
@@ -56,10 +56,10 @@ namespace System.CodeDom
 		//
 		public CodeAttributeDeclarationCollection AssemblyCustomAttributes {
 			get {
-				if ( assemblyCustomAttributes == null )
-					assemblyCustomAttributes = 
+				if ( attributes == null )
+					attributes = 
 						new CodeAttributeDeclarationCollection();
-				return assemblyCustomAttributes;
+				return attributes;
 			}
 		}
 
@@ -73,9 +73,9 @@ namespace System.CodeDom
 
 		public StringCollection ReferencedAssemblies {
 			get {
-				if ( referencedAssemblies == null )
-					referencedAssemblies = new StringCollection();
-				return referencedAssemblies;
+				if ( assemblies == null )
+					assemblies = new StringCollection();
+				return assemblies;
 			}
 		}
 
diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
index d3aac51..0f98a1d 100644
--- a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
+++ b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs
@@ -41,10 +41,11 @@ namespace System.CodeDom
 	{
 		private CodeTypeReferenceCollection implementationTypes;
 		private CodeParameterDeclarationExpressionCollection parameters;
-		private CodeTypeReference privateImplementationType;
+		private CodeTypeReference privateImplements;
 		private CodeTypeReference returnType;
 		private CodeStatementCollection statements;
-		private CodeAttributeDeclarationCollection returnTypeCustomAttributes;
+		private CodeAttributeDeclarationCollection returnAttributes;
+		int populated;
 
 #if NET_2_0
 		CodeTypeParameterCollection typeParameters;
@@ -83,10 +84,10 @@ namespace System.CodeDom
 
 		public CodeTypeReference PrivateImplementationType {
 			get {
-				return privateImplementationType;
+				return privateImplements;
 			}
 			set {
-				privateImplementationType = value;
+				privateImplements = value;
 			}
 		}
 
@@ -114,10 +115,10 @@ namespace System.CodeDom
 
 		public CodeAttributeDeclarationCollection ReturnTypeCustomAttributes {
 			get {
-				if ( returnTypeCustomAttributes == null )
-					returnTypeCustomAttributes = new CodeAttributeDeclarationCollection();
+				if ( returnAttributes == null )
+					returnAttributes = new CodeAttributeDeclarationCollection();
 				
-				return returnTypeCustomAttributes;
+				return returnAttributes;
 			}
 		}
 
diff --git a/mcs/class/System/System.CodeDom/CodeNamespace.cs b/mcs/class/System/System.CodeDom/CodeNamespace.cs
index 1a0e34a..22e05cb 100644
--- a/mcs/class/System/System.CodeDom/CodeNamespace.cs
+++ b/mcs/class/System/System.CodeDom/CodeNamespace.cs
@@ -40,8 +40,10 @@ namespace System.CodeDom
 	{
 		private CodeCommentStatementCollection comments;
 		private CodeNamespaceImportCollection imports;
-		private CodeTypeDeclarationCollection types;
+		private CodeNamespaceCollection namespaces;
+		private CodeTypeDeclarationCollection classes;
 		private string name;
+		int populated;
 
 		//
 		// Constructors
@@ -94,12 +96,12 @@ namespace System.CodeDom
 
 		public CodeTypeDeclarationCollection Types {
 			get {
-				if ( types == null ) {
-					types = new CodeTypeDeclarationCollection();
+				if ( classes == null ) {
+					classes = new CodeTypeDeclarationCollection();
 					if ( PopulateTypes != null )
 						PopulateTypes( this, EventArgs.Empty );
 				}
-				return types;
+				return classes;
 			}
 		}
 
diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
index f600a46..da5c905 100644
--- a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
+++ b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs
@@ -44,14 +44,16 @@ namespace System.CodeDom
 	public class CodeNamespaceImportCollection
 		: IList, ICollection, IEnumerable
 	{
-		private ArrayList namespaceImports;
+		private Hashtable keys;
+		private ArrayList data;
 
 		//
 		// Constructors
 		//
 		public CodeNamespaceImportCollection ()
 		{
-			namespaceImports = new ArrayList();
+			data = new ArrayList ();
+			keys = new Hashtable (CaseInsensitiveHashCodeProvider.Default, CaseInsensitiveComparer.Default);
 		}
 
 		//
@@ -59,22 +61,26 @@ namespace System.CodeDom
 		//
 		int ICollection.Count {
 			get {
-				return namespaceImports.Count;
+				return data.Count;
 			}
 		}
 		
 		public int Count {
 			get {
-				return namespaceImports.Count;
+				return data.Count;
 			}
 		}
 
 		public CodeNamespaceImport this [int index] {
 			get {
-				return (CodeNamespaceImport)namespaceImports[index];
+				return (CodeNamespaceImport)data[index];
 			}
 			set {
-				namespaceImports[index] = value;
+				CodeNamespaceImport oldImport = (CodeNamespaceImport) data [index];
+				CodeNamespaceImport newImport = (CodeNamespaceImport) value;
+				keys.Remove (oldImport.Namespace);
+				data[index] = value;
+				keys [newImport.Namespace] = newImport;
 			}
 		}
 
@@ -87,16 +93,10 @@ namespace System.CodeDom
 				throw new NullReferenceException ();
 			}
 
-			// perform case-insensitive check to see if the namespace of the 
-			// entry to add is not already in the collection
-			foreach (CodeNamespaceImport import in this) {
-				if (string.Compare(import.Namespace, value.Namespace, true) == 0) {
-					// skip duplicate namespaces
-					return;
-				}
+			if (!keys.ContainsKey (value.Namespace)) {
+				keys [value.Namespace] = value;
+				data.Add (value);
 			}
-
-			namespaceImports.Add (value);
 		}
 
 		public void AddRange (CodeNamespaceImport [] value)
@@ -112,12 +112,13 @@ namespace System.CodeDom
 
 		void IList.Clear ()
 		{
-			namespaceImports.Clear ();
+			Clear ();
 		}
 		
 		public void Clear ()
 		{
-			namespaceImports.Clear ();
+			data.Clear ();
+			keys.Clear ();
 		}
 
 		// IList implementation
@@ -135,41 +136,60 @@ namespace System.CodeDom
 
 		object IList.this[int index] {
 			get {
-				return namespaceImports[index];
+				return data[index];
 			}
 			set {
-				namespaceImports[index] = value;
+				this [index] = (CodeNamespaceImport) value;
 			}
 		}
 
 		int IList.Add( object value )
 		{
-			return namespaceImports.Add( value );
+			Add ((CodeNamespaceImport) value);
+			return data.Count - 1;
 		}
 		
 		bool IList.Contains( object value )
 		{
-			return namespaceImports.Contains( value );
+			return data.Contains( value );
 		}
 		
 		int IList.IndexOf( object value )
 		{
-			return namespaceImports.IndexOf( value );
+			return data.IndexOf( value );
 		}
 
 		void IList.Insert( int index, object value )
 		{
-			namespaceImports.Insert( index, value );
+			data.Insert( index, value );
+			CodeNamespaceImport import = (CodeNamespaceImport) value;
+			keys [import.Namespace] = import;
 		}
 
 		void IList.Remove( object value )
 		{
-			namespaceImports.Remove( value );
+			string ns = ((CodeNamespaceImport)value).Namespace;
+			data.Remove( value );
+			foreach (CodeNamespaceImport import in data) {
+				if (import.Namespace == ns) {
+					keys [ns] = import;
+					return;
+				}
+			}
+			keys.Remove (ns);
 		}
 		
 		void IList.RemoveAt( int index )
 		{
-			namespaceImports.RemoveAt( index );
+			string ns = this [index].Namespace;
+			data.RemoveAt( index );
+			foreach (CodeNamespaceImport import in data) {
+				if (import.Namespace == ns) {
+					keys [ns] = import;
+					return;
+				}
+			}
+			keys.Remove (ns);
 		}
 
 		// ICollection implementation
@@ -181,25 +201,25 @@ namespace System.CodeDom
 
 		bool ICollection.IsSynchronized {
 			get {
-				return namespaceImports.IsSynchronized;
+				return data.IsSynchronized;
 			}
 		}
 
 		void ICollection.CopyTo( Array array, int index )
 		{
-			namespaceImports.CopyTo( array, index );
+			data.CopyTo( array, index );
 		}
 
 		// IEnumerable implementation
 		IEnumerator IEnumerable.GetEnumerator ()
 		{
-			return namespaceImports.GetEnumerator();
+			return data.GetEnumerator();
 		}
 		
 		// IEnumerable implementation
 		public IEnumerator GetEnumerator ()
 		{
-			return namespaceImports.GetEnumerator();
+			return data.GetEnumerator();
 		}
 	}
 }
diff --git a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
index adf0e86..ed75aee 100644
--- a/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
+++ b/mcs/class/System/System.CodeDom/CodeTypeDeclaration.cs
@@ -43,9 +43,10 @@ namespace System.CodeDom
 	{
 		private CodeTypeReferenceCollection baseTypes;
 		private CodeTypeMemberCollection members;
-		private TypeAttributes typeAttributes = TypeAttributes.Public;
+		private TypeAttributes attributes = TypeAttributes.Public;
 		private bool isEnum;
 		private bool isStruct;
+		int populated;
 
 #if NET_2_0
 		bool isPartial;
@@ -83,7 +84,7 @@ namespace System.CodeDom
 
 		public bool IsClass {
 			get {
-				if ( (typeAttributes & TypeAttributes.Interface) != 0 )
+				if ( (attributes & TypeAttributes.Interface) != 0 )
 					return false;
 				if ( isEnum )
 					return false;
@@ -93,7 +94,7 @@ namespace System.CodeDom
 			}
 			set {
 				if ( value ) {
-					typeAttributes &= ~TypeAttributes.Interface;
+					attributes &= ~TypeAttributes.Interface;
 					isEnum = false;
 					isStruct = false;
 				}
@@ -106,7 +107,7 @@ namespace System.CodeDom
 			}
 			set {
 				if ( value ) {
-					typeAttributes &= ~TypeAttributes.Interface;
+					attributes &= ~TypeAttributes.Interface;
 					isEnum = true;
 					isStruct = false;
 				}
@@ -115,11 +116,11 @@ namespace System.CodeDom
 
 		public bool IsInterface {
 			get {
-				return (typeAttributes & TypeAttributes.Interface) != 0;
+				return (attributes & TypeAttributes.Interface) != 0;
 			}
 			set {
 				if ( value ) {
-					typeAttributes |= TypeAttributes.Interface;
+					attributes |= TypeAttributes.Interface;
 					isEnum = false;
 					isStruct = false;
 				}
@@ -132,7 +133,7 @@ namespace System.CodeDom
 			}
 			set {
 				if ( value ) {
-					typeAttributes &= ~TypeAttributes.Interface;
+					attributes &= ~TypeAttributes.Interface;
 					isEnum = false;
 					isStruct = true;
 				}
@@ -152,13 +153,13 @@ namespace System.CodeDom
 
 		public TypeAttributes TypeAttributes {
 			get {
-				return typeAttributes;
+				return attributes;
 			}
 			set {
-				typeAttributes = value;
+				attributes = value;
 #if FALSE
 				/* MS does not seem to do this, so don't I */
-				if ( (typeAttributes & TypeAttributes.Interface) != 0 ) {
+				if ( (attributes & TypeAttributes.Interface) != 0 ) {
 					isEnum = false;
 					isStruct = false;
 				}
diff --git a/mcs/class/System/System.CodeDom/CodeTypeReference.cs b/mcs/class/System/System.CodeDom/CodeTypeReference.cs
index 7478c35..cffd919 100644
--- a/mcs/class/System/System.CodeDom/CodeTypeReference.cs
+++ b/mcs/class/System/System.CodeDom/CodeTypeReference.cs
@@ -40,13 +40,14 @@ namespace System.CodeDom
 	public class CodeTypeReference : CodeObject
 	{
 		private string baseType;
-		private CodeTypeReference arrayType;
-		private int rank;
+		private CodeTypeReference arrayElementType;
+		private int arrayRank;
 		private bool isInterface;
+		bool needsFixup;
 
 #if NET_2_0
 		CodeTypeReferenceCollection typeArguments;
-		CodeTypeReferenceOptions codeTypeReferenceOption;
+		CodeTypeReferenceOptions referenceOptions;
 #endif
 
 		//
@@ -79,7 +80,7 @@ namespace System.CodeDom
 
 			if (baseType.IsGenericParameter) {
 				this.baseType = baseType.Name;
-				this.codeTypeReferenceOption = CodeTypeReferenceOptions.GenericTypeParameter;
+				this.referenceOptions = CodeTypeReferenceOptions.GenericTypeParameter;
 			}
 			else if (baseType.IsGenericTypeDefinition)
 				this.baseType = baseType.FullName;
@@ -95,27 +96,27 @@ namespace System.CodeDom
 			else
 #endif
 			if (baseType.IsArray) {
-				this.rank = baseType.GetArrayRank ();
-				this.arrayType = new CodeTypeReference (baseType.GetElementType ());
-				this.baseType = arrayType.BaseType;
+				this.arrayRank = baseType.GetArrayRank ();
+				this.arrayElementType = new CodeTypeReference (baseType.GetElementType ());
+				this.baseType = arrayElementType.BaseType;
 			} else {
 				Parse (baseType.FullName);
 			}
 			this.isInterface = baseType.IsInterface;
 		}
 
-		public CodeTypeReference( CodeTypeReference arrayType, int rank )
+		public CodeTypeReference( CodeTypeReference arrayElementType, int arrayRank )
 		{
 			this.baseType = null;
-			this.rank = rank;
-			this.arrayType = arrayType;
+			this.arrayRank = arrayRank;
+			this.arrayElementType = arrayElementType;
 		}
 
 #if NET_2_0
 		[MonoTODO("We should parse basetype from right to left in 2.0 profile.")]
 #endif
-		public CodeTypeReference( string baseType, int rank )
-			: this (new CodeTypeReference (baseType), rank)
+		public CodeTypeReference( string baseType, int arrayRank )
+			: this (new CodeTypeReference (baseType), arrayRank)
 		{
 		}
 
@@ -123,19 +124,19 @@ namespace System.CodeDom
 		public CodeTypeReference( CodeTypeParameter typeParameter ) :
 			this (typeParameter.Name)
 		{
-			this.codeTypeReferenceOption = CodeTypeReferenceOptions.GenericTypeParameter;
+			this.referenceOptions = CodeTypeReferenceOptions.GenericTypeParameter;
 		}
 
-		public CodeTypeReference( string typeName, CodeTypeReferenceOptions codeTypeReferenceOption ) :
+		public CodeTypeReference( string typeName, CodeTypeReferenceOptions referenceOptions ) :
 			this (typeName)
 		{
-			this.codeTypeReferenceOption = codeTypeReferenceOption;
+			this.referenceOptions = referenceOptions;
 		}
 
-		public CodeTypeReference( Type type, CodeTypeReferenceOptions codeTypeReferenceOption ) :
+		public CodeTypeReference( Type type, CodeTypeReferenceOptions referenceOptions ) :
 			this (type)
 		{
-			this.codeTypeReferenceOption = codeTypeReferenceOption;
+			this.referenceOptions = referenceOptions;
 		}
 
 		public CodeTypeReference( string typeName, params CodeTypeReference[] typeArguments ) :
@@ -154,26 +155,26 @@ namespace System.CodeDom
 		public CodeTypeReference ArrayElementType
 		{
 			get {
-				return arrayType;
+				return arrayElementType;
 			}
 			set {
-				arrayType = value;
+				arrayElementType = value;
 			}
 		}
 		
 		public int ArrayRank {
 			get {
-				return rank;
+				return arrayRank;
 			}
 			set {
-				rank = value;
+				arrayRank = value;
 			}
 		}
 
 		public string BaseType {
 			get {
-				if (arrayType != null && rank > 0) {
-					return arrayType.BaseType;
+				if (arrayElementType != null && arrayRank > 0) {
+					return arrayElementType.BaseType;
 				}
 
 				if (baseType == null)
@@ -210,6 +211,12 @@ namespace System.CodeDom
 				return;
 			}
 
+			int lastAngle = baseType.LastIndexOf ('>');
+			if (lastAngle != -1 && lastAngle > array_end) {
+				this.baseType = baseType;
+				return;
+			}
+			
 			string[] args = baseType.Substring (array_start + 1, array_end - array_start - 1).Split (',');
 
 			if ((array_end - array_start) != args.Length) {
@@ -261,8 +268,8 @@ namespace System.CodeDom
 					scanPos++;
 				}
 			} else {
-				arrayType = new CodeTypeReference (baseType.Substring (0, array_start));
-				rank = args.Length;
+				arrayElementType = new CodeTypeReference (baseType.Substring (0, array_start));
+				arrayRank = args.Length;
 			}
 #else
 			int array_start = baseType.LastIndexOf ('[');
@@ -287,8 +294,8 @@ namespace System.CodeDom
 				}
 			}
 			if (isArray) {
-				arrayType = new CodeTypeReference (baseType.Substring (0, array_start));
-				rank = args.Length;
+				arrayElementType = new CodeTypeReference (baseType.Substring (0, array_start));
+				arrayRank = args.Length;
 			} else {
 				this.baseType = baseType;
 			}
@@ -299,10 +306,10 @@ namespace System.CodeDom
 		[ComVisible (false)]
 		public CodeTypeReferenceOptions Options {
 			get {
-				return codeTypeReferenceOption;
+				return referenceOptions;
 			}
 			set {
-				codeTypeReferenceOption = value;
+				referenceOptions = value;
 			}
 		}
 
diff --git a/mcs/class/System/System.Collections.Generic/ChangeLog b/mcs/class/System/System.Collections.Generic/ChangeLog
index 466ff8e..78327cb 100644
--- a/mcs/class/System/System.Collections.Generic/ChangeLog
+++ b/mcs/class/System/System.Collections.Generic/ChangeLog
@@ -1,3 +1,4 @@
+
 2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* SortedList.cs: the IComparar.Compare arguments were reversed.
@@ -8,10 +9,15 @@
 	* SortedList.cs: Handle Count == 0 in CopyTo correcly
 	* SortedDictionary.cs: Handle Count == 0 in CopyTo correcly
 
+2009-03-11  Zoltan Varga  <vargaz at gmail.com>
+
+	* SortedList.cs: Add version checking to the Key/Value enumerators +
+	implement support for Reset (). Fixes #483985.
+
 2007-11-15  Roei Erez  <roeie at mainsoft.com>
 
 	* Stack.cs: Performance improvement in the case where the stack is popped
-	untill empty. Changed the condition for resizing the array, and instead of
+	until empty. Changed the condition for resizing the array, and instead of
 	check for zero size, check if the inner array is null.
 
 2007-11-15  Jb Evain  <jbevain at novell.com>
diff --git a/mcs/class/System/System.Collections.Generic/SortedList.cs b/mcs/class/System/System.Collections.Generic/SortedList.cs
index a7f9e0d..969eb5f 100644
--- a/mcs/class/System/System.Collections.Generic/SortedList.cs
+++ b/mcs/class/System/System.Collections.Generic/SortedList.cs
@@ -806,6 +806,119 @@ namespace System.Collections.Generic
 			}
 		}
 
+		[Serializable]
+		public struct KeyEnumerator : IEnumerator <TKey>, IDisposable {
+			const int NOT_STARTED = -2;
+			
+			// this MUST be -1, because we depend on it in move next.
+			// we just decr the size, so, 0 - 1 == FINISHED
+			const int FINISHED = -1;
+			
+			SortedList <TKey, TValue> l;
+			int idx;
+			int ver;
+			
+			internal KeyEnumerator (SortedList<TKey, TValue> l)
+			{
+				this.l = l;
+				idx = NOT_STARTED;
+				ver = l.modificationCount;
+			}
+			
+			public void Dispose ()
+			{
+				idx = NOT_STARTED;
+			}
+			
+			public bool MoveNext ()
+			{
+				if (ver != l.modificationCount)
+					throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
+				
+				if (idx == NOT_STARTED)
+					idx = l.Count;
+				
+				return idx != FINISHED && -- idx != FINISHED;
+			}
+			
+			public TKey Current {
+				get {
+					if (idx < 0)
+						throw new InvalidOperationException ();
+					
+					return l.KeyAt (l.Count - 1 - idx);
+				}
+			}
+			
+			void IEnumerator.Reset ()
+			{
+				if (ver != l.modificationCount)
+					throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
+				
+				idx = NOT_STARTED;
+			}
+			
+			object IEnumerator.Current {
+				get { return Current; }
+			}
+		}
+
+		[Serializable]
+		public struct ValueEnumerator : IEnumerator <TValue>, IDisposable {
+			const int NOT_STARTED = -2;
+			
+			// this MUST be -1, because we depend on it in move next.
+			// we just decr the size, so, 0 - 1 == FINISHED
+			const int FINISHED = -1;
+			
+			SortedList <TKey, TValue> l;
+			int idx;
+			int ver;
+			
+			internal ValueEnumerator (SortedList<TKey, TValue> l)
+			{
+				this.l = l;
+				idx = NOT_STARTED;
+				ver = l.modificationCount;
+			}
+			
+			public void Dispose ()
+			{
+				idx = NOT_STARTED;
+			}
+			
+			public bool MoveNext ()
+			{
+				if (ver != l.modificationCount)
+					throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
+				
+				if (idx == NOT_STARTED)
+					idx = l.Count;
+				
+				return idx != FINISHED && -- idx != FINISHED;
+			}
+			
+			public TValue Current {
+				get {
+					if (idx < 0)
+						throw new InvalidOperationException ();
+					
+					return l.ValueAt (l.Count - 1 - idx);
+				}
+			}
+			
+			void IEnumerator.Reset ()
+			{
+				if (ver != l.modificationCount)
+					throw new InvalidOperationException ("Collection was modified after the enumerator was instantiated.");
+				
+				idx = NOT_STARTED;
+			}
+			
+			object IEnumerator.Current {
+				get { return Current; }
+			}
+		}
 
 		private class ListKeys : IList<TKey>, ICollection, IEnumerable {
 
@@ -884,8 +997,8 @@ namespace System.Collections.Generic
 
 			public virtual IEnumerator<TKey> GetEnumerator ()
 			{
-				for (int i = 0; i < host.Count; ++i)
-					yield return host.KeyAt (i);
+				/* We couldn't use yield as it does not support Reset () */
+				return new KeyEnumerator (host);
 			}
 
 			//
@@ -1009,8 +1122,8 @@ namespace System.Collections.Generic
 
 			public virtual IEnumerator<TValue> GetEnumerator ()
 			{
-				for (int i = 0; i < host.Count; ++i)
-					yield return host.ValueAt (i);
+				/* We couldn't use yield as it does not support Reset () */
+				return new ValueEnumerator (host);
 			}
 
 			//
diff --git a/mcs/class/System/System.ComponentModel.Design/Changelog b/mcs/class/System/System.ComponentModel.Design/Changelog
index 8bd060a..4dc0a8c 100644
--- a/mcs/class/System/System.ComponentModel.Design/Changelog
+++ b/mcs/class/System/System.ComponentModel.Design/Changelog
@@ -1,3 +1,12 @@
+2009-10-21  Carlo Kok  <ck at remobjects.com>
+
+	* RuntimeLicenseContext.cs: Support for the resourceAssembly parameter.
+
+2009-10-12  Carlo Kok  <ck at remobjects.com>
+
+	* DesigntimeLicenseContextSerializer.cs: Properly serialize licenses.
+	* RuntimeLicenseContext.cs: Properly deserialize licenses.
+
 2008-06-18  Ivan N. Zlatev  <contact at i-nz.net>
 
 	* ServiceContainer.cs: Lazy initialize the services hashtable so that 
diff --git a/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContext.cs b/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContext.cs
index 5a01233..2739d85 100644
--- a/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContext.cs
+++ b/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContext.cs
@@ -38,21 +38,20 @@ namespace System.ComponentModel.Design
 {
 	public class DesigntimeLicenseContext : LicenseContext
 	{
-		private Hashtable keys = new Hashtable ();
+		internal Hashtable keys = new Hashtable ();
 
 		public DesigntimeLicenseContext()
 		{
 		}
 
-		public override string GetSavedLicenseKey (Type type,
-							   Assembly resourceAssembly)
+		public override string GetSavedLicenseKey (Type type, Assembly resourceAssembly)
 		{
-			return (string)keys[type];
+			return (string) keys [type];
 		}
 
 		public override void SetSavedLicenseKey (Type type, string key)
 		{
-			keys[type] = key;
+			keys [type] = key;
 		}
 
 		public override LicenseUsageMode UsageMode {
diff --git a/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs b/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs
index 1b39016..f795497 100644
--- a/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs
+++ b/mcs/class/System/System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs
@@ -4,9 +4,11 @@
 // Authors:
 //   Martin Willemoes Hansen (mwh at sysrq.dk)
 //   Andreas Nahr (ClassDevelopment at A-SoftTech.com)
+//   Carlo Kok  (ck at remobjects.com)
 //
 // (C) 2003 Martin Willemoes Hansen
 // (C) 2003 Andreas Nahr
+// (C) 2009 Carlo Kok
 //
 
 //
@@ -31,6 +33,8 @@
 //
 
 using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Collections;
 
 namespace System.ComponentModel.Design
 {
@@ -41,12 +45,19 @@ namespace System.ComponentModel.Design
 		{
 		}
 
-		[MonoTODO]
-		public static void Serialize (Stream o,
-					      string cryptoKey,
-					      DesigntimeLicenseContext context)
+		public static void Serialize (Stream o, string cryptoKey, DesigntimeLicenseContext context)
 		{
-			throw new NotImplementedException();
+			object [] lData = new object [2];
+			lData [0] = cryptoKey;
+			Hashtable lNewTable = new Hashtable ();
+			foreach (DictionaryEntry et in context.keys) {
+				lNewTable.Add (((Type) et.Key).AssemblyQualifiedName, et.Value);
+			}
+			lData[1] = lNewTable;
+
+			BinaryFormatter lFormatter = new BinaryFormatter ();
+			lFormatter.Serialize (o, lData);
 		}
+	
 	}
 }
diff --git a/mcs/class/System/System.ComponentModel.Design/RuntimeLicenseContext.cs b/mcs/class/System/System.ComponentModel.Design/RuntimeLicenseContext.cs
index 6ac86d2..99a17ed 100644
--- a/mcs/class/System/System.ComponentModel.Design/RuntimeLicenseContext.cs
+++ b/mcs/class/System/System.ComponentModel.Design/RuntimeLicenseContext.cs
@@ -5,10 +5,12 @@
 //   Ivan Hamilton (ivan at chimerical.com.au)
 //   Martin Willemoes Hansen (mwh at sysrq.dk)
 //   Andreas Nahr (ClassDevelopment at A-SoftTech.com)
+//   Carlo Kok  (ck at remobjects.com)
 //
 // (C) 2004 Ivan Hamilton
 // (C) 2003 Martin Willemoes Hansen
 // (C) 2003 Andreas Nahr
+// (C) 2009 Carlo Kok
 //
 
 //
@@ -35,26 +37,85 @@
 using System.ComponentModel;
 using System.Reflection;
 using System.Collections;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 
 namespace System.ComponentModel.Design
 {
 	internal class RuntimeLicenseContext : LicenseContext
 	{
-		private Hashtable keys = new Hashtable ();
+        private Hashtable extraassemblies;
+		private Hashtable keys;
 
-		public RuntimeLicenseContext () : base()
+		public RuntimeLicenseContext () : base ()
 		{
 		}
 
-		public override string GetSavedLicenseKey (Type type,
-							   Assembly resourceAssembly)
+		void LoadKeys ()
 		{
-			return (string) keys [type];
+			if (keys != null)
+				return;
+			keys = new Hashtable ();
+
+			Assembly asm = Assembly.GetEntryAssembly ();
+			if (asm != null)
+				LoadAssemblyLicenses (keys, asm);
+			else {
+				foreach (Assembly asmnode in AppDomain.CurrentDomain.GetAssemblies ()) {
+						LoadAssemblyLicenses (keys, asmnode);
+				}
+			}
+		}
+
+		void LoadAssemblyLicenses (Hashtable targetkeys, Assembly asm)
+		{
+            if (asm is System.Reflection.Emit.AssemblyBuilder) return; 
+			string asmname = Path.GetFileName (asm.Location);
+			string resourcename = asmname + ".licenses";
+			try {
+				foreach (string name in asm.GetManifestResourceNames ()) {
+					if (name != resourcename)
+						continue;
+					using (Stream stream = asm.GetManifestResourceStream (name)) {
+						BinaryFormatter formatter = new BinaryFormatter ();
+						object[] res = formatter.Deserialize (stream) as object[];
+						if (String.Compare ((string) res[0], asmname, true) == 0) {
+							Hashtable table = (Hashtable) res[1];
+							foreach (DictionaryEntry et in table)
+                                targetkeys.Add (et.Key, et.Value);
+						}
+					}
+				}
+
+			} catch (InvalidCastException) {
+			}
+		}
+
+		public override string GetSavedLicenseKey (Type type, Assembly resourceAssembly)
+		{
+			if (type == null)
+				throw new ArgumentNullException ("type");
+            if (resourceAssembly != null) {
+                if (extraassemblies == null) 
+					extraassemblies = new Hashtable ();
+                Hashtable ht = extraassemblies [resourceAssembly.FullName] as Hashtable;
+                if (ht == null) {
+                    ht = new Hashtable ();
+                    LoadAssemblyLicenses (ht, resourceAssembly);
+                    extraassemblies [resourceAssembly.FullName] = ht;
+                }
+                return (string) ht [type.AssemblyQualifiedName];
+            }
+			LoadKeys ();
+			return (string) keys [type.AssemblyQualifiedName];
 		}
 
 		public override void SetSavedLicenseKey (Type type, string key)
 		{
-			keys [type] = key;
+			if (type == null)
+				throw new ArgumentNullException ("type");
+			LoadKeys ();
+			keys [type.AssemblyQualifiedName] = key;
 		}
 	}
 }
diff --git a/mcs/class/System/System.ComponentModel/AttributeCollection.cs b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
index 56f3464..2c35ceb 100644
--- a/mcs/class/System/System.ComponentModel/AttributeCollection.cs
+++ b/mcs/class/System/System.ComponentModel/AttributeCollection.cs
@@ -44,7 +44,8 @@ namespace System.ComponentModel
 		
 		internal AttributeCollection (ArrayList attributes)
 		{
-			attrList = attributes;
+			if (attributes != null)
+				attrList = attributes;
 		}
 		
 #if NET_2_0
@@ -161,7 +162,7 @@ namespace System.ComponentModel
 
 		public int Count {
 			get {
-				return attrList.Count;
+				return attrList != null ? attrList.Count : 0;
 			}
 		}
 
diff --git a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs b/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
index 773e3f0..c7ab9a0 100644
--- a/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
+++ b/mcs/class/System/System.ComponentModel/CategoryAttribute.cs
@@ -93,7 +93,7 @@ namespace System.ComponentModel {
 
 				lock (lockobj) {
 					if (async == null)
-						async = new CategoryAttribute ("Asynchrinous");
+						async = new CategoryAttribute ("Asynchronous");
 				}
 				return async;
 			}
@@ -133,7 +133,11 @@ namespace System.ComponentModel {
 
 				lock (lockobj) {
 					if (def == null)
+#if NET_2_1
+						def = new CategoryAttribute ("Default");
+#else
 						def = new CategoryAttribute ();
+#endif
 				}
 				return def;
 			}
@@ -159,7 +163,11 @@ namespace System.ComponentModel {
 
 				lock (lockobj) {
 					if (drag_drop == null)
+#if NET_2_1
+						drag_drop = new CategoryAttribute ("DragDrop");
+#else
 						drag_drop = new CategoryAttribute ("Drag Drop");
+#endif
 				}
 				return drag_drop;
 			}
@@ -237,7 +245,11 @@ namespace System.ComponentModel {
 
 				lock (lockobj) {
 					if (window_style == null)
+#if NET_2_1
+						window_style = new CategoryAttribute ("WindowStyle");
+#else
 						window_style = new CategoryAttribute ("Window Style");
+#endif
 				}
 				return window_style;
 			}
diff --git a/mcs/class/System/System.ComponentModel/ChangeLog b/mcs/class/System/System.ComponentModel/ChangeLog
index 42f2b70..a9999fb 100644
--- a/mcs/class/System/System.ComponentModel/ChangeLog
+++ b/mcs/class/System/System.ComponentModel/ChangeLog
@@ -1,10 +1,65 @@
+2009-09-29  Alan McGovern  <amcgovern at novell.com>
+
+	* DefaultValueAttribute.cs: Implement the cctor which takes
+	a Type and a string for the SL2 case.
+	* CategoryAttribute.cs: Fix a typo in the CategoryAttribute.Asynchronous
+	ctor and fix some SL2 specific naming changes for the default properties.
+
+2009-09-24  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* EnumConverter.cs: Fix conversion of 0 flag values.
+	[Fixes bug #541402]
+
+2009-06-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* LicenseProviderAttribute.cs: avoid nullref when provider has not
+	been set or cannot be loaded.
+
+2009-06-23  Marek Habersack  <mhabersack at novell.com>
+
+	* TypeDescriptor.cs: do not wrap DefaultTypeDescriptionProvider.
+	Implemented GetAttributes and GetProperties in
+	DefaultTypeDescriptor.
+
+	* AttributeCollection.cs: make sure that attrList is never null.
+
+2009-06-22  Marek Habersack  <mhabersack at novell.com>
+
+	* WeakObjectWrapper.cs, WeakObjectWrapperComparer.cs: added - used
+	by TypeDescriptor for storage of type description providers.
+
+	* TypeDescriptor.cs: implemented part of the 2.0+ API which deals
+	with adding/removing/getting type description providers.
+
+	* AttributeCollection.cs: do not throw NREX when attrList is
+	null in Count.
+
+2009-05-14  Jonathan Pryor  <jpryor at novell.com>
+
+	* ListChangedEventArgs.cs: Fix .NET compatibility problems (discovered
+	  from trying to run the System.Data.Linq unit tests).
+
 2009-04-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* Win32Exception.cs: made W32ErrorMessage internal.
 
-2009-02-21  Jb Evain  <jbevain at novell.com>
+2009-02-28  Zoltan Varga  <vargaz at gmail.com>
+
+	* EventHandlerList.cs: Change this to use a linked list as stated by the
+	MSDN docs.
+
+2009-02-27  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* ReflectionPropertyDescriptor.cs: Don't cache getter and
+	setter properties. Cache instead the PropertyInfo objects
+	that defined them.
+
+	PropertyInfo::Get/SetValue is faster than calling the method
+	throught reflection.	
+
+2009-02-21  Kornél Pál  <kornelpal at gmail.com>
 
-	* EventHandlerList.cs: fix the 1.1 profile.
+	* EventHandlerList.cs: Fix profile 1.x build by not using HandlerEntry.
 
 2009-02-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
diff --git a/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs b/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
index b8872b3..baf1c17 100644
--- a/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
+++ b/mcs/class/System/System.ComponentModel/DefaultValueAttribute.cs
@@ -93,14 +93,19 @@ namespace System.ComponentModel
 
 		public DefaultValueAttribute (Type type, string value)
 		{
+			try {
 #if NET_2_1
-			throw new NotImplementedException ();
+				if (type.IsEnum)
+					DefaultValue = Enum.Parse (type, value);
+				else if (type == typeof (TimeSpan))
+					DefaultValue = TimeSpan.Parse (value);
+				else
+					DefaultValue = Convert.ChangeType (value, type, null);
 #else
-			try {
 				TypeConverter converter = TypeDescriptor.GetConverter (type);
 				DefaultValue = converter.ConvertFromString (null, CultureInfo.InvariantCulture, value);
-			} catch { }
 #endif
+			} catch { }
 		}
 
 #if NET_2_0
diff --git a/mcs/class/System/System.ComponentModel/EnumConverter.cs b/mcs/class/System/System.ComponentModel/EnumConverter.cs
index 59a5c82..a986b22 100644
--- a/mcs/class/System/System.ComponentModel/EnumConverter.cs
+++ b/mcs/class/System/System.ComponentModel/EnumConverter.cs
@@ -116,7 +116,7 @@ namespace System.ComponentModel
 						// looping indefinitely
 						interrupt = true;
 						foreach (long val in enumValues) {
-							if (val != 0 && ((val & valueLong) == val || val == valueLong)) {
+							if ((val != 0 && ((val & valueLong) == val)) || val == valueLong) {
 								enums.Add (Enum.ToObject (type, val));
 								valueLong &= (~val);
 								interrupt = false;
diff --git a/mcs/class/System/System.ComponentModel/EventHandlerList.cs b/mcs/class/System/System.ComponentModel/EventHandlerList.cs
index 4241a1c..9011910 100644
--- a/mcs/class/System/System.ComponentModel/EventHandlerList.cs
+++ b/mcs/class/System/System.ComponentModel/EventHandlerList.cs
@@ -38,6 +38,12 @@ using System.Collections.Generic;
 
 namespace System.ComponentModel {
 
+	internal class ListEntry {
+		public object key;
+		public Delegate value;
+		public ListEntry next;
+	}
+
 	// <summary>
 	//   List of Event delegates.
 	// </summary>
@@ -47,11 +53,8 @@ namespace System.ComponentModel {
 	// </remarks>
 	public sealed class EventHandlerList : IDisposable
 	{
-#if NET_2_0
-		Dictionary <object, Delegate> handlers;
-#else
-		Hashtable handlers;
-#endif
+		ListEntry entries;
+
 		Delegate null_entry;
 
 		public EventHandlerList ()
@@ -62,7 +65,11 @@ namespace System.ComponentModel {
 			get {
 				if (key == null)
 					return null_entry;
-				return FindEntry (key);
+				ListEntry entry = FindEntry (key);
+				if (entry != null)
+					return entry.value;
+				else
+					return null;
 			}
 
 			set {
@@ -77,17 +84,16 @@ namespace System.ComponentModel {
 				return;
 			}
 
-			Delegate prev = FindEntry (key);
-			if (prev == null) {
-				if (handlers == null) {
-#if NET_2_0
-					handlers = new Dictionary <object, Delegate> ();
-#else
-					handlers = new Hashtable ();
-#endif
-				}
+			ListEntry entry = FindEntry (key);
+			if (entry == null) {
+				entry = new ListEntry ();
+				entry.key = key;
+				entry.value = null;
+				entry.next = entries;
+				entries = entry;
 			}
-			handlers [key] = Delegate.Combine (prev, value);
+
+			entry.value = Delegate.Combine (entry.value, value);
 		}
 
 #if NET_2_0
@@ -95,9 +101,12 @@ namespace System.ComponentModel {
 		{
 			if (listToAddFrom == null)
 				return;
-
-			foreach (KeyValuePair <object, Delegate> kvp in listToAddFrom.handlers)
-				AddHandler (kvp.Key, kvp.Value);
+			
+			ListEntry entry = listToAddFrom.entries;
+			while (entry != null) {
+				AddHandler (entry.key, entry.value);
+				entry = entry.next;
+			}
 		}
 #endif
 
@@ -108,31 +117,28 @@ namespace System.ComponentModel {
 				return;
 			}
 
-			Delegate entry = FindEntry (key);
+			ListEntry entry = FindEntry (key);
 			if (entry == null)
 				return;
 
-			handlers [key] = Delegate.Remove (entry, value);
+			entry.value = Delegate.Remove (entry.value, value);
 		}
 
 		public void Dispose ()
 		{
-			handlers = null;
+			entries = null;
 		}
 		
-		private Delegate FindEntry (object key)
+		private ListEntry FindEntry (object key)
 		{
-			if (handlers == null)
-				return null;
-#if NET_2_0
-			Delegate entry;
-			if (handlers.TryGetValue (key, out entry))
-				return entry;
+			ListEntry entry = entries;
+			while (entry != null) {
+				if (entry.key == key)
+					return entry;
+				entry = entry.next;
+			}
 
 			return null;
-#else
-			return handlers [key] as Delegate;
-#endif
 		}
 	}
 }
diff --git a/mcs/class/System/System.ComponentModel/LicenseProviderAttribute.cs b/mcs/class/System/System.ComponentModel/LicenseProviderAttribute.cs
index 791fb80..bba46f0 100644
--- a/mcs/class/System/System.ComponentModel/LicenseProviderAttribute.cs
+++ b/mcs/class/System/System.ComponentModel/LicenseProviderAttribute.cs
@@ -61,7 +61,7 @@ namespace System.ComponentModel
 		public override object TypeId {
 			get {
 				// Seems to be MS implementation
-				return (base.ToString() + Provider.ToString());
+				return (base.ToString() + (Provider != null ? Provider.ToString() : null));
 			}
 		}
 
diff --git a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs b/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
index 5506a44..61d04a6 100644
--- a/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
+++ b/mcs/class/System/System.ComponentModel/ListChangedEventArgs.cs
@@ -42,9 +42,8 @@ namespace System.ComponentModel {
 
 		public ListChangedEventArgs (ListChangedType listChangedType,
 					     int newIndex)
+			: this (listChangedType, newIndex, -1)
 		{
-			this.changedType = listChangedType;
-			this.newIndex = newIndex;
 		}
 	
 		public ListChangedEventArgs (ListChangedType listChangedType,
@@ -71,6 +70,7 @@ namespace System.ComponentModel {
 		{
 			this.changedType = listChangedType;
 			this.newIndex = newIndex;
+			this.oldIndex = newIndex;
 			this.propDesc = propDesc;
 		}
 #endif
diff --git a/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs b/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs
index 74032d9..1b46293 100644
--- a/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs
+++ b/mcs/class/System/System.ComponentModel/ReflectionPropertyDescriptor.cs
@@ -41,7 +41,7 @@ namespace System.ComponentModel
 		PropertyInfo _member;
 		Type _componentType;
 		Type _propertyType;
-		MethodInfo getter, setter;
+		PropertyInfo getter, setter;
 		bool accessors_inited;
 
 		public ReflectionPropertyDescriptor (Type componentType, PropertyDescriptor oldPropertyDescriptor, Attribute [] attributes)
@@ -146,7 +146,7 @@ namespace System.ComponentModel
 		{
 			component = MemberDescriptor.GetInvokee (_componentType, component);
 			InitAccessors ();
-			return getter.Invoke (component, new object[0]);
+			return getter.GetValue (component,  null);
 		}
 
 		DesignerTransaction CreateTransaction (object obj, string description)
@@ -206,21 +206,28 @@ namespace System.ComponentModel
 			if (accessors_inited)
 				return;
 			PropertyInfo prop = GetPropertyInfo ();
+			MethodInfo setterMethod, getterMethod;
+			setterMethod = prop.GetSetMethod (true);
+			getterMethod = prop.GetGetMethod (true);
 
-			setter = prop.GetSetMethod (true);
-			getter = prop.GetGetMethod (true);
+			if (getterMethod != null)
+				getter = prop;
 
-			if (setter != null && getter != null) {//both exist
+			if (setterMethod != null)
+				setter = prop;
+
+
+			if (setterMethod != null && getterMethod != null) {//both exist
 				accessors_inited = true;
 				return;
 			}
-			if (setter == null && getter == null) {//neither exist, this is a broken property
+			if (setterMethod == null && getterMethod == null) {//neither exist, this is a broken property
 				accessors_inited = true;
 				return;
 			}
 
 			//In order to detect that this is a virtual property with override, we check the non null accessor
-			MethodInfo mi = getter != null ? getter : setter;
+			MethodInfo mi = getterMethod != null ? getterMethod : setterMethod;
 
 			if (mi == null || !mi.IsVirtual || (mi.Attributes & MethodAttributes.NewSlot) == MethodAttributes.NewSlot) {
 				accessors_inited = true;
@@ -235,10 +242,17 @@ namespace System.ComponentModel
 										      new Type[0], new ParameterModifier[0]);
 				if (prop == null) //nothing left to search
 					break;
-				if (setter == null)
-					setter = mi = prop.GetSetMethod ();
+				if (setterMethod == null)
+					setterMethod = mi = prop.GetSetMethod ();
 				else
-					getter = mi = prop.GetGetMethod ();
+					getterMethod = mi = prop.GetGetMethod ();
+
+				if (getterMethod != null && getter == null)
+					getter = prop;
+	
+				if (setterMethod != null && setter == null)
+					setter = prop;
+				
 				if (mi != null)
 					break;
 				type = type.BaseType;
@@ -255,7 +269,7 @@ namespace System.ComponentModel
 
 			try {
 				InitAccessors ();
-				setter.Invoke (propertyHolder, new object[] { value });
+				setter.SetValue (propertyHolder, value, null);
 				EndTransaction (component, tran, old, value, true);
 			} catch {
 				EndTransaction (component, tran, old, value, false);
diff --git a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs b/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
index 2a9f4b2..ab40a25 100644
--- a/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
+++ b/mcs/class/System/System.ComponentModel/TypeDescriptor.cs
@@ -39,6 +39,10 @@ using System.Globalization;
 using System.ComponentModel.Design;
 using System.Security.Permissions;
 
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
 namespace System.ComponentModel
 {
 
@@ -51,43 +55,98 @@ public sealed class TypeDescriptor
 	private static Hashtable typeTable = new Hashtable ();
 	private static Hashtable editors;
 
+#if NET_2_0
+	static object typeDescriptionProvidersLock = new object ();
+	static Dictionary <Type, LinkedList <TypeDescriptionProvider>> typeDescriptionProviders;
+
+	static object componentDescriptionProvidersLock = new object ();
+	static Dictionary <WeakObjectWrapper, LinkedList <TypeDescriptionProvider>> componentDescriptionProviders;
+
+	static TypeDescriptor ()
+	{
+		typeDescriptionProviders = new Dictionary <Type, LinkedList <TypeDescriptionProvider>> ();
+		componentDescriptionProviders = new Dictionary <WeakObjectWrapper, LinkedList <TypeDescriptionProvider>> (new WeakObjectWrapperComparer ());
+	}
+#endif
 	private TypeDescriptor ()
 	{
 	}
 
 #if NET_2_0
-	[MonoNotSupported ("")]
+	[MonoNotSupported ("Mono does not support COM")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static Type ComObjectType {
 		get { throw new NotImplementedException (); }
 	}
 
-	[MonoNotSupported("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static TypeDescriptionProvider AddAttributes (object instance, params Attribute [] attributes)
 	{
-		throw new NotImplementedException ();
+		if (instance == null)
+			throw new ArgumentNullException ("instance");
+		if (attributes == null)
+			throw new ArgumentNullException ("attributes");
+
+		var ret = new AttributeProvider (attributes, GetProvider (instance));
+		AddProvider (ret, instance);
+
+		return ret;
 	}
 
-	[MonoNotSupported("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static TypeDescriptionProvider AddAttributes (Type type, params Attribute [] attributes)
 	{
-		throw new NotImplementedException ();
-	}
+		if (type == null)
+			throw new ArgumentNullException ("type");
+		if (attributes == null)
+			throw new ArgumentNullException ("attributes");
 
-	[MonoNotSupported("")]
+		var ret = new AttributeProvider (attributes, GetProvider (type));
+		AddProvider (ret, type);
+		
+		return ret;
+	}
+	
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static void AddProvider (TypeDescriptionProvider provider, object instance)
 	{
-		throw new NotImplementedException ();
+		if (provider == null)
+			throw new ArgumentNullException ("provider");
+		if (instance == null)
+			throw new ArgumentNullException ("instance");
+
+		lock (componentDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+			WeakObjectWrapper instanceWrapper = new WeakObjectWrapper (instance);
+			
+			if (!componentDescriptionProviders.TryGetValue (instanceWrapper, out plist)) {
+				plist = new LinkedList <TypeDescriptionProvider> ();
+				componentDescriptionProviders.Add (new WeakObjectWrapper (instance), plist);
+			}
+
+			plist.AddLast (provider);
+			instanceWrapper = null;
+		}
 	}
 
-	[MonoNotSupported("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static void AddProvider (TypeDescriptionProvider provider, Type type)
 	{
-		throw new NotImplementedException ();
+		if (provider == null)
+			throw new ArgumentNullException ("provider");
+		if (type == null)
+			throw new ArgumentNullException ("type");
+
+		lock (typeDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+
+			if (!typeDescriptionProviders.TryGetValue (type, out plist)) {
+				plist = new LinkedList <TypeDescriptionProvider> ();
+				typeDescriptionProviders.Add (type, plist);
+			}
+
+			plist.AddLast (provider);
+		}
 	}
 
 	[MonoTODO]
@@ -695,32 +754,65 @@ public sealed class TypeDescriptor
 	}
 
 #if NET_2_0
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static TypeDescriptionProvider GetProvider (object instance)
 	{
-		throw new NotImplementedException ();
+		if (instance == null)
+			throw new ArgumentNullException ("instance");
+
+		TypeDescriptionProvider ret = null;
+		lock (componentDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+			WeakObjectWrapper instanceWrapper = new WeakObjectWrapper (instance);
+			
+			if (componentDescriptionProviders.TryGetValue (instanceWrapper, out plist) && plist.Count > 0)
+				ret = plist.Last.Value;
+			
+			instanceWrapper = null;
+		}
+
+		if (ret == null)
+			return new DefaultTypeDescriptionProvider ();
+		else
+			return new WrappedTypeDescriptionProvider (ret);
 	}
 
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static TypeDescriptionProvider GetProvider (Type type)
 	{
-		throw new NotImplementedException ();
+		if (type == null)
+			throw new ArgumentNullException ("type");
+		
+		TypeDescriptionProvider ret = null;
+		lock (typeDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+			
+			if (typeDescriptionProviders.TryGetValue (type, out plist) && plist.Count > 0)
+				ret = plist.Last.Value;
+		}
+
+		if (ret == null)
+			return new DefaultTypeDescriptionProvider ();
+		else
+			return new WrappedTypeDescriptionProvider (ret);
 	}
 
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static Type GetReflectionType (object instance)
 	{
-		throw new NotImplementedException ();
+		if (instance == null)
+			throw new ArgumentNullException ("instance");
+		
+		return instance.GetType ();
 	}
 
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static Type GetReflectionType (Type type)
 	{
-		throw new NotImplementedException ();
+		if (type == null)
+			throw new ArgumentNullException ("type");
+		
+		return type;
 	}
 
 	[MonoNotSupported("Associations not supported")]
@@ -751,18 +843,73 @@ public sealed class TypeDescriptor
 		throw new NotImplementedException ();
 	}
 
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static void RemoveProvider (TypeDescriptionProvider provider, object instance)
 	{
-		throw new NotImplementedException ();
+		if (provider == null)
+			throw new ArgumentNullException ("provider");
+		if (instance == null)
+			throw new ArgumentNullException ("instance");
+
+		bool removed = false;
+		lock (componentDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+			WeakObjectWrapper instanceWrapper = new WeakObjectWrapper (instance);
+
+			if (componentDescriptionProviders.TryGetValue (instanceWrapper, out plist) && plist.Count > 0) {
+				RemoveProvider (provider, plist);
+				removed = true;
+			}
+			
+			instanceWrapper = null;
+		}
+
+		var refreshed = Refreshed;
+		if (refreshed != null)
+			refreshed (new RefreshEventArgs (instance));
 	}
 
-	[MonoNotSupported ("")]
 	[EditorBrowsable (EditorBrowsableState.Advanced)]
 	public static void RemoveProvider (TypeDescriptionProvider provider, Type type)
 	{
-		throw new NotImplementedException ();
+		if (provider == null)
+			throw new ArgumentNullException ("provider");
+		if (type == null)
+			throw new ArgumentNullException ("type");
+
+		bool removed = false;
+		lock (typeDescriptionProvidersLock) {
+			LinkedList <TypeDescriptionProvider> plist;
+
+			if (typeDescriptionProviders.TryGetValue (type, out plist) && plist.Count > 0) {
+				RemoveProvider (provider, plist);
+				removed = true;
+			}
+		}
+
+		var refreshed = Refreshed;
+		if (refreshed != null)
+			refreshed (new RefreshEventArgs (type));
+	}
+
+	static void RemoveProvider (TypeDescriptionProvider provider, LinkedList <TypeDescriptionProvider> plist)
+	{
+		LinkedListNode <TypeDescriptionProvider> node = plist.Last;
+		LinkedListNode <TypeDescriptionProvider> first = plist.First;
+		TypeDescriptionProvider p;
+				
+		do {
+			p = node.Value;
+			if (p == provider) {
+				plist.Remove (node);
+				break;
+			}
+			if (node == first)
+				break;
+					
+			node = node.Previous;
+					
+		} while (true);
 	}
 #endif
 
@@ -874,6 +1021,197 @@ public sealed class TypeDescriptor
 			type = Type.GetType (typeName);
 		return type;
 	}
+
+#if NET_2_0
+	sealed class AttributeProvider : TypeDescriptionProvider
+	{
+		Attribute[] attributes;
+		
+		public AttributeProvider (Attribute[] attributes, TypeDescriptionProvider parent)
+			: base (parent)
+		{
+			this.attributes = attributes;
+		}
+
+		public override ICustomTypeDescriptor GetTypeDescriptor (Type type, object instance)
+		{
+			return new AttributeTypeDescriptor (base.GetTypeDescriptor (type, instance), attributes);
+		}
+		
+		sealed class AttributeTypeDescriptor : CustomTypeDescriptor
+		{
+			Attribute[] attributes;
+			
+			public AttributeTypeDescriptor (ICustomTypeDescriptor parent, Attribute[] attributes)
+				: base (parent)
+			{
+				this.attributes = attributes;
+			}
+
+			public override AttributeCollection GetAttributes ()
+			{
+				AttributeCollection attrs = base.GetAttributes ();
+
+				if (attrs != null && attrs.Count > 0)
+					return AttributeCollection.FromExisting (attrs, attributes);
+				else
+					return new AttributeCollection (attributes);
+			}
+		}
+	}
+
+	sealed class WrappedTypeDescriptionProvider : TypeDescriptionProvider
+	{
+		public TypeDescriptionProvider Wrapped { get; private set; }
+		
+		public WrappedTypeDescriptionProvider (TypeDescriptionProvider wrapped)
+		{
+			Wrapped = wrapped;
+		}
+
+		public override object CreateInstance (IServiceProvider provider, Type objectType, Type[] argTypes, object[] args)
+		{
+			TypeDescriptionProvider wrapped = Wrapped;
+
+			if (wrapped == null)
+				return base.CreateInstance (provider, objectType, argTypes, args);
+			
+			return wrapped.CreateInstance (provider, objectType, argTypes, args);
+		}
+
+		public override IDictionary GetCache (object instance)
+		{
+			TypeDescriptionProvider wrapped = Wrapped;
+
+			if (wrapped == null)
+				return base.GetCache (instance);
+
+			return wrapped.GetCache (instance);
+		}
+
+		public override ICustomTypeDescriptor GetExtendedTypeDescriptor (object instance)
+		{
+			return new DefaultTypeDescriptor (this, null, instance);
+		}
+
+		public override string GetFullComponentName (object component)
+		{
+			TypeDescriptionProvider wrapped = Wrapped;
+
+			if (wrapped == null)
+				return base.GetFullComponentName (component);
+
+			return wrapped.GetFullComponentName (component);
+		}
+
+		public override Type GetReflectionType (Type type, object instance)
+		{
+			TypeDescriptionProvider wrapped = Wrapped;
+
+			if (wrapped == null)
+				return base.GetReflectionType (type, instance);
+
+			return wrapped.GetReflectionType (type, instance);
+		}
+
+		public override ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance)
+		{
+			return new DefaultTypeDescriptor (this, objectType, instance);
+		}
+	}
+
+	// TODO: this needs more work
+	sealed class DefaultTypeDescriptor : CustomTypeDescriptor
+	{
+		TypeDescriptionProvider owner;
+		Type objectType;
+		object instance;
+
+		public DefaultTypeDescriptor (TypeDescriptionProvider owner, Type objectType, object instance)
+		{
+			this.owner = owner;
+			this.objectType = objectType;
+			this.instance = instance;
+		}
+
+		public override AttributeCollection GetAttributes ()
+		{
+			var wrapped = owner as WrappedTypeDescriptionProvider;
+
+			if (wrapped != null)
+				return wrapped.Wrapped.GetTypeDescriptor (objectType, instance).GetAttributes ();
+
+			if (instance != null)
+				return TypeDescriptor.GetAttributes (instance, false);
+
+			if (objectType != null)
+				return TypeDescriptor.GetTypeInfo (objectType).GetAttributes ();
+			
+			return base.GetAttributes ();
+		}
+		
+		public override string GetClassName ()
+		{
+			var wrapped = owner as WrappedTypeDescriptionProvider;
+
+			if (wrapped != null)
+				return wrapped.Wrapped.GetTypeDescriptor (objectType, instance).GetClassName ();
+
+			return base.GetClassName ();
+		}
+
+		public override PropertyDescriptor GetDefaultProperty ()
+		{
+			var wrapped = owner as WrappedTypeDescriptionProvider;
+
+			if (wrapped != null)
+				return wrapped.Wrapped.GetTypeDescriptor (objectType, instance).GetDefaultProperty ();
+
+			PropertyDescriptor ret;
+			if (objectType != null)
+				ret = TypeDescriptor.GetTypeInfo (objectType).GetDefaultProperty ();
+			else if (instance != null)
+				ret = TypeDescriptor.GetTypeInfo (instance.GetType ()).GetDefaultProperty ();
+			else
+				ret = base.GetDefaultProperty ();
+
+			return ret;
+		}
+
+		public override PropertyDescriptorCollection GetProperties ()
+		{
+			var wrapped = owner as WrappedTypeDescriptionProvider;
+
+			if (wrapped != null)
+				return wrapped.Wrapped.GetTypeDescriptor (objectType, instance).GetProperties ();
+
+			if (instance != null)
+				return TypeDescriptor.GetProperties (instance, null, false);
+
+			if (objectType != null)
+				return TypeDescriptor.GetTypeInfo (objectType).GetProperties (null);
+
+			return base.GetProperties ();
+		}		
+	}
+
+	sealed class DefaultTypeDescriptionProvider : TypeDescriptionProvider
+	{
+		public DefaultTypeDescriptionProvider ()
+		{
+		}
+
+		public override ICustomTypeDescriptor GetExtendedTypeDescriptor (object instance)
+		{
+			return new DefaultTypeDescriptor (this, null, instance);
+		}
+
+		public override ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance)
+		{
+			return new DefaultTypeDescriptor (this, objectType, instance);
+		}
+	}
+#endif
 }
 
 	internal abstract class Info
diff --git a/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs b/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs
new file mode 100644
index 0000000..8bf4269
--- /dev/null
+++ b/mcs/class/System/System.ComponentModel/WeakObjectWrapper.cs
@@ -0,0 +1,51 @@
+//
+// System.ComponentModel.WeakObjectWrapper.cs
+//
+// Authors:
+//   Marek Habersack <mhabersack at novell.com>
+// 
+//
+// (C) 2009 Novell, Inc (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System.ComponentModel
+{
+	sealed class WeakObjectWrapper
+	{
+		public int TargetHashCode { get; private set; }
+		public WeakReference Weak { get; private set; }
+	
+		public WeakObjectWrapper (object target)
+		{
+			TargetHashCode = target.GetHashCode ();
+			Weak = new WeakReference (target);
+		}
+	}
+}
+#endif
\ No newline at end of file
diff --git a/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs b/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs
new file mode 100644
index 0000000..830ced2
--- /dev/null
+++ b/mcs/class/System/System.ComponentModel/WeakObjectWrapperComparer.cs
@@ -0,0 +1,67 @@
+//
+// System.ComponentModel.WeakObjectWrapperComparer.cs
+//
+// Authors:
+//   Marek Habersack <mhabersack at novell.com>
+// 
+//
+// (C) 2009 Novell, Inc (http://novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System.ComponentModel
+{
+	sealed class WeakObjectWrapperComparer : EqualityComparer <WeakObjectWrapper>
+	{
+		public override bool Equals (WeakObjectWrapper x, WeakObjectWrapper y)
+		{
+			if (x == null && y == null)
+				return false;
+
+			if (x == null || y == null)
+				return false;
+
+			WeakReference xWeak = x.Weak;
+			WeakReference yWeak = y.Weak;
+			
+			if (!xWeak.IsAlive && !yWeak.IsAlive)
+				return false;
+
+			return xWeak.Target == yWeak.Target;
+		}
+
+		public override int GetHashCode (WeakObjectWrapper obj)
+		{
+			if (obj == null)
+				return 0;
+
+			return obj.TargetHashCode;
+		}
+	}
+}
+#endif
diff --git a/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs b/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs
index b5967cd..9e96e49 100644
--- a/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs
+++ b/mcs/class/System/System.Configuration/ApplicationSettingsBase.cs
@@ -94,12 +94,13 @@ namespace System.Configuration {
 		public void Reset()
 		{
 #if (CONFIGURATION_DEP)
-			foreach (SettingsProvider provider in Providers) {
-				IApplicationSettingsProvider iasp = provider as IApplicationSettingsProvider;
-				if (iasp != null)
-					iasp.Reset (Context);
-			}
-
+			// Code bellow is identical to code in Reload().
+			// foreach (SettingsProvider provider in Providers) {
+			//         IApplicationSettingsProvider iasp = provider as IApplicationSettingsProvider;
+			//         if (iasp != null)
+			//		iasp.Reset (Context);
+			// }
+                                                
 			Reload ();
 #endif
 		}
diff --git a/mcs/class/System/System.Configuration/ChangeLog b/mcs/class/System/System.Configuration/ChangeLog
index d1affb8..7b36975 100644
--- a/mcs/class/System/System.Configuration/ChangeLog
+++ b/mcs/class/System/System.Configuration/ChangeLog
@@ -1,3 +1,17 @@
+2009-08-31 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* CustomizableFileSettingsProvider.cs: reset the property value
+	instead of using the DefaultValue.
+	* SettingsPropertyValue.cs: new Reset() method.
+	* ApplicationSettingsBase.cs: Reset happens in Reload().
+	Patch by Andrew Kurochka that fixes bug #532180.
+
+2009-06-18 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* IriParsingElement.cs:
+	* UriSection.cs:
+	* IdnElement.cs: new files that parse <uri> and subelements.
+
 2009-05-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* CustomizableFileSettingsProvider.cs: make sure 'values' is
diff --git a/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs b/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs
index 49e6238..a1ffe54 100644
--- a/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs
+++ b/mcs/class/System/System.Configuration/CustomizableFileSettingsProvider.cs
@@ -837,8 +837,9 @@ namespace System.Configuration
 			SettingsPropertyCollection coll = new SettingsPropertyCollection ();
 			GetPropertyValues (context, coll);
 			foreach (SettingsPropertyValue propertyValue in values) {
-				propertyValue.PropertyValue = propertyValue.Property.DefaultValue;
-				propertyValue.IsDirty = true;
+				// Can't use propertyValue.Property.DefaultValue
+				// as it may cause InvalidCastException (see bug# 532180)
+				propertyValue.PropertyValue = propertyValue.Reset ();
 			}
 			SetPropertyValues (context, values);
 		}
diff --git a/mcs/class/System/System.Configuration/IdnElement.cs b/mcs/class/System/System.Configuration/IdnElement.cs
new file mode 100644
index 0000000..eaef8fb
--- /dev/null
+++ b/mcs/class/System/System.Configuration/IdnElement.cs
@@ -0,0 +1,79 @@
+//
+// System.Configuration.IdnElement.cs
+//
+// Authors:
+//	Gonzalo Paniagua Javier (gonzalo at novell.com)
+//
+// (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0 && CONFIGURATION_DEP
+using System;
+
+namespace System.Configuration
+{
+	public sealed class IdnElement : ConfigurationElement
+	{
+		static ConfigurationPropertyCollection properties;
+		static ConfigurationProperty enabled_prop;
+
+		static IdnElement ()
+		{
+			enabled_prop = new ConfigurationProperty ("enabled", typeof (UriIdnScope), UriIdnScope.None, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+			properties = new ConfigurationPropertyCollection ();
+			properties.Add (enabled_prop);
+		}
+
+		public IdnElement ()
+		{
+		}
+
+		[ConfigurationPropertyAttribute("enabled", DefaultValue = UriIdnScope.None,
+					Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
+		public UriIdnScope Enabled {
+			get { return (UriIdnScope) base [enabled_prop]; }
+			set { base [enabled_prop] = value; }
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get { return properties; }
+		}
+
+		public override bool Equals (object o)
+		{
+			IdnElement e = o as IdnElement;
+			if (e == null)
+				return false;
+
+			return e.Enabled == Enabled;
+		}
+
+		public override int GetHashCode ()
+		{
+			return (int) Enabled ^ 0x7F;
+		}
+	}
+
+}
+
+#endif
+
diff --git a/mcs/class/System/System.Configuration/IriParsingElement.cs b/mcs/class/System/System.Configuration/IriParsingElement.cs
new file mode 100644
index 0000000..38dddbf
--- /dev/null
+++ b/mcs/class/System/System.Configuration/IriParsingElement.cs
@@ -0,0 +1,79 @@
+//
+// System.Configuration.IriParsingElement.cs
+//
+// Authors:
+//	Gonzalo Paniagua Javier (gonzalo at novell.com)
+//
+// (c) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0 && CONFIGURATION_DEP
+using System;
+
+namespace System.Configuration
+{
+	public sealed class IriParsingElement : ConfigurationElement
+	{
+		static ConfigurationPropertyCollection properties;
+		static ConfigurationProperty enabled_prop;
+
+		static IriParsingElement ()
+		{
+			enabled_prop = new ConfigurationProperty ("enabled", typeof (bool), false, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+			properties = new ConfigurationPropertyCollection ();
+			properties.Add (enabled_prop);
+		}
+
+		public IriParsingElement ()
+		{
+		}
+
+		[ConfigurationProperty ("enabled", DefaultValue = false,
+					Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
+		public bool Enabled {
+			get { return (bool) base [enabled_prop]; }
+			set { base [enabled_prop] = value; }
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get { return properties; }
+		}
+
+		public override bool Equals (object o)
+		{
+			IriParsingElement e = o as IriParsingElement;
+			if (e == null)
+				return false;
+
+			return e.Enabled == Enabled;
+		}
+
+		public override int GetHashCode ()
+		{
+			return Convert.ToInt32 (Enabled) ^ 0x7F;
+		}
+	}
+
+}
+
+#endif
+
diff --git a/mcs/class/System/System.Configuration/SettingsPropertyValue.cs b/mcs/class/System/System.Configuration/SettingsPropertyValue.cs
index d71f606..90e7973 100644
--- a/mcs/class/System/System.Configuration/SettingsPropertyValue.cs
+++ b/mcs/class/System/System.Configuration/SettingsPropertyValue.cs
@@ -160,6 +160,15 @@ namespace System.Configuration
 			}
 		}
 
+		internal object Reset ()
+		{
+			propertyValue = GetDeserializedDefaultValue ();
+			dirty = true;
+			defaulted = true;
+			needPropertyValue = true;
+			return propertyValue;
+		}
+
 		private object GetDeserializedDefaultValue ()
 		{
 			if (property.DefaultValue == null)
diff --git a/mcs/class/System/System.Configuration/UriSection.cs b/mcs/class/System/System.Configuration/UriSection.cs
new file mode 100644
index 0000000..ab9ac84
--- /dev/null
+++ b/mcs/class/System/System.Configuration/UriSection.cs
@@ -0,0 +1,83 @@
+//
+// UriSection.cs
+//
+// Authors:
+//	Gonzalo Paniagua Javier (gonzalo at novell.com)
+//
+// (c) 2009 Novell, Inc. (http://www.novell.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0 && CONFIGURATION_DEP
+
+using System.Configuration;
+
+namespace System.Configuration 
+{
+	public sealed class UriSection : ConfigurationSection
+	{
+		#region Fields
+
+		static ConfigurationPropertyCollection properties;
+		static ConfigurationProperty idn_prop;
+		static ConfigurationProperty iriParsing_prop;
+
+		#endregion // Fields
+
+		#region Constructors
+
+		static UriSection ()
+		{
+			idn_prop = new ConfigurationProperty ("idn", typeof (IdnElement), null);
+			iriParsing_prop = new ConfigurationProperty ( "iriParsing", typeof (IriParsingElement), null);
+			properties = new ConfigurationPropertyCollection ();
+			properties.Add (idn_prop);
+			properties.Add (iriParsing_prop);
+		}
+
+		public UriSection ()
+		{
+		}
+
+		#endregion // Constructors
+
+		#region Properties
+
+		[ConfigurationProperty ("idn")]
+		public IdnElement Idn {
+			get { return (IdnElement) base [idn_prop]; }
+		}
+
+		[ConfigurationProperty ("iriParsing")]
+		public IriParsingElement IriParsing {
+			get { return (IriParsingElement) base [iriParsing_prop]; }
+		}
+
+		protected override ConfigurationPropertyCollection Properties {
+			get { return properties; }
+		}
+
+		#endregion // Properties
+	}
+}
+
+#endif
diff --git a/mcs/class/System/System.Diagnostics/ChangeLog b/mcs/class/System/System.Diagnostics/ChangeLog
index 90bcd49..e3557d3 100644
--- a/mcs/class/System/System.Diagnostics/ChangeLog
+++ b/mcs/class/System/System.Diagnostics/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-12  Zoltan Varga  <vargaz at gmail.com>
+
+	* Process.cs (Dispose): Close the async output/error readers. Fixes #545429.
+
+2009-07-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ProcessStartInfo.cs: HaveEnvVars is enabled by just using the
+	EnvironmentVariables property. Bug #520650 fixed.
+
 2009-04-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* ConsoleTraceListener.cs: add an internal constructor that takes a
diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs
index a26719e..60af0e6 100644
--- a/mcs/class/System/System.Diagnostics/Process.cs
+++ b/mcs/class/System/System.Diagnostics/Process.cs
@@ -1378,7 +1378,7 @@ namespace System.Diagnostics {
 			internal int error;
 			public int operation = 8; // MAGIC NUMBER: see Socket.cs:AsyncOperation
 			public object ares;
-
+			public int EndCalled;
 
 			// These fields are not in SocketAsyncResult
 			Process process;
@@ -1477,6 +1477,10 @@ namespace System.Diagnostics {
 					}
 				}
 			}
+
+			public void Close () {
+				stream.Close ();
+			}
 		}
 
 		AsyncModes async_mode;
@@ -1582,6 +1586,15 @@ namespace System.Diagnostics {
 				// dispose all managed resources.
 				if(disposing) {
 					// Do stuff here
+					lock (this) {
+#if NET_2_0
+						/* These have open FileStreams on the pipes we are about to close */
+						if (async_output != null)
+							async_output.Close ();
+						if (async_error != null)
+							async_error.Close ();
+#endif
+					}
 				}
 				
 				// Release unmanaged resources
diff --git a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
index f47c402..1d7e4fe 100644
--- a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
+++ b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs
@@ -131,7 +131,7 @@ namespace System.Diagnostics
 		}
 		
 		internal bool HaveEnvVars {
-			get { return (envVars != null && envVars.Count > 0); }
+			get { return (envVars != null); }
 		}
 		
 		[DefaultValue (false)]
diff --git a/mcs/class/System/System.IO.Compression/ChangeLog b/mcs/class/System/System.IO.Compression/ChangeLog
index 7bc9bc1..0a63cf7 100644
--- a/mcs/class/System/System.IO.Compression/ChangeLog
+++ b/mcs/class/System/System.IO.Compression/ChangeLog
@@ -1,3 +1,16 @@
+2009-09-14 Jonathan Pryor <jpryor at novell.com>
+
+	* DeflateStream.cs: MonoTouch reverse callbacks need to be static
+	  methods and be annotated with [MonoPInvokeCallback].  Get things
+	  working with these limitations.
+
+2009-07-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* GzipStream.cs: fixed Dispose (bool).
+	* DeflateStream.cs: simplify the interface with unmanaged code, big
+	reduction of managaed<->unmanaged round trips.
+	Also fixes bug #523418.
+
 2007-09-22  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* DeflateStream.cs: Avoid double free. Fixes bug #327480.
diff --git a/mcs/class/System/System.IO.Compression/DeflateStream.cs b/mcs/class/System/System.IO.Compression/DeflateStream.cs
index beb36c5..2e40030 100644
--- a/mcs/class/System/System.IO.Compression/DeflateStream.cs
+++ b/mcs/class/System/System.IO.Compression/DeflateStream.cs
@@ -4,8 +4,28 @@
 //
 // Authors:
 //	Christopher James Lahey <clahey at ximian.com>
+//	Gonzalo Paniagua Javier (gonzalo at novell.com)
 //
-// (c) 2004 Novell, Inc. <http://www.novell.com>
+// (c) Copyright 2004,2009 Novell, Inc. <http://www.novell.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
 #if NET_2_0
@@ -17,188 +37,161 @@ using System.Runtime.Remoting.Messaging;
 namespace System.IO.Compression {
 	public class DeflateStream : Stream
 	{
-		private Stream compressedStream;
-		private CompressionMode mode;
-		private bool leaveOpen;
-		private bool open;
-		private IntPtr z_stream;
-
-		private const int BUFFER_SIZE = 4096;
-		private IntPtr sized_buffer;
-		static int bytes_read = 0;
-		private bool finished = false;
-		private enum ZReturnConsts {
-			Z_OK = 0,
-			Z_STREAM_END = 1,
-			Z_NEED_DICT = 2,
-			Z_STREAM_ERROR = -2,
-			Z_DATA_ERROR = -3,
-			Z_MEM_ERROR = -4,
-			Z_BUF_ERROR = -5,
+		const int BufferSize = 4096;
+		delegate int UnmanagedReadOrWrite (IntPtr buffer, int length);
+		delegate int ReadMethod (byte[] array, int offset, int count);
+		delegate void WriteMethod (byte[] array, int offset, int count);
+
+		Stream base_stream;
+		CompressionMode mode;
+		bool leaveOpen;
+		bool disposed;
+		UnmanagedReadOrWrite feeder; // This will be passed to unmanaged code and used there
+		IntPtr z_stream;
+		byte [] io_buffer;
+
+		GCHandle data;
+
+		public DeflateStream (Stream compressedStream, CompressionMode mode) :
+			this (compressedStream, mode, false, false)
+		{
+		}
+
+		public DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen) :
+			this (compressedStream, mode, leaveOpen, false)
+		{
 		}
-		private enum ZFlushConsts {
-			Z_NO_FLUSH     = 0,
-			Z_PARTIAL_FLUSH = 1, /* will be removed, use Z_SYNC_FLUSH instead */
-			Z_SYNC_FLUSH    = 2,
-			Z_FULL_FLUSH    = 3,
-			Z_FINISH        = 4,
-			Z_BLOCK         = 5,
-		};
-
-		[DllImport("MonoPosixHelper")]
-		static extern IntPtr create_z_stream(CompressionMode compress, bool gzip);
-		[DllImport("MonoPosixHelper")]
-		static extern void free_z_stream(IntPtr z_stream, CompressionMode compress );
-		[DllImport("MonoPosixHelper")]
-		static extern void z_stream_set_next_in(IntPtr z_stream, IntPtr next_in);
-		[DllImport("MonoPosixHelper")]
-		static extern void z_stream_set_avail_in(IntPtr z_stream, int avail_in);
-		[DllImport("MonoPosixHelper")]
-		static extern int z_stream_get_avail_in(IntPtr z_stream);
-		[DllImport("MonoPosixHelper")]
-		static extern void z_stream_set_next_out(IntPtr z_stream, IntPtr next_out);
-		//[DllImport("MonoPosixHelper")]
-		//static extern void z_stream_set_avail_out(IntPtr z_stream, int avail_out);
-		[DllImport("MonoPosixHelper")]
-		static extern ZReturnConsts z_stream_inflate(IntPtr z_stream, ref int avail_out);
-		[DllImport("MonoPosixHelper")]
-		static extern ZReturnConsts z_stream_deflate(IntPtr z_stream, ZFlushConsts flush, IntPtr next_out, ref int avail_out);
-		delegate int  ReadMethod (byte[] array, int offset, int count);
-		delegate void WriteMethod(byte[] array, int offset, int count);
 
 		internal DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen, bool gzip)
 		{
 			if (compressedStream == null)
 				throw new ArgumentNullException ("compressedStream");
 
-			switch (mode) {
-			case CompressionMode.Compress:
-			case CompressionMode.Decompress:
-				break;
-			default:
+			if (mode != CompressionMode.Compress && mode != CompressionMode.Decompress)
 				throw new ArgumentException ("mode");
-			}
 
-			this.compressedStream = compressedStream;
-			this.mode = mode;
-			this.leaveOpen = leaveOpen;
-			this.sized_buffer = Marshal.AllocHGlobal (BUFFER_SIZE);
-			this.z_stream = create_z_stream (mode, gzip);
+			this.data = GCHandle.Alloc (this);
+			this.base_stream = compressedStream;
+			this.feeder = (mode == CompressionMode.Compress) ? new UnmanagedReadOrWrite (UnmanagedWrite) :
+									   new UnmanagedReadOrWrite (UnmanagedRead);
+			this.z_stream = CreateZStream (mode, gzip, feeder, GCHandle.ToIntPtr (data));
 			if (z_stream == IntPtr.Zero) {
+				this.base_stream = null;
+				this.feeder = null;
 				throw new NotImplementedException ("Failed to initialize zlib. You probably have an old zlib installed. Version 1.2.0.4 or later is required.");
 			}
-			this.open = true;
-			if (mode == CompressionMode.Compress) {
-				Flush();
-			}
+			this.mode = mode;
+			this.leaveOpen = leaveOpen;
 		}
 
-		public DeflateStream (Stream compressedStream, CompressionMode mode) :
-			this (compressedStream, mode, false, false) { }
-
-		public DeflateStream (Stream compressedStream, CompressionMode mode, bool leaveOpen) :
-			this (compressedStream, mode, leaveOpen, false) { }
-
 		protected override void Dispose (bool disposing)
 		{
-			if (!open) {
-				base.Dispose (disposing);
-				return;
+			if (disposing && !disposed) {
+				disposed = true;
+				IntPtr zz = z_stream;
+				z_stream = IntPtr.Zero;
+				int res = 0;
+				if (zz != IntPtr.Zero)
+					res = CloseZStream (zz); // This will Flush() the remaining output if any
+
+				io_buffer = null;
+				if (!leaveOpen) {
+					Stream st = base_stream;
+					if (st != null)
+						st.Close ();
+					base_stream = null;
+				}
+				CheckResult (res, "Dispose");
 			}
 
-			try {
-				FlushInternal (true);
-				base.Dispose (disposing);
-			} finally {
-				try {
-					DisposeCore ();
-				} finally {
-					if (disposing)
-						Marshal.FreeHGlobal (sized_buffer);
-				}
+			if (data.IsAllocated) {
+				data.Free ();
+				data = new GCHandle ();
 			}
+
+			base.Dispose (disposing);
+		}
+
+#if MONOTOUCH
+		[MonoPInvokeCallback (typeof (UnmanagedReadOrWrite))]
+#endif
+		static int UnmanagedRead (IntPtr buffer, int length, IntPtr data)
+		{
+			GCHandle s = GCHandle.FromIntPtr (data);
+			var self = s.Target as DeflateStream;
+			if (self == null)
+				return -1;
+			return self.UnmanagedRead (buffer, length);
 		}
 
-		void DisposeCore ()
+		int UnmanagedRead (IntPtr buffer, int length)
 		{
-			if (/*mode == CompressionMode.Decompress &&*/ compressedStream.CanSeek) {
-				int avail_in = z_stream_get_avail_in (z_stream);
-				if (avail_in != 0) {
-					compressedStream.Seek (- avail_in, SeekOrigin.Current);
-					z_stream_set_avail_in (z_stream, 0);
+			int total = 0;
+			int n = 1;
+			while (length > 0 && n > 0) {
+				if (io_buffer == null)
+					io_buffer = new byte [BufferSize];
+
+				int count = Math.Min (length, io_buffer.Length);
+				n = base_stream.Read (io_buffer, 0, count);
+				if (n > 0) {
+					Marshal.Copy (io_buffer, 0, buffer, n);
+					unsafe {
+						buffer = new IntPtr ((byte *) buffer.ToPointer () + n);
+					}
+					length -= n;
+					total += n;
 				}
 			}
+			return total;
+		}
 
-			free_z_stream (z_stream,mode);
-			z_stream = IntPtr.Zero;
+#if MONOTOUCH
+		[MonoPInvokeCallback (typeof (UnmanagedReadOrWrite))]
+#endif
+		static int UnmanagedWrite (IntPtr buffer, int length, IntPtr data)
+		{
+			GCHandle s = GCHandle.FromIntPtr (data);
+			var self = s.Target as DeflateStream;
+			if (self == null)
+				return -1;
+			return self.UnmanagedWrite (buffer, length);
+		}
 
-			if (!leaveOpen) {
-				compressedStream.Close();
+		int UnmanagedWrite (IntPtr buffer, int length)
+		{
+			int total = 0;
+			while (length > 0) {
+				if (io_buffer == null)
+					io_buffer = new byte [BufferSize];
+
+				int count = Math.Min (length, io_buffer.Length);
+				Marshal.Copy (buffer, io_buffer, 0, count);
+				base_stream.Write (io_buffer, 0, count);
+				unsafe {
+					buffer = new IntPtr ((byte *) buffer.ToPointer () + count);
+				}
+				length -= count;
+				total += count;
 			}
-
-			open = false;
+			return total;
 		}
 
-		private int ReadInternal(byte[] array, int offset, int count) {
-			int buffer_size;
-			if (finished)
-				return 0;
-
-			if (compressedStream.CanSeek)
-				buffer_size = BUFFER_SIZE;
-			else
-				buffer_size = 1;
-
-			IntPtr buffer = Marshal.AllocHGlobal(count);
-			try {
-				int avail_out;
-
-				avail_out = count;
-				z_stream_set_next_out (z_stream, buffer);
-
-				while (avail_out != 0 && !finished) {
-					if (z_stream_get_avail_in (z_stream) == 0) {
-						byte[] read_buf = new byte[buffer_size];
-						int length_read = compressedStream.Read (read_buf, 0, buffer_size);
-						bytes_read += length_read;
-						if (length_read == 0) {
-							break;
-						}
-						Marshal.Copy (read_buf, 0, sized_buffer, length_read);
-						z_stream_set_next_in (z_stream, sized_buffer);
-						z_stream_set_avail_in (z_stream, length_read);
-					}
-					ZReturnConsts ret_val = z_stream_inflate(z_stream, ref avail_out);
-					switch (ret_val) {
-					case ZReturnConsts.Z_OK:
-						break;
-					case ZReturnConsts.Z_STREAM_END:
-						finished = true;
-						break;
-					case ZReturnConsts.Z_NEED_DICT:
-						throw new InvalidDataException ("ZLib stream requires a dictionary.");
-					case ZReturnConsts.Z_DATA_ERROR:
-						throw new InvalidDataException ("Invalid ZLib data.");
-					case ZReturnConsts.Z_STREAM_ERROR:
-						throw new InvalidOperationException ("Internal DeflateStream error.");
-					case ZReturnConsts.Z_MEM_ERROR:
-						throw new OutOfMemoryException ();
-					case ZReturnConsts.Z_BUF_ERROR:
-						throw new InvalidOperationException ("Internal DeflateStream error: Buf error.");
-					}
-				}
-				if (count != avail_out)
-					Marshal.Copy (buffer, array, offset, count - avail_out);
-				return count - avail_out; 
-			} finally {
-				Marshal.FreeHGlobal(buffer);
+		unsafe int ReadInternal (byte[] array, int offset, int count)
+		{
+			int result = 0;
+			fixed (byte *b = array) {
+				IntPtr ptr = new IntPtr (b + offset);
+				result = ReadZStream (z_stream, ptr, count);
 			}
+			CheckResult (result, "ReadInternal");
+			return result;
 		}
 
 		public override int Read (byte[] dest, int dest_offset, int count)
 		{
-			if (!open)
-				throw new ObjectDisposedException ("DeflateStream");
+			if (disposed)
+				throw new ObjectDisposedException (GetType ().FullName);
 			if (dest == null)
 				throw new ArgumentNullException ("Destination array is null.");
 			if (!CanRead)
@@ -214,51 +207,20 @@ namespace System.IO.Compression {
 			return ReadInternal (dest, dest_offset, count);
 		}
 
-
-		private ZReturnConsts do_deflate (ZFlushConsts flush, out int avail_out) {
-			avail_out = BUFFER_SIZE;
-			ZReturnConsts ret_val = z_stream_deflate (z_stream, flush, sized_buffer, ref avail_out);
-			switch (ret_val) {
-			case ZReturnConsts.Z_STREAM_ERROR:
-				throw new InvalidOperationException ("Internal error.");
-			case ZReturnConsts.Z_MEM_ERROR:
-				throw new InvalidOperationException ("Memory error.");
-			}
-			return ret_val;
-		}
-
-		private void WriteInternal(byte[] array, int offset, int count) {
-			IntPtr buffer = Marshal.AllocHGlobal(count);
-			try {
-				int avail_in;
-
-				avail_in = count;
-
-				Marshal.Copy (array, offset, buffer, count);
-				z_stream_set_next_in (z_stream, buffer);
-				z_stream_set_avail_in (z_stream, avail_in);
-				while (avail_in != 0) {
-					int avail_out;
-				
-					do_deflate (ZFlushConsts.Z_NO_FLUSH, out avail_out);
-
-					if (avail_out != BUFFER_SIZE) {
-						byte[] output = new byte[BUFFER_SIZE - avail_out];
-						Marshal.Copy (sized_buffer, output, 0, BUFFER_SIZE - avail_out);
-						compressedStream.Write(output, 0, BUFFER_SIZE - avail_out);
-					}
-
-					avail_in = z_stream_get_avail_in (z_stream);
-				}
-			} finally {
-				Marshal.FreeHGlobal(buffer);
+		unsafe void WriteInternal (byte[] array, int offset, int count)
+		{
+			int result = 0;
+			fixed (byte *b = array) {
+				IntPtr ptr = new IntPtr (b + offset);
+				result = WriteZStream (z_stream, ptr, count);
 			}
+			CheckResult (result, "WriteInternal");
 		}
 
 		public override void Write (byte[] src, int src_offset, int count)
 		{
-			if (!open)
-				throw new ObjectDisposedException ("DeflateStream");
+			if (disposed)
+				throw new ObjectDisposedException (GetType ().FullName);
 
 			if (src == null)
 				throw new ArgumentNullException ("src");
@@ -275,55 +237,61 @@ namespace System.IO.Compression {
 			WriteInternal (src, src_offset, count);
 		}
 
-		private void FlushInternal (bool finish) 
+		static void CheckResult (int result, string where)
 		{
-			if (!open)
-				throw new ObjectDisposedException ("DeflateStream");
-
-			int avail_out;
-			ZReturnConsts ret_val;
-
-			if (!(open && mode == CompressionMode.Compress && compressedStream.CanWrite))
+			if (result >= 0)
 				return;
 
-			z_stream_set_next_in (z_stream, IntPtr.Zero);
-			z_stream_set_avail_in (z_stream, 0);
-
-			while (true) {
-				ret_val = do_deflate (finish ? ZFlushConsts.Z_FINISH : ZFlushConsts.Z_SYNC_FLUSH, out avail_out);
-
-				if (BUFFER_SIZE != avail_out) {
-					byte[] output = new byte[BUFFER_SIZE - avail_out];
-					Marshal.Copy (sized_buffer, output, 0, BUFFER_SIZE - avail_out);
-					compressedStream.Write(output, 0, BUFFER_SIZE - avail_out);
-				} else {
-					if (!finish)
-						break;
-				}
-				if (ret_val == ZReturnConsts.Z_STREAM_END)
-					break;
+			string error;
+			switch (result) {
+			case -1: // Z_ERRNO
+				error = "Unknown error"; // Marshal.GetLastWin32() ?
+				break;
+			case -2: // Z_STREAM_ERROR
+				error = "Internal error";
+				break;
+			case -3: // Z_DATA_ERROR
+				error = "Corrupted data";
+				break;
+			case -4: // Z_MEM_ERROR
+				error = "Not enough memory";
+				break;
+			case -5: // Z_BUF_ERROR
+				error = "Internal error (no progress possible)";
+				break;
+			case -6: // Z_VERSION_ERROR
+				error = "Invalid version";
+				break;
+			case -10:
+				error = "Invalid argument(s)";
+				break;
+			case -11:
+				error = "IO error";
+				break;
+			default:
+				error = "Unknown error";
+				break;
 			}
 
-			compressedStream.Flush();
-		}
-
-		public override void Flush () {
-			FlushInternal (false);
+			throw new IOException (error + " " + where);
 		}
 
-		public override long Seek (long offset, SeekOrigin origin) {
-			throw new System.NotSupportedException();
-		}
+		public override void Flush ()
+		{
+			if (disposed)
+				throw new ObjectDisposedException (GetType ().FullName);
 
-		public override void SetLength (long value) {
-			throw new System.NotSupportedException();
+			if (CanWrite) {
+				int result = Flush (z_stream);
+				CheckResult (result, "Flush");
+			}
 		}
 
 		public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
 							AsyncCallback cback, object state)
 		{
-			if (!open)
-				throw new ObjectDisposedException ("DeflateStream");
+			if (disposed)
+				throw new ObjectDisposedException (GetType ().FullName);
 
 			if (!CanRead)
 				throw new NotSupportedException ("This stream does not support reading");
@@ -347,8 +315,8 @@ namespace System.IO.Compression {
 		public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
 							AsyncCallback cback, object state)
 		{
-			if (!open)
-				throw new ObjectDisposedException ("DeflateStream");
+			if (disposed)
+				throw new ObjectDisposedException (GetType ().FullName);
 
 			if (!CanWrite)
 				throw new InvalidOperationException ("This stream does not support writing");
@@ -369,7 +337,8 @@ namespace System.IO.Compression {
 			return w.BeginInvoke (buffer, offset, count, cback, state);			
 		}
 
-		public override int EndRead(IAsyncResult async_result) {
+		public override int EndRead(IAsyncResult async_result)
+		{
 			if (async_result == null)
 				throw new ArgumentNullException ("async_result");
 
@@ -401,39 +370,62 @@ namespace System.IO.Compression {
 			return;
 		}
 
+		public override long Seek (long offset, SeekOrigin origin)
+		{
+			throw new NotSupportedException();
+		}
+
+		public override void SetLength (long value)
+		{
+			throw new NotSupportedException();
+		}
+
 		public Stream BaseStream {
-			get {
-				return compressedStream;
-			}
+			get { return base_stream; }
 		}
+
 		public override bool CanRead {
-			get {
-				return open && mode == CompressionMode.Decompress && compressedStream.CanRead;
-			}
+			get { return !disposed && mode == CompressionMode.Decompress && base_stream.CanRead; }
 		}
+
 		public override bool CanSeek {
-			get {
-				return false;
-			}
+			get { return false; }
 		}
+
 		public override bool CanWrite {
-			get {
-				return open && mode == CompressionMode.Compress && compressedStream.CanWrite;
-			}
+			get { return !disposed && mode == CompressionMode.Compress && base_stream.CanWrite; }
 		}
+
 		public override long Length {
-			get {
-				throw new System.NotSupportedException();
-			}
+			get { throw new NotSupportedException(); }
 		}
+
 		public override long Position {
-			get {
-				throw new System.NotSupportedException();
-			}
-			set {
-				throw new System.NotSupportedException();
-			}
+			get { throw new NotSupportedException(); }
+			set { throw new NotSupportedException(); }
 		}
+
+#if MONOTOUCH
+		const string LIBNAME = "__Internal";
+#else
+		const string LIBNAME = "MonoPosixHelper";
+#endif
+
+		[DllImport (LIBNAME)]
+		static extern IntPtr CreateZStream (CompressionMode compress, bool gzip, UnmanagedReadOrWrite feeder, IntPtr data);
+
+		[DllImport (LIBNAME)]
+		static extern int CloseZStream (IntPtr stream);
+
+		[DllImport (LIBNAME)]
+		static extern int Flush (IntPtr stream);
+
+		[DllImport (LIBNAME)]
+		static extern int ReadZStream (IntPtr stream, IntPtr buffer, int length);
+
+		[DllImport (LIBNAME)]
+		static extern int WriteZStream (IntPtr stream, IntPtr buffer, int length);
 	}
 }
 #endif
+
diff --git a/mcs/class/System/System.IO.Compression/GZipStream.cs b/mcs/class/System/System.IO.Compression/GZipStream.cs
new file mode 100644
index 0000000..183bd72
--- /dev/null
+++ b/mcs/class/System/System.IO.Compression/GZipStream.cs
@@ -0,0 +1,138 @@
+/* -*- Mode: csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+// 
+// GZipStream.cs
+//
+// Authors:
+//	Christopher James Lahey <clahey at ximian.com>
+//
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+using System;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Runtime.Remoting.Messaging;
+
+namespace System.IO.Compression {
+
+	public class GZipStream : Stream
+	{
+		private DeflateStream deflateStream;
+
+		public GZipStream (Stream compressedStream, CompressionMode mode) :
+			this (compressedStream, mode, false) {
+		}
+
+		public GZipStream (Stream compressedStream, CompressionMode mode, bool leaveOpen) {
+			this.deflateStream = new DeflateStream (compressedStream, mode, leaveOpen, true);
+		}
+
+		protected override void Dispose (bool disposing)
+		{
+			if (disposing)
+				deflateStream.Dispose ();
+			base.Dispose (disposing);
+		}
+
+		public override int Read (byte[] dest, int dest_offset, int count)
+		{
+			return deflateStream.Read(dest, dest_offset, count);
+		}
+
+
+		public override void Write (byte[] src, int src_offset, int count)
+		{
+			deflateStream.Write (src, src_offset, count);
+		}
+
+		public override void Flush() {
+			deflateStream.Flush();
+		}
+
+		public override long Seek (long offset, SeekOrigin origin) {
+			return deflateStream.Seek (offset, origin);
+		}
+
+		public override void SetLength (long value) {
+			deflateStream.SetLength (value);
+		}
+
+		public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
+							AsyncCallback cback, object state)
+		{
+			return deflateStream.BeginRead (buffer, offset, count, cback, state);
+		}
+
+		public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
+							AsyncCallback cback, object state)
+		{
+			return deflateStream.BeginWrite (buffer, offset, count, cback, state);
+		}
+
+		public override int EndRead(IAsyncResult async_result) {
+			return deflateStream.EndRead (async_result);
+		}
+
+		public override void EndWrite (IAsyncResult async_result)
+		{
+			deflateStream.EndWrite (async_result);
+		}
+
+		public Stream BaseStream {
+			get {
+				return deflateStream.BaseStream;
+			}
+		}
+		public override bool CanRead {
+			get {
+				return deflateStream.CanRead;
+			}
+		}
+		public override bool CanSeek {
+			get {
+				return deflateStream.CanSeek;
+			}
+		}
+		public override bool CanWrite {
+			get {
+				return deflateStream.CanWrite;
+			}
+		}
+		public override long Length {
+			get {
+				return deflateStream.Length;
+			}
+		}
+		public override long Position {
+			get {
+				return deflateStream.Position;
+			}
+			set {
+				deflateStream.Position = value;
+			}
+		}
+	}
+}
+
+#endif
diff --git a/mcs/class/System/System.IO.Compression/GzipStream.cs b/mcs/class/System/System.IO.Compression/GzipStream.cs
deleted file mode 100644
index b885796..0000000
--- a/mcs/class/System/System.IO.Compression/GzipStream.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-// 
-// GZipStream.cs
-//
-// Authors:
-//	Christopher James Lahey <clahey at ximian.com>
-//
-// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
-//
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-#if NET_2_0
-using System;
-using System.IO;
-using System.Runtime.InteropServices;
-using System.Runtime.Remoting.Messaging;
-
-namespace System.IO.Compression {
-
-	public class GZipStream : Stream
-	{
-		private DeflateStream deflateStream;
-
-		public GZipStream (Stream compressedStream, CompressionMode mode) :
-			this (compressedStream, mode, false) {
-		}
-
-		public GZipStream (Stream compressedStream, CompressionMode mode, bool leaveOpen) {
-			this.deflateStream = new DeflateStream (compressedStream, mode, leaveOpen, true);
-		}
-
-		protected override void Dispose (bool disposing)
-		{
-			try {
-				base.Dispose (disposing);
-			} finally {
-				deflateStream.Dispose ();
-			}
-		}
-
-		public override int Read (byte[] dest, int dest_offset, int count)
-		{
-			return deflateStream.Read(dest, dest_offset, count);
-		}
-
-
-		public override void Write (byte[] src, int src_offset, int count)
-		{
-			deflateStream.Write (src, src_offset, count);
-		}
-
-		public override void Flush() {
-			deflateStream.Flush();
-		}
-
-		public override long Seek (long offset, SeekOrigin origin) {
-			return deflateStream.Seek (offset, origin);
-		}
-
-		public override void SetLength (long value) {
-			deflateStream.SetLength (value);
-		}
-
-		public override IAsyncResult BeginRead (byte [] buffer, int offset, int count,
-							AsyncCallback cback, object state)
-		{
-			return deflateStream.BeginRead (buffer, offset, count, cback, state);
-		}
-
-		public override IAsyncResult BeginWrite (byte [] buffer, int offset, int count,
-							AsyncCallback cback, object state)
-		{
-			return deflateStream.BeginWrite (buffer, offset, count, cback, state);
-		}
-
-		public override int EndRead(IAsyncResult async_result) {
-			return deflateStream.EndRead (async_result);
-		}
-
-		public override void EndWrite (IAsyncResult async_result)
-		{
-			deflateStream.EndWrite (async_result);
-		}
-
-		public Stream BaseStream {
-			get {
-				return deflateStream.BaseStream;
-			}
-		}
-		public override bool CanRead {
-			get {
-				return deflateStream.CanRead;
-			}
-		}
-		public override bool CanSeek {
-			get {
-				return deflateStream.CanSeek;
-			}
-		}
-		public override bool CanWrite {
-			get {
-				return deflateStream.CanWrite;
-			}
-		}
-		public override long Length {
-			get {
-				return deflateStream.Length;
-			}
-		}
-		public override long Position {
-			get {
-				return deflateStream.Position;
-			}
-			set {
-				deflateStream.Position = value;
-			}
-		}
-	}
-}
-
-#endif
diff --git a/mcs/class/System/System.IO/ChangeLog b/mcs/class/System/System.IO/ChangeLog
index e42bbdf..7360fd5 100644
--- a/mcs/class/System/System.IO/ChangeLog
+++ b/mcs/class/System/System.IO/ChangeLog
@@ -1,3 +1,46 @@
+2009-11-16 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DefaultWatcher.cs: patch by James P. Mitchel III.
+	The change corrects an instance of unsynchronized access to shared
+	state and is probably the intent of the original code.
+
+2009-09-30  Marek Habersack  <mhabersack at novell.com>
+
+	* InotifyWatcher.cs: optimized the Renamed event child update loop
+	in the previous commit for directories in ProcessEvents.
+
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* InotifyWatcher.cs: fixes bug #322330. Patch by Alexander Kojevnikov.
+	This patch fixes the issues reported by the OP and in my previous
+	comment. In particular:
+
+	Hunks 1 and 4 remove the new_name_needed flag, it's not used
+	anywhere and only adds confusion.
+
+	Hunk 2 skips DeleteSelf event for sub-directories, they receive the
+	Delete event anyway.
+
+	Hunk 3 makes sure that we use a combination of Deleted+Created
+	notifications instead of a single Renamed notification, if the watched item
+	has been moved from one directory to another. This is because RenamedEventArgs
+	supports only one directory name: FullPath is always directory+name,
+	OldFullPath is always directory+old_name.
+
+	Hunk 5 updates relevant InotifyData instances with the new directory
+	name.  Without this, notifications always use the original folder names.
+
+	The last hunk may be a bit slow as it needs to iterate on all the
+	InotifyData instances. On the other hand, we are already doing it on the
+	Delete event (lines 560:568) and by default inotify allows only 8192 watches
+	per user.
+
+2009-07-13 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* InotifyWatcher.cs: when a watched subdirectory is deleted, remove it
+	from the list of children and only raise an event if it matches the
+	filter.
+
 2009-06-04  Marek Habersack  <mhabersack at novell.com>
 
 	* InotifyWatcher.cs: filter pattern should be matched on file name
diff --git a/mcs/class/System/System.IO/DefaultWatcher.cs b/mcs/class/System/System.IO/DefaultWatcher.cs
index 1a02cdb..8988a6b 100644
--- a/mcs/class/System/System.IO/DefaultWatcher.cs
+++ b/mcs/class/System/System.IO/DefaultWatcher.cs
@@ -148,7 +148,7 @@ namespace System.IO {
 					my_watches = (Hashtable) watches.Clone ();
 				}
 				
-				if (watches.Count != 0) {
+				if (my_watches.Count != 0) {
 					zeroes = 0;
 					foreach (DefaultWatcherData data in my_watches.Values) {
 						bool remove = UpdateDataAndDispatch (data, true);
diff --git a/mcs/class/System/System.IO/InotifyWatcher.cs b/mcs/class/System/System.IO/InotifyWatcher.cs
index f58cc43..9dce03e 100644
--- a/mcs/class/System/System.IO/InotifyWatcher.cs
+++ b/mcs/class/System/System.IO/InotifyWatcher.cs
@@ -465,7 +465,6 @@ namespace System.IO {
 			ArrayList newdirs = null;
 			InotifyEvent evt;
 			int nread = 0;
-			bool new_name_needed = false;
 			RenamedEventArgs renamed = null;
 			while (length > nread) {
 				int bytes_read = ReadEvent (buffer, nread, length, out evt);
@@ -500,6 +499,10 @@ namespace System.IO {
 					} else if ((mask & InotifyMask.Delete) != 0) {
 						action = FileAction.Removed;
 					} else if ((mask & InotifyMask.DeleteSelf) != 0) {
+						if (data.Watch != parent.data.Watch) {
+							// To avoid duplicate events handle DeleteSelf only for the top level directory.
+							continue;
+						}
 						action = FileAction.Removed;
 					} else if ((mask & InotifyMask.MoveSelf) != 0) {
 						//action = FileAction.Removed;
@@ -507,7 +510,7 @@ namespace System.IO {
 					} else if ((mask & InotifyMask.MovedFrom) != 0) {
 						InotifyEvent to;
 						int i = ReadEvent (buffer, nread, length, out to);
-						if (i == -1 || (to.Mask & InotifyMask.MovedTo) == 0) {
+						if (i == -1 || (to.Mask & InotifyMask.MovedTo) == 0 || evt.WatchDescriptor != to.WatchDescriptor) {
 							action = FileAction.Removed;
 						} else {
 							nread += i;
@@ -517,10 +520,8 @@ namespace System.IO {
 								filename = to.Name;
 						}
 					} else if ((mask & InotifyMask.MovedTo) != 0) {
-						action = (new_name_needed) ? FileAction.RenamedNewName : FileAction.Added;
-						new_name_needed = false;
+						action = FileAction.Added;
 					}
-
 					if (fsw.IncludeSubdirectories) {
 						string full = fsw.FullPath;
 						string datadir = data.Directory;
@@ -545,6 +546,34 @@ namespace System.IO {
 							fd.Directory = datadir;
 							newdirs.Add (fd);
 						}
+
+						if (action == FileAction.RenamedNewName && is_directory) {
+							string renamedOldFullPath = renamed.OldFullPath;
+							string renamedFullPath = renamed.FullPath;
+							int renamedOldFullPathLength = renamedOldFullPath.Length;
+							
+							foreach (InotifyData child in parent.children) {
+									
+								if (child.Directory.StartsWith (renamedOldFullPath
+#if NET_2_0
+												, StringComparison.Ordinal
+#endif
+								    )) {
+									child.Directory = renamedFullPath +
+										child.Directory.Substring (renamedOldFullPathLength);
+								}
+							}
+						}
+					}
+
+					if (action == FileAction.Removed && filename == data.Directory) {
+						int idx = parent.children.IndexOf (data);
+						if (idx != -1) {
+							parent.children.RemoveAt (idx);
+							if (!fsw.Pattern.IsMatch (Path.GetFileName (filename))) {
+								continue;
+							}
+						}
 					}
 
 					if (filename != data.Directory && !fsw.Pattern.IsMatch (Path.GetFileName (filename))) {
diff --git a/mcs/class/System/System.Net.Configuration/ChangeLog b/mcs/class/System/System.Net.Configuration/ChangeLog
index 2ebc414..c7178f7 100644
--- a/mcs/class/System/System.Net.Configuration/ChangeLog
+++ b/mcs/class/System/System.Net.Configuration/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DefaultProxyHandler.cs: handle upper and lowercase HTTP_PROXY and
+	the Any address.  Fixes bug #537283.
+
 2007-11-13  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* SmtpNetworkElement.cs, SmtpSection.cs : added missing 2,0 stuff.
diff --git a/mcs/class/System/System.Net.Configuration/DefaultProxyHandler.cs b/mcs/class/System/System.Net.Configuration/DefaultProxyHandler.cs
index c8f1787..550a7e3 100644
--- a/mcs/class/System/System.Net.Configuration/DefaultProxyHandler.cs
+++ b/mcs/class/System/System.Net.Configuration/DefaultProxyHandler.cs
@@ -85,10 +85,27 @@ namespace System.Net.Configuration
 					//MS: presence of valid address URI takes precedence over usesystemdefault
 					if (sysdefault != null && String.Compare (sysdefault, "true", true) == 0) {
 						address = Environment.GetEnvironmentVariable ("http_proxy");
-						if (address != null)
+						if (address == null)
+							address = Environment.GetEnvironmentVariable ("HTTP_PROXY");
+
+						if (address != null) {
 							try {
-								((WebProxy) result).Address = new Uri (address);
-							} catch (UriFormatException) {}
+								Uri uri = new Uri (address);
+								IPAddress ip;
+								if (IPAddress.TryParse (uri.Host, out ip)) {
+									if (IPAddress.Any.Equals (ip)) {
+										UriBuilder builder = new UriBuilder (uri);
+										builder.Host = "127.0.0.1";
+										uri = builder.Uri;
+									} else if (IPAddress.IPv6Any.Equals (ip)) {
+										UriBuilder builder = new UriBuilder (uri);
+										builder.Host = "[::1]";
+										uri = builder.Uri;
+									}
+								}
+								((WebProxy) result).Address = uri;
+							} catch (UriFormatException) { }
+						}
 					}
 					
 					continue;
diff --git a/mcs/class/System/System.Net.Mail/Attachment.cs b/mcs/class/System/System.Net.Mail/Attachment.cs
index 584d8ab..2ce8c91 100644
--- a/mcs/class/System/System.Net.Mail/Attachment.cs
+++ b/mcs/class/System/System.Net.Mail/Attachment.cs
@@ -139,6 +139,7 @@ namespace System.Net.Mail {
 			ms.Position = 0;
 			Attachment a = new Attachment (ms, name, mediaType);
 			a.TransferEncoding = ContentType.GuessTransferEncoding (contentEncoding);
+			a.ContentType.CharSet = sw.Encoding.BodyName;
 			return a;
 		}
 
diff --git a/mcs/class/System/System.Net.Mail/ChangeLog b/mcs/class/System/System.Net.Mail/ChangeLog
index 577708b..3d5e7d2 100644
--- a/mcs/class/System/System.Net.Mail/ChangeLog
+++ b/mcs/class/System/System.Net.Mail/ChangeLog
@@ -1,3 +1,18 @@
+2009-08-20  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* SmtpClient.cs: Honor ServicePointManager.
+	ServerCertificateValidationCallback when provided
+	[Backport r140347]
+
+2009-08-03 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Attachment.cs: set the body encoding for multipart attachments.
+	Fixes bug #527177.
+
+2009-06-08 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SmtpClient.cs: handle dots. Patch by Ted Unangst that fixes bug
+	#392875.
 
 2008-11-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
diff --git a/mcs/class/System/System.Net.Mail/SmtpClient.cs b/mcs/class/System/System.Net.Mail/SmtpClient.cs
index 516f46f..62fd6e3 100644
--- a/mcs/class/System/System.Net.Mail/SmtpClient.cs
+++ b/mcs/class/System/System.Net.Mail/SmtpClient.cs
@@ -683,7 +683,7 @@ namespace System.Net.Mail {
 			else
 				SendWithoutAttachments (message, null, false);
 
-			SendData (".");
+			SendDot ();
 
 			status = Read ();
 			if (IsError (status))
@@ -701,17 +701,39 @@ namespace System.Net.Mail {
 			Send (new MailMessage (from, to, subject, body));
 		}
 
+		private void SendDot()
+		{
+			writer.Write(".\r\n");
+			writer.Flush();
+		}
+
 		private void SendData (string data)
 		{
-			CheckCancellation ();
+			if (String.IsNullOrEmpty (data)) {
+				writer.Write("\r\n");
+				writer.Flush();
+				return;
+			}
 
-			// Certain SMTP servers will reject mail sent with unix line-endings; see http://cr.yp.to/docs/smtplf.html
-			StringBuilder sb = new StringBuilder (data);
-			sb.Replace ("\r\n", "\n");
-			sb.Replace ('\r', '\n');
-			sb.Replace ("\n", "\r\n");
-			writer.Write (sb.ToString ());
-			writer.Write ("\r\n");
+			StringReader sr = new StringReader (data);
+			string line;
+			bool escapeDots = deliveryMethod == SmtpDeliveryMethod.Network;
+			while ((line = sr.ReadLine ()) != null) {
+				CheckCancellation ();
+
+				if (escapeDots) {
+					int i;
+					for (i = 0; i < line.Length; i++) {
+						if (line[i] != '.')
+							break;
+					}
+					if (i > 0 && i == line.Length) {
+						line += ".";
+					}
+				}
+				writer.Write (line);
+				writer.Write ("\r\n");
+			}
 			writer.Flush ();
 		}
 
@@ -1069,6 +1091,10 @@ try {
 									 X509Certificate certificate,
 									 X509Chain chain,
 									 SslPolicyErrors sslPolicyErrors) {
+			// honor any exciting callback defined on ServicePointManager
+			if (ServicePointManager.ServerCertificateValidationCallback != null)
+				return ServicePointManager.ServerCertificateValidationCallback (sender, certificate, chain, sslPolicyErrors);
+			// otherwise provide our own
 			if (sslPolicyErrors != SslPolicyErrors.None)
 				throw new InvalidOperationException ("SSL authentication error: " + sslPolicyErrors);
 			return true;
diff --git a/mcs/class/System/System.Net.NetworkInformation/ChangeLog b/mcs/class/System/System.Net.NetworkInformation/ChangeLog
index e68bdd3..4607eb8 100644
--- a/mcs/class/System/System.Net.NetworkInformation/ChangeLog
+++ b/mcs/class/System/System.Net.NetworkInformation/ChangeLog
@@ -1,3 +1,25 @@
+2009-10-06 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* GatewayIPAddressInformationCollection.cs:
+	* IPInterfaceProperties.cs: implement GatewayAddresses for linux.
+	Original patch by Christoph von Wittich.
+	Fixes bug #544640.
+
+2009-09-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Ping.cs: fix the check for a time-out return value from 'ping'.
+
+2009-09-19 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Ping.cs: if we receive a packet that is ignored, adjust the
+	timeout. Fixes bug #538013.
+
+2009-05-16  Miguel de Icaza  <miguel at novell.com>
+
+	* Apply patch from Alex Shulgin
+	<alexander.shulgin at yessoftware.com> to support OSX in
+	NetworkInformation classes.
+
 2009-05-03 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* Ping.cs: we just need the address(es), not a host entry. This avoids
diff --git a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
index 62018b1..e4bd8bb 100644
--- a/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs
@@ -139,6 +139,13 @@ namespace System.Net.NetworkInformation {
 		{
 			this.is_readonly = isReadOnly;
 		}
+
+		public LinuxGatewayIPAddressInformationCollection (IPAddressCollection col)
+		{
+			foreach (IPAddress a in col)
+				Add (new GatewayIPAddressInformationImpl (a));
+			this.is_readonly = true;
+		}
 		
 		public override bool IsReadOnly {
 			get { return is_readonly; }
diff --git a/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs b/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs
index 207dcac..4f5ac86 100644
--- a/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/IPInterfaceProperties.cs
@@ -28,6 +28,7 @@
 //
 #if NET_2_0
 using System.Collections.Generic;
+using System.Globalization;
 using System.IO;
 using System.Net.Sockets;
 using System.Text.RegularExpressions;
@@ -53,34 +54,59 @@ namespace System.Net.NetworkInformation {
 		public abstract IPAddressCollection WinsServersAddresses { get; }
 	}
 
-	class LinuxIPInterfaceProperties : IPInterfaceProperties
+	abstract class UnixIPInterfaceProperties : IPInterfaceProperties
 	{
-		IPv4InterfaceProperties ipv4iface_properties;
-		LinuxNetworkInterface iface;
+		protected IPv4InterfaceProperties ipv4iface_properties;
+		protected UnixNetworkInterface iface;
 		List <IPAddress> addresses;
 		IPAddressCollection dns_servers;
+		IPAddressCollection gateways;
 		string dns_suffix;
 		DateTime last_parse;
 		
-		public LinuxIPInterfaceProperties (LinuxNetworkInterface iface, List <IPAddress> addresses)
+		public UnixIPInterfaceProperties (UnixNetworkInterface iface, List <IPAddress> addresses)
 		{
 			this.iface = iface;
 			this.addresses = addresses;
 		}
 
-		public override IPv4InterfaceProperties GetIPv4Properties ()
-		{
-			if (ipv4iface_properties == null)
-				ipv4iface_properties = new LinuxIPv4InterfaceProperties (iface);
-			
-			return ipv4iface_properties;
-		}
-
 		public override IPv6InterfaceProperties GetIPv6Properties ()
 		{
 			throw new NotImplementedException ();
 		}
 
+		void ParseRouteInfo (string iface)
+		{
+			try {
+				gateways = new IPAddressCollection ();
+				using (StreamReader reader = new StreamReader ("/proc/net/route")) {
+					string str;
+					string line;
+					reader.ReadLine (); // Ignore first line
+					while ((line = reader.ReadLine ()) != null) {
+						line = line.Trim ();
+						if (line.Length == 0)
+							continue;
+
+						string [] parts = line.Split ('\t');
+						if (parts.Length < 3)
+							continue;
+						string gw_address = parts [2].Trim ();
+						byte [] ipbytes = new byte [4];  
+						if (gw_address.Length == 8 && iface.Equals (parts [0], StringComparison.OrdinalIgnoreCase)) {
+							for (int i = 0; i < 4; i++) {
+								if (!Byte.TryParse (gw_address.Substring (i * 2, 2), NumberStyles.HexNumber, null, out ipbytes [3 - i]))
+									continue;
+							}
+							IPAddress ip = new IPAddress (ipbytes);
+							if (!ip.Equals (IPAddress.Any))
+								gateways.Add (ip);
+						}
+					}
+				}
+			} catch {
+			}
+		}
 
 		static Regex ns = new Regex (@"\s*nameserver\s+(?<address>.*)");
 		static Regex search = new Regex (@"\s*search\s+(?<domain>.*)");
@@ -151,7 +177,6 @@ namespace System.Net.NetworkInformation {
 			}
 		}
 
-		[MonoTODO ("Always returns an empty collection.")]
 		public override IPAddressCollection DnsAddresses {
 			get {
 				ParseResolvConf ();
@@ -159,19 +184,20 @@ namespace System.Net.NetworkInformation {
 			}
 		}
 
-		[MonoTODO ("Does not return anything.")]
 		public override string DnsSuffix {
 			get {
 				ParseResolvConf ();
 				return dns_suffix;
 			}
 		}
-
-		[MonoTODO ("Always returns an empty collection.")]
+     
 		public override GatewayIPAddressInformationCollection GatewayAddresses {
 			get {
-				// XXX: Pull information from route table.
-				return LinuxGatewayIPAddressInformationCollection.Empty;
+				ParseRouteInfo (this.iface.Name.ToString());
+				if (gateways.Count > 0)
+					return new LinuxGatewayIPAddressInformationCollection (gateways);
+				else
+					return LinuxGatewayIPAddressInformationCollection.Empty;
 			}
 		}
 
@@ -234,6 +260,38 @@ namespace System.Net.NetworkInformation {
 		}
 	}
 
+	class LinuxIPInterfaceProperties : UnixIPInterfaceProperties
+	{
+		public LinuxIPInterfaceProperties (LinuxNetworkInterface iface, List <IPAddress> addresses)
+			: base (iface, addresses)
+		{
+		}
+
+		public override IPv4InterfaceProperties GetIPv4Properties ()
+		{
+			if (ipv4iface_properties == null)
+				ipv4iface_properties = new LinuxIPv4InterfaceProperties (iface as LinuxNetworkInterface);
+			
+			return ipv4iface_properties;
+		}
+	}
+
+	class MacOsIPInterfaceProperties : UnixIPInterfaceProperties
+	{
+		public MacOsIPInterfaceProperties (MacOsNetworkInterface iface, List <IPAddress> addresses)
+			: base (iface, addresses)
+		{
+		}
+
+		public override IPv4InterfaceProperties GetIPv4Properties ()
+		{
+			if (ipv4iface_properties == null)
+				ipv4iface_properties = new MacOsIPv4InterfaceProperties (iface as MacOsNetworkInterface);
+			
+			return ipv4iface_properties;
+		}
+	}
+
 	class Win32IPInterfaceProperties2 : IPInterfaceProperties
 	{
 		readonly Win32_IP_ADAPTER_ADDRESSES addr;
diff --git a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs
index 8f1ddbb..21356e8 100644
--- a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceProperties.cs
@@ -46,17 +46,17 @@ namespace System.Net.NetworkInformation {
 		public abstract bool UsesWins { get; }
 	}
 
-	sealed class LinuxIPv4InterfaceProperties : IPv4InterfaceProperties
+	abstract class UnixIPv4InterfaceProperties : IPv4InterfaceProperties
 	{
-		LinuxNetworkInterface iface;
+		protected UnixNetworkInterface iface;
 		
-		public LinuxIPv4InterfaceProperties (LinuxNetworkInterface iface)
+		public UnixIPv4InterfaceProperties (UnixNetworkInterface iface)
 		{
 			this.iface = iface;
 		}
 		
 		public override int Index {
-			get { return LinuxNetworkInterface.IfNameToIndex (iface.Name); }
+			get { return UnixNetworkInterface.IfNameToIndex (iface.Name); }
 		}
 
 		// TODO: how to discover that?
@@ -74,6 +74,18 @@ namespace System.Net.NetworkInformation {
 			get { return false; }
 		}
 	
+		public override bool UsesWins {
+			get { return false; }
+		}
+	}
+	
+	sealed class LinuxIPv4InterfaceProperties : UnixIPv4InterfaceProperties
+	{
+		public LinuxIPv4InterfaceProperties (LinuxNetworkInterface iface)
+			: base (iface)
+		{
+		}
+		
 		public override bool IsForwardingEnabled {
 			get {
 				string iface_path = "/proc/sys/net/ipv4/conf/" + iface.Name + "/forwarding";
@@ -87,9 +99,10 @@ namespace System.Net.NetworkInformation {
 				return false;
 			}
 		}
+
 		public override int Mtu {
 			get {
-				string iface_path = iface.IfacePath + "mtu";
+				string iface_path = (iface as LinuxNetworkInterface).IfacePath + "mtu";
 				int ret = 0;
 
 				if (File.Exists (iface_path)) {
@@ -105,10 +118,24 @@ namespace System.Net.NetworkInformation {
 						
 			}
 		}
-	
-		public override bool UsesWins {
+	}
+
+	sealed class MacOsIPv4InterfaceProperties : UnixIPv4InterfaceProperties
+	{
+		public MacOsIPv4InterfaceProperties (MacOsNetworkInterface iface)
+			: base (iface)
+		{
+		}
+
+		// dummy
+		public override bool IsForwardingEnabled {
 			get { return false; }
 		}
+
+		// dummy
+		public override int Mtu {
+			get { return 0; }
+		}
 	}
 	
 	sealed class Win32IPv4InterfaceProperties : IPv4InterfaceProperties
diff --git a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
index 940b3ed..d3b32c9 100644
--- a/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
@@ -201,8 +201,65 @@ namespace System.Net.NetworkInformation {
 				return Read ("statistics/tx_packets");
 			}
 		}
+	}
 
+	// dummy class
+	class MacOsIPv4InterfaceStatistics : IPv4InterfaceStatistics
+	{
+		MacOsNetworkInterface macos;
 		
+		public MacOsIPv4InterfaceStatistics (MacOsNetworkInterface parent)
+		{
+			macos = parent;
+		}
+
+		public override long BytesReceived {
+			get { return 0; }
+		}
+
+		public override long BytesSent {
+			get { return 0; }
+		}
+
+		public override long IncomingPacketsDiscarded {
+			get { return 0; }
+		}
+
+		public override long IncomingPacketsWithErrors {
+			get { return 0; }
+		}
+
+		public override long IncomingUnknownProtocolPackets {
+			get { return 0; }
+		}
+
+		public override long NonUnicastPacketsReceived {
+			get { return 0; }
+		}
+
+		public override long NonUnicastPacketsSent {
+			get { return 0; }
+		}
+
+		public override long OutgoingPacketsDiscarded {
+			get { return 0; }
+		}
+
+		public override long OutgoingPacketsWithErrors {
+			get { return 0; }
+		}
+
+		public override long OutputQueueLength {
+			get { return 0; }
+		}
+
+		public override long UnicastPacketsReceived {
+			get { return 0; }
+		}
+
+		public override long UnicastPacketsSent {
+			get { return 0; }
+		}
 	}
 	
 }
diff --git a/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs b/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs
new file mode 100644
index 0000000..52edf9c
--- /dev/null
+++ b/mcs/class/System/System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs
@@ -0,0 +1,73 @@
+#if NET_2_0
+using System;
+using System.Runtime.InteropServices;
+
+namespace System.Net.NetworkInformation {
+	namespace MacOsStructs {
+		internal struct ifaddrs
+		{
+			public IntPtr  ifa_next;
+			public string  ifa_name;
+			public uint    ifa_flags;
+			public IntPtr  ifa_addr;
+			public IntPtr  ifa_netmask;
+			public IntPtr  ifa_dstaddr;
+			public IntPtr  ifa_data;
+		}
+
+		internal struct sockaddr
+		{
+			public byte  sa_len;
+			public byte  sa_family;
+		}
+
+		internal struct sockaddr_in
+		{
+			public byte   sin_len;
+			public byte   sin_family;
+			public ushort sin_port;
+			public uint   sin_addr;
+		}
+
+		internal struct in6_addr
+		{
+			[MarshalAs (UnmanagedType.ByValArray, SizeConst=16)]
+			public byte[] u6_addr8;
+		}
+
+		internal struct sockaddr_in6
+		{
+			public byte     sin6_len;
+			public byte     sin6_family;
+			public ushort   sin6_port;
+			public uint     sin6_flowinfo;
+			public in6_addr sin6_addr;
+			public uint     sin6_scope_id;
+		}
+
+		internal struct sockaddr_dl
+		{
+			public byte   sdl_len;
+			public byte   sdl_family;
+			public ushort sdl_index;
+			public byte   sdl_type;
+			public byte   sdl_nlen;
+			public byte   sdl_alen;
+			public byte   sdl_slen;
+
+			[MarshalAs (UnmanagedType.ByValArray, SizeConst=12)]
+			public byte[] sdl_data;
+		}
+
+	}
+
+	internal enum MacOsArpHardware {
+		ETHER = 0x6,
+		ATM = 0x25,
+		SLIP = 0x1c,
+		PPP = 0x17,
+		LOOPBACK = 0x18,
+		FDDI = 0xf
+	}
+}
+#endif
diff --git a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
index 4b3b527..5eefd79 100644
--- a/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs
@@ -42,6 +42,9 @@ using System.Globalization;
 
 namespace System.Net.NetworkInformation {
 	public abstract class NetworkInterface {
+		[DllImport ("libc")]
+		static extern int uname (IntPtr buf);
+
 		static Version windowsVer51 = new Version (5, 1);
 		static internal readonly bool runningOnUnix = (Environment.OSVersion.Platform == PlatformID.Unix);
 		
@@ -53,8 +56,20 @@ namespace System.Net.NetworkInformation {
 		public static NetworkInterface [] GetAllNetworkInterfaces ()
 		{
 			if (runningOnUnix) {
+				bool darwin = false;
+				IntPtr buf = Marshal.AllocHGlobal (8192);
+				if (uname (buf) == 0) {
+					string os = Marshal.PtrToStringAnsi (buf);
+					if (os == "Darwin")
+						darwin = true;
+				}
+				Marshal.FreeHGlobal (buf);
+
 				try {
-					return LinuxNetworkInterface.ImplGetAllNetworkInterfaces ();
+					if (darwin)
+						return MacOsNetworkInterface.ImplGetAllNetworkInterfaces ();
+					else
+						return LinuxNetworkInterface.ImplGetAllNetworkInterfaces ();
 				} catch (SystemException ex) {
 					throw ex;
 				} catch {
@@ -87,7 +102,7 @@ namespace System.Net.NetworkInformation {
 			get {
 				if (runningOnUnix) {
 					try {
-						return LinuxNetworkInterface.IfNameToIndex ("lo");
+						return UnixNetworkInterface.IfNameToIndex ("lo");
 					} catch  {
 						return 0;
 					}
@@ -111,17 +126,103 @@ namespace System.Net.NetworkInformation {
 		public abstract bool SupportsMulticast { get; }
 	}
 
+	abstract class UnixNetworkInterface : NetworkInterface
+	{
+		[DllImport("libc")]
+		static extern int if_nametoindex(string ifname);
+
+		protected IPv4InterfaceStatistics ipv4stats;
+		protected IPInterfaceProperties ipproperties;
+		
+		string               name;
+		int                  index;
+		protected List <IPAddress> addresses;
+		byte[]               macAddress;
+		NetworkInterfaceType type;
+		
+		internal UnixNetworkInterface (string name)
+		{
+			this.name = name;
+			addresses = new List<IPAddress> ();
+		}
+
+		public static int IfNameToIndex (string ifname)
+		{
+			return if_nametoindex(ifname);
+		}
+		
+		internal void AddAddress (IPAddress address)
+		{
+			addresses.Add (address);
+		}
+
+		internal void SetLinkLayerInfo (int index, byte[] macAddress, NetworkInterfaceType type)
+		{
+			this.index = index;
+			this.macAddress = macAddress;
+			this.type = type;
+		}
+
+		public override PhysicalAddress GetPhysicalAddress ()
+		{
+			if (macAddress != null)
+				return new PhysicalAddress (macAddress);
+			else
+				return PhysicalAddress.None;
+		}
+
+		public override bool Supports (NetworkInterfaceComponent networkInterfaceComponent)
+		{
+			bool wantIPv4 = networkInterfaceComponent == NetworkInterfaceComponent.IPv4;
+			bool wantIPv6 = wantIPv4 ? false : networkInterfaceComponent == NetworkInterfaceComponent.IPv6;
+				
+			foreach (IPAddress address in addresses) {
+				if (wantIPv4 && address.AddressFamily == AddressFamily.InterNetwork)
+					return true;
+				else if (wantIPv6 && address.AddressFamily == AddressFamily.InterNetworkV6)
+					return true;
+			}
+			
+			return false;
+		}
+
+		public override string Description {
+			get { return name; }
+		}
+
+		public override string Id {
+			get { return name; }
+		}
+
+		public override bool IsReceiveOnly {
+			get { return false; }
+		}
+
+		public override string Name {
+			get { return name; }
+		}
+		
+		public override NetworkInterfaceType NetworkInterfaceType {
+			get { return type; }
+		}
+		
+		[MonoTODO ("Parse dmesg?")]
+		public override long Speed {
+			get {
+				// Bits/s
+				return 1000000;
+			}
+		}
+	}
+
 	//
 	// This class needs support from the libsupport.so library to fetch the
 	// data using arch-specific ioctls.
 	//
 	// For this to work, we have to create this on the factory above.
 	//
-	class LinuxNetworkInterface : NetworkInterface
+	class LinuxNetworkInterface : UnixNetworkInterface
 	{
-		[DllImport("libc")]
-		static extern int if_nametoindex(string ifname);
-
 		[DllImport ("libc")]
 		static extern int getifaddrs (out IntPtr ifap);
 
@@ -132,13 +233,6 @@ namespace System.Net.NetworkInformation {
 		const int AF_INET6  = 10;
 		const int AF_PACKET = 17;
 		
-		IPv4InterfaceStatistics ipv4stats;
-		IPInterfaceProperties ipproperties;
-		
-		string               name;
-		int                  index;
-		List <IPAddress>     addresses;
-		byte[]               macAddress;
 		NetworkInterfaceType type;
 		string               iface_path;
 		string               iface_operstate_path;
@@ -148,11 +242,6 @@ namespace System.Net.NetworkInformation {
 			get { return iface_path; }
 		}
 		
-		public static int IfNameToIndex (string ifname)
-		{
-			return if_nametoindex(ifname);
-		}
-		
 		public static NetworkInterface [] ImplGetAllNetworkInterfaces ()
 		{
 			var interfaces = new Dictionary <string, LinuxNetworkInterface> ();
@@ -246,8 +335,14 @@ namespace System.Net.NetworkInformation {
 					if (!address.Equals (IPAddress.None))
 						iface.AddAddress (address);
 
-					if (macAddress != null || type == NetworkInterfaceType.Loopback)
+					if (macAddress != null || type == NetworkInterfaceType.Loopback) {
+						if (type == NetworkInterfaceType.Ethernet) {
+							if (Directory.Exists(iface.IfacePath + "wireless")) {
+								type = NetworkInterfaceType.Wireless80211;
+							}
+						}
 						iface.SetLinkLayerInfo (index, macAddress, type);
+					}
 
 					next = addr.ifa_next;
 				}
@@ -265,31 +360,13 @@ namespace System.Net.NetworkInformation {
 		}
 		
 		LinuxNetworkInterface (string name)
+			: base (name)
 		{
-			this.name = name;
-			addresses = new List<IPAddress> ();
 			iface_path = "/sys/class/net/" + name + "/";
 			iface_operstate_path = iface_path + "operstate";
 			iface_flags_path = iface_path + "flags";
 		}
 
-		internal void AddAddress (IPAddress address)
-		{
-			addresses.Add (address);
-		}
-
-		internal void SetLinkLayerInfo (int index, byte[] macAddress, NetworkInterfaceType type)
-		{
-			this.index = index;
-			this.macAddress = macAddress;
-			if (type == NetworkInterfaceType.Ethernet) {
-				if (Directory.Exists(iface_path + "wireless")) {
-					type = NetworkInterfaceType.Wireless80211;
-				}
-			}
-			this.type = type;
-		}
-
 		public override IPInterfaceProperties GetIPProperties ()
 		{
 			if (ipproperties == null)
@@ -301,53 +378,9 @@ namespace System.Net.NetworkInformation {
 		{
 			if (ipv4stats == null)
 				ipv4stats = new LinuxIPv4InterfaceStatistics (this);
-			
 			return ipv4stats;
 		}
 
-		public override PhysicalAddress GetPhysicalAddress ()
-		{
-			if (macAddress != null)
-				return new PhysicalAddress (macAddress);
-			else
-				return PhysicalAddress.None;
-		}
-
-		public override bool Supports (NetworkInterfaceComponent networkInterfaceComponent)
-		{
-			bool wantIPv4 = networkInterfaceComponent == NetworkInterfaceComponent.IPv4;
-			bool wantIPv6 = wantIPv4 ? false : networkInterfaceComponent == NetworkInterfaceComponent.IPv6;
-				
-			foreach (IPAddress address in addresses) {
-				if (wantIPv4 && address.AddressFamily == AddressFamily.InterNetwork)
-					return true;
-				else if (wantIPv6 && address.AddressFamily == AddressFamily.InterNetworkV6)
-					return true;
-                        }
-			
-                        return false;
-		}
-
-		public override string Description {
-			get { return name; }
-		}
-
-		public override string Id {
-			get { return name; }
-		}
-
-		public override bool IsReceiveOnly {
-			get { return false; }
-		}
-
-		public override string Name {
-			get { return name; }
-		}
-		
-		public override NetworkInterfaceType NetworkInterfaceType {
-			get { return type; }
-		}
-		
 		public override OperationalStatus OperationalStatus {
 			get {
 				if (!Directory.Exists (iface_path))
@@ -384,14 +417,6 @@ namespace System.Net.NetworkInformation {
 			}
 		}
 
-		[MonoTODO ("Parse dmesg?")]
-		public override long Speed {
-			get {
-				// Bits/s
-				return 1000000;
-			}
-		}
-		
 		public override bool SupportsMulticast {
 			get {
 				if (!Directory.Exists (iface_path))
@@ -413,6 +438,143 @@ namespace System.Net.NetworkInformation {
 		}
 	}
 
+	class MacOsNetworkInterface : UnixNetworkInterface
+	{
+		[DllImport ("libc")]
+		static extern int getifaddrs (out IntPtr ifap);
+
+		[DllImport ("libc")]
+		static extern void freeifaddrs (IntPtr ifap);
+
+		const int AF_INET  = 2;
+		const int AF_INET6 = 30;
+		const int AF_LINK  = 18;
+		
+		public static NetworkInterface [] ImplGetAllNetworkInterfaces ()
+		{
+			var interfaces = new Dictionary <string, MacOsNetworkInterface> ();
+			IntPtr ifap;
+			if (getifaddrs (out ifap) != 0)
+				throw new SystemException ("getifaddrs() failed");
+
+			try {
+				IntPtr next = ifap;
+				while (next != IntPtr.Zero) {
+					MacOsStructs.ifaddrs addr = (MacOsStructs.ifaddrs) Marshal.PtrToStructure (next, typeof (MacOsStructs.ifaddrs));
+					IPAddress address = IPAddress.None;
+					string    name = addr.ifa_name;
+					int       index = -1;
+					byte[]    macAddress = null;
+					NetworkInterfaceType type = NetworkInterfaceType.Unknown;
+
+					if (addr.ifa_addr != IntPtr.Zero) {
+						MacOsStructs.sockaddr sockaddr = (MacOsStructs.sockaddr) Marshal.PtrToStructure (addr.ifa_addr, typeof (MacOsStructs.sockaddr));
+
+						if (sockaddr.sa_family == AF_INET6) {
+							MacOsStructs.sockaddr_in6 sockaddr6 = (MacOsStructs.sockaddr_in6) Marshal.PtrToStructure (addr.ifa_addr, typeof (MacOsStructs.sockaddr_in6));
+							address = new IPAddress (sockaddr6.sin6_addr.u6_addr8, sockaddr6.sin6_scope_id);
+						} else if (sockaddr.sa_family == AF_INET) {
+							MacOsStructs.sockaddr_in sockaddrin = (MacOsStructs.sockaddr_in) Marshal.PtrToStructure (addr.ifa_addr, typeof (MacOsStructs.sockaddr_in));
+							address = new IPAddress (sockaddrin.sin_addr);
+						} else if (sockaddr.sa_family == AF_LINK) {
+							MacOsStructs.sockaddr_dl sockaddrdl = (MacOsStructs.sockaddr_dl) Marshal.PtrToStructure (addr.ifa_addr, typeof (MacOsStructs.sockaddr_dl));
+
+							macAddress = new byte [(int) sockaddrdl.sdl_alen];
+							Array.Copy (sockaddrdl.sdl_data, sockaddrdl.sdl_nlen, macAddress, 0, macAddress.Length);
+							index = sockaddrdl.sdl_index;
+
+							int hwtype = (int) sockaddrdl.sdl_type;
+							if (Enum.IsDefined (typeof (MacOsArpHardware), hwtype)) {
+								switch ((MacOsArpHardware) hwtype) {
+									case MacOsArpHardware.ETHER:
+										type = NetworkInterfaceType.Ethernet;
+										break;
+
+									case MacOsArpHardware.ATM:
+										type = NetworkInterfaceType.Atm;
+										break;
+									
+									case MacOsArpHardware.SLIP:
+										type = NetworkInterfaceType.Slip;
+										break;
+									
+									case MacOsArpHardware.PPP:
+										type = NetworkInterfaceType.Ppp;
+										break;
+									
+									case MacOsArpHardware.LOOPBACK:
+										type = NetworkInterfaceType.Loopback;
+										macAddress = null;
+										break;
+
+									case MacOsArpHardware.FDDI:
+										type = NetworkInterfaceType.Fddi;
+										break;
+								}
+							}
+						}
+					}
+
+					MacOsNetworkInterface iface = null;
+
+					if (!interfaces.TryGetValue (name, out iface)) {
+						iface = new MacOsNetworkInterface (name);
+						interfaces.Add (name, iface);
+					}
+
+					if (!address.Equals (IPAddress.None))
+						iface.AddAddress (address);
+
+					if (macAddress != null || type == NetworkInterfaceType.Loopback)
+						iface.SetLinkLayerInfo (index, macAddress, type);
+
+					next = addr.ifa_next;
+				}
+			} finally {
+				freeifaddrs (ifap);
+			}
+
+			NetworkInterface [] result = new NetworkInterface [interfaces.Count];
+			int x = 0;
+			foreach (NetworkInterface thisInterface in interfaces.Values) {
+				result [x] = thisInterface;
+				x++;
+			}
+			return result;
+		}
+		
+		MacOsNetworkInterface (string name)
+			: base (name)
+		{
+		}
+
+		public override IPInterfaceProperties GetIPProperties ()
+		{
+			if (ipproperties == null)
+				ipproperties = new MacOsIPInterfaceProperties (this, addresses);
+			return ipproperties;
+		}
+
+		public override IPv4InterfaceStatistics GetIPv4Statistics ()
+		{
+			if (ipv4stats == null)
+				ipv4stats = new MacOsIPv4InterfaceStatistics (this);
+			return ipv4stats;
+		}
+
+		public override OperationalStatus OperationalStatus {
+			get {
+				return OperationalStatus.Unknown;
+			}
+		}
+
+		public override bool SupportsMulticast {
+			get {
+				return false;
+			}
+		}
+	}
+
 	class Win32NetworkInterface2 : NetworkInterface
 	{
 		[DllImport ("iphlpapi.dll", SetLastError = true)]
diff --git a/mcs/class/System/System.Net.NetworkInformation/Ping.cs b/mcs/class/System/System.Net.NetworkInformation/Ping.cs
index 09b2d8a..3bf3888 100644
--- a/mcs/class/System/System.Net.NetworkInformation/Ping.cs
+++ b/mcs/class/System/System.Net.NetworkInformation/Ping.cs
@@ -229,14 +229,25 @@ namespace System.Net.NetworkInformation {
 					int headerLength = (bytes [0] & 0xF) << 2;
 					int bodyLength = rc - headerLength;
 
-					if (!((IPEndPoint) endpoint).Address.Equals (target.Address)) // Ping reply to different request. discard it.
+					// Ping reply to different request. discard it.
+					if (!((IPEndPoint) endpoint).Address.Equals (target.Address)) {
+						long t = timeout - rtt;
+						if (t <= 0)
+							return new PingReply (null, new byte [0], options, 0, IPStatus.TimedOut);
+						s.ReceiveTimeout = (int) t;
 						continue;
+					}
 
 					IcmpMessage recv = new IcmpMessage (bytes, headerLength, bodyLength);
 
 					/* discard ping reply to different request or echo requests if running on same host. */
-					if (recv.Identifier != identifier || recv.Type == 8)
+					if (recv.Identifier != identifier || recv.Type == 8) {
+						long t = timeout - rtt;
+						if (t <= 0)
+							return new PingReply (null, new byte [0], options, 0, IPStatus.TimedOut);
+						s.ReceiveTimeout = (int) t;
 						continue; 
+					}
 
 					return new PingReply (address, recv.Data, options, rtt, recv.IPStatus);
 				} while (true);
@@ -271,7 +282,7 @@ namespace System.Net.NetworkInformation {
 #pragma warning restore 219
 				
 				trip_time = (long) (DateTime.Now - sentTime).TotalMilliseconds;
-				if (!ping.WaitForExit (timeout) || ping.ExitCode == 2)
+				if (!ping.WaitForExit (timeout) || (ping.HasExited && ping.ExitCode == 2))
 					return new PingReply (address, buffer, options, trip_time, IPStatus.TimedOut); 
 
 				if (ping.ExitCode == 1)
diff --git a/mcs/class/System/System.Net.Security/ChangeLog b/mcs/class/System/System.Net.Security/ChangeLog
index e0d7cc0..bfaa914 100644
--- a/mcs/class/System/System.Net.Security/ChangeLog
+++ b/mcs/class/System/System.Net.Security/ChangeLog
@@ -1,3 +1,11 @@
+2009-08-20  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* SslStream.cs : Always use/provide a X509Chain even if this 
+	duplicates some of the old/existing logic of Mono.Security.
+	This makes it possible to provide a callback using 
+	ServicePointManager.ServerCertificateValidationCallback
+	[Backport r140359]
+
 2007-08-24  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* SslStream.cs : uh, fixed the build.
diff --git a/mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs b/mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs
index a23d860..c7ab73a 100644
--- a/mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs
+++ b/mcs/class/System/System.Net.Security/RemoteCertificateValidationCallback.cs
@@ -29,17 +29,26 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && SECURITY_DEP
+#if NET_2_0
 
 using System.Security.Cryptography.X509Certificates;
 
 namespace System.Net.Security 
 {
-	public delegate bool RemoteCertificateValidationCallback (
+#if !NET_2_1
+	public
+#endif
+	delegate bool RemoteCertificateValidationCallback (
 		object sender,
+#if !NET_2_1
 		X509Certificate certificate,
 		X509Chain chain,
+#else
+		object certificate,
+		object chain,
+#endif
 		SslPolicyErrors sslPolicyErrors);
 }
 
 #endif
+
diff --git a/mcs/class/System/System.Net.Security/SslStream.cs b/mcs/class/System/System.Net.Security/SslStream.cs
index b47171a..fd5927e 100644
--- a/mcs/class/System/System.Net.Security/SslStream.cs
+++ b/mcs/class/System/System.Net.Security/SslStream.cs
@@ -348,13 +348,40 @@ namespace System.Net.Security
 
 			if (validation_callback != null)
 				s.ServerCertValidationDelegate = delegate (X509Certificate cert, int [] certErrors) {
-					X509Chain chain = null;
-					if (cert is X509Certificate2) {
-						chain = new X509Chain ();
-						chain.Build ((X509Certificate2) cert);
+					X509Chain chain = new X509Chain ();
+					X509Certificate2 x2 = (cert as X509Certificate2);
+					if (x2 == null)
+						x2 = new X509Certificate2 (cert);
+
+					if (!ServicePointManager.CheckCertificateRevocationList)
+						chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
+
+					// SSL specific checks (done by Mono.Security.dll SSL/TLS implementation) 
+					SslPolicyErrors errors = SslPolicyErrors.None;
+					foreach (int i in certErrors) {
+						switch (i) {
+						case -2146762490: // CERT_E_PURPOSE
+							errors |= SslPolicyErrors.RemoteCertificateNotAvailable;
+							break;
+						case -2146762481: // CERT_E_CN_NO_MATCH
+							errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
+							break;
+						default:
+							errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+							break;
+						}
 					}
-					// FIXME: SslPolicyErrors is incomplete
-					SslPolicyErrors errors = certErrors.Length > 0 ? SslPolicyErrors.RemoteCertificateChainErrors : SslPolicyErrors.None;
+
+					chain.Build (x2);
+
+					// non-SSL specific X509 checks (i.e. RFC3280 related checks)
+					foreach (X509ChainStatus status in chain.ChainStatus) {
+						if ((status.Status & X509ChainStatusFlags.PartialChain) != 0)
+							errors |= SslPolicyErrors.RemoteCertificateNotAvailable;
+						else
+							errors |= SslPolicyErrors.RemoteCertificateChainErrors;
+					}
+
 					return validation_callback (this, cert, chain, errors);
 				};
 			if (selection_callback != null)
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog
index 4bc7fab..5e9b574 100644
--- a/mcs/class/System/System.Net.Sockets/ChangeLog
+++ b/mcs/class/System/System.Net.Sockets/ChangeLog
@@ -1,3 +1,30 @@
+2009-11-03 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Socket_2_1.cs: stop any blocking thread before closing the socket.
+
+2009-10-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Socket.cs: implement *SendFile().
+
+2009-09-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* NetworkStream.cs: after disposing the stream, CanRead/CanWrite
+	return false.
+
+2009-09-19 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SocketAsyncEventArgs.cs: fix check for non-null.
+	Fixes bug #516455.
+
+2009-06-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Socket.cs: turn WSAEINVAL into ArgumentException.
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Socket.cs: MS throws a SocketException in the byte[] overload when
+	the value is null.
+
 2009-05-11 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* TcpClient.cs:
diff --git a/mcs/class/System/System.Net.Sockets/NetworkStream.cs b/mcs/class/System/System.Net.Sockets/NetworkStream.cs
index 39d952e..de8ba67 100644
--- a/mcs/class/System/System.Net.Sockets/NetworkStream.cs
+++ b/mcs/class/System/System.Net.Sockets/NetworkStream.cs
@@ -302,6 +302,7 @@ namespace System.Net.Sockets
 					s.Close ();
 			}
 			socket = null;
+			access = 0;
 		}
 
 		public override int EndRead (IAsyncResult ar)
diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs
index 1cb400a..75a8e96 100644
--- a/mcs/class/System/System.Net.Sockets/Socket.cs
+++ b/mcs/class/System/System.Net.Sockets/Socket.cs
@@ -1961,7 +1961,43 @@ namespace System.Net.Sockets
 			return (BeginSend (buffers, socketFlags, callback, state));
 		}
 
-		[MonoTODO ("Not implemented")]
+		delegate void SendFileHandler (string fileName, byte [] preBuffer, byte [] postBuffer, TransmitFileOptions flags);
+
+		sealed class SendFileAsyncResult : IAsyncResult {
+			IAsyncResult ares;
+			SendFileHandler d;
+
+			public SendFileAsyncResult (SendFileHandler d, IAsyncResult ares)
+			{
+				this.d = d;
+				this.ares = ares;
+			}
+
+			public object AsyncState {
+				get { return ares.AsyncState; }
+			}
+
+			public WaitHandle AsyncWaitHandle {
+				get { return ares.AsyncWaitHandle; }
+			}
+
+			public bool CompletedSynchronously {
+				get { return ares.CompletedSynchronously; }
+			}
+
+			public bool IsCompleted {
+				get { return ares.IsCompleted; }
+			}
+
+			public SendFileHandler Delegate {
+				get { return d; }
+			}
+
+			public IAsyncResult Original {
+				get { return ares; }
+			}
+		}
+
 		public IAsyncResult BeginSendFile (string fileName,
 						   AsyncCallback callback,
 						   object state)
@@ -1975,10 +2011,9 @@ namespace System.Net.Sockets
 			if (!File.Exists (fileName))
 				throw new FileNotFoundException ();
 
-			throw new NotImplementedException ();
+			return BeginSendFile (fileName, null, null, 0, callback, state);
 		}
 
-		[MonoTODO ("Not implemented")]
 		public IAsyncResult BeginSendFile (string fileName,
 						   byte[] preBuffer,
 						   byte[] postBuffer,
@@ -1995,7 +2030,8 @@ namespace System.Net.Sockets
 			if (!File.Exists (fileName))
 				throw new FileNotFoundException ();
 
-			throw new NotImplementedException ();
+			SendFileHandler d = new SendFileHandler (SendFile);
+			return new SendFileAsyncResult (d, d.BeginInvoke (fileName, preBuffer, postBuffer, flags, callback, state));
 		}
 #endif
 
@@ -2502,7 +2538,6 @@ namespace System.Net.Sockets
 		}
 
 #if NET_2_0
-		[MonoTODO]
 		public void EndSendFile (IAsyncResult asyncResult)
 		{
 			if (disposed && closed)
@@ -2511,13 +2546,11 @@ namespace System.Net.Sockets
 			if (asyncResult == null)
 				throw new ArgumentNullException ("asyncResult");
 
-			SocketAsyncResult req = asyncResult as SocketAsyncResult;
-			if (req == null)
+			SendFileAsyncResult ares = asyncResult as SendFileAsyncResult;
+			if (ares == null)
 				throw new ArgumentException ("Invalid IAsyncResult", "asyncResult");
 
-			if (Interlocked.CompareExchange (ref req.EndCalled, 1, 0) == 1)
-				throw InvalidAsyncOp ("EndSendFile");
-			throw new NotImplementedException ();
+			ares.Delegate.EndInvoke (ares.Original);
 		}
 #endif
 
@@ -3402,7 +3435,9 @@ namespace System.Net.Sockets
 		}
 
 #if NET_2_0
-		[MonoTODO ("Not implemented")]
+ 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
+ 		private extern static bool SendFile (IntPtr sock, string filename, byte [] pre_buffer, byte [] post_buffer, TransmitFileOptions flags);
+ 
 		public void SendFile (string fileName)
 		{
 			if (disposed && closed)
@@ -3414,14 +3449,9 @@ namespace System.Net.Sockets
 			if (!blocking)
 				throw new InvalidOperationException ();
 
-			if (!File.Exists (fileName))
-				throw new FileNotFoundException ();
-
-			/* FIXME: Implement TransmitFile */
-			throw new NotImplementedException ();
+			SendFile (fileName, null, null, 0);
 		}
 
-		[MonoTODO ("Not implemented")]
 		public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
 		{
 			if (disposed && closed)
@@ -3433,11 +3463,12 @@ namespace System.Net.Sockets
 			if (!blocking)
 				throw new InvalidOperationException ();
 
-			if (!File.Exists (fileName))
-				throw new FileNotFoundException ();
-
-			/* FIXME: Implement TransmitFile */
-			throw new NotImplementedException ();
+			if (!SendFile (socket, fileName, preBuffer, postBuffer, flags)) {
+				SocketException exc = new SocketException ();
+				if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
+					throw new FileNotFoundException ();
+				throw exc;
+			}
 		}
 
 		public bool SendToAsync (SocketAsyncEventArgs e)
@@ -3570,13 +3601,20 @@ namespace System.Net.Sockets
 			if (disposed && closed)
 				throw new ObjectDisposedException (GetType ().ToString ());
 
+			// I'd throw an ArgumentNullException, but this is what MS does.
+			if (opt_value == null)
+				throw new SocketException (10014, "Error trying to dereference an invalid pointer");
+			
 			int error;
 			
 			SetSocketOption_internal(socket, level, name, null,
 						 opt_value, 0, out error);
 
-			if (error != 0)
+			if (error != 0) {
+				if (error == 10022) // WSAEINVAL
+					throw new ArgumentException ();
 				throw new SocketException (error);
+			}
 		}
 
 		public void SetSocketOption (SocketOptionLevel level, SocketOptionName name, int opt_value)
@@ -3599,6 +3637,7 @@ namespace System.Net.Sockets
 			if (disposed && closed)
 				throw new ObjectDisposedException (GetType ().ToString ());
 
+			// NOTE: if a null is passed, the byte[] overload is used instead...
 			if (opt_value == null)
 				throw new ArgumentNullException("opt_value");
 			
@@ -3623,8 +3662,11 @@ namespace System.Net.Sockets
 				SetSocketOption_internal (socket, level, name, opt_value, null, 0, out error);
 			}
 
-			if (error != 0)
+			if (error != 0) {
+				if (error == 10022) // WSAEINVAL
+					throw new ArgumentException ();
 				throw new SocketException (error);
+			}
 		}
 
 #if NET_2_0
@@ -3636,8 +3678,11 @@ namespace System.Net.Sockets
 			int error;
 			int int_val = (optionValue) ? 1 : 0;
 			SetSocketOption_internal (socket, level, name, null, null, int_val, out error);
-			if (error != 0)
+			if (error != 0) {
+				if (error == 10022) // WSAEINVAL
+					throw new ArgumentException ();
 				throw new SocketException (error);
+			}
 		}
 #endif
 		[MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -3679,12 +3724,13 @@ namespace System.Net.Sockets
 				closed = true;
 				IntPtr x = socket;
 				socket = (IntPtr) (-1);
-				Close_internal (x, out error);
-				if (blocking_thread != null) {
-					blocking_thread.Abort ();
+				Thread th = blocking_thread;
+				if (th != null) {
+					th.Abort ();
 					blocking_thread = null;
 				}
 
+				Close_internal (x, out error);
 				if (error != 0)
 					throw new SocketException (error);
 			}
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
index f7afc27..a11a60c 100644
--- a/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
+++ b/mcs/class/System/System.Net.Sockets/SocketAsyncEventArgs.cs
@@ -45,7 +45,7 @@ namespace System.Net.Sockets
 		public IList<ArraySegment<byte>> BufferList {
 			get { return _bufferList; }
 			set {
-				if (Buffer != null)
+				if (Buffer != null && value != null)
 					throw new ArgumentException ("Buffer and BufferList properties cannot both be non-null.");
 				_bufferList = value;
 			}
diff --git a/mcs/class/System/System.Net/ChangeLog b/mcs/class/System/System.Net/ChangeLog
index d03db9e..a02abd7 100644
--- a/mcs/class/System/System.Net/ChangeLog
+++ b/mcs/class/System/System.Net/ChangeLog
@@ -1,3 +1,190 @@
+2009-10-23  Alexandre Gomes  <alexmipego at gmail.com>
+
+	* WebClient.cs: Fixed GetWebRequest overriding problems, bug: 
+	  https://bugzilla.novell.com/show_bug.cgi?id=549580
+	  
+2009-10-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnectionStream.cs: add 3 missing DoCallback() calls in
+	EndRead/EndWrite.
+
+2009-09-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* EndPointListener.cs: fix matching a listener in presence of a query
+	string or anchor.
+
+2009-09-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebRequest.cs: handle upper and lowercase HTTP_PROXY and
+	the Any address.  Fixes bug #537283.
+
+2009-09-04 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: if the request has already finished reading, don't
+	throw ObjectDisposedException here, just return as if nothing
+	happened. Fixes bug #312968.
+
+2009-08-29 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: HEAD response does not have a body even if the
+	response is an error. Fixes buf #535102.
+
+2009-08-13 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs:
+	* WebConnectionStream.cs: if there's an error writing the headers from
+	a buffered request, propagate the error instead of hiding it and
+	causing a different one later (ie, ObjectDisposedException instead of
+	the original WebException). This happened when posting without
+	Content-Length set to an HTTPS url without validating the server
+	certificate.
+
+2009-07-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebClient.cs: rethrow WebExceptions instead of creating a new one
+	with less information on the actual error.
+	Fixes bug #526069.
+
+2009-07-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebHeaderCollection.cs: check the validity of the characters in the
+	header names.
+
+2009-07-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebHeaderCollection.cs: implemente the 2.0 IsRestricted().
+
+2009-07-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnectionStream.cs: when sending a 0-length POST, ignore further
+	writes instead of throwing.
+	Fixes bug #524049.
+
+2009-07-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebClient.cs: implement GetWebRequest and GetWebResponse. Use them
+	instead of SetupRequest and ProcessResponse.
+
+2009-07-07 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebClient.cs: set the content length when uploading values. This
+	allows reusing the connection.
+	* WebConnectionStream.cs: SetHeaders() takes ownership of the buffer
+	and does not need to copy it any more. WriteRequest() wasn't always
+	setting 'requestWritten' to true.
+	* HttpWebRequest.cs: change in SetHeaders call.
+
+2009-07-06  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* WebConnectionStream.cs: Move and improve argument checks to match MS.
+	Modified CanRead and CanWrite to return false when instance is disposed.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: provide better error message when there's an error
+	writing.
+	* WebConnectionStream.cs: don't nullify the buffer until
+	CheckFinalStatus() decides that there are no more authentication
+	retries or redirects.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ServicePointManager.cs: implement ServerCertificateValidationCallback.
+	* DefaultCertificatePolicy.cs: if there's a SCVC registered, don't do
+	normal error checking.a
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: avoid duplicating Accept-Encoding if GetHeaders()
+	is called twice.
+	* WebConnectionStream.cs: don't send a 0 content length for non-write
+	requests.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: must use the 'int' version in 1.1.
+
+2009-07-01 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs:
+	* ServicePoint.cs: UseNagleAlgorithm determines NoDelay value.
+
+2009-06-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: fix 1.1 only test.
+
+2009-06-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnectionStream.cs: when buffering the response, we have to set
+	the internal length and regenerate the headers.
+
+2009-06-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebClient.cs: backported from HEAD.
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: don't send Content-Length header when SendChunked
+	is enabled.
+	* WebConnectionStream.cs: send the headers immediately when possible.
+	When writing the request before a Close(), if there was an exception
+	it was lost.
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpConnection.cs:
+	* HttpListenerResponse.cs: force closing the socket when the response
+	is aborted.
+
+2009-06-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebAsyncResult.cs: new field that tells us if the request is being
+	written automatically because we reached the content length.
+	* WebConnection.cs:
+	* WebConnectionStream.cs: make sure we only access the NetworkStream
+	while we own it. Automatically write the request when we reach
+	ContentLength number of bytes. Kill the write buffer as soon as
+	possible. Don't use the buffer at all when chunked encoding is
+	enabled.
+
+	Fixes bugs #515931 and #510642.
+
+2009-06-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: 'socket' and 'Data' where being changed by 2
+	threads at the same time when there were queued requests and the
+	current one was aborted in Connect().
+	* HttpWebRequest.cs: 'aborted' is now an int and we use Interlocked to
+	access it. Added WebConnection field used when aborting the request.
+
+	Fixes bug #514591 for good.
+
+2009-06-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: check for an aborted request in Begin* before
+	proceeding. Fixes bug #511851.
+
+2009-06-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnectionStream.cs: close the underlying socket if there's an
+	exception when closing the stream. Fixes bug #514996.
+
+2009-06-20  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* WebConnectionStream.cs: Keep count of all bytes written, and perform
+	write overflow check in both buffered and non-buffered writing (if
+	not using chunked transfer encoding). Fixes bug #510642.
+
+2009-06-19 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnection.cs: make sure we don't open a new socket if the
+	request is aborted before we establish the connection. Fixes bug
+	#514591.
+
+	* HttpWebRequest.cs: new property to return abort status. Invoke the
+	abort handler before doing anything else when Abort() is called for
+	the first time.
+
 2009-06-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* EndPointListener.cs: call CheckIfRemove() after removing a regular
@@ -8,6 +195,38 @@
 	Clear the ip_to_endpoints hashtable if there are no more prefixes
 	listening on that address.
 
+2009-06-16 Andrés G. Aragoneses <aaragoneses at novell.com>
+
+	* WebConnection.cs: propagate the exception to the request.
+	* WebException.cs: new internal ctor.
+	* HttpWebRequest.cs: use new ctor to encapsulate the innerException.
+	Fixes #323452.
+
+2009-06-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: for unknown methods, always send the request once
+	we are connected even if there's no writeStream. Fixes bug #513087.
+
+2009-06-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: ProtocolViolationException is not thrown in
+	certain cases since 2.0. Fixes bug #508027.
+
+2009-06-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequest.cs: follow MS docs when throwing
+	ProtocolViolationException at the beginning of an asynchronous
+	operation. Fixes bug #465613.
+
+2009-06-08 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebConnectionStream.cs: throw a WebException instead of an IOException.
+
+2009-06-08 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* FtpWebRequest.cs: avoid exception when the reply from the server
+	contains just response code. Fixes bug #510852.
+
 2009-06-05  Robert Jordan  <robertj at gmx.net>
 
 	* WebClient.cs (UploadValuesCore): Encode POST arguments with UTF-8.
diff --git a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
index 12d3602..82d3369 100644
--- a/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
+++ b/mcs/class/System/System.Net/DefaultCertificatePolicy.cs
@@ -39,6 +39,11 @@ namespace System.Net {
 		// but) expired certificates.
 		public bool CheckValidationResult (ServicePoint point, X509Certificate certificate, WebRequest request, int certificateProblem)
 		{
+#if NET_2_0 && SECURITY_DEP
+			// If using default policy and the new callback is there, ignore this
+			if (ServicePointManager.ServerCertificateValidationCallback != null)
+				return true;
+#endif
 			switch (certificateProblem) {
 				case 0:			// No error
 				case -2146762495:	// CERT_E_EXPIRED 0x800B0101 (WinError.h)
@@ -49,3 +54,4 @@ namespace System.Net {
 		}
 	}
 }
+
diff --git a/mcs/class/System/System.Net/EndPoint.cs b/mcs/class/System/System.Net/EndPoint.cs
index f1b0bc3..73b55c8 100644
--- a/mcs/class/System/System.Net/EndPoint.cs
+++ b/mcs/class/System/System.Net/EndPoint.cs
@@ -35,27 +35,31 @@ namespace System.Net {
 	public abstract class EndPoint {
 
 		// NB: These methods really do nothing but throw
-		// NotSupportedException
+		// NotImplementedException
 		
 		public virtual AddressFamily AddressFamily {
-			get {
-				throw new NotSupportedException();
-			}
+			get { throw NotImplemented (); }
 		}
 		
 		public virtual EndPoint Create (SocketAddress address)
 		{
-			throw new NotSupportedException();
+			throw NotImplemented ();
 		}
 
 		public virtual SocketAddress Serialize ()
 		{
-			throw new NotSupportedException();
+			throw NotImplemented ();
 		}
 
 		protected EndPoint ()
 		{
 		}
+
+		static Exception NotImplemented ()
+		{
+			// hide the "normal" NotImplementedException from corcompare-like tools
+			return new NotImplementedException ();
+		}
 	}
 }
 
diff --git a/mcs/class/System/System.Net/EndPointListener.cs b/mcs/class/System/System.Net/EndPointListener.cs
index 16f4ea0..5d55a75 100644
--- a/mcs/class/System/System.Net/EndPointListener.cs
+++ b/mcs/class/System/System.Net/EndPointListener.cs
@@ -114,7 +114,7 @@ namespace System.Net {
 		{
 			HttpListenerRequest req = context.Request;
 			ListenerPrefix prefix;
-			HttpListener listener = SearchListener (req.UserHostName, req.RawUrl, out prefix);
+			HttpListener listener = SearchListener (req.UserHostName, req.Url, out prefix);
 			if (listener == null)
 				return false;
 
@@ -131,15 +131,15 @@ namespace System.Net {
 
 			HttpListenerRequest req = context.Request;
 			ListenerPrefix prefix;
-			HttpListener listener = SearchListener (req.UserHostName, req.RawUrl, out prefix);
+			HttpListener listener = SearchListener (req.UserHostName, req.Url, out prefix);
 			if (listener != null)
 				listener.UnregisterContext (context);
 		}
 
-		HttpListener SearchListener (string host, string raw_url, out ListenerPrefix prefix)
+		HttpListener SearchListener (string host, Uri uri, out ListenerPrefix prefix)
 		{
 			prefix = null;
-			if (raw_url == null)
+			if (uri == null)
 				return null;
 
 			//TODO: We should use a ReaderWriterLock between this and the add/remove operations.
@@ -149,13 +149,7 @@ namespace System.Net {
 					host = host.Substring (0, colon);
 			}
 
-			string path;
-			Uri raw_uri;
-			if (Uri.MaybeUri (raw_url) && Uri.TryCreate (raw_url, UriKind.Absolute, out raw_uri))
-				path = raw_uri.PathAndQuery;
-			else
-				path = HttpUtility.UrlDecode (raw_url);
-			
+			string path = HttpUtility.UrlDecode (uri.AbsolutePath);
 			string path_slash = path [path.Length - 1] == '/' ? path : path + "/";
 			
 			HttpListener best_match = null;
diff --git a/mcs/class/System/System.Net/FtpWebRequest.cs b/mcs/class/System/System.Net/FtpWebRequest.cs
index 20ae470..32ae9a1 100644
--- a/mcs/class/System/System.Net/FtpWebRequest.cs
+++ b/mcs/class/System/System.Net/FtpWebRequest.cs
@@ -1076,7 +1076,7 @@ namespace System.Net
 				if (!Int32.TryParse (response.Substring (0, 3), out code))
 					return ServiceNotAvailable ();
 
-				if (response [3] == '-'){
+				if (response.Length > 3 && response [3] == '-'){
 					string line = null;
 					string find = code.ToString() + ' ';
 					while (true){
diff --git a/mcs/class/System/System.Net/HttpConnection.cs b/mcs/class/System/System.Net/HttpConnection.cs
index 76df53a..cbf7787 100644
--- a/mcs/class/System/System.Net/HttpConnection.cs
+++ b/mcs/class/System/System.Net/HttpConnection.cs
@@ -312,6 +312,11 @@ namespace System.Net {
 
 		public void Close ()
 		{
+			Close (false);
+		}
+
+		internal void Close (bool force_close)
+		{
 			if (sock != null) {
 				Stream st = GetResponseStream ();
 				st.Close ();
@@ -319,7 +324,7 @@ namespace System.Net {
 			}
 
 			if (sock != null) {
-				if (chunked && context.Response.ForceCloseChunked == false) {
+				if (!force_close && chunked && context.Response.ForceCloseChunked == false) {
 					// Don't close. Keep working.
 					chunked_uses++;
 					Unbind ();
@@ -328,7 +333,7 @@ namespace System.Net {
 					return;
 				}
 
-				if (context.Response.Headers ["connection"] == "close") {
+				if (force_close || context.Response.Headers ["connection"] == "close") {
 					Socket s = sock;
 					sock = null;
 					try {
diff --git a/mcs/class/System/System.Net/HttpListenerResponse.cs b/mcs/class/System/System.Net/HttpListenerResponse.cs
index 0b4bf74..413326f 100644
--- a/mcs/class/System/System.Net/HttpListenerResponse.cs
+++ b/mcs/class/System/System.Net/HttpListenerResponse.cs
@@ -331,8 +331,7 @@ namespace System.Net {
 
 		void Close (bool force)
 		{
-			// TODO: use the 'force' argument
-			context.Connection.Close ();
+			context.Connection.Close (force);
 			disposed = true;
 		}
 
diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs
index 5d410dc..d83142b 100644
--- a/mcs/class/System/System.Net/HttpWebRequest.cs
+++ b/mcs/class/System/System.Net/HttpWebRequest.cs
@@ -86,7 +86,7 @@ namespace System.Net
 		WebAsyncResult asyncWrite;
 		WebAsyncResult asyncRead;
 		EventHandler abortHandler;
-		bool aborted;
+		int aborted;
 		bool gotRequestStream;
 		int redirects;
 		bool expectContinue;
@@ -98,6 +98,7 @@ namespace System.Net
 		object locker = new object ();
 		bool is_ntlm_auth;
 		bool finished_reading;
+		internal WebConnection WebConnection;
 #if NET_2_0
 		DecompressionMethods auto_decomp;
 #endif
@@ -640,31 +641,23 @@ namespace System.Net
 		}
 #endif
 		
-		void CommonChecks (bool putpost)
-		{
-			if (method == null)
-				throw new ProtocolViolationException ("Method is null.");
-
-			if (putpost && contentLength == -1 && !sendChunked && !allowBuffering)
-				throw new ProtocolViolationException ("Content-Length not set");
-
-			string transferEncoding = TransferEncoding;
-			if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")
-				throw new ProtocolViolationException ("SendChunked should be true.");
-		}
-
 		public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state) 
 		{
-			if (aborted)
-				throw new WebException ("The request was previosly aborted.");
+			if (Aborted)
+				throw new WebException ("The request was canceled.", WebExceptionStatus.RequestCanceled);
 
 			bool send = !(method == "GET" || method == "CONNECT" || method == "HEAD" ||
 					method == "TRACE" || method == "DELETE");
 			if (method == null || !send)
 				throw new ProtocolViolationException ("Cannot send data when method is: " + method);
 
-			CommonChecks (send);
-			
+			if (contentLength == -1 && !sendChunked && !allowBuffering && KeepAlive)
+				throw new ProtocolViolationException ("Content-Length not set");
+
+			string transferEncoding = TransferEncoding;
+			if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")
+				throw new ProtocolViolationException ("SendChunked should be true.");
+
 			lock (locker)
 			{
 				if (asyncWrite != null) {
@@ -742,13 +735,26 @@ namespace System.Net
 
 		public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
 		{
-			bool send = (method == "PUT" || method == "POST");
-			if (send) {
-				if (ContentLength == -1 && !SendChunked && !AllowWriteStreamBuffering)
-					throw new ProtocolViolationException ("Content-Length not set");
-			}
+			if (Aborted)
+				throw new WebException ("The request was canceled.", WebExceptionStatus.RequestCanceled);
+
+			if (method == null)
+				throw new ProtocolViolationException ("Method is null.");
+
+#if !NET_2_0
+			bool send = !(method == "GET" || method == "CONNECT" || method == "HEAD" ||
+						method == "TRACE" || method == "DELETE");
+			if (send && contentLength < 0 && !sendChunked && !allowBuffering && KeepAlive)
+				throw new ProtocolViolationException ("Buffering is disabled, ContentLength is negative and SendChunked is disabled.");
+
+			if (!send && (contentLength > -1 || sendChunked))
+				throw new ProtocolViolationException ("ContentLength can't be set for non-write operations.");
+#endif
+
+			string transferEncoding = TransferEncoding;
+			if (!sendChunked && transferEncoding != null && transferEncoding.Trim () != "")
+				throw new ProtocolViolationException ("SendChunked should be true.");
 
-			CommonChecks (send);
 			Monitor.Enter (locker);
 			getResponseCalled = true;
 			if (asyncRead != null && !haveResponse) {
@@ -822,16 +828,26 @@ namespace System.Net
 			set { finished_reading = value; }
 		}
 
+		internal bool Aborted {
+			get { return Interlocked.CompareExchange (ref aborted, 0, 0) == 1; }
+		}
+
 		public override void Abort ()
 		{
-			if (aborted)
+			if (Interlocked.CompareExchange (ref aborted, 1, 0) == 1)
 				return;
 
-			aborted = true;
 			if (haveResponse && finished_reading)
 				return;
 
 			haveResponse = true;
+			if (abortHandler != null) {
+				try {
+					abortHandler (this, EventArgs.Empty);
+				} catch (Exception) {}
+				abortHandler = null;
+			}
+
 			if (asyncWrite != null) {
 				WebAsyncResult r = asyncWrite;
 				if (!r.IsCompleted) {
@@ -856,13 +872,6 @@ namespace System.Net
 				asyncRead = null;
 			}			
 
-			if (abortHandler != null) {
-				try {
-					abortHandler (this, EventArgs.Empty);
-				} catch (Exception) {}
-				abortHandler = null;
-			}
-
 			if (writeStream != null) {
 				try {
 					writeStream.Close ();
@@ -988,15 +997,15 @@ namespace System.Net
 		string GetHeaders ()
 		{
 			bool continue100 = false;
-			if (contentLength != -1) {
+			if (sendChunked) {
+				continue100 = true;
+				webHeaders.RemoveAndAdd ("Transfer-Encoding", "chunked");
+				webHeaders.RemoveInternal ("Content-Length");
+			} else if (contentLength != -1) {
 				if (contentLength > 0)
 					continue100 = true;
 				webHeaders.SetInternal ("Content-Length", contentLength.ToString ());
 				webHeaders.RemoveInternal ("Transfer-Encoding");
-			} else if (sendChunked) {
-				continue100 = true;
-				webHeaders.RemoveAndAdd ("Transfer-Encoding", "chunked");
-				webHeaders.RemoveInternal ("Content-Length");
 			}
 
 			if (actualVersion == HttpVersion.Version11 && continue100 &&
@@ -1034,7 +1043,7 @@ namespace System.Net
 			if ((auto_decomp & DecompressionMethods.Deflate) != 0)
 				accept_encoding = accept_encoding != null ? "gzip, deflate" : "deflate";
 			if (accept_encoding != null)
-				webHeaders.SetInternal ("Accept-Encoding", accept_encoding);
+				webHeaders.RemoveAndAdd ("Accept-Encoding", accept_encoding);
 #endif
 			if (!usedPreAuth && preAuthenticate)
 				DoPreAuthenticate ();
@@ -1057,9 +1066,9 @@ namespace System.Net
 			usedPreAuth = true;
 		}
 		
-		internal void SetWriteStreamError (WebExceptionStatus status)
+		internal void SetWriteStreamError (WebExceptionStatus status, Exception exc)
 		{
-			if (aborted)
+			if (Aborted)
 				return;
 
 			WebAsyncResult r = asyncWrite;
@@ -1067,12 +1076,21 @@ namespace System.Net
 				r = asyncRead;
 
 			if (r != null) {
-				r.SetCompleted (false, new WebException ("Error: " + status, status));
+				string msg;
+				WebException wex;
+				if (exc == null) {
+					msg = "Error: " + status;
+					wex = new WebException (msg, status);
+				} else {
+					msg = String.Format ("Error: {0} ({1})", status, exc.Message);
+					wex = new WebException (msg, exc, status);
+				}
+				r.SetCompleted (false, wex);
 				r.DoCallback ();
 			}
 		}
 
-		internal void SendRequestHeaders ()
+		internal void SendRequestHeaders (bool propagate_error)
 		{
 			StringBuilder req = new StringBuilder ();
 			string query;
@@ -1101,17 +1119,21 @@ namespace System.Net
 			string reqstr = req.ToString ();
 			byte [] bytes = Encoding.UTF8.GetBytes (reqstr);
 			try {
-				writeStream.SetHeaders (bytes, 0, bytes.Length);
+				writeStream.SetHeaders (bytes);
 			} catch (WebException wexc) {
-				SetWriteStreamError (wexc.Status);
-			} catch (Exception) {
-				SetWriteStreamError (WebExceptionStatus.SendFailure);
+				SetWriteStreamError (wexc.Status, wexc);
+				if (propagate_error)
+					throw;
+			} catch (Exception exc) {
+				SetWriteStreamError (WebExceptionStatus.SendFailure, exc);
+				if (propagate_error)
+					throw;
 			}
 		}
 
 		internal void SetWriteStream (WebConnectionStream stream)
 		{
-			if (aborted)
+			if (Aborted)
 				return;
 			
 			writeStream = stream;
@@ -1121,7 +1143,7 @@ namespace System.Net
 				writeStream.SendChunked = false;
 			}
 
-			SendRequestHeaders ();
+			SendRequestHeaders (false);
 
 			haveRequest = true;
 			
@@ -1131,7 +1153,8 @@ namespace System.Net
 				writeStream.Write (bodyBuffer, 0, bodyBufferLength);
 				bodyBuffer = null;
 				writeStream.Close ();
-			} else if (method == "PUT" || method == "POST" || method == "OPTIONS") {
+			} else if (method != "HEAD" && method != "GET" && method != "MKCOL" && method != "CONNECT" &&
+					method != "DELETE" && method != "TRACE") {
 				if (getResponseCalled && !writeStream.RequestWritten)
 					writeStream.WriteRequest ();
 			}
@@ -1145,7 +1168,7 @@ namespace System.Net
 
 		internal void SetResponseError (WebExceptionStatus status, Exception e, string where)
 		{
-			if (aborted)
+			if (Aborted)
 				return;
 			lock (locker) {
 			string msg = String.Format ("Error getting response stream ({0}): {1}", where, status);
@@ -1215,7 +1238,7 @@ namespace System.Net
 		internal void SetResponseData (WebConnectionData data)
 		{
 			lock (locker) {
-			if (aborted) {
+			if (Aborted) {
 				if (data.stream != null)
 					data.stream.Close ();
 				return;
diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs
index f9bc2a7..3a7de6b 100644
--- a/mcs/class/System/System.Net/ServicePoint.cs
+++ b/mcs/class/System/System.Net/ServicePoint.cs
@@ -179,7 +179,6 @@ namespace System.Net
 			set { SendContinue = value; }
 		}
 
-		[MonoTODO ("Use me")]
 		public bool UseNagleAlgorithm {
 			get { return useNagle; }
 			set { useNagle = value; }
diff --git a/mcs/class/System/System.Net/ServicePointManager.cs b/mcs/class/System/System.Net/ServicePointManager.cs
index bea42e4..22926e3 100644
--- a/mcs/class/System/System.Net/ServicePointManager.cs
+++ b/mcs/class/System/System.Net/ServicePointManager.cs
@@ -109,6 +109,9 @@ namespace System.Net
 #endif
 		static bool useNagle;
 #endif
+#if NET_2_0
+		static RemoteCertificateValidationCallback server_cert_cb;
+#endif
 
 		// Fields
 		
@@ -240,15 +243,14 @@ namespace System.Net
 			set { _securityProtocol = value; }
 		}
 
-#if NET_2_0 && SECURITY_DEP
-		[MonoTODO]
+#if NET_2_0
 		public static RemoteCertificateValidationCallback ServerCertificateValidationCallback
 		{
 			get {
-				throw GetMustImplement ();
+				return server_cert_cb;
 			}
 			set {
-				throw GetMustImplement ();
+				server_cert_cb = value;
 			}
 		}
 #endif
diff --git a/mcs/class/System/System.Net/WebAsyncResult.cs b/mcs/class/System/System.Net/WebAsyncResult.cs
index 6d0a3f4..3c0a315 100644
--- a/mcs/class/System/System.Net/WebAsyncResult.cs
+++ b/mcs/class/System/System.Net/WebAsyncResult.cs
@@ -51,6 +51,7 @@ namespace System.Net
 		int size;
 		object locker = new object ();
 		public bool EndCalled;
+		public bool AsyncWriteAll;
 
 		public WebAsyncResult (AsyncCallback cb, object state)
 		{
diff --git a/mcs/class/System/System.Net/WebClient.cs b/mcs/class/System/System.Net/WebClient.cs
index 4b46f4c..6018c73 100644
--- a/mcs/class/System/System.Net/WebClient.cs
+++ b/mcs/class/System/System.Net/WebClient.cs
@@ -103,7 +103,7 @@ namespace System.Net
 			for (int i = '0'; i <= '9'; i++, index++)
 				hexBytes [index] = (byte) i;
 
-			for (int i = 'A'; i <= 'F'; i++, index++)
+			for (int i = 'a'; i <= 'f'; i++, index++)
 				hexBytes [index] = (byte) i;
 		}
 		
@@ -117,7 +117,7 @@ namespace System.Net
 			get {
 				if (baseString == null) {
 					if (baseAddress == null)
-						return "";
+						return string.Empty;
 				}
 
 				baseString = baseAddress.ToString ();
@@ -125,7 +125,7 @@ namespace System.Net
 			}
 			
 			set {
-				if (value == null || value == "") {
+				if (value == null || value.Length == 0) {
 					baseAddress = null;
 				} else {
 					baseAddress = new Uri (value);
@@ -196,7 +196,7 @@ namespace System.Net
 			get { return encoding; }
 			set {
 				if (value == null)
-					throw new ArgumentNullException ("value");
+					throw new ArgumentNullException ("Encoding");
 				encoding = value;
 			}
 		}
@@ -272,13 +272,15 @@ namespace System.Net
 			
 			try {
 				request = SetupRequest (address);
-				WebResponse response = request.GetResponse ();
-				Stream st = ProcessResponse (response);
+				WebResponse response = GetWebResponse (request);
+				Stream st = response.GetResponseStream ();
 				return ReadAll (st, (int) response.ContentLength, userToken);
 			} catch (ThreadInterruptedException){
 				if (request != null)
 					request.Abort ();
 				throw;
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -315,6 +317,8 @@ namespace System.Net
 				async = false;
 #endif				
 				DownloadFileCore (address, fileName, null);
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -330,8 +334,8 @@ namespace System.Net
 			using (FileStream f = new FileStream (fileName, FileMode.Create)) {
 				try {
 					request = SetupRequest (address);
-					WebResponse response = request.GetResponse ();
-					Stream st = ProcessResponse (response);
+					WebResponse response = GetWebResponse (request);
+					Stream st = response.GetResponseStream ();
 					
 					int cLength = (int) response.ContentLength;
 					int length = (cLength <= -1 || cLength > 32*1024) ? 32*1024 : cLength;
@@ -389,8 +393,10 @@ namespace System.Net
 				async = false;
 #endif				
 				request = SetupRequest (address);
-				WebResponse response = request.GetResponse ();
-				return ProcessResponse (response);
+				WebResponse response = GetWebResponse (request);
+				return response.GetResponseStream ();
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -446,6 +452,8 @@ namespace System.Net
 #endif				
 				WebRequest request = SetupRequest (address, method, true);
 				return request.GetRequestStream ();
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -541,8 +549,8 @@ namespace System.Net
 					stream.Write (data, 0, contentLength);
 				}
 				
-				WebResponse response = request.GetResponse ();
-				Stream st = ProcessResponse (response);
+				WebResponse response = GetWebResponse (request);
+				Stream st = response.GetResponseStream ();
 				return ReadAll (st, (int) response.ContentLength, userToken);
 			} catch (ThreadInterruptedException){
 				if (request != null)
@@ -594,6 +602,8 @@ namespace System.Net
 				async = false;
 #endif				
 				return UploadFileCore (address, method, fileName, null);
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -651,8 +661,8 @@ namespace System.Net
 				reqStream.Write (realBoundary, 0, realBoundary.Length);
 				reqStream.Close ();
 				reqStream = null;
-				WebResponse response = request.GetResponse ();
-				Stream st = ProcessResponse (response);
+				WebResponse response = GetWebResponse (request);
+				Stream st = response.GetResponseStream ();
 				resultBytes = ReadAll (st, (int) response.ContentLength, userToken);
 			} catch (ThreadInterruptedException){
 				if (request != null)
@@ -715,6 +725,8 @@ namespace System.Net
 				async = false;
 #endif				
 				return UploadValuesCore (address, method, data, null);
+			} catch (WebException wexc) {
+				throw;
 			} catch (Exception ex) {
 				throw new WebException ("An error occurred " +
 					"performing a WebClient request.", ex);
@@ -738,7 +750,6 @@ namespace System.Net
 			Headers ["Content-Type"] = urlEncodedCType;
 			WebRequest request = SetupRequest (uri, method, true);
 			try {
-				Stream rqStream = request.GetRequestStream ();
 				MemoryStream tmpStream = new MemoryStream ();
 				foreach (string key in data) {
 					byte [] bytes = Encoding.UTF8.GetBytes (key);
@@ -754,12 +765,14 @@ namespace System.Net
 					tmpStream.SetLength (--length); // remove trailing '&'
 				
 				byte [] buf = tmpStream.GetBuffer ();
-				rqStream.Write (buf, 0, length);
-				rqStream.Close ();
+				request.ContentLength = length;
+				using (Stream rqStream = request.GetRequestStream ()) {
+					rqStream.Write (buf, 0, length);
+				}
 				tmpStream.Close ();
 				
-				WebResponse response = request.GetResponse ();
-				Stream st = ProcessResponse (response);
+				WebResponse response = GetWebResponse (request);
+				Stream st = response.GetResponseStream ();
 				return ReadAll (st, (int) response.ContentLength, userToken);
 			} catch (ThreadInterruptedException) {
 				request.Abort ();
@@ -925,7 +938,7 @@ namespace System.Net
 		
 		WebRequest SetupRequest (Uri uri)
 		{
-			WebRequest request = WebRequest.Create (uri);
+			WebRequest request = GetWebRequest (uri);
 #if NET_2_0
 			if (Proxy != null)
 				request.Proxy = Proxy;
@@ -980,12 +993,6 @@ namespace System.Net
 			return request;
 		}
 
-		Stream ProcessResponse (WebResponse response)
-		{
-			responseHeaders = response.Headers;
-			return response.GetResponseStream ();
-		}
-
 		byte [] ReadAll (Stream stream, int length, object userToken)
 		{
 			MemoryStream ms = null;
@@ -1228,8 +1235,8 @@ namespace System.Net
 					WebRequest request = null;
 					try {
 						request = SetupRequest ((Uri) args [0]);
-						WebResponse response = request.GetResponse ();
-						Stream stream = ProcessResponse (response);
+						WebResponse response = GetWebResponse (request);
+						Stream stream = response.GetResponseStream ();
 						OnOpenReadCompleted (
 							new OpenReadCompletedEventArgs (stream, null, false, args [1]));
 					} catch (ThreadInterruptedException){
@@ -1533,21 +1540,32 @@ namespace System.Net
 				UploadValuesCompleted (this, args);
 		}
 
-		[MonoNotSupported("")]
-		protected virtual WebRequest GetWebRequest (Uri address)
+		protected virtual WebResponse GetWebResponse (WebRequest request, IAsyncResult result)
 		{
-			throw new NotImplementedException ();
+			WebResponse response = request.EndGetResponse (result);
+			responseHeaders = response.Headers;
+			return response;
 		}
+#endif
 
-		protected virtual WebResponse GetWebResponse (WebRequest request)
+#if NET_2_0
+		protected virtual
+#endif
+		WebRequest GetWebRequest (Uri address)
 		{
-			return request.GetResponse ();
+			return WebRequest.Create (address);
 		}
 
-		protected virtual WebResponse GetWebResponse (WebRequest request, IAsyncResult result)
+#if NET_2_0
+		protected virtual
+#endif
+		WebResponse GetWebResponse (WebRequest request)
 		{
-			return request.EndGetResponse (result);
+			WebResponse response = request.GetResponse ();
+			responseHeaders = response.Headers;
+			return response;
 		}
-#endif
+
 	}
 }
+
diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs
index 6f0adbd..6c005e4 100644
--- a/mcs/class/System/System.Net/WebConnection.cs
+++ b/mcs/class/System/System.Net/WebConnection.cs
@@ -45,7 +45,7 @@ namespace System.Net
 		Headers,
 		Content
 	}
-	
+
 	class WebConnection
 	{
 		ServicePoint sPoint;
@@ -58,6 +58,7 @@ namespace System.Net
 		byte [] buffer;
 		static AsyncCallback readDoneDelegate = new AsyncCallback (ReadDone);
 		EventHandler abortHandler;
+		AbortHelper abortHelper;
 		ReadState readState;
 		internal WebConnectionData Data;
 		bool chunkedRead;
@@ -75,6 +76,7 @@ namespace System.Net
 
 		bool ssl;
 		bool certsAvailable;
+		Exception connect_exception;
 		static object classLock = new object ();
 		static Type sslStream;
 		static PropertyInfo piClient;
@@ -88,8 +90,22 @@ namespace System.Net
 			readState = ReadState.None;
 			Data = new WebConnectionData ();
 			initConn = new WaitCallback (InitConnection);
-			abortHandler = new EventHandler (Abort);
 			queue = group.Queue;
+			abortHelper = new AbortHelper ();
+			abortHelper.Connection = this;
+			abortHandler = new EventHandler (abortHelper.Abort);
+		}
+
+		class AbortHelper {
+			public WebConnection Connection;
+
+			public void Abort (object sender, EventArgs args)
+			{
+				WebConnection other = ((HttpWebRequest) sender).WebConnection;
+				if (other == null)
+					other = Connection;
+				other.Abort (sender, args);
+			}
 		}
 
 		bool CanReuse ()
@@ -99,7 +115,7 @@ namespace System.Net
 			return (socket.Poll (0, SelectMode.SelectRead) == false);
 		}
 		
-		void Connect ()
+		void Connect (HttpWebRequest request)
 		{
 			lock (socketLock) {
 				if (socket != null && socket.Connected && status == WebExceptionStatus.Success) {
@@ -125,13 +141,15 @@ namespace System.Net
 					return;
 				}
 
+				WebConnectionData data = Data;
 				foreach (IPAddress address in hostEntry.AddressList) {
 					socket = new Socket (address.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
-
 					IPEndPoint remote = new IPEndPoint (address, sPoint.Address.Port);
-
+#if NET_1_1
+					socket.SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, sPoint.UseNagleAlgorithm ? 0 : 1);
+#endif
 #if NET_2_0
-					socket.NoDelay = true;
+					socket.NoDelay = !sPoint.UseNagleAlgorithm;
 					if (!sPoint.CallEndPointDelegate (socket, remote)) {
 						socket.Close ();
 						socket = null;
@@ -139,16 +157,29 @@ namespace System.Net
 					} else {
 #endif
 						try {
+							if (request.Aborted)
+								return;
 							socket.Connect (remote);
 							status = WebExceptionStatus.Success;
 							break;
-						} catch (SocketException) {
-							// This might be null if the request is aborted
-							if (socket != null) {
-								socket.Close ();
-								socket = null;
+						} catch (ThreadAbortException) {
+							// program exiting...
+							Socket s = socket;
+							socket = null;
+							if (s != null)
+								s.Close ();
+							return;
+						} catch (ObjectDisposedException exc) {
+							// socket closed from another thread
+							return;
+						} catch (Exception exc) {
+							Socket s = socket;
+							socket = null;
+							if (s != null)
+								s.Close ();
+							if (!request.Aborted)
 								status = WebExceptionStatus.ConnectFailure;
-							}
+							connect_exception = exc;
 						}
 #if NET_2_0
 					}
@@ -308,7 +339,8 @@ namespace System.Net
 					nstream = serverStream;
 				}
 			} catch (Exception) {
-				status = WebExceptionStatus.ConnectFailure;
+				if (!request.Aborted)
+					status = WebExceptionStatus.ConnectFailure;
 				return false;
 			}
 
@@ -432,7 +464,7 @@ namespace System.Net
 
 			data.stream = stream;
 			
-			if (!ExpectContent (data.StatusCode))
+			if (!ExpectContent (data.StatusCode) || data.request.Method == "HEAD")
 				stream.ForceCompletion ();
 
 			data.request.SetResponseData (data);
@@ -570,34 +602,38 @@ namespace System.Net
 		void InitConnection (object state)
 		{
 			HttpWebRequest request = (HttpWebRequest) state;
+			request.WebConnection = this;
 
-			if (status == WebExceptionStatus.RequestCanceled) {
-				lock (this) {
-					busy = false;
-					Data = new WebConnectionData ();
-					SendNext ();
-				}
+			if (request.Aborted)
 				return;
-			}
 
 			keepAlive = request.KeepAlive;
 			Data = new WebConnectionData ();
 			Data.request = request;
 		retry:
-			Connect ();
+			Connect (request);
+			if (request.Aborted)
+				return;
+
 			if (status != WebExceptionStatus.Success) {
-				if (status != WebExceptionStatus.RequestCanceled) {
-					request.SetWriteStreamError (status);
+				if (!request.Aborted) {
+					request.SetWriteStreamError (status, connect_exception);
 					Close (true);
 				}
 				return;
 			}
 			
 			if (!CreateStream (request)) {
+				if (request.Aborted)
+					return;
+
+				WebExceptionStatus st = status;
 				if (Data.Challenge != null)
 					goto retry;
 
-				request.SetWriteStreamError (status);
+				Exception cnc_exc = connect_exception;
+				connect_exception = null;
+				request.SetWriteStreamError (st, cnc_exc);
 				Close (true);
 				return;
 			}
@@ -608,6 +644,9 @@ namespace System.Net
 		
 		internal EventHandler SendRequest (HttpWebRequest request)
 		{
+			if (request.Aborted)
+				return null;
+
 			lock (this) {
 				if (!busy) {
 					busy = true;
@@ -702,10 +741,14 @@ namespace System.Net
 		}
 
 
-		internal IAsyncResult BeginRead (byte [] buffer, int offset, int size, AsyncCallback cb, object state)
+		internal IAsyncResult BeginRead (HttpWebRequest request, byte [] buffer, int offset, int size, AsyncCallback cb, object state)
 		{
-			if (nstream == null)
-				return null;
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					return null;
+			}
 
 			IAsyncResult result = null;
 			if (!chunkedRead || chunkStream.WantMore) {
@@ -732,10 +775,14 @@ namespace System.Net
 			return result;
 		}
 		
-		internal int EndRead (IAsyncResult result)
+		internal int EndRead (HttpWebRequest request, IAsyncResult result)
 		{
-			if (nstream == null)
-				return 0;
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+			}
 
 			int nbytes = 0;
 			WebAsyncResult wr = null;
@@ -814,12 +861,17 @@ namespace System.Net
 
 			return true;
   		}
-		internal IAsyncResult BeginWrite (byte [] buffer, int offset, int size, AsyncCallback cb, object state)
+
+		internal IAsyncResult BeginWrite (HttpWebRequest request, byte [] buffer, int offset, int size, AsyncCallback cb, object state)
 		{
-			IAsyncResult result = null;
-			if (nstream == null)
-				return null;
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					return null;
+			}
 
+			IAsyncResult result = null;
 			try {
 				result = nstream.BeginWrite (buffer, offset, size, cb, state);
 			} catch (Exception) {
@@ -830,10 +882,39 @@ namespace System.Net
 			return result;
 		}
 
-		internal bool EndWrite (IAsyncResult result)
+		internal void EndWrite2 (HttpWebRequest request, IAsyncResult result)
 		{
-			if (nstream == null)
-				return false;
+			if (request.FinishedReading)
+				return;
+
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+			}
+
+			try {
+				nstream.EndWrite (result);
+			} catch (Exception exc) {
+				status = WebExceptionStatus.SendFailure;
+				if (exc.InnerException != null)
+					throw exc.InnerException;
+				throw;
+			}
+		}
+
+		internal bool EndWrite (HttpWebRequest request, IAsyncResult result)
+		{
+			if (request.FinishedReading)
+				return true;
+
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+			}
 
 			try {
 				nstream.EndWrite (result);
@@ -844,10 +925,14 @@ namespace System.Net
 			}
 		}
 
-		internal int Read (byte [] buffer, int offset, int size)
+		internal int Read (HttpWebRequest request, byte [] buffer, int offset, int size)
 		{
-			if (nstream == null)
-				return 0;
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					return 0;
+			}
 
 			int result = 0;
 			try {
@@ -879,10 +964,15 @@ namespace System.Net
 			return result;
 		}
 
-		internal bool Write (byte [] buffer, int offset, int size)
+		internal bool Write (HttpWebRequest request, byte [] buffer, int offset, int size, ref string err_msg)
 		{
-			if (nstream == null)
-				return false;
+			err_msg = null;
+			lock (this) {
+				if (Data.request != request)
+					throw new ObjectDisposedException (typeof (NetworkStream).FullName);
+				if (nstream == null)
+					return false;
+			}
 
 			try {
 				nstream.Write (buffer, offset, size);
@@ -890,8 +980,9 @@ namespace System.Net
 				if (ssl && !certsAvailable)
 					GetCertificates ();
 			} catch (Exception e) {
+				err_msg = e.Message;
 				WebExceptionStatus wes = WebExceptionStatus.SendFailure;
-				string msg = "Write";
+				string msg = "Write: " + err_msg;
 				if (e is WebException) {
 					HandleError (wes, e, msg);
 					return false;
@@ -927,6 +1018,7 @@ namespace System.Net
 				}
 
 				busy = false;
+				Data = new WebConnectionData ();
 				if (sendNext)
 					SendNext ();
 			}
@@ -935,23 +1027,31 @@ namespace System.Net
 		void Abort (object sender, EventArgs args)
 		{
 			lock (this) {
-				if (Data.request == sender) {
-					if (!Data.request.FinishedReading)
-						HandleError (WebExceptionStatus.RequestCanceled, null, "Abort");
-					return;
-				}
-
 				lock (queue) {
-					if (queue.Count > 0 && queue.Peek () == sender) {
-						queue.Dequeue ();
+					HttpWebRequest req = (HttpWebRequest) sender;
+					if (Data.request == req) {
+						if (!req.FinishedReading) {
+							status = WebExceptionStatus.RequestCanceled;
+							Close (false);
+							if (queue.Count > 0) {
+								Data.request = (HttpWebRequest) queue.Dequeue ();
+								SendRequest (Data.request);
+							}
+						}
 						return;
 					}
 
-					object [] old = queue.ToArray ();
-					queue.Clear ();
-					for (int i = old.Length - 1; i >= 0; i--) {
-						if (old [i] != sender)
-							queue.Enqueue (old [i]);
+					req.FinishedReading = true;
+					req.SetResponseError (WebExceptionStatus.RequestCanceled, null, "User aborted");
+					if (queue.Count > 0 && queue.Peek () == sender) {
+						queue.Dequeue ();
+					} else if (queue.Count > 0) {
+						object [] old = queue.ToArray ();
+						queue.Clear ();
+						for (int i = old.Length - 1; i >= 0; i--) {
+							if (old [i] != sender)
+								queue.Enqueue (old [i]);
+						}
 					}
 				}
 			}
diff --git a/mcs/class/System/System.Net/WebConnectionStream.cs b/mcs/class/System/System.Net/WebConnectionStream.cs
index 362ef04..bafd6e7 100644
--- a/mcs/class/System/System.Net/WebConnectionStream.cs
+++ b/mcs/class/System/System.Net/WebConnectionStream.cs
@@ -46,6 +46,7 @@ namespace System.Net
 		int readBufferSize;
 		int contentLength;
 		int totalRead;
+		long totalWritten;
 		bool nextReadCalled;
 		int pendingReads;
 		int pendingWrites;
@@ -61,7 +62,6 @@ namespace System.Net
 		bool initRead;
 		bool read_eof;
 		bool complete_request_written;
-		long max_buffer_size;
 		int read_timeout;
 		int write_timeout;
 
@@ -77,7 +77,6 @@ namespace System.Net
 			bool chunkedRead = (contentType != null && contentType.ToLower ().IndexOf ("chunked") != -1);
 			string clength = cnc.Data.Headers ["Content-Length"];
 			if (!chunkedRead && clength != null && clength != "") {
-
 				try {
 					contentLength = Int32.Parse (clength);
 					if (contentLength == 0 && !IsNtlmAuth ()) {
@@ -100,15 +99,10 @@ namespace System.Net
 			this.request = request;
 			allowBuffering = request.InternalAllowBuffering;
 			sendChunked = request.SendChunked;
-			if (allowBuffering) {
-				writeBuffer = new MemoryStream ();
-				max_buffer_size = request.ContentLength;
-			} else {
-				max_buffer_size = -1;
-			}
-
 			if (sendChunked)
 				pending = new ManualResetEvent (true);
+			else if (allowBuffering)
+				writeBuffer = new MemoryStream ();
 		}
 
 		bool IsNtlmAuth ()
@@ -127,6 +121,10 @@ namespace System.Net
 			}
 		}
 
+		internal HttpWebRequest Request {
+			get { return request; }
+		}
+
 		internal WebConnection Connection {
 			get { return cnc; }
 		}
@@ -245,7 +243,7 @@ namespace System.Net
 						buffer = new byte [8192];
 
 					int read;
-					while ((read = cnc.Read (buffer, 0, buffer.Length)) != 0)
+					while ((read = cnc.Read (request, buffer, 0, buffer.Length)) != 0)
 						ms.Write (buffer, 0, read);
 
 					b = ms.GetBuffer ();
@@ -264,7 +262,7 @@ namespace System.Net
 					int remaining = new_size - diff;
 					int r = -1;
 					while (remaining > 0 && r != 0) {
-						r = cnc.Read (b, diff, remaining);
+						r = cnc.Read (request, b, diff, remaining);
 						remaining -= r;
 						diff += r;
 					}
@@ -282,7 +280,10 @@ namespace System.Net
 
 	   	void WriteCallbackWrapper (IAsyncResult r)
 		{
-			WebAsyncResult result;
+			WebAsyncResult result = r as WebAsyncResult;
+			if (result != null && result.AsyncWriteAll)
+				return;
+
 			if (r.AsyncState != null) {
 				result = (WebAsyncResult) r.AsyncState;
 				result.InnerAsyncResult = r;
@@ -306,12 +307,6 @@ namespace System.Net
 
 		public override int Read (byte [] buffer, int offset, int size)
 		{
-			if (!isRead)
-				throw new NotSupportedException ("this stream does not allow reading");
-
-			if (totalRead >= contentLength)
-				return 0;
-
 			AsyncCallback cb = new AsyncCallback (ReadCallbackWrapper);
 			WebAsyncResult res = (WebAsyncResult) BeginRead (buffer, offset, size, cb, null);
 			if (!res.IsCompleted && !res.WaitUntilComplete (ReadTimeout, false)) {
@@ -333,8 +328,10 @@ namespace System.Net
 				throw new ArgumentNullException ("buffer");
 
 			int length = buffer.Length;
-			if (size < 0 || offset < 0 || length < offset || length - offset < size)
-				throw new ArgumentOutOfRangeException ();
+			if (offset < 0 || length < offset)
+				throw new ArgumentOutOfRangeException ("offset");
+			if (size < 0 || (length - offset) < size)
+				throw new ArgumentOutOfRangeException ("size");
 
 			lock (locker) {
 				pendingReads++;
@@ -371,7 +368,7 @@ namespace System.Net
 				size = contentLength - totalRead;
 
 			if (!read_eof) {
-				result.InnerAsyncResult = cnc.BeginRead (buffer, offset, size, cb, result);
+				result.InnerAsyncResult = cnc.BeginRead (request, buffer, offset, size, cb, result);
 			} else {
 				result.SetCompleted (true, result.NBytes);
 				result.DoCallback ();
@@ -392,7 +389,7 @@ namespace System.Net
 			if (!result.IsCompleted) {
 				int nbytes = -1;
 				try {
-					nbytes = cnc.EndRead (result);
+					nbytes = cnc.EndRead (request, result);
 				} catch (Exception exc) {
 					lock (locker) {
 						pendingReads--;
@@ -403,6 +400,7 @@ namespace System.Net
 					nextReadCalled = true;
 					cnc.Close (true);
 					result.SetCompleted (false, exc);
+					result.DoCallback ();
 					throw;
 				}
 
@@ -430,10 +428,35 @@ namespace System.Net
 			int nb = result.NBytes;
 			return (nb >= 0) ? nb : 0;
 		}
-		
+
+	   	void WriteRequestAsyncCB (IAsyncResult r)
+		{
+			WebAsyncResult result = (WebAsyncResult) r.AsyncState;
+			try {
+				cnc.EndWrite2 (request, r);
+				result.SetCompleted (false, 0);
+				if (!initRead) {
+					initRead = true;
+					WebConnection.InitRead (cnc);
+				}
+			} catch (Exception e) {
+				KillBuffer ();
+				nextReadCalled = true;
+				cnc.Close (true);
+				if (e is System.Net.Sockets.SocketException)
+					e = new IOException ("Error writing request", e);
+				result.SetCompleted (false, e);
+			}
+			complete_request_written = true;
+			result.DoCallback ();
+		}
+
 		public override IAsyncResult BeginWrite (byte [] buffer, int offset, int size,
 							AsyncCallback cb, object state)
 		{
+			if (request.Aborted)
+				throw new WebException ("The request was canceled.", null, WebExceptionStatus.RequestCanceled);
+
 			if (isRead)
 				throw new NotSupportedException ("this stream does not allow writing");
 
@@ -441,8 +464,10 @@ namespace System.Net
 				throw new ArgumentNullException ("buffer");
 
 			int length = buffer.Length;
-			if (size < 0 || offset < 0 || length < offset || length - offset < size)
-				throw new ArgumentOutOfRangeException ();
+			if (offset < 0 || length < offset)
+				throw new ArgumentOutOfRangeException ("offset");
+			if (size < 0 || (length - offset) < size)
+				throw new ArgumentOutOfRangeException ("size");
 
 			if (sendChunked) {
 				lock (locker) {
@@ -452,22 +477,31 @@ namespace System.Net
 			}
 
 			WebAsyncResult result = new WebAsyncResult (cb, state);
-			if (allowBuffering) {
-				if (max_buffer_size >= 0) {
-					long avail = max_buffer_size - writeBuffer.Length;
-					if (size > avail) {
-						if (requestWritten)
-							throw new ProtocolViolationException (
-							"The number of bytes to be written is greater than " +
-							"the specified ContentLength.");
-					}
-				}
+			if (!sendChunked)
+				CheckWriteOverflow (request.ContentLength, totalWritten, size);
+			if (allowBuffering && !sendChunked) {
+				if (writeBuffer == null)
+					writeBuffer = new MemoryStream ();
 				writeBuffer.Write (buffer, offset, size);
-				if (!sendChunked) {
+				totalWritten += size;
+				if (request.ContentLength > 0 && totalWritten == request.ContentLength) {
+					try {
+						result.AsyncWriteAll = true;
+						result.InnerAsyncResult = WriteRequestAsync (new AsyncCallback (WriteRequestAsyncCB), result);
+						if (result.InnerAsyncResult == null) {
+							if (!result.IsCompleted)
+								result.SetCompleted (true, 0);
+							result.DoCallback ();
+						}
+					} catch (Exception exc) {
+						result.SetCompleted (true, exc);
+						result.DoCallback ();
+					}
+				} else {
 					result.SetCompleted (true, 0);
 					result.DoCallback ();
-					return result;
 				}
+				return result;
 			}
 
 			AsyncCallback callback = null;
@@ -490,10 +524,27 @@ namespace System.Net
 				size = chunkSize;
 			}
 
-			result.InnerAsyncResult = cnc.BeginWrite (buffer, offset, size, callback, result);
+			result.InnerAsyncResult = cnc.BeginWrite (request, buffer, offset, size, callback, result);
+			totalWritten += size;
 			return result;
 		}
 
+		void CheckWriteOverflow (long contentLength, long totalWritten, long size)
+		{
+			if (contentLength == -1)
+				return;
+
+			long avail = contentLength - totalWritten;
+			if (size > avail) {
+				KillBuffer ();
+				nextReadCalled = true;
+				cnc.Close (true);
+				throw new ProtocolViolationException (
+					"The number of bytes to be written is greater than " +
+					"the specified ContentLength.");
+			}
+		}
+
 		public override void EndWrite (IAsyncResult r)
 		{
 			if (r == null)
@@ -507,6 +558,12 @@ namespace System.Net
 				return;
 
 			result.EndCalled = true;
+			if (result.AsyncWriteAll) {
+				result.WaitUntilComplete ();
+				if (result.GotException)
+					throw result.Exception;
+				return;
+			}
 
 			if (allowBuffering && !sendChunked)
 				return;
@@ -514,30 +571,31 @@ namespace System.Net
 			if (result.GotException)
 				throw result.Exception;
 
-			try { 
-				cnc.EndWrite (result.InnerAsyncResult);
+			try {
+				cnc.EndWrite2 (request, result.InnerAsyncResult);
 				result.SetCompleted (false, 0);
+				result.DoCallback ();
 			} catch (Exception e) {
 				result.SetCompleted (false, e);
-			}
-
-			if (sendChunked) {
-				lock (locker) {
-					pendingWrites--;
-					if (pendingWrites == 0)
-						pending.Set ();
+				result.DoCallback ();
+				throw;
+			} finally {
+				if (sendChunked) {
+					lock (locker) {
+						pendingWrites--;
+						if (pendingWrites == 0)
+							pending.Set ();
+					}
 				}
 			}
 		}
 		
 		public override void Write (byte [] buffer, int offset, int size)
 		{
-			if (isRead)
-				throw new NotSupportedException ("This stream does not allow writing");
-
 			AsyncCallback cb = new AsyncCallback (WriteCallbackWrapper);
 			WebAsyncResult res = (WebAsyncResult) BeginWrite (buffer, offset, size, cb, null);
 			if (!res.IsCompleted && !res.WaitUntilComplete (WriteTimeout, false)) {
+				KillBuffer ();
 				nextReadCalled = true;
 				cnc.Close (true);
 				throw new IOException ("Write timed out.");
@@ -550,27 +608,24 @@ namespace System.Net
 		{
 		}
 
-		internal void SetHeaders (byte [] buffer, int offset, int size)
+		internal void SetHeaders (byte [] buffer)
 		{
 			if (headersSent)
 				return;
 
-			if (!allowBuffering || sendChunked) {
-				headersSent = true;
-				if (!cnc.Connected)
-					throw new WebException ("Not connected", null, WebExceptionStatus.SendFailure, null);
-
-				
-				if (!cnc.Write (buffer, offset, size))
-					throw new WebException ("Error writing request.", null, WebExceptionStatus.SendFailure, null);
-
+			headers = buffer;
+			long cl = request.ContentLength;
+			string method = request.Method;
+			bool no_writestream = (method == "GET" || method == "CONNECT" || method == "HEAD" ||
+						method == "TRACE" || method == "DELETE");
+			if (sendChunked || cl > -1 || no_writestream) {
+				WriteHeaders ();
 				if (!initRead) {
 					initRead = true;
 					WebConnection.InitRead (cnc);
 				}
-			} else {
-				headers = new byte [size];
-				Buffer.BlockCopy (buffer, offset, headers, 0, size);
+				if (!sendChunked && cl == 0)
+					requestWritten = true;
 			}
 		}
 
@@ -578,16 +633,34 @@ namespace System.Net
 			get { return requestWritten; }
 		}
 
+		IAsyncResult WriteRequestAsync (AsyncCallback cb, object state)
+		{
+			requestWritten = true;
+			byte [] bytes = writeBuffer.GetBuffer ();
+			int length = (int) writeBuffer.Length;
+			// Headers already written to the stream
+			return (length > 0) ? cnc.BeginWrite (request, bytes, 0, length, cb, state) : null;
+		}
+
+		void WriteHeaders ()
+		{
+			if (headersSent)
+				return;
+
+			headersSent = true;
+			string err_msg = null;
+			if (!cnc.Write (request, headers, 0, headers.Length, ref err_msg))
+				throw new WebException ("Error writing request: " + err_msg, null, WebExceptionStatus.SendFailure, null);
+		}
+
 		internal void WriteRequest ()
 		{
 			if (requestWritten)
 				return;
 
-			if (sendChunked) {
-				request.SendRequestHeaders ();
-				requestWritten = true;
+			requestWritten = true;
+			if (sendChunked)
 				return;
-			}
 
 			if (!allowBuffering || writeBuffer == null)
 				return;
@@ -595,56 +668,37 @@ namespace System.Net
 			byte [] bytes = writeBuffer.GetBuffer ();
 			int length = (int) writeBuffer.Length;
 			if (request.ContentLength != -1 && request.ContentLength < length) {
+				nextReadCalled = true;
+				cnc.Close (true);
 				throw new WebException ("Specified Content-Length is less than the number of bytes to write", null,
 							WebExceptionStatus.ServerProtocolViolation, null);
 			}
 
-			request.InternalContentLength = length;
-			request.SendRequestHeaders ();
-			requestWritten = true;
-
-			//
-			// For small requests, make a copy, it will reduce the traffic, for large
-			// requests, the NoDelay bit on the socket should take effect (set in WebConnection).
-			//
-			if (headers.Length + length < 8192){
-				byte[] b = new byte [headers.Length + length];
-
-				Buffer.BlockCopy (headers, 0, b, 0, headers.Length);
-				Buffer.BlockCopy (bytes, 0, b, headers.Length, length);
-				
-				if (!cnc.Write (b, 0, b.Length))
-					throw new WebException ("Error writing request.", null, WebExceptionStatus.SendFailure, null);
-				
-				headersSent = true;
-				complete_request_written = true;
-				
-				if (!initRead) {
-					initRead = true;
-					WebConnection.InitRead (cnc);
-				}				
-			} else {
-				if (!cnc.Write (headers, 0, headers.Length))
-					throw new WebException ("Error writing request.", null, WebExceptionStatus.SendFailure, null);
-				
-				headersSent = true;
-				if (cnc.Data.StatusCode != 0 && cnc.Data.StatusCode != 100)
-					return;
-				
-				IAsyncResult result = null;
-				if (length > 0)
-					result = cnc.BeginWrite (bytes, 0, length, null, null);
-				
-				if (!initRead) {
-					initRead = true;
-					WebConnection.InitRead (cnc);
-				}
+			if (!headersSent) {
+				string method = request.Method;
+				bool no_writestream = (method == "GET" || method == "CONNECT" || method == "HEAD" ||
+							method == "TRACE" || method == "DELETE");
+				if (!no_writestream)
+					request.InternalContentLength = length;
+				request.SendRequestHeaders (true);
+			}
+			WriteHeaders ();
+			if (cnc.Data.StatusCode != 0 && cnc.Data.StatusCode != 100)
+				return;
 				
-				if (length > 0) 
-					complete_request_written = cnc.EndWrite (result);
-				else
-					complete_request_written = true;
+			IAsyncResult result = null;
+			if (length > 0)
+				result = cnc.BeginWrite (request, bytes, 0, length, null, null);
+			
+			if (!initRead) {
+				initRead = true;
+				WebConnection.InitRead (cnc);
 			}
+
+			if (length > 0) 
+				complete_request_written = cnc.EndWrite (request, result);
+			else
+				complete_request_written = true;
 		}
 
 		internal void InternalClose ()
@@ -652,20 +706,16 @@ namespace System.Net
 			disposed = true;
 		}
 
-		internal void ForceCloseConnection ()
-		{
-			if (!disposed) {
-				disposed = true;
-				cnc.Close (true);
-			}
-		}
-
 		public override void Close ()
 		{
 			if (sendChunked) {
+				if (disposed)
+					return;
+				disposed = true;
 				pending.WaitOne ();
 				byte [] chunk = Encoding.ASCII.GetBytes ("0\r\n\r\n");
-				cnc.Write (chunk, 0, chunk.Length);
+				string err_msg = null;
+				cnc.Write (request, chunk, 0, chunk.Length, ref err_msg);
 				return;
 			}
 
@@ -688,14 +738,17 @@ namespace System.Net
 				return;
 			}
 
-			if (disposed)
+			if (disposed || requestWritten)
 				return;
 
 			long length = request.ContentLength;
 
-			// writeBuffer could be null if KillBuffer was already called.
-			if (writeBuffer != null && length != -1 && length > writeBuffer.Length)
-				throw new IOException ("Cannot close the stream until all bytes are written");
+			if (!sendChunked && length != -1 && totalWritten != length) {
+				IOException io = new IOException ("Cannot close the stream until all bytes are written");
+				nextReadCalled = true;
+				cnc.Close (true);
+				throw new WebException ("Request was cancelled.", io, WebExceptionStatus.RequestCanceled);
+			}
 
 			WriteRequest ();
 			disposed = true;
@@ -721,11 +774,11 @@ namespace System.Net
 		}
 
 		public override bool CanRead {
-			get { return isRead; }
+			get { return !disposed && isRead; }
 		}
 
 		public override bool CanWrite {
-			get { return !isRead; }
+			get { return !disposed && !isRead; }
 		}
 
 		public override long Length {
diff --git a/mcs/class/System/System.Net/WebException.cs b/mcs/class/System/System.Net/WebException.cs
index 6c8c295..be4446b 100644
--- a/mcs/class/System/System.Net/WebException.cs
+++ b/mcs/class/System/System.Net/WebException.cs
@@ -62,6 +62,12 @@ namespace System.Net
 		{
 			this.status = status;
 		}
+		
+		internal WebException (string message, Exception innerException, WebExceptionStatus status)
+			: base (message, innerException)
+		{
+			this.status = status;
+		}
 
 		public WebException(string message, 
 				    Exception innerException,
diff --git a/mcs/class/System/System.Net/WebHeaderCollection.cs b/mcs/class/System/System.Net/WebHeaderCollection.cs
index a210ab0..9c4e94c 100644
--- a/mcs/class/System/System.Net/WebHeaderCollection.cs
+++ b/mcs/class/System/System.Net/WebHeaderCollection.cs
@@ -33,6 +33,9 @@
 
 using System;
 using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
 using System.Collections.Specialized;
 using System.Runtime.InteropServices;
 using System.Runtime.Serialization;
@@ -48,6 +51,9 @@ namespace System.Net
 	{
 		private static readonly Hashtable restricted;
 		private static readonly Hashtable multiValue;
+#if NET_2_0
+		static readonly Dictionary<string, bool> restricted_response;
+#endif
 		private bool internallyCreated = false;
 		
 		// Static Initializer
@@ -71,7 +77,15 @@ namespace System.Net
 			restricted.Add ("referer", true);
 			restricted.Add ("transfer-encoding", true);
 			restricted.Add ("user-agent", true);			
-			
+			restricted.Add ("proxy-connection", true);			
+
+			//
+#if NET_2_0
+			restricted_response = new Dictionary<string, bool> (StringComparer.InvariantCultureIgnoreCase);
+			restricted_response.Add ("Content-Length", true);
+			restricted_response.Add ("Transfer-Encoding", true);
+			restricted_response.Add ("WWW-Authenticate", true);
+#endif
 			// see par 14 of RFC 2068 to see which header names
 			// accept multiple values each separated by a comma
 			multiValue = new Hashtable (CaseInsensitiveHashCodeProvider.DefaultInvariant,
@@ -243,14 +257,25 @@ namespace System.Net
 			if (headerName == "") // MS throw nullexception here!
 				throw new ArgumentException ("empty string", "headerName");
 
+			if (!IsHeaderName (headerName))
+				throw new ArgumentException ("Invalid character in header");
+
 			return restricted.ContainsKey (headerName);
 		}
 
 #if NET_2_0
-		[MonoNotSupported("")]
 		public static bool IsRestricted (string headerName, bool response)
 		{
-			throw new NotImplementedException ();
+			if (String.IsNullOrEmpty (headerName))
+				throw new ArgumentNullException ("headerName");
+
+			if (!IsHeaderName (headerName))
+				throw new ArgumentException ("Invalid character in header");
+
+
+			if (response)
+				return restricted_response.ContainsKey (headerName);
+			return restricted.ContainsKey (headerName);
 		}
 #endif
 
@@ -663,31 +688,30 @@ namespace System.Net
 		
 		internal static bool IsHeaderName (string name)
 		{
-			// token          = 1*<any CHAR except CTLs or tspecials>
-			// tspecials      = "(" | ")" | "<" | ">" | "@"
-			//                | "," | ";" | ":" | "\" | <">
-			//                | "/" | "[" | "]" | "?" | "="
-			//                | "{" | "}" | SP | HT
-			
 			if (name == null || name.Length == 0)
 				return false;
 
 			int len = name.Length;
 			for (int i = 0; i < len; i++) {			
 				char c = name [i];
-				if (c < 0x20 || c >= 0x7f)
+				if (c > 126 || !allowed_chars [(int) c])
 					return false;
 			}
 			
-			return name.IndexOfAny (tspecials) == -1;
+			return true;
 		}
 
-		private static char [] tspecials = 
-				new char [] {'(', ')', '<', '>', '@',
-					     ',', ';', ':', '\\', '"',
-					     '/', '[', ']', '?', '=',
-					     '{', '}', ' ', '\t'};
-							
+		static bool [] allowed_chars = new bool [126] {
+			false, false, false, false, false, false, false, false, false, false, false, false, false, false,
+			false, false, false, false, false, false, false, false, false, false, false, false, false, false,
+			false, false, false, false, false, true, false, true, true, true, true, false, false, false, true,
+			true, false, true, true, false, true, true, true, true, true, true, true, true, true, true, false,
+			false, false, false, false, false, false, true, true, true, true, true, true, true, true, true,
+			true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			false, false, false, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true,
+			false, true, false
+			};
 	}
 }
 
diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs
index bb1f13c..153abff 100644
--- a/mcs/class/System/System.Net/WebRequest.cs
+++ b/mcs/class/System/System.Net/WebRequest.cs
@@ -300,11 +300,28 @@ namespace System.Net
 		public static IWebProxy GetSystemWebProxy ()
 		{
 			string address = Environment.GetEnvironmentVariable ("http_proxy");
+			if (address == null)
+				address = Environment.GetEnvironmentVariable ("HTTP_PROXY");
+
 			if (address != null) {
 				try {
-					WebProxy p = new WebProxy (address);
-					return p;
-				} catch (UriFormatException) {}
+					if (!address.StartsWith ("http://"))
+						address = "http://" + address;
+					Uri uri = new Uri (address);
+					IPAddress ip;
+					if (IPAddress.TryParse (uri.Host, out ip)) {
+						if (IPAddress.Any.Equals (ip)) {
+							UriBuilder builder = new UriBuilder (uri);
+							builder.Host = "127.0.0.1";
+							uri = builder.Uri;
+						} else if (IPAddress.IPv6Any.Equals (ip)) {
+							UriBuilder builder = new UriBuilder (uri);
+							builder.Host = "[::1]";
+							uri = builder.Uri;
+						}
+					}
+					return new WebProxy (uri);
+				} catch (UriFormatException) { }
 			}
 			return new WebProxy ();
 		}
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
index 49a835e..c2f5dd9 100644
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
@@ -1,3 +1,14 @@
+2009-07-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* X509Chain.cs: revert my last change here since it caused 2 tests to
+	fail.
+
+2009-07-02 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* X509Certificate2.cs:
+	* X509Chain.cs: changes to make everything compile with latest changes
+	and fixed typo in IsChainComplete().
+
 2008-06-26  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* X509Certificate2.cs: Allow password-less ctor to (try to) open 
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
index f6f5853..ccdfa63 100644
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Certificate2.cs
@@ -40,6 +40,12 @@ using MX = Mono.Security.X509;
 namespace System.Security.Cryptography.X509Certificates {
 
 	public class X509Certificate2 : X509Certificate {
+#if !SECURITY_DEP
+		// Used in Mono.Security HttpsClientStream
+		public X509Certificate2 (byte[] rawData)
+		{
+		}
+#endif
 #if SECURITY_DEP
 		private bool _archived;
 		private X509ExtensionCollection _extensions;
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
index 26da15b..a35037b 100644
--- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509Chain.cs
@@ -761,6 +761,9 @@ namespace System.Security.Cryptography.X509Certificates {
 				// FIXME - download and install new CRL
 				// then you get a second chance
 				// crl = FindCrl (ca_cert, ref valid, ref out_of_date);
+
+				// We need to get the subjectAltName and an URI from there (or use OCSP)	
+				// X509KeyUsageExtension subjectAltName = (X509KeyUsageExtension) ca_cert.Extensions["2.5.29.17"];
 			}
 
 			if (crl != null) {
@@ -854,5 +857,14 @@ namespace System.Security.Cryptography.X509Certificates {
 		}
 	}
 }
-
+#elif NET_2_0 && !NET_2_1
+namespace System.Security.Cryptography.X509Certificates {
+	public class X509Chain {
+		public bool Build (X509Certificate2 cert)
+		{
+			return false;
+		}
+	}
+}
 #endif
+
diff --git a/mcs/class/System/System.Timers/ChangeLog b/mcs/class/System/System.Timers/ChangeLog
index e600215..f8513ef 100644
--- a/mcs/class/System/System.Timers/ChangeLog
+++ b/mcs/class/System/System.Timers/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Timer.cs: lock access to the 'timer' field. Attemp to fix bug
+	#537921.
 
 Wed Sep 17 11:48:00 CEST 2008 Paolo Molaro <lupus at ximian.com>
 
diff --git a/mcs/class/System/System.Timers/Timer.cs b/mcs/class/System/System.Timers/Timer.cs
index a0c024f..fc907a6 100644
--- a/mcs/class/System/System.Timers/Timer.cs
+++ b/mcs/class/System/System.Timers/Timer.cs
@@ -42,6 +42,7 @@ namespace System.Timers
 		double interval;
 		bool autoReset;
 		System.Threading.Timer timer;
+		object _lock = new object ();
 		ISynchronizeInvoke so;
 
 		[Category("Behavior")]
@@ -79,17 +80,21 @@ namespace System.Timers
 		public bool Enabled
 		{
 			get {
-				return timer != null;
+				lock (_lock)
+					return timer != null;
 			}
 			set {
-				if (Enabled == value)
-					return;
-
-				if (value) {
-					timer = new System.Threading.Timer (Callback, this, (int)interval, autoReset? (int)interval: 0);
-				} else {
-					timer.Dispose ();
-					timer = null;
+				lock (_lock) {
+					bool enabled = timer != null;
+					if (enabled == value)
+						return;
+
+					if (value) {
+						timer = new System.Threading.Timer (Callback, this, (int)interval, autoReset ? (int)interval: 0);
+					} else {
+						timer.Dispose ();
+						timer = null;
+					}
 				}
 			}
 		}
@@ -106,9 +111,11 @@ namespace System.Timers
 				if (value <= 0)
 					throw new ArgumentException ("Invalid value: " + value);
 
-				interval = value;
-				if (timer != null)
-					timer.Change ((int)interval, autoReset? (int)interval: 0);
+				lock (_lock) {
+					interval = value;
+					if (timer != null)
+						timer.Change ((int)interval, autoReset? (int)interval: 0);
+				}
 			}
 		}
 
@@ -164,6 +171,8 @@ namespace System.Timers
 		static void Callback (object state)
 		{
 			Timer timer = (Timer) state;
+			if (timer.Enabled == false)
+				return;
 			ElapsedEventHandler events = timer.Elapsed;
 			if (!timer.autoReset)
 				timer.Enabled = false;
diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources
index f78a221..8b87386 100644
--- a/mcs/class/System/System.dll.sources
+++ b/mcs/class/System/System.dll.sources
@@ -409,6 +409,8 @@ System.ComponentModel/UInt16Converter.cs
 System.ComponentModel/UInt32Converter.cs
 System.ComponentModel/UInt64Converter.cs
 System.ComponentModel/WarningException.cs
+System.ComponentModel/WeakObjectWrapper.cs
+System.ComponentModel/WeakObjectWrapperComparer.cs
 System.ComponentModel/Win32Exception.cs
 System.Configuration/ApplicationScopedSettingAttribute.cs
 System.Configuration/ApplicationSettingsBase.cs
@@ -426,7 +428,9 @@ System.Configuration/IApplicationSettingsProvider.cs
 System.Configuration/IConfigurationSectionHandler.cs
 System.Configuration/IConfigurationSystem.cs
 System.Configuration/IConfigXmlNode.cs
+System.Configuration/IdnElement.cs
 System.Configuration/IgnoreSectionHandler.cs
+System.Configuration/IriParsingElement.cs
 System.Configuration/IPersistComponentSettings.cs
 System.Configuration/ISettingsProviderService.cs
 System.Configuration/LocalFileSettingsProvider.cs
@@ -465,6 +469,7 @@ System.Configuration/SettingsGroupNameAttribute.cs
 System.Configuration/SingleTagSectionHandler.cs
 System.Configuration/SpecialSetting.cs
 System.Configuration/SpecialSettingAttribute.cs
+System.Configuration/UriSection.cs
 System.Configuration/UserSettingsGroup.cs
 System.Configuration/UserScopedSettingAttribute.cs
 System/DefaultUriParser.cs
@@ -561,7 +566,7 @@ System/GopherStyleUriParser.cs
 System/HttpStyleUriParser.cs
 System.IO.Compression/CompressionMode.cs
 System.IO.Compression/DeflateStream.cs
-System.IO.Compression/GzipStream.cs
+System.IO.Compression/GZipStream.cs
 System.IO/DefaultWatcher.cs
 System.IO/ErrorEventArgs.cs
 System.IO/ErrorEventHandler.cs
@@ -761,6 +766,7 @@ System.Net.NetworkInformation/IPv4InterfaceProperties.cs
 System.Net.NetworkInformation/IPv4InterfaceStatistics.cs
 System.Net.NetworkInformation/IPv6InterfaceProperties.cs
 System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs
+System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs
 System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs
 System.Net.NetworkInformation/MulticastIPAddressInformation.cs
 System.Net.NetworkInformation/NetBiosNodeType.cs
diff --git a/mcs/class/System/System/ChangeLog b/mcs/class/System/System/ChangeLog
index 9b17614..5aead44 100644
--- a/mcs/class/System/System/ChangeLog
+++ b/mcs/class/System/System/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-01  Raja R Harinath  <harinath at hurrynot.org>
+
+	Fix #533572
+	* Uri.cs (ParseNoExceptions): Don't look for '@' in absolute unix paths.
+
 2009-01-28  Bill Holmes  <billholmes54 at gmail.com>
 
 	Backport of r124869.
diff --git a/mcs/class/System/System/Uri.cs b/mcs/class/System/System/Uri.cs
index 7460ca0..3e02231 100644
--- a/mcs/class/System/System/Uri.cs
+++ b/mcs/class/System/System/Uri.cs
@@ -1465,7 +1465,10 @@ namespace System {
 			}
 
 			// 4.a user info
-			pos = uriString.IndexOf ('@', startpos, endpos-startpos);
+			if (unixAbsPath)
+				pos = -1;
+			else
+				pos = uriString.IndexOf ('@', startpos, endpos-startpos);
 			if (pos != -1) {
 				userinfo = uriString.Substring (startpos, pos-startpos);
 				startpos = pos + 1;
diff --git a/mcs/class/System/System_test.dll.sources b/mcs/class/System/System_test.dll.sources
index 9d18999..513ff44 100644
--- a/mcs/class/System/System_test.dll.sources
+++ b/mcs/class/System/System_test.dll.sources
@@ -196,6 +196,7 @@ System.Net/CredentialCacheTest.cs
 System.Net/DnsPermissionAttributeTest.cs
 System.Net/DnsPermissionTest.cs
 System.Net/DnsTest.cs
+System.Net/EndPointTest.cs
 System.Net/FileWebRequestTest.cs
 System.Net/FileWebResponseTest.cs
 System.Net/FtpWebRequestTest.cs
diff --git a/mcs/class/System/Test/System.CodeDom/ChangeLog b/mcs/class/System/Test/System.CodeDom/ChangeLog
index 85bc552..a5db9f4 100644
--- a/mcs/class/System/Test/System.CodeDom/ChangeLog
+++ b/mcs/class/System/Test/System.CodeDom/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-13  Marek Habersack  <mhabersack at novell.com>
+
+	* CodeTypeReferenceTest.cs: added test for bug #523341
+
 2007-01-25  Ilya Kharmatsky  <ilyak -at- mainsoft.com>
 	
 	* CodeTypeReferenceTest.cs :
diff --git a/mcs/class/System/Test/System.CodeDom/CodeTypeReferenceTest.cs b/mcs/class/System/Test/System.CodeDom/CodeTypeReferenceTest.cs
index fb38cfb..aee90f0 100644
--- a/mcs/class/System/Test/System.CodeDom/CodeTypeReferenceTest.cs
+++ b/mcs/class/System/Test/System.CodeDom/CodeTypeReferenceTest.cs
@@ -586,6 +586,18 @@ namespace MonoTests.System.CodeDom
 			Assert.IsNotNull (reference.TypeArguments, "#5");
 			Assert.AreEqual (0, reference.TypeArguments.Count, "#6");
 		}
+
+		[Test (Description="Bug #523341")]
+		public void GenericTypeTest6 ()
+		{
+			CodeTypeReference reference = new CodeTypeReference ("System.Collections.List<System.Globalization.CultureInfo[]>");
+			Assert.AreEqual ("System.Collections.List<System.Globalization.CultureInfo[]>", reference.BaseType, "#1");
+			Assert.AreEqual (0, reference.ArrayRank, "#2");
+			Assert.IsNull (reference.ArrayElementType, "#3");
+			Assert.AreEqual (0, (int) reference.Options, "#4");
+			Assert.IsNotNull (reference.TypeArguments, "#5");
+			Assert.AreEqual (0, reference.TypeArguments.Count, "#6");
+		}
 #endif
 
 		// bug #76535
diff --git a/mcs/class/System/Test/System.Collections.Generic/ChangeLog b/mcs/class/System/Test/System.Collections.Generic/ChangeLog
index f278bb5..d7ed2d6 100644
--- a/mcs/class/System/Test/System.Collections.Generic/ChangeLog
+++ b/mcs/class/System/Test/System.Collections.Generic/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SortedListTest.cs: new tests for bug #521750 provided by
+	Kevin Fitzgerald.
+
 2009-05-06  Pia Eriksson  <pe at hallerud.se>
 
 	* SortedListTest.cs: Added test for CopyTo
diff --git a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs
index d7a30c7..ced822e 100644
--- a/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs
+++ b/mcs/class/System/Test/System.Collections.Generic/SortedListTest.cs
@@ -275,33 +275,194 @@ namespace MonoTests.System.Collections.Generic
 			Assert.AreEqual ("B", values [1]);
 			Assert.AreEqual ("C", values [2]);
 		}
- 		public void CopyTo ()
- 		{	
- 			ICollection<KeyValuePair<int, string>> col1 =
- 				list as ICollection<KeyValuePair<int, string>>;
- 			KeyValuePair <int, string> [] array1 =
- 				new KeyValuePair <int, string> [col1.Count];
- 			col1.CopyTo (array1, 0);
- 			Assert.AreEqual (3, array1.Length);
- 			
- 			ICollection col = list as ICollection;
- 			array1 = new KeyValuePair <int, string> [col.Count];
- 			col.CopyTo (array1, 0);			
- 			Assert.AreEqual (3, array1.Length);
- 			
- 			ICollection<KeyValuePair<string, int>> col2 =
- 				list2 as ICollection<KeyValuePair<string, int>>;
- 			KeyValuePair <string, int> [] array2 =
- 				new KeyValuePair <string, int> [col2.Count];
- 			col2.CopyTo (array2, 0);
- 			Assert.AreEqual (0, array2.Length);
- 			
- 			col = list2 as ICollection;
- 			array2 = new KeyValuePair <string, int> [col.Count];
- 			col.CopyTo (array2, 0);
- 			Assert.AreEqual (0, array2.Length);			
- 		}
-		
+
+		[Test]
+		public void CopyTo ()
+		{	
+			ICollection<KeyValuePair<int, string>> col1 =
+				list as ICollection<KeyValuePair<int, string>>;
+			KeyValuePair <int, string> [] array1 =
+				new KeyValuePair <int, string> [col1.Count];
+			col1.CopyTo (array1, 0);
+			Assert.AreEqual (3, array1.Length);
+			
+			ICollection col = list as ICollection;
+			array1 = new KeyValuePair <int, string> [col.Count];
+			col.CopyTo (array1, 0);			
+			Assert.AreEqual (3, array1.Length);
+			
+			ICollection<KeyValuePair<string, int>> col2 =
+				list2 as ICollection<KeyValuePair<string, int>>;
+			KeyValuePair <string, int> [] array2 =
+				new KeyValuePair <string, int> [col2.Count];
+			col2.CopyTo (array2, 0);
+			Assert.AreEqual (0, array2.Length);
+			
+			col = list2 as ICollection;
+			array2 = new KeyValuePair <string, int> [col.Count];
+			col.CopyTo (array2, 0);
+			Assert.AreEqual (0, array2.Length);			
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void KeyEnumeratorVersionChecking () {
+			var en = list.Keys.GetEnumerator();
+
+			int i = 0;
+			en.MoveNext ();
+			list.Remove (en.Current);
+			en.MoveNext ();
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void ValueEnumeratorVersionChecking () {
+            var en = list.Values.GetEnumerator();
+
+            int i = 0;
+			en.MoveNext ();
+			list.RemoveAt (0);
+			en.MoveNext ();
+		}
+
+		sealed class StartsWithComparator : IComparer<string> {
+			private readonly static Comparer<string> _stringComparer = Comparer<string>.Default;
+			public static readonly StartsWithComparator Instance = new StartsWithComparator();
+
+			public int Compare(string part, string whole)
+			{
+				// let the default string comparer deal with null or when part is not smaller then whole
+				if (part == null || whole == null || part.Length >= whole.Length)
+					return _stringComparer.Compare(part, whole);
+
+				// loop through all characters that part and whole have in common
+				int pos = 0;
+				bool match;
+				do {
+					match = (part[pos] == whole[pos]);
+				} while (match && ++pos < part.Length);
+
+				// return result of last comparison
+				return match ? 0 : (part[pos] < whole[pos] ? -1 : 1);
+			}
+		}
+
+		sealed class StartsWithComparatorPartWholeCheck : IComparer<string>
+		{
+			private readonly static Comparer<string> _stringComparer = Comparer<string>.Default;
+
+			public static readonly StartsWithComparator Instance = new StartsWithComparator();
+
+			public int Compare(string part, string whole)
+			{
+				Assert.IsTrue(part == "Part", "#PWC0");
+				Assert.IsTrue(whole == "Whole", "#PWC1");
+
+				// let the default string comparer deal with null or when part is not smaller then whole
+				if (part == null || whole == null || part.Length >= whole.Length)
+					return _stringComparer.Compare(part, whole);
+
+				// loop through all characters that part and whole have in common
+				int pos = 0;
+				bool match;
+				do {
+					match = (part[pos] == whole[pos]);
+				} while (match && ++pos < part.Length);
+
+				// return result of last comparison
+				return match ? 0 : (part[pos] < whole[pos] ? -1 : 1);
+			}
+		}
+
+		[Test]
+		public void ComparatorUsageTest()
+		{
+			SortedList<string, string> sl = new SortedList<string, string>(StartsWithComparator.Instance);
+
+			sl.Add("Apples", "Value-Apples");
+			sl.Add("Bananas", "Value-Bananas");
+			sl.Add("Oranges", "Value-Oranges");
+
+			// Ensure 3 objects exist in the collection
+			Assert.IsTrue(sl.Count == 3, "Count");
+
+			// Complete Match Test Set
+			Assert.IsTrue(sl.ContainsKey("Apples"), "#A0");
+			Assert.IsTrue(sl.ContainsKey("Bananas"), "#A1");
+			Assert.IsTrue(sl.ContainsKey("Oranges"), "#A2");
+
+			// Partial Match Test Set
+			Assert.IsTrue(sl.ContainsKey("Apples are great fruit!"), "#B0");
+			Assert.IsTrue(sl.ContainsKey("Bananas are better fruit."), "#B1");
+			Assert.IsTrue(sl.ContainsKey("Oranges are fun to peel."), "#B2");
+
+			// Reversed Match Test Set
+			Assert.IsFalse(sl.ContainsKey("Value"), "#C0");
+
+			// No match tests
+			Assert.IsFalse(sl.ContainsKey("I forgot to bring my bananas."), "#D0");
+			Assert.IsFalse(sl.ContainsKey("My apples are on vacation."), "#D0");
+			Assert.IsFalse(sl.ContainsKey("The oranges are not ripe yet."), "#D0");
+
+		}
+
+		[Test]
+		public void ComparatorPartWholeCheck()
+		{
+			SortedList<string, string> sl = new SortedList<string, string>(StartsWithComparatorPartWholeCheck.Instance);
+			sl.Add("Part", "Value-Part");
+			Assert.IsFalse(sl.ContainsKey("Whole"), "#PWC2");
+		}
+
+		[Test]
+		public void NonComparatorStringCheck()
+		{
+			SortedList<string, string> sl = new SortedList<string, string>();
+
+			sl.Add("Oranges", "Value-Oranges");
+			sl.Add("Apples", "Value-Apples");
+			sl.Add("Bananas", "Value-Bananas");
+
+			int i = 0;
+			Assert.IsTrue(sl.Count == 3, "NCSC #A0");
+
+			Assert.IsTrue(sl.ContainsKey("Apples"), "NCSC #B1");
+			Assert.IsTrue(sl.ContainsKey("Bananas"), "NCSC #B2");
+			Assert.IsTrue(sl.ContainsKey("Oranges"), "NCSC #B3");
+
+			Assert.IsFalse(sl.ContainsKey("XApples"), "NCSC #C1");
+			Assert.IsFalse(sl.ContainsKey("XBananas"), "NCSC #C2");
+			Assert.IsFalse(sl.ContainsKey("XOranges"), "NCSC #C3");
+
+			Assert.IsTrue(sl.Keys[0] == "Apples", "NCSC #D1");
+			Assert.IsTrue(sl.Keys[1] == "Bananas", "NCSC #D2");
+			Assert.IsTrue(sl.Keys[2] == "Oranges", "NCSC #D3");
+		}
+
+		[Test]
+		public void NonComparatorIntCheck()
+		{
+			SortedList<int, string> sl = new SortedList<int, string>();
+
+			sl.Add(3, "Value-Oranges");
+			sl.Add(2, "Value-Bananas");
+			sl.Add(1, "Value-Apples");
+
+			Assert.IsTrue(sl.Count == 3, "NCIC #A0");
+
+			Assert.IsTrue(sl.ContainsKey(1), "NCIC #B1");
+			Assert.IsTrue(sl.ContainsKey(2), "NCIC #B2");
+			Assert.IsTrue(sl.ContainsKey(3), "NCIC #B3");
+
+			Assert.IsFalse(sl.ContainsKey(11), "NCIC #C1");
+			Assert.IsFalse(sl.ContainsKey(22), "NCIC #C2");
+			Assert.IsFalse(sl.ContainsKey(33), "NCIC #C3");
+
+			Assert.IsTrue(sl.Keys[0] == 1, "NCIC #D1");
+			Assert.IsTrue(sl.Keys[1] == 2, "NCIC #D2");
+			Assert.IsTrue(sl.Keys[2] == 3, "NCIC #D3");
+		}
 	}
 }
 
diff --git a/mcs/class/System/Test/System.ComponentModel/ChangeLog b/mcs/class/System/Test/System.ComponentModel/ChangeLog
index 2706648..8a0a412 100644
--- a/mcs/class/System/Test/System.ComponentModel/ChangeLog
+++ b/mcs/class/System/Test/System.ComponentModel/ChangeLog
@@ -1,3 +1,12 @@
+2009-09-29  Alan McGovern  <amcgovern at novell.com>
+
+	* CategoryAttributeTest.cs: Added new test file.
+	  
+2009-09-24  Ivan N. Zlatev  <contact at i-nz.net>
+
+	* EnumConverterTests.cs: Add a test to verify behaviour when converting
+	 a 0 flag value.
+
 2009-02-19  Marek Habersack  <mhabersack at novell.com>
 
 	* TypeDescriptorTests.cs: added a test for
diff --git a/mcs/class/System/Test/System.ComponentModel/EnumConverterTests.cs b/mcs/class/System/Test/System.ComponentModel/EnumConverterTests.cs
index 9fa4c4d..ea5bd1b 100644
--- a/mcs/class/System/Test/System.ComponentModel/EnumConverterTests.cs
+++ b/mcs/class/System/Test/System.ComponentModel/EnumConverterTests.cs
@@ -482,6 +482,14 @@ namespace MonoTests.System.ComponentModel
 			Assert.AreEqual (F2.Dd, enums [1], "#J6");
 			Assert.AreEqual (typeof (F2), enums [2].GetType (), "#J5");
 			Assert.AreEqual ((F2) 5, enums [2], "#J6");
+
+			// Test Flags conversion of enum value 0
+			converter = new EnumConverter (typeof (E3));
+			enums = converter.ConvertTo (null, CultureInfo.InvariantCulture,
+				E3.Aa, typeof (Enum [])) as Enum [];
+			Assert.AreEqual (1, enums.Length, "#H1");
+			Assert.AreEqual (typeof (E3), enums [0].GetType (), "#H2");
+			Assert.AreEqual (E3.Aa, enums[0], "#H3");
 		}
 #endif
 
@@ -874,6 +882,16 @@ namespace MonoTests.System.ComponentModel
 			Dd = 8,
 		}
 
+
+		[Flags]
+		enum E3
+		{
+			Aa = 0,
+			Bb = 1,
+			Cc = 2,
+			Dd = 4,
+		}
+
 		enum F : byte
 		{
 			Bb = 1,
diff --git a/mcs/class/System/Test/System.Configuration/ApplicationSettingsBaseTest.cs b/mcs/class/System/Test/System.Configuration/ApplicationSettingsBaseTest.cs
index 9454d56..3e3f2a7 100644
--- a/mcs/class/System/Test/System.Configuration/ApplicationSettingsBaseTest.cs
+++ b/mcs/class/System/Test/System.Configuration/ApplicationSettingsBaseTest.cs
@@ -364,6 +364,25 @@ namespace MonoTests.System.Configuration {
 		{
 			Assert.AreEqual (0, new TestSettings1 ().Providers.Count);
 		}
+
+                class Bug532180 : ApplicationSettingsBase {
+                        [UserScopedSetting]
+                        [DefaultSettingValue("10")]
+                        public int IntSetting {
+                                get { return (int)this["IntSetting"]; }
+                                set { this["IntSetting"] = value; }                               
+                        }
+                }
+
+                [Test] // bug #532180
+                public void DefaultSettingValueAsWithReload() {
+                        Bug532180 settings = new Bug532180();
+                        Assert.AreEqual(10, settings.IntSetting, "A1");
+                        settings.IntSetting = 1;
+                        Assert.AreEqual(1, settings.IntSetting, "A2");
+                        settings.Reload();
+                        Assert.AreEqual(10, settings.IntSetting, "A3");
+                }                        
 	}
 }
 
diff --git a/mcs/class/System/Test/System.IO.Compression/ChangeLog b/mcs/class/System/Test/System.IO.Compression/ChangeLog
index f590707..a93a351 100644
--- a/mcs/class/System/Test/System.IO.Compression/ChangeLog
+++ b/mcs/class/System/Test/System.IO.Compression/ChangeLog
@@ -1,3 +1,7 @@
+2009-10-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DeflateStreamTest.cs: test from bug #549492.
+
 2007-09-22  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* DeflateStreamTest.cs: Improved CanRead, CanSeek and CanWrite tests.
diff --git a/mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs b/mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
index d75aa65..fe31fee 100644
--- a/mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
+++ b/mcs/class/System/Test/System.IO.Compression/DeflateStreamTest.cs
@@ -268,7 +268,35 @@ namespace MonoTests.System.IO.Compression
 
 		static byte [] compressed_data = { 0xf3, 0x48, 0xcd, 0xc9, 0xc9,
 			0xe7, 0x02, 0x00 };
+
+
+		[Test]
+		public void JunkAtTheEnd ()
+		{
+			// Write a deflated stream, then some additional data...
+			using (MemoryStream ms = new MemoryStream())
+			{
+				// The compressed stream
+				using (DeflateStream stream = new DeflateStream(ms, CompressionMode.Compress, true))
+				{
+					stream.WriteByte(1);
+					stream.Flush();
+				}
+				// Junk
+				ms.WriteByte(2);
+
+				ms.Position = 0;
+				// Reading: this should not hang
+				using (DeflateStream stream = new DeflateStream(ms, CompressionMode.Decompress))
+				{
+					byte[] buffer  = new byte[512];
+					int len = stream.Read(buffer, 0, buffer.Length);
+					Console.WriteLine(len == 1);
+				}
+			}
+		}
 	}
 }
 
 #endif
+
diff --git a/mcs/class/System/Test/System.Net.Sockets/ChangeLog b/mcs/class/System/Test/System.Net.Sockets/ChangeLog
index 61dc522..81222e6 100644
--- a/mcs/class/System/Test/System.Net.Sockets/ChangeLog
+++ b/mcs/class/System/Test/System.Net.Sockets/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SocketTest.cs: tests for DontLinger.
+
 2009-01-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* SocketTest.cs:
diff --git a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
index b2e865a..ecd7d57 100644
--- a/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
+++ b/mcs/class/System/Test/System.Net.Sockets/SocketTest.cs
@@ -55,7 +55,7 @@ namespace MonoTests.System.Net.Sockets
 		}
 
 		[Test]
-		[Ignore ("Bug #75158")]
+		[Ignore ("Bug #75158")] // Looks like MS fails after the .ctor, when you try to use the socket
 		public void IncompatibleAddress ()
 		{
 			IPEndPoint epIPv6 = new IPEndPoint (IPAddress.IPv6Any,
@@ -2828,6 +2828,35 @@ namespace MonoTests.System.Net.Sockets
 			}
 		}
 #endif
+		[Test]
+		public void SetSocketOption_DontLinger ()
+		{
+			using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) {
+#if NET_2_0
+				s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, false);
+#endif
+				s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 0);
+				s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 5);
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (SocketException))]
+		public void SetSocketOption_Null_DontLinger ()
+		{
+			using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) {
+				s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, null);
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void SetSocketOption_LingerOption_DontLinger ()
+		{
+			using (Socket s = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)) {
+				s.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, new LingerOption (true, 1000));
+			}
+		}
 	}
 }
 
diff --git a/mcs/class/System/Test/System.Net/ChangeLog b/mcs/class/System/Test/System.Net/ChangeLog
index b9e0ecd..9f6ddd3 100644
--- a/mcs/class/System/Test/System.Net/ChangeLog
+++ b/mcs/class/System/Test/System.Net/ChangeLog
@@ -1,12 +1,128 @@
+2009-07-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebHeaderCollectionTest.cs: test for allowed characters in headers.
+
+2009-07-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebHeaderCollectionTest.cs: test for 2.0 IsRestricted().
+
+2009-07-09 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequestTest.cs: use different ports for different tests since
+	the shutdown might take a little bit and tests might conflict.
+
+2009-07-07 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* WebClientTest.cs: if we write the 100 response, reset the output
+	stream writer.
+
+2009-07-06  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Enabled tests, and removed test that is now
+	covered by two separate CanTimeout tests for request and response
+	stream.
+	* HttpWebResponseStreamTest.cs: Enabled tests.
+
+2009-07-06  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Marked test notworking on 1.0 profile.
+
+2009-07-06  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Added tests for bug #511851. Added tests
+	for request stream. Fixed compiler warnings, and fixed code style.
+	* HttpWebResponseTest.cs: Added tests for response stream. Fixed
+	compiler warnings.
+
+2009-07-06 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequestTest.cs: add tests for POST + redirect and 401.
+
+2009-06-28 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequestTest.cs: sleep between reads as we do in
+	WebClientTest.
+
+2009-06-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SocketResponder.cs: the listener might be closed right before
+	Accept() is called and in that case we get an EINVAL.
+	* WebClientTest.cs: now that we might send separate packets for
+	headers and body, wait a little bit before checking socket.Available.
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* HttpWebRequestTest.cs: add a bunch of tests provided by
+	Bassan Tabbara.
+
+2009-06-26  Robert Jordan  <robertj at gmx.net>
+
+	* *.cs: Upgrade to new NUnit style.
+
+2009-06-20  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Improved and enabled test for bug #510642.
+
+2009-06-20  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* SocketResponder.cs: Made a little more robust.
+
+2009-06-20  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpListener2Test.cs: Added test for bug #513849.
+	* HttpWebRequestTest.cs: Enabled test for bug #508027. Added test for
+	bug #513087.
+	* WebClientTest.cs: Added test for bug #484795, for Encoding property.
+
+2009-06-16  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+	* WebRequestTest.cs: Drop NotWorking attrib, more accurate tests.
+
+2009-06-09  Andrés G. Aragoneses  <aaragoneses at novell.com>
+
+	* WebRequestTest.cs: Added tests for bug #323452.
+
+2009-06-06  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Added tests for bugs #465613, #510661,
+	#510642 and #508027.
+
+2009-05-17  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* CookieTest.cs: Added test for Path.
+	* CookieContainerTest.cs: Added and improved .ctor tests.
+	Improved tests for Capacity and MaxCookieSize. Added tests for
+	PerDomainCapacity. Added tests for Add overloads, GetCookieHeader,
+	GetCookies and SetCookies. Added test for bug #421827.
+
+2009-05-02  Atsushi Enomoto  <atsushi at ximian.com>
+
+	* CredentialCacheTest.cs : new tests for get/add/remove.
+	  Patch by Mineda Nozomi.
+
 2009-04-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* DnsTest.cs: new IP for go-mono and fix AsyncResolve test.
 
+2009-04-21  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* EndPointTest.cs: New
+
 2009-02-08  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* DnsTest.cs: Use Assert syntax, and spaces to tabs. Added tests
 	for argument checks.
 
+2009-02-08  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpWebRequestTest.cs: Added Not-Modified-Since test. Updated
+	bug numbers.
+
+2009-02-05  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* HttpListener2Test.cs: Make tests quiet.
+	* HttpWebRequestTest.cs: Added test for bug #471782.
+
 2009-01-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* IPAddressTest.cs: tests for bug #467472.
diff --git a/mcs/class/System/Test/System.Net/EndPointTest.cs b/mcs/class/System/Test/System.Net/EndPointTest.cs
new file mode 100644
index 0000000..c1839cb
--- /dev/null
+++ b/mcs/class/System/Test/System.Net/EndPointTest.cs
@@ -0,0 +1,67 @@
+//
+// EndPointTest.cs - Unit tests for System.Net.EndPoint
+//
+// Author:
+//	Sebastien Pouliot  <sebastien at ximian.com>
+//
+// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using NUnit.Framework;
+
+using System;
+using System.Net;
+
+namespace MonoTests.System.Net {
+
+	[TestFixture]
+	public class EndPointTest {
+
+		class ConcreteEndPoint : EndPoint {
+		}
+
+		[Test]
+		[ExpectedException (typeof (NotImplementedException))]
+		public void AddressFamily ()
+		{
+			ConcreteEndPoint ep = new ConcreteEndPoint ();
+			Assert.IsNotNull (ep.AddressFamily);
+		}
+
+		[Test]
+		[ExpectedException (typeof (NotImplementedException))]
+		public void Create ()
+		{
+			ConcreteEndPoint ep = new ConcreteEndPoint ();
+			Assert.IsNotNull (ep.Create (null));
+		}
+
+		[Test]
+		[ExpectedException (typeof (NotImplementedException))]
+		public void Serialize ()
+		{
+			ConcreteEndPoint ep = new ConcreteEndPoint ();
+			Assert.IsNotNull (ep.Serialize ());
+		}
+	}
+}
+
diff --git a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
index d7f3359..31ed72b 100644
--- a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
+++ b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs
@@ -32,6 +32,18 @@ namespace MonoTests.System.Net
 	[TestFixture]
 	public class HttpWebRequestTest
 	{
+#if NET_2_0
+		private Random rand = new Random ();
+		private byte [] data64KB = new byte [64 * 1024];
+
+		[TestFixtureSetUp]
+		public void Setup ()
+		{
+				ServicePointManager.Expect100Continue = false;
+				rand.NextBytes (data64KB);
+		}
+#endif
+
 		[Test]
 #if TARGET_JVM
 		[Ignore ("Ignore failures in Sys.Net")]
@@ -65,7 +77,7 @@ namespace MonoTests.System.Net
 		public void Sync ()
 		{
 			HttpWebRequest req = (HttpWebRequest) WebRequest.Create ("http://www.google.com");
-			Assertion.AssertNotNull ("req:If Modified Since: ", req.IfModifiedSince);
+			Assert.IsNotNull (req.IfModifiedSince, "req:If Modified Since: ");
 
 			req.UserAgent = "MonoClient v1.0";
 			Assert.AreEqual ("User-Agent", req.Headers.GetKey (0), "#A1");
@@ -90,15 +102,45 @@ namespace MonoTests.System.Net
 			req.AddRange (50, 90);
 			req.AddRange ("bytes", 100); 
 			req.AddRange ("bytes", 100, 120);
-			Assertion.AssertEquals ("#1", "bytes=10-,50-90,100-,100-120", req.Headers ["Range"]);
+			Assert.AreEqual ("bytes=10-,50-90,100-,100-120", req.Headers ["Range"], "#1");
 			try {
 				req.AddRange ("bits", 2000);
-				Assertion.Fail ("#2");
+				Assert.Fail ("#2");
 			} catch (InvalidOperationException) {}
 		}
 
+		[Test] // bug #471782
+		public void CloseRequestStreamAfterReadingResponse ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9152);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+
+				byte [] data = new byte [128];
+				req.ContentLength = data.Length;
+
+				Stream rs = req.GetRequestStream ();
+				rs.Write (data, 0, data.Length);
+				rs.Flush ();
+
+				HttpWebResponse response = (HttpWebResponse) req.GetResponse ();
+				response.Close ();
+
+				rs.Close ();
+
+				responder.Stop ();
+			}
+		}
+
 		[Test]
-		[Category("InetAccess")] 
+		[Category("InetAccess")]
 		public void Cookies1 ()
 		{
 			// The purpose of this test is to ensure that the cookies we get from a request
@@ -111,19 +153,20 @@ namespace MonoTests.System.Net
 			req.KeepAlive = false;
 			req.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv; 1.7.6) Gecko/20050317 Firefox/1.0.2";
 			req.CookieContainer = cookies;
-			Assertion.AssertEquals ("#01", 0, cookies.Count);
+			Assert.AreEqual (0, cookies.Count, "#01");
 			using (HttpWebResponse res = (HttpWebResponse) req.GetResponse()) {
 				CookieCollection coll = req.CookieContainer.GetCookies (new Uri (url));
-				Assertion.AssertEquals ("#02", 1, coll.Count);
-				Assertion.AssertEquals ("#03", 1, res.Cookies.Count);
+				Assert.AreEqual (1, coll.Count, "#02");
+				Assert.AreEqual (1, res.Cookies.Count, "#03");
 				Cookie one = coll [0];
 				Cookie two = res.Cookies [0];
-				Assertion.AssertEquals ("#04", true, object.ReferenceEquals (one, two));
+				Assert.AreEqual (true, object.ReferenceEquals (one, two), "#04");
 			}
 		}
 
 #if !TARGET_JVM //NotWorking
 		[Test]
+		[Ignore ("Fails on MS.NET")]
 		public void SslClientBlock ()
 		{
 			// This tests that the write request/initread/write body sequence does not hang
@@ -142,9 +185,9 @@ namespace MonoTests.System.Net
 				stream.Write (bytes, 0, bytes.Length);
 				stream.Close ();
 				HttpWebResponse resp = (HttpWebResponse) request.GetResponse ();
-				Assertion.AssertEquals ("StatusCode", 200, (int) resp.StatusCode);
+				Assert.AreEqual (200, (int) resp.StatusCode, "StatusCode");
 				StreamReader sr = new StreamReader (resp.GetResponseStream (), Encoding.UTF8);
-				string x = sr.ReadToEnd ();
+				sr.ReadToEnd ();
 				sr.Close ();
 				resp.Close ();
 				server.Stop ();
@@ -199,7 +242,7 @@ namespace MonoTests.System.Net
 				// Using StreamReader+UTF8Encoding here fails on MS runtime
 				Stream stream = resp.GetResponseStream ();
 				int nread = stream.Read (bytes, 0, 32);
-				Assertion.AssertEquals ("#01", 16, nread);
+				Assert.AreEqual (16, nread, "#01");
 				x = Encoding.ASCII.GetString (bytes, 0, 16);
 			} finally {
 				resp.Close ();
@@ -209,7 +252,7 @@ namespace MonoTests.System.Net
 			if (server.Error != null)
 				throw server.Error;
 
-			Assertion.AssertEquals ("1234567890123456", x);
+			Assert.AreEqual ("1234567890123456", x);
 		}
 
 		[Test]
@@ -228,12 +271,11 @@ namespace MonoTests.System.Net
 			methods.Add ("whatever", "whatever");
 			methods.Add ("PUT", "PUT");
 
-			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9153);
+			string url = "http://" + ep.ToString () + "/test/";
 
 			foreach (DictionaryEntry de in methods) {
-				SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), 
-					new SocketRequestHandler (EchoRequestHandler));
+				SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler));
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -256,11 +298,433 @@ namespace MonoTests.System.Net
 			}
 		}
 
+		[Test]
+		public void BeginGetRequestStream_Body_NotAllowed ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9154);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest request;
+
+				request = (HttpWebRequest) WebRequest.Create (url);
+				request.Method = "GET";
+
+				try {
+					request.BeginGetRequestStream (null, null);
+					Assert.Fail ("#A1");
+				} catch (ProtocolViolationException ex) {
+					// Cannot send a content-body with this
+					// verb-type
+					Assert.IsNull (ex.InnerException, "#A2");
+					Assert.IsNotNull (ex.Message, "#A3");
+				}
+
+				request = (HttpWebRequest) WebRequest.Create (url);
+				request.Method = "HEAD";
+
+				try {
+					request.BeginGetRequestStream (null, null);
+					Assert.Fail ("#B1");
+				} catch (ProtocolViolationException ex) {
+					// Cannot send a content-body with this
+					// verb-type
+					Assert.IsNull (ex.InnerException, "#B2");
+					Assert.IsNotNull (ex.Message, "#B3");
+				}
+			}
+		}
+
+		[Test] // bug #465613
+		public void BeginGetRequestStream_NoBuffering ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 11001);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+				IAsyncResult ar;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = false;
+				req.AllowWriteStreamBuffering = false;
+
+				ar = req.BeginGetRequestStream (null, null);
+				rs = req.EndGetRequestStream (ar);
+				rs.Close ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = true;
+				req.AllowWriteStreamBuffering = false;
+
+				try {
+					req.BeginGetRequestStream (null, null);
+					Assert.Fail ("#A1");
+				} catch (ProtocolViolationException ex) {
+					// When performing a write operation with
+					// AllowWriteStreamBuffering set to false,
+					// you must either set ContentLength to a
+					// non-negative number or set SendChunked
+					// to true
+					Assert.IsNull (ex.InnerException, "#A2");
+					Assert.IsNotNull (ex.Message, "#A3");
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = true;
+				req.AllowWriteStreamBuffering = false;
+				req.ContentLength = 0;
+
+				ar = req.BeginGetRequestStream (null, null);
+				rs = req.EndGetRequestStream (ar);
+				rs.Close ();
+			}
+		}
+
+		[Test] // bug #508027
+		public void BeginGetResponse ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8001);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = false;
+				req.AllowWriteStreamBuffering = false;
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = true;
+				req.KeepAlive = false;
+				req.AllowWriteStreamBuffering = false;
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.ContentLength = 5;
+				req.SendChunked = false;
+				req.KeepAlive = false;
+				req.AllowWriteStreamBuffering = false;
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = true;
+				req.AllowWriteStreamBuffering = false;
+#if NET_2_0
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+#else
+				try {
+					req.BeginGetResponse (null, null);
+				} catch (ProtocolViolationException ex) {
+					// Either ContentLength must be set to a non-negative
+					// number, or SendChunked set to true in order to perform
+					// the write operation when AllowWriteStreamBuffering
+					// is disabled
+					Assert.IsNull (ex.InnerException, "#A2");
+					Assert.IsNotNull (ex.Message, "#A3");
+				} finally {
+					req.Abort ();
+				}
+#endif
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = false;
+				req.AllowWriteStreamBuffering = false;
+				req.ContentLength = 5;
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = false;
+				req.KeepAlive = true;
+				req.AllowWriteStreamBuffering = false;
+				req.ContentLength = 5;
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.SendChunked = true;
+#if NET_2_0
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+#else
+				try {
+					req.BeginGetResponse (null, null);
+					Assert.Fail ("#B1");
+				} catch (ProtocolViolationException ex) {
+					// Content-Length cannot be set for a
+					// non-write operation
+					Assert.IsNull (ex.InnerException, "#B2");
+					Assert.IsNotNull (ex.Message, "#B3");
+				} finally {
+					req.Abort ();
+				}
+#endif
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.ContentLength = 5;
+#if NET_2_0
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+#else
+				try {
+					req.BeginGetResponse (null, null);
+					Assert.Fail ("#C1");
+				} catch (ProtocolViolationException ex) {
+					// Content-Length cannot be set for a
+					// non-write operation
+					Assert.IsNull (ex.InnerException, "#C2");
+					Assert.IsNotNull (ex.Message, "#C3");
+				} finally {
+					req.Abort ();
+				}
+#endif
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.ContentLength = 0;
+#if NET_2_0
+				req.BeginGetResponse (null, null);
+				req.Abort ();
+#else
+				try {
+					req.BeginGetResponse (null, null);
+					Assert.Fail ("#D1");
+				} catch (ProtocolViolationException ex) {
+					// Content-Length cannot be set for a
+					// non-write operation
+					Assert.IsNull (ex.InnerException, "#D2");
+					Assert.IsNotNull (ex.Message, "#D3");
+				} finally {
+					req.Abort ();
+				}
+#endif
+			}
+		}
+
+		[Test] // bug #511851
+#if ONLY_1_1
+		[Category ("NotWorking")]
+#endif
+		public void BeginGetRequestStream_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8002);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Abort ();
+
+#if NET_2_0
+				try {
+					req.BeginGetRequestStream (null, null);
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+#else
+				IAsyncResult ar = req.BeginGetRequestStream (null, null);
+				try {
+					req.EndGetRequestStream (ar);
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The underlying connection was closed: the request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+#endif
+			}
+		}
+
+		[Test] // bug #511851
+		public void BeginGetResponse_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9155);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Abort ();
+
+				try {
+					req.BeginGetResponse (null, null);
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+			}
+		}
+
+		[Test]
+		public void EndGetRequestStream_AsyncResult_Null ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9156);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.BeginGetRequestStream (null, null);
+
+				try {
+					req.EndGetRequestStream (null);
+					Assert.Fail ("#1");
+				} catch (ArgumentNullException ex) {
+					Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.AreEqual ("asyncResult", ex.ParamName, "#5");
+				} finally {
+					req.Abort ();
+				}
+			}
+		}
+
+		[Test]
+		[Category ("NotWorking")] // do not get consistent result on MS
+		public void EndGetRequestStream_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8003);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				IAsyncResult ar = req.BeginGetRequestStream (null, null);
+				req.Abort ();
+				Thread.Sleep (500);
+
+				try {
+					req.EndGetRequestStream (ar);
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+			}
+		}
+
+		[Test] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=471522
+		[Category ("NotWorking")]
+		public void EndGetResponse_AsyncResult_Invalid ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9157);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				IAsyncResult ar = req.BeginGetRequestStream (null, null);
+
+				// AsyncResult was not returned from call to BeginGetResponse
+				try {
+					req.EndGetResponse (ar);
+					Assert.Fail ();
+				} catch (InvalidCastException) {
+				} finally {
+					req.Abort ();
+				}
+			}
+		}
+
+		[Test]
+		public void EndGetResponse_AsyncResult_Null ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9158);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.Method = "POST";
+				IAsyncResult ar = req.BeginGetResponse (null, null);
+
+				try {
+					req.EndGetResponse (null);
+					Assert.Fail ("#1");
+				} catch (ArgumentNullException ex) {
+					Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.AreEqual ("asyncResult", ex.ParamName, "#5");
+				} finally {
+					req.Abort ();
+					/*
+					using (HttpWebResponse resp = (HttpWebResponse) req.EndGetResponse (ar)) {
+						resp.Close ();
+					}*/
+				}
+			}
+		}
+
 		[Test] // bug #429200
 		public void GetRequestStream ()
 		{
-			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 10000);
+			string url = "http://" + ep.ToString () + "/test/";
 
 			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
 				responder.Start ();
@@ -277,7 +741,289 @@ namespace MonoTests.System.Net
 				Assert.AreSame (rs1, rs2, "#2");
 
 				rs1.Close ();
-				responder.Stop ();
+			}
+		}
+
+		[Test] // bug #511851
+		public void GetRequestStream_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 10001);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Abort ();
+
+				try {
+					req.GetRequestStream ();
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+			}
+		}
+
+		[Test] // bug #510661
+		public void GetRequestStream_Close_NotAllBytesWritten ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 10002);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.ContentLength = 2;
+				rs = req.GetRequestStream ();
+				try {
+					rs.Close ();
+					Assert.Fail ("#A1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#A2");
+					Assert.IsNotNull (ex.Message, "#A3");
+					Assert.IsNull (ex.Response, "#A4");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#A5");
+
+					// Cannot close stream until all bytes are written
+					Exception inner = ex.InnerException;
+					Assert.IsNotNull (inner, "#A6");
+					Assert.AreEqual (typeof (IOException), inner.GetType (), "#A7");
+					Assert.IsNull (inner.InnerException, "#A8");
+					Assert.IsNotNull (inner.Message, "#A9");
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.ContentLength = 2;
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x0d);
+				try {
+					rs.Close ();
+					Assert.Fail ("#B1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#B2");
+					Assert.IsNotNull (ex.Message, "#B3");
+					Assert.IsNull (ex.Response, "#B4");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#B5");
+
+					// Cannot close stream until all bytes are written
+					Exception inner = ex.InnerException;
+					Assert.IsNotNull (inner, "#B6");
+					Assert.AreEqual (typeof (IOException), inner.GetType (), "#B7");
+					Assert.IsNull (inner.InnerException, "#B8");
+					Assert.IsNotNull (inner.Message, "#B9");
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.ContentLength = 2;
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x0d);
+				rs.WriteByte (0x0d);
+				rs.Close ();
+			}
+		}
+
+		[Test] // bug #510642
+		public void GetRequestStream_Write_Overflow ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8010);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			// buffered, non-chunked
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+				byte [] buffer;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x2c);
+
+				buffer = new byte [] { 0x2a, 0x1d };
+				try {
+					rs.Write (buffer, 0, buffer.Length);
+					Assert.Fail ("#A1");
+				} catch (ProtocolViolationException ex) {
+					// Bytes to be written to the stream exceed
+					// Content-Length bytes size specified
+					Assert.IsNull (ex.InnerException, "#A2");
+					Assert.IsNotNull (ex.Message, "#A3");
+				} finally {
+					req.Abort ();
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+
+				buffer = new byte [] { 0x2a, 0x2c, 0x1d };
+				try {
+					rs.Write (buffer, 0, buffer.Length);
+					Assert.Fail ("#B1");
+				} catch (ProtocolViolationException ex) {
+					// Bytes to be written to the stream exceed
+					// Content-Length bytes size specified
+					Assert.IsNull (ex.InnerException, "#B2");
+					Assert.IsNotNull (ex.Message, "#B3");
+				} finally {
+					req.Abort ();
+				}
+			}
+
+			// buffered, chunked
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+				byte [] buffer;
+
+				/*
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = true;
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x2c);
+
+				buffer = new byte [] { 0x2a, 0x1d };
+				rs.Write (buffer, 0, buffer.Length);
+				req.Abort ();
+				*/
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.SendChunked = true;
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+
+				buffer = new byte [] { 0x2a, 0x2c, 0x1d };
+				rs.Write (buffer, 0, buffer.Length);
+				req.Abort ();
+			}
+
+			// non-buffered, non-chunked
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+				byte [] buffer;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.AllowWriteStreamBuffering = false;
+				req.Method = "POST";
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x2c);
+
+				buffer = new byte [] { 0x2a, 0x1d };
+				try {
+					rs.Write (buffer, 0, buffer.Length);
+					Assert.Fail ("#C1");
+				} catch (ProtocolViolationException ex) {
+					// Bytes to be written to the stream exceed
+					// Content-Length bytes size specified
+					Assert.IsNull (ex.InnerException, "#C2");
+					Assert.IsNotNull (ex.Message, "#3");
+				} finally {
+					req.Abort ();
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.AllowWriteStreamBuffering = false;
+				req.Method = "POST";
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+
+				buffer = new byte [] { 0x2a, 0x2c, 0x1d };
+				try {
+					rs.Write (buffer, 0, buffer.Length);
+					Assert.Fail ("#D1");
+				} catch (ProtocolViolationException ex) {
+					// Bytes to be written to the stream exceed
+					// Content-Length bytes size specified
+					Assert.IsNull (ex.InnerException, "#D2");
+					Assert.IsNotNull (ex.Message, "#D3");
+				} finally {
+					req.Abort ();
+				}
+			}
+
+			// non-buffered, chunked
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				Stream rs;
+				byte [] buffer;
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.AllowWriteStreamBuffering = false;
+				req.Method = "POST";
+				req.SendChunked = true;
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+				rs.WriteByte (0x2c);
+
+				buffer = new byte [] { 0x2a, 0x1d };
+				rs.Write (buffer, 0, buffer.Length);
+				req.Abort ();
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.AllowWriteStreamBuffering = false;
+				req.Method = "POST";
+				req.SendChunked = true;
+				req.Timeout = 1000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength = 2;
+
+				rs = req.GetRequestStream ();
+
+				buffer = new byte [] { 0x2a, 0x2c, 0x1d };
+				rs.Write (buffer, 0, buffer.Length);
+				req.Abort ();
 			}
 		}
 
@@ -303,6 +1049,33 @@ namespace MonoTests.System.Net
 			}
 		}
 
+		[Test] // bug #511851
+		public void GetResponse_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 10100);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Abort ();
+
+				try {
+					req.GetResponse ();
+					Assert.Fail ("#1");
+				} catch (WebException ex) {
+					// The request was aborted: The request was canceled
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.Response, "#5");
+					Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+				}
+			}
+		}
+
 		[Test]
 #if TARGET_JVM
 		[Category("NotWorking")]
@@ -320,7 +1093,7 @@ namespace MonoTests.System.Net
 				req.Method = "POST";
 				req.AllowAutoRedirect = false;
 				req.Timeout = 200;
-				req.ReadWriteTimeout = 100;
+				req.ReadWriteTimeout = 2000;
 				req.KeepAlive = false;
 				Stream rs = req.GetRequestStream ();
 				rs.Close ();
@@ -340,13 +1113,13 @@ namespace MonoTests.System.Net
 			}
 		}
 
-		[Test] // bug #81624
+		[Test] // bug #324300
 #if TARGET_JVM
 		[Category("NotWorking")]
 #endif
 		public void AllowAutoRedirect ()
 		{
-			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8764);
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8765);
 			string url = "http://" + localEP.ToString () + "/original/";
 
 			// allow autoredirect
@@ -395,11 +1168,104 @@ namespace MonoTests.System.Net
 			}
 		}
 
-		[Test] // bug #81671
+		[Test]
+		public void PostAndRedirect_NoCL ()
+		{
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8769);
+			string url = "http://" + localEP.ToString () + "/original/";
+
+			using (SocketResponder responder = new SocketResponder (localEP, new SocketRequestHandler (RedirectRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				Stream rs = req.GetRequestStream ();
+				rs.WriteByte (10);
+				rs.Close ();
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					StreamReader sr = new StreamReader (resp.GetResponseStream (),
+						Encoding.UTF8);
+					string body = sr.ReadToEnd ();
+
+					Assert.AreEqual (resp.StatusCode, HttpStatusCode.OK, "#A1");
+					Assert.AreEqual (resp.ResponseUri.ToString (), "http://" +
+						localEP.ToString () + "/moved/", "#A2");
+					Assert.AreEqual ("GET", resp.Method, "#A3");
+					Assert.AreEqual ("LOOKS OK", body, "#A4");
+				}
+				responder.Stop ();
+			}
+		}
+
+		[Test]
+		public void PostAndRedirect_CL ()
+		{
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8770);
+			string url = "http://" + localEP.ToString () + "/original/";
+
+			using (SocketResponder responder = new SocketResponder (localEP, new SocketRequestHandler (RedirectRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength  = 1;
+				Stream rs = req.GetRequestStream ();
+				rs.WriteByte (10);
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					StreamReader sr = new StreamReader (resp.GetResponseStream (),
+						Encoding.UTF8);
+					string body = sr.ReadToEnd ();
+
+					Assert.AreEqual (resp.StatusCode, HttpStatusCode.OK, "#A1");
+					Assert.AreEqual (resp.ResponseUri.ToString (), "http://" +
+						localEP.ToString () + "/moved/", "#A2");
+					Assert.AreEqual ("GET", resp.Method, "#A3");
+					Assert.AreEqual ("LOOKS OK", body, "#A4");
+				}
+				responder.Stop ();
+			}
+		}
+
+		[Test]
+		public void PostAnd401 ()
+		{
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8771);
+			string url = "http://" + localEP.ToString () + "/original/";
+
+			using (SocketResponder responder = new SocketResponder (localEP, new SocketRequestHandler (RedirectRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.ContentLength  = 1;
+				Stream rs = req.GetRequestStream ();
+				rs.WriteByte (10);
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					StreamReader sr = new StreamReader (resp.GetResponseStream (),
+						Encoding.UTF8);
+					string body = sr.ReadToEnd ();
+
+					Assert.AreEqual (resp.StatusCode, HttpStatusCode.OK, "#A1");
+					Assert.AreEqual (resp.ResponseUri.ToString (), "http://" +
+						localEP.ToString () + "/moved/", "#A2");
+					Assert.AreEqual ("GET", resp.Method, "#A3");
+					Assert.AreEqual ("LOOKS OK", body, "#A4");
+				}
+				responder.Stop ();
+			}
+		}
+
+		[Test] // bug #324347
 		[Category ("NotWorking")]
 		public void InternalServerError ()
 		{
-			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8764);
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8766);
 			string url = "http://" + localEP.ToString () + "/original/";
 
 			// POST
@@ -461,10 +1327,10 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
-		[Category ("NotWorking")] // we report a timeout
+		[Category ("NotWorking")] // #B3 fails; we get a SocketException: An existing connection was forcibly closed by the remote host
 		public void NoContentLength ()
 		{
-			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8764);
+			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8767);
 			string url = "http://" + localEP.ToString () + "/original/";
 
 			// POST
@@ -483,9 +1349,12 @@ namespace MonoTests.System.Net
 					req.GetResponse ();
 					Assert.Fail ("#A1");
 				} catch (WebException ex) {
-					Assert.AreEqual (typeof (WebException), ex.GetType (), "#A2");
 #if NET_2_0
-					//Assert.IsNotNull (ex.InnerException, "#A3");
+					// The underlying connection was closed:
+					// An unexpected error occurred on a
+					// receive
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#A2");
+					Assert.IsNotNull (ex.InnerException, "#A3");
 					Assert.AreEqual (WebExceptionStatus.ReceiveFailure, ex.Status, "#A4");
 					Assert.AreEqual (typeof (IOException), ex.InnerException.GetType (), "#A5");
 					
@@ -499,10 +1368,8 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ioe.Message, "#A7");
 					Assert.AreEqual (typeof (SocketException), ioe.InnerException.GetType (), "#A8");
 
-					// A connection attempt failed because the connected party
-					// did not properly respond after a period of time, or
-					// established connection failed because connected host has
-					// failed to respond
+					// An existing connection was forcibly
+					// closed by the remote host
 					SocketException soe = (SocketException) ioe.InnerException;
 					Assert.IsNull (soe.InnerException, "#A9");
 					Assert.IsNotNull (soe.Message, "#A10");
@@ -510,6 +1377,9 @@ namespace MonoTests.System.Net
 					HttpWebResponse webResponse = ex.Response as HttpWebResponse;
 					Assert.IsNull (webResponse, "#A11");
 #else
+					// The remote server returned an error:
+					// (500) Internal Server Error
+					Assert.AreEqual (typeof (WebException), ex.GetType (), "#A2");
 					Assert.IsNull (ex.InnerException, "#A3");
 					Assert.AreEqual (WebExceptionStatus.ProtocolError, ex.Status, "#A4");
 
@@ -537,6 +1407,8 @@ namespace MonoTests.System.Net
 					req.GetResponse ();
 					Assert.Fail ("#B1");
 				} catch (WebException ex) {
+					// The remote server returned an error:
+					// (500) Internal Server Error
 					Assert.AreEqual (typeof (WebException), ex.GetType (), "#B2");
 					Assert.IsNull (ex.InnerException, "#B3");
 					Assert.AreEqual (WebExceptionStatus.ProtocolError, ex.Status, "#B4");
@@ -551,37 +1423,85 @@ namespace MonoTests.System.Net
 			}
 		}
 
-#if NET_2_0
-		[Test] // bug #81504
-#if TARGET_JVM
-		[Category ("NotWorking")]
-#endif
-		public void Stream_CanTimeout ()
+		[Test] // bug #513087
+		public void NonStandardVerb ()
 		{
-			IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8764);
-			string url = "http://" + localEP.ToString () + "/original/";
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8123);
+			string url = "http://" + ep.ToString () + "/moved/";
 
-			// allow autoredirect
-			using (SocketResponder responder = new SocketResponder (localEP, new SocketRequestHandler (RedirectRequestHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (VerbEchoHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
-				req.Method = "POST";
-				req.Timeout = 2000;
-				req.ReadWriteTimeout = 2000;
+				req.Method = "WhatEver";
 				req.KeepAlive = false;
+				req.Timeout = 20000;
+				req.ReadWriteTimeout = 20000;
+
 				Stream rs = req.GetRequestStream ();
-				Assert.IsTrue (rs.CanTimeout, "#1");
 				rs.Close ();
+
 				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
-					Stream os = resp.GetResponseStream ();
-					Assert.IsTrue (os.CanTimeout, "#2");
-					os.Close ();
+					StreamReader sr = new StreamReader (resp.GetResponseStream (),
+						Encoding.UTF8);
+					string body = sr.ReadToEnd ();
+
+					Assert.AreEqual (resp.StatusCode, HttpStatusCode.OK, "#1");
+					Assert.AreEqual (resp.ResponseUri.ToString (), "http://" +
+						ep.ToString () + "/moved/", "#2");
+					Assert.AreEqual ("WhatEver", resp.Method, "#3");
+					Assert.AreEqual ("WhatEver", body, "#4");
 				}
+
 				responder.Stop ();
 			}
 		}
+
+		[Test]
+		[Category ("NotWorking")] // Assert #2 fails
+		public void NotModifiedSince ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9123);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (NotModifiedSinceHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.KeepAlive = false;
+				req.Timeout = 20000;
+				req.ReadWriteTimeout = 20000;
+#if NET_2_0
+				req.Headers.Add (HttpRequestHeader.IfNoneMatch, "898bbr2347056cc2e096afc66e104653");
+#else
+				req.Headers.Add ("If-None-Match", "898bbr2347056cc2e096afc66e104653");
 #endif
+				req.IfModifiedSince = new DateTime (2010, 01, 04);
+
+				DateTime start = DateTime.Now;
+				HttpWebResponse response = null;
+
+				try {
+					req.GetResponse ();
+					Assert.Fail ("#1");
+				} catch (WebException e) {
+					response = (HttpWebResponse) e.Response;
+				}
+
+				Assert.IsNotNull (response, "#2");
+				using (Stream stream = response.GetResponseStream ()) {
+					byte [] buffer = new byte [4096];
+					int bytesRead = stream.Read (buffer, 0, buffer.Length);
+					Assert.AreEqual (0, bytesRead, "#3");
+				}
+
+				TimeSpan elapsed = DateTime.Now - start;
+				Assert.IsTrue (elapsed.TotalMilliseconds < 2000, "#4");
+
+				responder.Stop ();
+			}
+		}
 
 		[Test] // bug #353495
 		[Category ("NotWorking")]
@@ -591,7 +1511,7 @@ namespace MonoTests.System.Net
 			HttpWebRequest req = (HttpWebRequest) WebRequest.Create (reqURL);
 			HttpWebResponse resp = (HttpWebResponse) req.GetResponse ();
 			DateTime lastMod = resp.LastModified;
-			string rawLastMod = resp.Headers ["Last-Modified"];
+			//string rawLastMod = resp.Headers ["Last-Modified"];
 			resp.Close ();
 			//Assert.AreEqual ("Tue, 15 Jan 2008 08:59:59 GMT", rawLastMod, "#1");
 #if NET_2_0
@@ -609,13 +1529,16 @@ namespace MonoTests.System.Net
 			}
 		}
 
-		static byte [] EchoRequestHandler (Socket socket)
+		internal static byte [] EchoRequestHandler (Socket socket)
 		{
 			MemoryStream ms = new MemoryStream ();
 			byte [] buffer = new byte [4096];
 			int bytesReceived = socket.Receive (buffer);
 			while (bytesReceived > 0) {
 				ms.Write (buffer, 0, bytesReceived);
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
 				if (socket.Available > 0) {
 					bytesReceived = socket.Receive (buffer);
 				} else {
@@ -645,6 +1568,9 @@ namespace MonoTests.System.Net
 			int bytesReceived = socket.Receive (buffer);
 			while (bytesReceived > 0) {
 				ms.Write (buffer, 0, bytesReceived);
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
 				if (socket.Available > 0) {
 					bytesReceived = socket.Receive (buffer);
 				} else {
@@ -661,7 +1587,8 @@ namespace MonoTests.System.Net
 			StringWriter sw = new StringWriter ();
 			if (statusLine.StartsWith ("POST /original/")) {
 				sw.WriteLine ("HTTP/1.0 302 Found");
-				sw.WriteLine ("Location: " + "http://" + IPAddress.Loopback.ToString () + ":8764/moved/");
+				EndPoint ep = socket.LocalEndPoint;
+				sw.WriteLine ("Location: " + "http://" + ep.ToString () + "/moved/");
 				sw.WriteLine ();
 				sw.Flush ();
 			} else if (statusLine.StartsWith ("GET /moved/")) {
@@ -682,6 +1609,18 @@ namespace MonoTests.System.Net
 
 		static byte [] InternalErrorHandler (Socket socket)
 		{
+			byte [] buffer = new byte [4096];
+			int bytesReceived = socket.Receive (buffer);
+			while (bytesReceived > 0) {
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
+				if (socket.Available > 0) {
+					bytesReceived = socket.Receive (buffer);
+				} else {
+					bytesReceived = 0;
+				}
+			}
 			StringWriter sw = new StringWriter ();
 			sw.WriteLine ("HTTP/1.1 500 Too Lazy");
 			sw.WriteLine ("Content-Length: 0");
@@ -701,6 +1640,118 @@ namespace MonoTests.System.Net
 			return Encoding.UTF8.GetBytes (sw.ToString ());
 		}
 
+		static byte [] NotModifiedSinceHandler (Socket socket)
+		{
+			StringWriter sw = new StringWriter ();
+			sw.WriteLine ("HTTP/1.1 304 Not Modified");
+			sw.WriteLine ("Date: Fri, 06 Feb 2009 12:50:26 GMT");
+			sw.WriteLine ("Server: Apache/2.2.6 (Debian) PHP/5.2.6-2+b1 with Suhosin-Patch mod_ssl/2.2.6 OpenSSL/0.9.8g");
+			sw.WriteLine ("Not-Modified-Since: Sun, 08 Feb 2009 08:49:26 GMT");
+			sw.WriteLine ("ETag: 898bbr2347056cc2e096afc66e104653");
+			sw.WriteLine ("Connection: close");
+			sw.WriteLine ();
+			sw.Flush ();
+
+			return Encoding.UTF8.GetBytes (sw.ToString ());
+		}
+
+		static byte [] VerbEchoHandler (Socket socket)
+		{
+			MemoryStream ms = new MemoryStream ();
+			byte [] buffer = new byte [4096];
+			int bytesReceived = socket.Receive (buffer);
+			while (bytesReceived > 0) {
+				ms.Write (buffer, 0, bytesReceived);
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
+				if (socket.Available > 0) {
+					bytesReceived = socket.Receive (buffer);
+				} else {
+					bytesReceived = 0;
+				}
+			}
+			ms.Flush ();
+			ms.Position = 0;
+			string statusLine = null;
+			using (StreamReader sr = new StreamReader (ms, Encoding.UTF8)) {
+				statusLine = sr.ReadLine ();
+			}
+
+			string verb = "DEFAULT";
+			if (statusLine != null) {
+				string [] parts = statusLine.Split (' ');
+				if (parts.Length > 0)
+					verb = parts [0];
+			}
+
+			StringWriter sw = new StringWriter ();
+			sw.WriteLine ("HTTP/1.1 200 OK");
+			sw.WriteLine ("Content-Type: text/plain");
+			sw.WriteLine ("Content-Length: " + verb.Length);
+			sw.WriteLine ();
+			sw.Write (verb);
+			sw.Flush ();
+
+			return Encoding.UTF8.GetBytes (sw.ToString ());
+		}
+
+		static byte [] PostAnd401Handler (Socket socket)
+		{
+			MemoryStream ms = new MemoryStream ();
+			byte [] buffer = new byte [4096];
+			int bytesReceived = socket.Receive (buffer);
+			while (bytesReceived > 0) {
+				ms.Write (buffer, 0, bytesReceived);
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
+				if (socket.Available > 0) {
+					bytesReceived = socket.Receive (buffer);
+				} else {
+					bytesReceived = 0;
+				}
+			}
+			ms.Flush ();
+			ms.Position = 0;
+			string statusLine = null;
+			bool have_auth = false;
+			int cl = -1;
+			using (StreamReader sr = new StreamReader (ms, Encoding.UTF8)) {
+				string l;
+				while ((l = sr.ReadLine ()) != null) {
+					if (statusLine == null) {
+						statusLine = l;
+					} else if (l.StartsWith ("Authorization:")) {
+						have_auth = true;
+					} else if (l.StartsWith ("Content-Length:")) {
+						cl = Int32.Parse (l.Substring ("content-length: ".Length));
+					}
+				}
+			}
+
+			StringWriter sw = new StringWriter ();
+			if (!have_auth) {
+				sw.WriteLine ("HTTP/1.0 401 Invalid Credentials");
+				sw.WriteLine ("WWW-Authenticate: basic Yeah");
+				sw.WriteLine ();
+				sw.Flush ();
+			} else if (cl > 0 && statusLine.StartsWith ("POST ")) {
+				sw.WriteLine ("HTTP/1.0 200 OK");
+				sw.WriteLine ("Content-Type: text/plain");
+				sw.WriteLine ("Content-Length: 8");
+				sw.WriteLine ();
+				sw.Write ("LOOKS OK");
+				sw.Flush ();
+			} else {
+				sw.WriteLine ("HTTP/1.0 500 test failed");
+				sw.WriteLine ("Content-Length: 0");
+				sw.WriteLine ();
+				sw.Flush ();
+			}
+
+			return Encoding.UTF8.GetBytes (sw.ToString ());
+		}
 		[Test]
 		public void NtlmAuthentication ()
 		{
@@ -714,7 +1765,7 @@ namespace MonoTests.System.Net
 			HttpWebResponse resp = (HttpWebResponse) request.GetResponse ();
 			string res = null;
 			using (StreamReader reader = new StreamReader (resp.GetResponseStream ())) {
-				res = reader.ReadToEnd ();	
+				res = reader.ReadToEnd ();
 			}
 			resp.Close ();
 			server.Stop ();
@@ -841,6 +1892,475 @@ namespace MonoTests.System.Net
 			protected abstract void Run ();
 		}
 
+#if NET_2_0
+		[Test]
+		public void BeginGetRequestStream ()
+		{
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = 0;
+				r.BeginGetRequestStream ((a) =>
+				{
+				using (Stream s = r.EndGetRequestStream (a)) { };
+				c.Set();
+				},
+				null);
+			},
+			(c) => { });
+		}
+
+		[Test]
+		public void BeginGetRequestStreamNoClose ()
+		{
+			this.DoRequest (
+			(r, c) => {
+				r.Method = "POST";
+				r.ContentLength = 1;
+				r.BeginGetRequestStream ((a) =>
+				{
+					r.EndGetRequestStream (a);
+					c.Set ();
+				},
+				null);
+			},
+			(c) => {});
+		}
+
+		[Test]
+		public void BeginGetRequestStreamCancelIfNotAllBytesWritten ()
+		{
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = 10;
+				r.BeginGetRequestStream ((a) =>
+				{
+					WebException ex = ExceptionAssert.Throws<WebException> (() =>
+					{
+						using (Stream s = r.EndGetRequestStream (a)) {
+						}
+					}
+				);
+				Assert.AreEqual (ex.Status, WebExceptionStatus.RequestCanceled);
+				c.Set();
+				},
+				null);
+			},
+			(c) => { });
+		}
+
+		[Test]
+		public void GetRequestStream2 ()
+		{
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+				using (Stream s = r.GetRequestStream ()) {
+					s.Write (data64KB, 0, data64KB.Length);
+				}
+				c.Set ();
+			},
+			(c) => { });
+		}
+
+		[Test]
+		public void GetRequestStreamNotAllBytesWritten ()
+		{
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+				WebException ex = ExceptionAssert.Throws<WebException> (() => r.GetRequestStream ().Close ());
+				Assert.AreEqual (ex.Status, WebExceptionStatus.RequestCanceled);
+				c.Set ();
+			},
+			(c) => {});
+		}
+
+		[Test]
+		public void GetRequestStreamTimeout ()
+		{
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+				r.Timeout = 100;
+				WebException ex = ExceptionAssert.Throws<WebException> (() => r.GetRequestStream ());
+				Assert.IsTrue (ex.Status == WebExceptionStatus.Timeout || ex.Status == WebExceptionStatus.ConnectFailure);
+				c.Set();
+			});
+		}
+
+		[Test]
+		public void BeginWrite ()
+		{
+			byte[] received = new byte[data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+
+				Stream s = r.GetRequestStream ();
+				s.BeginWrite (data64KB, 0, data64KB.Length,
+				(a) =>
+				{
+					s.EndWrite (a);
+					s.Close ();
+					r.GetResponse ().Close ();
+					c.Set();
+				},
+				null);
+			},
+			(c) =>
+			{
+				c.Request.InputStream.ReadAll (received, 0, received.Length);
+				c.Response.StatusCode = 204;
+				c.Response.Close ();
+			});
+
+			Assert.AreEqual (data64KB, received);
+		}
+
+		[Test]
+		public void BeginWriteAfterAbort ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+
+				Stream s = r.GetRequestStream ();
+				r.Abort();
+
+				WebException ex = ExceptionAssert.Throws<WebException> (() => s.BeginWrite (data64KB, 0, data64KB.Length, null, null));
+				Assert.AreEqual (ex.Status, WebExceptionStatus.RequestCanceled);
+
+				c.Set();
+			},
+			(c) =>
+			{
+				c.Request.InputStream.ReadAll (received, 0, received.Length);
+				c.Response.StatusCode = 204;
+				c.Response.Close();
+			});
+		}
+
+		[Test]
+		public void PrematureStreamCloseAborts ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length * 2;
+
+				Stream s = r.GetRequestStream ();
+				s.Write (data64KB, 0, data64KB.Length);
+
+				WebException ex = ExceptionAssert.Throws<WebException>(() => s.Close());
+				Assert.AreEqual(ex.Status, WebExceptionStatus.RequestCanceled);
+
+				c.Set();
+			},
+			(c) =>
+			{
+				c.Request.InputStream.ReadAll (received, 0, received.Length);
+				c.Response.StatusCode = 204;
+				c.Response.Close ();
+			});
+		}
+
+		[Test]
+		public void Write ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+
+				using (Stream s = r.GetRequestStream ()) {
+					s.Write (data64KB, 0, data64KB.Length);
+				}
+
+				r.GetResponse ().Close ();
+				c.Set ();
+			},
+			(c) =>
+			{
+				c.Request.InputStream.ReadAll (received, 0, received.Length);
+				c.Response.StatusCode = 204;
+				c.Response.Close ();
+			});
+
+			Assert.AreEqual(data64KB, received);
+		}
+
+		[Test]
+		public void WriteServerAborts ()
+		{
+			ManualResetEvent abort = new ManualResetEvent (false);
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.Method = "POST";
+				r.ContentLength = data64KB.Length;
+
+				using (Stream s = r.GetRequestStream()) {
+					abort.Set();
+					Thread.Sleep(100);
+					IOException ex = ExceptionAssert.Throws<IOException> (() => s.Write(data64KB, 0, data64KB.Length));
+				}
+
+				c.Set();
+			},
+			(c) =>
+			{
+				abort.WaitOne();
+				c.Response.Abort();
+			});
+		}
+
+		[Test]
+		public void Read ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				using (HttpWebResponse x = (HttpWebResponse) r.GetResponse ())
+				using (Stream s = x.GetResponseStream()) {
+					s.ReadAll (received, 0, received.Length);
+				}
+
+				c.Set ();
+			},
+			(c) =>
+			{
+				c.Response.StatusCode = 200;
+				c.Response.ContentLength64 = data64KB.Length;
+				c.Response.OutputStream.Write (data64KB, 0, data64KB.Length);
+				c.Response.OutputStream.Close ();
+				c.Response.Close ();
+			});
+
+			Assert.AreEqual (data64KB, received);
+		}
+
+		[Test]
+		public void ReadTimeout2 ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.ReadWriteTimeout = 10;
+				using (HttpWebResponse x = (HttpWebResponse) r.GetResponse ())
+				using (Stream s = x.GetResponseStream ()) {
+					WebException ex = ExceptionAssert.Throws<WebException> (() => s.ReadAll (received, 0, received.Length));
+					Assert.AreEqual (ex.Status, WebExceptionStatus.Timeout);
+				}
+
+				c.Set();
+			},
+			(c) =>
+			{
+				c.Response.StatusCode = 200;
+				c.Response.ContentLength64 = data64KB.Length;
+				c.Response.OutputStream.Write (data64KB, 0, data64KB.Length / 2);
+				Thread.Sleep (1000);
+				c.Response.OutputStream.Write (data64KB, data64KB.Length / 2, data64KB.Length / 2);
+				c.Response.OutputStream.Close ();
+				c.Response.Close ();
+			});
+		}
+
+		[Test]
+		public void ReadServerAborted ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				using (HttpWebResponse x = (HttpWebResponse) r.GetResponse ())
+				using (Stream s = x.GetResponseStream ()) {
+					Assert.AreEqual (1, s.ReadAll (received, 0, received.Length));
+				}
+
+				c.Set();
+			},
+			(c) =>
+			{
+				c.Response.StatusCode = 200;
+				c.Response.ContentLength64 = data64KB.Length;
+				c.Response.OutputStream.Write (data64KB, 0, 1);
+				c.Response.Abort ();
+			});
+		}
+
+		[Test]
+		public void BeginGetResponse2 ()
+		{
+			byte [] received = new byte [data64KB.Length];
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.BeginGetResponse ((a) =>
+				{
+					using (HttpWebResponse x = (HttpWebResponse) r.EndGetResponse (a))
+					using (Stream s = x.GetResponseStream ()) {
+						s.ReadAll (received, 0, received.Length);
+					}
+
+					c.Set();
+				}, null);
+			},
+			(c) =>
+			{
+				c.Response.StatusCode = 200;
+				c.Response.ContentLength64 = data64KB.Length;
+				c.Response.OutputStream.Write (data64KB, 0, data64KB.Length);
+				c.Response.OutputStream.Close ();
+				c.Response.Close ();
+			});
+
+			Assert.AreEqual (data64KB, received);
+		}
+
+		[Test]
+		public void BeginGetResponseAborts ()
+		{
+			ManualResetEvent aborted = new ManualResetEvent(false);
+
+			this.DoRequest (
+			(r, c) =>
+			{
+				r.BeginGetResponse((a) =>
+				{
+					WebException ex = ExceptionAssert.Throws<WebException> (() => r.EndGetResponse (a));
+					Assert.AreEqual (ex.Status, WebExceptionStatus.RequestCanceled);
+					c.Set ();
+				}, null);
+
+				aborted.WaitOne ();
+				r.Abort ();
+			},
+			(c) =>
+			{
+				aborted.Set ();
+				Thread.Sleep (100);
+				c.Response.StatusCode = 200;
+				c.Response.ContentLength64 = 0;
+				c.Response.Close ();
+			});
+		}
+
+		void DoRequest (Action<HttpWebRequest, EventWaitHandle> request)
+		{
+			int port = rand.Next (20000, 65535);
+
+			ManualResetEvent completed = new ManualResetEvent (false);
+			Uri address = new Uri (string.Format ("http://localhost:{0}", port));
+			HttpWebRequest client = (HttpWebRequest) WebRequest.Create (address);
+
+			request (client, completed);
+
+			if (!completed.WaitOne (10000))
+				Assert.Fail ("Test hung");
+		}
+
+		void DoRequest (Action<HttpWebRequest, EventWaitHandle> request, Action<HttpListenerContext> processor)
+		{
+			int port = rand.Next (20000, 65535);
+
+			ManualResetEvent [] completed = new ManualResetEvent [2];
+			completed [0] = new ManualResetEvent (false);
+			completed [1] = new ManualResetEvent (false);
+
+			using (ListenerScope scope = new ListenerScope (processor, port, completed [0])) {
+				ManualResetEvent clientCompleted = new ManualResetEvent (false);
+				Uri address = new Uri (string.Format ("http://localhost:{0}", port));
+				HttpWebRequest client = (HttpWebRequest) WebRequest.Create (address);
+
+				ThreadPool.QueueUserWorkItem ((o) => request (client, completed [1]));
+
+				if (!WaitHandle.WaitAll (completed, 10000))
+					Assert.Fail ("Test hung.");
+			}
+		}
+
+		class ListenerScope : IDisposable {
+			EventWaitHandle completed;
+			public HttpListener listener;
+			Action<HttpListenerContext> processor;
+
+			public ListenerScope (Action<HttpListenerContext> processor, int port, EventWaitHandle completed)
+			{
+				this.processor = processor;
+				this.completed = completed;
+
+				this.listener = new HttpListener ();
+				this.listener.Prefixes.Add (string.Format ("http://localhost:{0}/", port));
+				this.listener.AuthenticationSchemes = AuthenticationSchemes.Anonymous;
+				this.listener.Start ();
+
+				this.listener.BeginGetContext (this.RequestHandler, null);
+			}
+
+			void RequestHandler (IAsyncResult result)
+			{
+				HttpListenerContext context = null;
+
+				try {
+					context = this.listener.EndGetContext (result);
+				} catch (HttpListenerException ex) {
+					// check if the thread has been aborted as in the case when we are shutting down.
+					if (ex.ErrorCode == 995)
+						return;
+				} catch (ObjectDisposedException) {
+					return;
+				}
+
+				ThreadPool.QueueUserWorkItem ((o) =>
+				{
+					try {
+						this.processor (context);
+					} catch (HttpListenerException) {
+					}
+				});
+
+				this.completed.Set ();
+			}
+
+			public void Dispose ()
+			{
+				this.listener.Stop ();
+			}
+		}
+#endif
+
 #if !TARGET_JVM
 		class SslHttpServer : HttpServer {
 			X509Certificate _certificate;
@@ -877,7 +2397,8 @@ namespace MonoTests.System.Net
 
 					writer.Write (answer);
 					writer.Flush ();
-					evt.WaitOne (50000, false);
+					if (evt.WaitOne (5000, false))
+						error = new Exception ("Timeout when stopping the server");
 				} catch (Exception e) {
 					error = e;
 				}
@@ -976,4 +2497,596 @@ namespace MonoTests.System.Net
 		}
 #endif
 	}
+
+	[TestFixture]
+	public class HttpRequestStreamTest
+	{
+		[Test]
+		public void BeginRead ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9124);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [10];
+					try {
+						rs.BeginRead (buffer, 0, buffer.Length, null, null);
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// The stream does not support reading
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void BeginWrite_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9125);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					req.Abort ();
+					try {
+						rs.BeginWrite (new byte [] { 0x2a, 0x2f }, 0, 2, null, null);
+						Assert.Fail ("#1");
+					} catch (WebException ex) {
+						// The request was aborted: The request was canceled
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.IsNull (ex.Response, "#5");
+						Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void CanRead ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9126);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.IsFalse (rs.CanRead, "#1");
+					rs.Close ();
+					Assert.IsFalse (rs.CanRead, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+
+		[Test]
+		public void CanSeek ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9127);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.IsFalse (rs.CanSeek, "#1");
+					rs.Close ();
+					Assert.IsFalse (rs.CanSeek, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test] // bug #324182
+#if TARGET_JVM
+		[Category ("NotWorking")]
+#endif
+		public void CanTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9128);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.IsTrue (rs.CanTimeout, "#1");
+					rs.Close ();
+					Assert.IsTrue (rs.CanTimeout, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+#endif
+
+		[Test]
+		public void CanWrite ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9129);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.IsTrue (rs.CanWrite, "#1");
+					rs.Close ();
+					Assert.IsFalse (rs.CanWrite, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+
+		[Test]
+		public void Read ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9130);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [10];
+					try {
+						rs.Read (buffer, 0, buffer.Length);
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// The stream does not support reading
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void ReadByte ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9140);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					try {
+						rs.ReadByte ();
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// The stream does not support reading
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test]
+		public void ReadTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9141);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.AreEqual (300000, rs.ReadTimeout, "#1");
+					rs.Close ();
+					Assert.AreEqual (300000, rs.ReadTimeout, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+#endif
+
+		[Test]
+		public void Seek ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9142);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					try {
+						rs.Seek (0, SeekOrigin.Current);
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// This stream does not support seek operations
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Write_Buffer_Null ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9143);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					try {
+						rs.Write ((byte []) null, -1, -1);
+						Assert.Fail ("#1");
+					} catch (ArgumentNullException ex) {
+						Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.AreEqual ("buffer", ex.ParamName, "#5");
+					}
+				}
+
+				req.Abort ();
+			}
+		}
+
+		[Test]
+		public void Write_Count_Negative ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9144);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [] { 0x2a, 0x2c, 0x1d, 0x00, 0x0f };
+					try {
+						rs.Write (buffer, 1, -1);
+						Assert.Fail ("#1");
+					} catch (ArgumentOutOfRangeException ex) {
+						// Specified argument was out of the range of valid values
+						Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#A2");
+						Assert.IsNull (ex.InnerException, "#A3");
+						Assert.IsNotNull (ex.Message, "#A4");
+						Assert.AreEqual ("size", ex.ParamName, "#A5");
+					}
+				}
+
+				req.Abort ();
+			}
+		}
+
+		[Test]
+		public void Write_Count_Overflow ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9145);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [] { 0x2a, 0x2c, 0x1d, 0x00, 0x0f };
+					try {
+						rs.Write (buffer, buffer.Length - 2, 3);
+						Assert.Fail ("#1");
+					} catch (ArgumentOutOfRangeException ex) {
+						// Specified argument was out of the range of valid values
+						Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.AreEqual ("size", ex.ParamName, "#5");
+					}
+				}
+
+				req.Abort ();
+			}
+		}
+
+		[Test]
+		public void Write_Offset_Negative ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9146);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [] { 0x2a, 0x2c, 0x1d, 0x00, 0x0f };
+					try {
+						rs.Write (buffer, -1, 0);
+						Assert.Fail ("#1");
+					} catch (ArgumentOutOfRangeException ex) {
+						// Specified argument was out of the range of valid values
+						Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.AreEqual ("offset", ex.ParamName, "#5");
+					}
+				}
+
+				req.Abort ();
+			}
+		}
+
+		[Test]
+		public void Write_Offset_Overflow ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9147);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					byte [] buffer = new byte [] { 0x2a, 0x2c, 0x1d, 0x00, 0x0f };
+					try {
+						rs.Write (buffer, buffer.Length + 1, 0);
+						Assert.Fail ("#1");
+					} catch (ArgumentOutOfRangeException ex) {
+						// Specified argument was out of the range of valid values
+						Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.AreEqual ("offset", ex.ParamName, "#5");
+					}
+				}
+
+				req.Abort ();
+			}
+		}
+
+		[Test]
+		public void Write_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9148);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					req.Abort ();
+					try {
+						rs.Write (new byte [0], 0, 0);
+						Assert.Fail ("#1");
+					} catch (WebException ex) {
+						// The request was aborted: The request was canceled
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.IsNull (ex.Response, "#5");
+						Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+					}
+				}
+			}
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void Write_Stream_Closed ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9149);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					rs.Close ();
+					try {
+						rs.Write (new byte [0], 0, 0);
+						Assert.Fail ("#1");
+					} catch (WebException ex) {
+						// The request was aborted: The connection was closed unexpectedly
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.IsNull (ex.Response, "#5");
+						Assert.AreEqual (WebExceptionStatus.ConnectionClosed, ex.Status, "#6");
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void WriteByte_Request_Aborted ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9150);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				using (Stream rs = req.GetRequestStream ()) {
+					req.Abort ();
+					try {
+						rs.WriteByte (0x2a);
+						Assert.Fail ("#1");
+					} catch (WebException ex) {
+						// The request was aborted: The request was canceled
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+						Assert.IsNull (ex.Response, "#5");
+						Assert.AreEqual (WebExceptionStatus.RequestCanceled, ex.Status, "#6");
+					}
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test]
+		public void WriteTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 9151);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebRequestTest.EchoRequestHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "POST";
+
+				Stream rs = req.GetRequestStream ();
+				try {
+					Assert.AreEqual (300000, rs.WriteTimeout, "#1");
+					rs.Close ();
+					Assert.AreEqual (300000, rs.WriteTimeout, "#2");
+				} finally {
+					rs.Close ();
+					req.Abort ();
+				}
+			}
+		}
+#endif
+	}
+
+#if NET_2_0
+	public static class StreamExtensions {
+		public static int ReadAll(this Stream stream, byte[] buffer, int offset, int count)
+		{
+			int totalRead = 0;
+
+			while (totalRead < count) {
+				int bytesRead = stream.Read (buffer, offset + totalRead, count - totalRead);
+				if (bytesRead == 0)
+					break;
+
+				totalRead += bytesRead;
+			}
+
+			return totalRead;
+		}
+	}
+
+	public class ExceptionAssert {
+		/// <summary>
+		/// Asserts that the function throws an exception.
+		/// </summary>
+		/// <param name="f">A function execute that is expected to raise an exception.</param>
+		/// <typeparam name="T">The type of exception that is expected.</typeparam>
+		/// <returns>The exception thrown.</returns>
+		/// <exception cref="AssertFailedException">If the function does not throw an exception 
+		/// or throws a different exception.</exception>
+		/// <example><![CDATA[
+		///     ExceptionAssert.Throws(typeof(ArgumentNullException), delegate {
+		///         myObject.myFunction(null); });
+		/// ]]></example>
+		public static T Throws<T> (Action f) where T : Exception {
+			Exception actualException = null;
+
+			try {
+				f ();
+			} catch (Exception ex) {
+				actualException = ex;
+			}
+
+			if (actualException == null)
+				throw new AssertionException (string.Format (
+					"No exception thrown. Expected '{0}'",
+					typeof (T).FullName));
+			else if (typeof(T) != actualException.GetType())
+				throw new AssertionException (string.Format (
+					"Caught exception of type '{0}'. Expected '{1}':{2}",
+					actualException.GetType().FullName,
+					typeof (T).FullName,
+					Environment.NewLine + actualException));
+
+			return (T) actualException;
+		}
+	}
+#endif
 }
diff --git a/mcs/class/System/Test/System.Net/HttpWebResponseTest.cs b/mcs/class/System/Test/System.Net/HttpWebResponseTest.cs
index 936de69..dd97491 100644
--- a/mcs/class/System/Test/System.Net/HttpWebResponseTest.cs
+++ b/mcs/class/System/Test/System.Net/HttpWebResponseTest.cs
@@ -25,9 +25,9 @@ namespace MonoTests.System.Net
 		public void CharacterSet_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -48,8 +48,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -57,9 +55,9 @@ namespace MonoTests.System.Net
 		public void Close_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -71,8 +69,6 @@ namespace MonoTests.System.Net
 				HttpWebResponse resp = (HttpWebResponse) req.GetResponse ();
 				((IDisposable) resp).Dispose ();
 				resp.Close ();
-
-				responder.Stop ();
 			}
 		}
 
@@ -80,9 +76,9 @@ namespace MonoTests.System.Net
 		public void ContentEncoding_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -103,8 +99,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -112,9 +106,9 @@ namespace MonoTests.System.Net
 		public void ContentLength_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -127,8 +121,6 @@ namespace MonoTests.System.Net
 				((IDisposable) resp).Dispose ();
 
 				Assert.AreEqual (9, resp.ContentLength);
-
-				responder.Stop ();
 			}
 		}
 
@@ -136,9 +128,9 @@ namespace MonoTests.System.Net
 		public void ContentType_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -159,8 +151,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -168,9 +158,9 @@ namespace MonoTests.System.Net
 		public void Cookies_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -201,8 +191,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#B4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#B5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -210,9 +198,9 @@ namespace MonoTests.System.Net
 		public void GetResponseHeader_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -233,8 +221,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -242,9 +228,9 @@ namespace MonoTests.System.Net
 		public void GetResponseStream_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -265,8 +251,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -274,9 +258,9 @@ namespace MonoTests.System.Net
 		public void Headers_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -308,8 +292,6 @@ namespace MonoTests.System.Net
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
 #endif
-
-				responder.Stop ();
 			}
 		}
 
@@ -317,9 +299,9 @@ namespace MonoTests.System.Net
 		public void LastModified_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -340,8 +322,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -349,9 +329,9 @@ namespace MonoTests.System.Net
 		public void Method_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -372,8 +352,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -381,9 +359,9 @@ namespace MonoTests.System.Net
 		public void ProtocolVersion_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -404,8 +382,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -413,9 +389,9 @@ namespace MonoTests.System.Net
 		public void ResponseUri_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -436,8 +412,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -445,9 +419,9 @@ namespace MonoTests.System.Net
 		public void Server_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -468,8 +442,6 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
@@ -477,9 +449,9 @@ namespace MonoTests.System.Net
 		public void StatusCode_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -492,8 +464,6 @@ namespace MonoTests.System.Net
 				((IDisposable) resp).Dispose ();
 
 				Assert.AreEqual (HttpStatusCode.OK, resp.StatusCode);
-
-				responder.Stop ();
 			}
 		}
 
@@ -501,9 +471,9 @@ namespace MonoTests.System.Net
 		public void StatusDescription_Disposed ()
 		{
 			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
-			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+			string url = "http://" + ep.ToString () + "/test/";
 
-			using (SocketResponder responder = new SocketResponder (new IPEndPoint (IPAddress.Loopback, 8000), new SocketRequestHandler (FullResponseHandler))) {
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (FullResponseHandler))) {
 				responder.Start ();
 
 				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
@@ -524,12 +494,10 @@ namespace MonoTests.System.Net
 					Assert.IsNotNull (ex.Message, "#4");
 					Assert.AreEqual (typeof (HttpWebResponse).FullName, ex.ObjectName, "#5");
 				}
-
-				responder.Stop ();
 			}
 		}
 
-		static byte [] FullResponseHandler (Socket socket)
+		internal static byte [] FullResponseHandler (Socket socket)
 		{
 			StringWriter sw = new StringWriter ();
 			sw.NewLine = "\r\n";
@@ -548,4 +516,675 @@ namespace MonoTests.System.Net
 			return Encoding.UTF8.GetBytes (sw.ToString ());
 		}
 	}
+
+	[TestFixture]
+	public class HttpResponseStreamTest
+	{
+		[Test]
+		public void BeginRead_Buffer_Null ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = null;
+					try {
+						try {
+							rs.BeginRead (buffer, 0, 0, null, null);
+							Assert.Fail ("#A1");
+						} catch (ArgumentNullException ex) {
+							Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("buffer", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						buffer = null;
+						try {
+							rs.BeginRead (buffer, 0, 0, null, null);
+							Assert.Fail ("#B1");
+						} catch (ArgumentNullException ex) {
+							Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("buffer", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void BeginWrite ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						rs.BeginWrite (buffer, 0, buffer.Length, null, null);
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// The stream does not support writing
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void CanRead ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.IsTrue (rs.CanRead, "#1");
+						rs.Close ();
+						Assert.IsFalse (rs.CanRead, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void CanSeek ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.IsFalse (rs.CanSeek, "#1");
+						rs.Close ();
+						Assert.IsFalse (rs.CanSeek, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test] // bug #324182
+#if TARGET_JVM
+		[Category ("NotWorking")]
+#endif
+		public void CanTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.IsTrue (rs.CanTimeout, "#1");
+						rs.Close ();
+						Assert.IsTrue (rs.CanTimeout, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+#endif
+
+		[Test]
+		public void CanWrite ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.IsFalse (rs.CanWrite, "#1");
+						rs.Close ();
+						Assert.IsFalse (rs.CanWrite, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						Assert.AreEqual (1, rs.Read (buffer, 4, 1), "#A1");
+						Assert.AreEqual (new byte [] { 0x00, 0x00, 0x00, 0x00, 0x3c }, buffer, "#A2");
+						Assert.AreEqual (2, rs.Read (buffer, 0, 2), "#B1");
+						Assert.AreEqual (new byte [] { 0x64, 0x75, 0x00, 0x00, 0x3c }, buffer, "#B2");
+						Assert.AreEqual (4, rs.Read (buffer, 1, 4), "#C1");
+						Assert.AreEqual (new byte [] { 0x64, 0x6d, 0x6d, 0x79, 0x20 }, buffer, "#C2");
+						Assert.AreEqual (2, rs.Read (buffer, 0, 3), "#D1");
+						Assert.AreEqual (new byte [] { 0x2f, 0x3e, 0x6d, 0x79, 0x20 }, buffer, "#D2");
+						Assert.AreEqual (0, rs.Read (buffer, 1, 3), "#E1");
+						Assert.AreEqual (new byte [] { 0x2f, 0x3e, 0x6d, 0x79, 0x20 }, buffer, "#E2");
+						Assert.AreEqual (0, rs.Read (buffer, buffer.Length, 0), "#G1");
+						Assert.AreEqual (new byte [] { 0x2f, 0x3e, 0x6d, 0x79, 0x20 }, buffer, "#G2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Buffer_Null ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = null;
+					try {
+						try {
+							rs.Read (buffer, 0, 0);
+							Assert.Fail ("#A1");
+						} catch (ArgumentNullException ex) {
+							Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("buffer", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						buffer = null;
+						try {
+							rs.Read (buffer, 0, 0);
+							Assert.Fail ("#B1");
+						} catch (ArgumentNullException ex) {
+							Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("buffer", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Count_Negative ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						try {
+							rs.Read (buffer, 1, -1);
+							Assert.Fail ("#A1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("size", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						try {
+							rs.Read (buffer, 1, -1);
+							Assert.Fail ("#B1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("size", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Count_Overflow ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						try {
+							rs.Read (buffer, buffer.Length - 2, 3);
+							Assert.Fail ("#A1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("size", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						try {
+							rs.Read (buffer, buffer.Length - 2, 3);
+							Assert.Fail ("#B1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("size", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Offset_Negative ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						try {
+							rs.Read (buffer, -1, 0);
+							Assert.Fail ("#A1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("offset", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						try {
+							rs.Read (buffer, -1, 0);
+							Assert.Fail ("#B1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("offset", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Offset_Overflow ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						try {
+							rs.Read (buffer, buffer.Length + 1, 0);
+							Assert.Fail ("#A1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#A2");
+							Assert.IsNull (ex.InnerException, "#A3");
+							Assert.IsNotNull (ex.Message, "#A4");
+							Assert.AreEqual ("offset", ex.ParamName, "#A5");
+						}
+
+						// read full response
+						buffer = new byte [24];
+						Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+
+						try {
+							rs.Read (buffer, buffer.Length + 1, 0);
+							Assert.Fail ("#B1");
+						} catch (ArgumentOutOfRangeException ex) {
+							// Specified argument was out of the range of valid values
+							Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#B2");
+							Assert.IsNull (ex.InnerException, "#B3");
+							Assert.IsNotNull (ex.Message, "#B4");
+							Assert.AreEqual ("offset", ex.ParamName, "#B5");
+						}
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void Read_Stream_Closed ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req;
+				
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					rs.Close ();
+					try {
+						rs.Read (new byte [0], 0, 0);
+						Assert.Fail ("#A1");
+					} catch (WebException ex) {
+						// The request was aborted: The connection was closed unexpectedly
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#A2");
+						Assert.IsNull (ex.InnerException, "#A3");
+						Assert.IsNotNull (ex.Message, "#A4");
+						Assert.IsNull (ex.Response, "#A5");
+						Assert.AreEqual (WebExceptionStatus.ConnectionClosed, ex.Status, "#A6");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+
+				req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [24];
+					Assert.AreEqual (9, rs.Read (buffer, 0, buffer.Length));
+					rs.Close ();
+					try {
+						rs.Read (new byte [0], 0, 0);
+						Assert.Fail ("#B1");
+					} catch (WebException ex) {
+						// The request was aborted: The connection was closed unexpectedly
+						Assert.AreEqual (typeof (WebException), ex.GetType (), "#B2");
+						Assert.IsNull (ex.InnerException, "#B3");
+						Assert.IsNotNull (ex.Message, "#B4");
+						Assert.IsNull (ex.Response, "#B5");
+						Assert.AreEqual (WebExceptionStatus.ConnectionClosed, ex.Status, "#B6");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test]
+		public void ReadTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.AreEqual (2000, rs.ReadTimeout, "#1");
+						rs.Close ();
+						Assert.AreEqual (2000, rs.ReadTimeout, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+#endif
+
+		[Test]
+		public void Write ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					byte [] buffer = new byte [5];
+					try {
+						rs.Write (buffer, 0, buffer.Length);
+						Assert.Fail ("#1");
+					} catch (NotSupportedException ex) {
+						// The stream does not support writing
+						Assert.AreEqual (typeof (NotSupportedException), ex.GetType (), "#2");
+						Assert.IsNull (ex.InnerException, "#3");
+						Assert.IsNotNull (ex.Message, "#4");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+
+#if NET_2_0
+		[Test]
+		public void WriteTimeout ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + ep.ToString () + "/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (HttpWebResponseTest.FullResponseHandler))) {
+				responder.Start ();
+
+				HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url);
+				req.Method = "GET";
+				req.Timeout = 2000;
+				req.ReadWriteTimeout = 2000;
+				req.KeepAlive = false;
+
+				using (HttpWebResponse resp = (HttpWebResponse) req.GetResponse ()) {
+					Stream rs = resp.GetResponseStream ();
+					try {
+						Assert.AreEqual (2000, rs.WriteTimeout, "#1");
+						rs.Close ();
+						Assert.AreEqual (2000, rs.WriteTimeout, "#2");
+					} finally {
+						rs.Close ();
+						req.Abort ();
+					}
+				}
+			}
+		}
+#endif
+	}
 }
diff --git a/mcs/class/System/Test/System.Net/SocketResponder.cs b/mcs/class/System/Test/System.Net/SocketResponder.cs
index dd932ec..382503d 100644
--- a/mcs/class/System/Test/System.Net/SocketResponder.cs
+++ b/mcs/class/System/Test/System.Net/SocketResponder.cs
@@ -48,6 +48,7 @@ namespace MonoTests.System.Net
 		private readonly object _syncRoot = new object ();
 
 		private const int SOCKET_CLOSED = 10004;
+		private const int SOCKET_INVALID_ARGS = 10022;
 
 		public SocketResponder (IPEndPoint localEP, SocketRequestHandler requestHandler)
 		{
@@ -116,7 +117,7 @@ namespace MonoTests.System.Net
 					socket.Close ();
 				} catch (SocketException ex) {
 					// ignore interruption of blocking call
-					if (ex.ErrorCode != SOCKET_CLOSED)
+					if (ex.ErrorCode != SOCKET_CLOSED && ex.ErrorCode != SOCKET_INVALID_ARGS)
 						throw;
 				}
 			}
diff --git a/mcs/class/System/Test/System.Net/WebClientTest.cs b/mcs/class/System/Test/System.Net/WebClientTest.cs
index fa57be6..ea87f0a 100644
--- a/mcs/class/System/Test/System.Net/WebClientTest.cs
+++ b/mcs/class/System/Test/System.Net/WebClientTest.cs
@@ -5,12 +5,15 @@
 //
 
 using System;
+using System.Collections;
 using System.Collections.Specialized;
+using System.Globalization;
 using System.IO;
 using System.Net;
-using System.Collections;
+using System.Net.Sockets;
 using System.Runtime.Serialization;
-
+using System.Text;
+using System.Threading;
 using NUnit.Framework;
 
 namespace MonoTests.System.Net
@@ -382,6 +385,30 @@ namespace MonoTests.System.Net
 				Assert.IsNotNull (inner.Message, "#9");
 			}
 		}
+
+		[Test]
+		public void EncodingTest ()
+		{
+			WebClient wc = new WebClient ();
+			Assert.AreSame (Encoding.Default, wc.Encoding, "#1");
+			wc.Encoding = Encoding.ASCII;
+			Assert.AreSame (Encoding.ASCII, wc.Encoding, "#2");
+		}
+
+		[Test]
+		public void Encoding_Value_Null ()
+		{
+			WebClient wc = new WebClient ();
+			try {
+				wc.Encoding = null;
+				Assert.Fail ("#1");
+			} catch (ArgumentNullException ex) {
+				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
+				Assert.IsNull (ex.InnerException, "#3");
+				Assert.IsNotNull (ex.Message, "#4");
+				Assert.AreEqual ("Encoding", ex.ParamName, "#6");
+			}
+		}
 #endif
 
 		[Test] // OpenRead (string)
@@ -1667,6 +1694,30 @@ namespace MonoTests.System.Net
 		}
 #endif
 
+		[Test]
+		public void UploadValues1 ()
+		{
+			IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);
+			string url = "http://" + IPAddress.Loopback.ToString () + ":8000/test/";
+
+			using (SocketResponder responder = new SocketResponder (ep, new SocketRequestHandler (EchoRequestHandler))) {
+				responder.Start ();
+
+				WebClient wc = new WebClient ();
+#if NET_2_0
+				wc.Encoding = Encoding.ASCII;
+#endif
+
+				NameValueCollection nvc = new NameValueCollection ();
+				nvc.Add ("Name", "\u0041\u2262\u0391\u002E");
+				nvc.Add ("Address", "\u002E\u2262\u0041\u0391");
+
+				byte [] buffer = wc.UploadValues (url, nvc);
+				string response = Encoding.UTF8.GetString (buffer);
+				Assert.AreEqual ("Name=A%e2%89%a2%ce%91.&Address=.%e2%89%a2A%ce%91\r\n", response);
+			}
+		}
+
 		[Test] // UploadValues (string, NameValueCollection)
 		public void UploadValues1_Address_Null ()
 		{
@@ -1982,5 +2033,89 @@ namespace MonoTests.System.Net
 			}
 		}
 #endif
+
+		static byte [] EchoRequestHandler (Socket socket)
+		{
+			MemoryStream ms = new MemoryStream ();
+			byte [] buffer = new byte [4096];
+			int bytesReceived = socket.Receive (buffer);
+			while (bytesReceived > 0) {
+				ms.Write (buffer, 0, bytesReceived);
+				 // We don't check for Content-Length or anything else here, so we give the client a little time to write
+				 // after sending the headers
+				Thread.Sleep (200);
+				if (socket.Available > 0) {
+					bytesReceived = socket.Receive (buffer);
+				} else {
+					bytesReceived = 0;
+				}
+			}
+			ms.Flush ();
+			ms.Position = 0;
+
+			StringBuilder sb = new StringBuilder ();
+
+			string expect = null;
+
+			StreamReader sr = new StreamReader (ms, Encoding.UTF8);
+			string line = null;
+			byte state = 0;
+			while ((line = sr.ReadLine ()) != null) {
+				if (state > 0) {
+					state = 2;
+					sb.Append (line);
+					sb.Append ("\r\n");
+				} if (line.Length == 0) {
+					state = 1;
+				} else if (line.StartsWith ("Expect:")) {
+					expect = line.Substring (8);
+				}
+			}
+
+			StringWriter sw = new StringWriter ();
+
+			if (expect == "100-continue" && state != 2) {
+				sw.WriteLine ("HTTP/1.1 100 Continue");
+				sw.WriteLine ();
+				sw.Flush ();
+
+				socket.Send (Encoding.UTF8.GetBytes (sw.ToString ()));
+
+				// receive body
+				ms = new MemoryStream ();
+				buffer = new byte [4096];
+				bytesReceived = socket.Receive (buffer);
+				while (bytesReceived > 0) {
+					ms.Write (buffer, 0, bytesReceived);
+					Thread.Sleep (200);
+					if (socket.Available > 0) {
+						bytesReceived = socket.Receive (buffer);
+					} else {
+						bytesReceived = 0;
+					}
+				}
+				ms.Flush ();
+				ms.Position = 0;
+
+				sb = new StringBuilder ();
+				sr = new StreamReader (ms, Encoding.UTF8);
+				line = sr.ReadLine ();
+				while (line != null) {
+					sb.Append (line);
+					sb.Append ("\r\n");
+					line = sr.ReadLine ();
+				}
+			}
+
+			sw = new StringWriter ();
+			sw.WriteLine ("HTTP/1.1 200 OK");
+			sw.WriteLine ("Content-Type: text/xml");
+			sw.WriteLine ("Content-Length: " + sb.Length.ToString (CultureInfo.InvariantCulture));
+			sw.WriteLine ();
+			sw.Write (sb.ToString ());
+			sw.Flush ();
+
+			return Encoding.UTF8.GetBytes (sw.ToString ());
+		}
 	}
 }
diff --git a/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs b/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
index 8d33590..1bc8b4d 100644
--- a/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
+++ b/mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs
@@ -5,6 +5,7 @@
 //   Lawrence Pit (loz at cable.a2000.nl)
 //   Martin Willemoes Hansen (mwh at sysrq.dk)
 //   Gert Driesen (drieseng at users.sourceforge.net)
+//   Gonzalo Paniagua Javier (gonzalo at novell.com)
 //
 // (C) 2003 Martin Willemoes Hansen
 //
@@ -40,44 +41,44 @@ namespace MonoTests.System.Net
 		{
 			try {
 				col.Add (null);
-				Assertion.Fail ("#1");
+				Assert.Fail ("#1");
 			} catch (ArgumentNullException) { }
 			try {
 				col.Add ("");
-				Assertion.Fail ("#2");
+				Assert.Fail ("#2");
 			} catch (ArgumentException) { }
 			try {
 				col.Add ("  ");
-				Assertion.Fail ("#3");
+				Assert.Fail ("#3");
 			} catch (ArgumentException) { }
 			try {
 				col.Add (":");
-				Assertion.Fail ("#4");
+				Assert.Fail ("#4");
 			} catch (ArgumentException) { }
 			try {
 				col.Add (" : ");
-				Assertion.Fail ("#5");
+				Assert.Fail ("#5");
 			} catch (ArgumentException) { }
 
 			try {
 				col.Add ("XHost: foo");
 			} catch (ArgumentException) {
-				Assertion.Fail ("#7");
+				Assert.Fail ("#7");
 			}
 
 			// invalid values
 			try {
 				col.Add ("XHost" + ((char) 0xa9) + ": foo");
-				Assertion.Fail ("#8");
+				Assert.Fail ("#8");
 			} catch (ArgumentException) { }
 			try {
 				col.Add ("XHost: foo" + (char) 0xa9);
 			} catch (ArgumentException) {
-				Assertion.Fail ("#9");
+				Assert.Fail ("#9");
 			}
 			try {
 				col.Add ("XHost: foo" + (char) 0x7f);
-				Assertion.Fail ("#10");
+				Assert.Fail ("#10");
 			} catch (ArgumentException) {
 
 			}
@@ -85,12 +86,12 @@ namespace MonoTests.System.Net
 			try {
 				col.Add ("XHost", null);
 			} catch (ArgumentException) {
-				Assertion.Fail ("#11");
+				Assert.Fail ("#11");
 			}
 			try {
 				col.Add ("XHost:");
 			} catch (ArgumentException) {
-				Assertion.Fail ("#12");
+				Assert.Fail ("#12");
 			}
 
 			// restricted
@@ -99,7 +100,7 @@ namespace MonoTests.System.Net
 			try {
 				WebHeaderCollection col2 = new WebHeaderCollection (true);
 				col2.Add ("Host: foo");
-				Assertion.Fail ("#13: should fail according to spec");
+				Assert.Fail ("#13: should fail according to spec");
 			} catch (ArgumentException) {}		
 			*/
 		}
@@ -114,61 +115,61 @@ namespace MonoTests.System.Net
 			w.Add ("Hello", "H3,H4");
 
 			string [] sa = w.GetValues ("Hello");
-			Assertion.AssertEquals ("#1", 3, sa.Length);
-			Assertion.AssertEquals ("#2", "H1,H2,H3,H4", w.Get ("Hello"));
+			Assert.AreEqual (3, sa.Length, "#1");
+			Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Hello"), "#2");
 
 			w = new WebHeaderCollection ();
 			w.Add ("Accept", "H1");
 			w.Add ("Accept", "H2");
 			w.Add ("Accept", "H3,H4");
-			Assertion.AssertEquals ("#3a", 3, w.GetValues (0).Length);
-			Assertion.AssertEquals ("#3b", 4, w.GetValues ("Accept").Length);
-			Assertion.AssertEquals ("#4", "H1,H2,H3,H4", w.Get ("Accept"));
+			Assert.AreEqual (3, w.GetValues (0).Length, "#3a");
+			Assert.AreEqual (4, w.GetValues ("Accept").Length, "#3b");
+			Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Accept"), "#4");
 
 			w = new WebHeaderCollection ();
 			w.Add ("Allow", "H1");
 			w.Add ("Allow", "H2");
 			w.Add ("Allow", "H3,H4");
 			sa = w.GetValues ("Allow");
-			Assertion.AssertEquals ("#5", 4, sa.Length);
-			Assertion.AssertEquals ("#6", "H1,H2,H3,H4", w.Get ("Allow"));
+			Assert.AreEqual (4, sa.Length, "#5");
+			Assert.AreEqual ("H1, H2,H3,H4", w.Get ("Allow"), "#6");
 
 			w = new WebHeaderCollection ();
 			w.Add ("AUTHorization", "H1, H2, H3");
 			sa = w.GetValues ("authorization");
-			Assertion.AssertEquals ("#9", 3, sa.Length);
+			Assert.AreEqual (3, sa.Length, "#9");
 
 			w = new WebHeaderCollection ();
 			w.Add ("proxy-authenticate", "H1, H2, H3");
 			sa = w.GetValues ("Proxy-Authenticate");
-			Assertion.AssertEquals ("#9", 3, sa.Length);
+			Assert.AreEqual (3, sa.Length, "#9");
 
 			w = new WebHeaderCollection ();
 			w.Add ("expect", "H1,\tH2,   H3  ");
 			sa = w.GetValues ("EXPECT");
-			Assertion.AssertEquals ("#10", 3, sa.Length);
-			Assertion.AssertEquals ("#11", "H2", sa [1]);
-			Assertion.AssertEquals ("#12", "H3", sa [2]);
+			Assert.AreEqual (3, sa.Length, "#10");
+			Assert.AreEqual ("H2", sa [1], "#11");
+			Assert.AreEqual ("H3", sa [2], "#12");
 
 			try {
 				w.GetValues (null);
-				Assertion.Fail ("#13");
+				Assert.Fail ("#13");
 			} catch (ArgumentNullException) { }
-			Assertion.AssertEquals ("#14", null, w.GetValues (""));
-			Assertion.AssertEquals ("#15", null, w.GetValues ("NotExistent"));
+			Assert.AreEqual (null, w.GetValues (""), "#14");
+			Assert.AreEqual (null, w.GetValues ("NotExistent"), "#15");
 		}
 
 		[Test]
 		public void Indexers ()
 		{
 #if NET_2_0
-		Assertion.AssertEquals ("#1.1", "Value1", ((NameValueCollection)col)[0]);
+		Assert.AreEqual ("Value1", ((NameValueCollection)col)[0], "#1.1");
 		//FIXME: test also HttpRequestHeader and HttpResponseHeader
 #else
-			Assertion.AssertEquals ("#1", "Value1", col [0]);
+			Assert.AreEqual ("Value1", col [0], "#1");
 #endif
-			Assertion.AssertEquals ("#2", "Value1", col ["Name1"]);
-			Assertion.AssertEquals ("#3", "Value1", col ["NAME1"]);
+			Assert.AreEqual ("Value1", col ["Name1"], "#2");
+			Assert.AreEqual ("Value1", col ["NAME1"], "#3");
 		}
 
 		[Test]
@@ -176,7 +177,7 @@ namespace MonoTests.System.Net
 		{
 			col.Remove ("Name1");
 			col.Remove ("NameNotExist");
-			Assertion.AssertEquals ("#1", 1, col.Count);
+			Assert.AreEqual (1, col.Count, "#1");
 
 			/*
 			// this can only be tested in namespace System.Net
@@ -184,7 +185,7 @@ namespace MonoTests.System.Net
 				WebHeaderCollection col2 = new WebHeaderCollection (true);
 				col2.Add ("Host", "foo");
 				col2.Remove ("Host");
-				Assertion.Fail ("#2: should fail according to spec");
+				Assert.Fail ("#2: should fail according to spec");
 			} catch (ArgumentException) {}
 			*/
 		}
@@ -194,19 +195,19 @@ namespace MonoTests.System.Net
 		{
 			col.Add ("Name1", "Value1b");
 			col.Set ("Name1", "\t  X  \t");
-			Assertion.AssertEquals ("#1", "X", col.Get ("Name1"));
+			Assert.AreEqual ("X", col.Get ("Name1"), "#1");
 		}
 
 		[Test]
 		public void IsRestricted ()
 		{
-			Assertion.Assert ("#1", !WebHeaderCollection.IsRestricted ("Xhost"));
-			Assertion.Assert ("#2", WebHeaderCollection.IsRestricted ("Host"));
-			Assertion.Assert ("#3", WebHeaderCollection.IsRestricted ("HOST"));
-			Assertion.Assert ("#4", WebHeaderCollection.IsRestricted ("Transfer-Encoding"));
-			Assertion.Assert ("#5", WebHeaderCollection.IsRestricted ("user-agent"));
-			Assertion.Assert ("#6", WebHeaderCollection.IsRestricted ("accept"));
-			Assertion.Assert ("#7", !WebHeaderCollection.IsRestricted ("accept-charset"));
+			Assert.IsTrue (!WebHeaderCollection.IsRestricted ("Xhost"), "#1");
+			Assert.IsTrue (WebHeaderCollection.IsRestricted ("Host"), "#2");
+			Assert.IsTrue (WebHeaderCollection.IsRestricted ("HOST"), "#3");
+			Assert.IsTrue (WebHeaderCollection.IsRestricted ("Transfer-Encoding"), "#4");
+			Assert.IsTrue (WebHeaderCollection.IsRestricted ("user-agent"), "#5");
+			Assert.IsTrue (WebHeaderCollection.IsRestricted ("accept"), "#6");
+			Assert.IsTrue (!WebHeaderCollection.IsRestricted ("accept-charset"), "#7");
 		}
 
 		[Test]
@@ -215,7 +216,7 @@ namespace MonoTests.System.Net
 			col.Add ("Name1", "Value1b");
 			col.Add ("Name3", "Value3a\r\n Value3b");
 			col.Add ("Name4", "   Value4   ");
-			Assertion.AssertEquals ("#1", "Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString ());
+			Assert.AreEqual ("Name1: Value1,Value1b\r\nName2: Value2\r\nName3: Value3a\r\n Value3b\r\nName4: Value4\r\n\r\n", col.ToString (), "#1");
 		}
 
 		[Test]
@@ -375,5 +376,246 @@ namespace MonoTests.System.Net
 			0x74, 0x74, 0x61, 0x63, 0x68, 0x0b
 #endif
 		};
+
+		[Test]
+		public void IsRestricted_InvalidChars_1 ()
+		{
+			// Not allowed:
+			//	0-32
+			//	34
+			//	39-41
+			//	44
+			//	47
+			//	91-93
+			//	123
+			//	125
+			//	>= 127
+			int [] singles = new int [] { 34, 44, 47, 123, 125 };
+			foreach (int single in singles) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) single, 1));
+					Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 0; i <= 32; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1));
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 39; i <= 41; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1));
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 91; i <= 93; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1));
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 127; i <= 255; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1));
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+		}
+#if NET_2_0
+		[Test]
+		public void IsRestricted_InvalidChars_Request_2 ()
+		{
+			// Not allowed:
+			//	0-32
+			//	34
+			//	39-41
+			//	44
+			//	47
+			//	91-93
+			//	123
+			//	125
+			//	>= 127
+			int [] singles = new int [] { 34, 44, 47, 123, 125 };
+			foreach (int single in singles) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) single, 1), false);
+					Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 0; i <= 32; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 39; i <= 41; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 91; i <= 93; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 127; i <= 255; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), false);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+		}
+
+		[Test]
+		public void IsRestricted_InvalidChars_Response_2 ()
+		{
+			// Not allowed:
+			//	0-32
+			//	34
+			//	39-41
+			//	44
+			//	47
+			//	91-93
+			//	123
+			//	125
+			//	>= 127
+			int [] singles = new int [] { 34, 44, 47, 123, 125 };
+			foreach (int single in singles) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) single, 1), true);
+					Assert.Fail (String.Format ("{0}: {1}", single, (char) single));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 0; i <= 32; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 39; i <= 41; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 91; i <= 93; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+			for (int i = 127; i <= 255; i++) {
+				try {
+					WebHeaderCollection.IsRestricted (new string ((char) i, 1), true);
+					Assert.Fail (String.Format ("{0}: {1}", i, (char) i));
+				} catch (ArgumentException) {
+				}
+			}
+		}
+
+		static string [] request_headers = new string [] {
+			"Accept", "Accept-Charset", "Accept-Encoding", "Accept-Language", "Accept-Ranges", "Authorization", 
+			"Cache-Control", "Connection", "Cookie", "Content-Length", "Content-Type", "Date", 
+			"Expect", "From", "Host", "If-Match", "If-Modified-Since", "If-None-Match", 
+			"If-Range", "If-Unmodified-Since", "Max-Forwards", "Pragma", "Proxy-Authorization", 
+			"Range", "Referer", "TE", "Upgrade", "User-Agent", "Via", "Warn" };
+
+		static string [] response_headers = new string [] {
+			"Accept-Ranges", "Age", "Allow", "Cache-Control", "Content-Encoding", "Content-Language", 
+			"Content-Length", "Content-Location", "Content-Disposition", "Content-MD5", "Content-Range", 
+			"Content-Type", "Date", "ETag", "Expires", "Last-Modified", "Location", "Pragma", 
+			"Proxy-Authenticate", "Retry-After", "Server", "Set-Cookie", "Trailer", 
+			"Transfer-Encoding", "Vary", "Via", "Warn", "WWW-Authenticate" };
+
+		static string [] restricted_request_request = new string [] {
+			"Accept", "Connection", "Content-Length", "Content-Type", "Date",
+			"Expect", "Host", "If-Modified-Since", "Range", "Referer",
+			"User-Agent" };
+		static string [] restricted_response_request = new string [] {
+			"Content-Length", "Content-Type", "Date", "Transfer-Encoding" };
+
+		static string [] restricted_request_response = new string [] {
+			 "Content-Length" };
+		static string [] restricted_response_response = new string [] {
+			 "Content-Length", "Transfer-Encoding", "WWW-Authenticate" };
+
+		[Test]
+		public void IsRestricted_2_0_RequestRequest ()
+		{
+			int count = 0;
+			foreach (string str in request_headers) {
+				if (WebHeaderCollection.IsRestricted (str, false)) {
+					Assert.IsTrue (Array.IndexOf (restricted_request_request, str) != -1, "restricted " + str);
+					count++;
+				} else {
+					Assert.IsTrue (Array.IndexOf (restricted_request_request, str) == -1, str);
+				}
+			}
+			Assert.IsTrue (count == restricted_request_request.Length, "req-req length");
+		}
+
+		[Test]
+		public void IsRestricted_2_0_ResponseRequest ()
+		{
+			int count = 0;
+			foreach (string str in response_headers) {
+				if (WebHeaderCollection.IsRestricted (str, false)) {
+					Assert.IsTrue (Array.IndexOf (restricted_response_request, str) != -1, "restricted " + str);
+					count++;
+				} else {
+					Assert.IsTrue (Array.IndexOf (restricted_response_request, str) == -1, str);
+				}
+			}
+			Assert.IsTrue (count == restricted_response_request.Length, "length");
+		}
+
+		[Test]
+		public void IsRestricted_2_0_RequestResponse ()
+		{
+			int count = 0;
+			foreach (string str in request_headers) {
+				if (WebHeaderCollection.IsRestricted (str, true)) {
+					Assert.IsTrue (Array.IndexOf (restricted_request_response, str) != -1, "restricted " + str);
+					count++;
+				} else {
+					Assert.IsTrue (Array.IndexOf (restricted_request_response, str) == -1, str);
+				}
+			}
+			Assert.IsTrue (count == restricted_request_response.Length, "length");
+		}
+
+		[Test]
+		public void IsRestricted_2_0_ResponseResponse ()
+		{
+			int count = 0;
+			foreach (string str in response_headers) {
+				if (WebHeaderCollection.IsRestricted (str, true)) {
+					Assert.IsTrue (Array.IndexOf (restricted_response_response, str) != -1, "restricted " + str);
+					count++;
+				} else {
+					Assert.IsTrue (Array.IndexOf (restricted_response_response, str) == -1, str);
+				}
+			}
+			Assert.IsTrue (count == restricted_response_response.Length, "length");
+		}
+#endif
 	}
 }
+
diff --git a/mcs/class/System/Test/System.Net/WebRequestTest.cs b/mcs/class/System/Test/System.Net/WebRequestTest.cs
index c5b146b..4b5c176 100644
--- a/mcs/class/System/Test/System.Net/WebRequestTest.cs
+++ b/mcs/class/System/Test/System.Net/WebRequestTest.cs
@@ -15,6 +15,8 @@ using System;
 using System.Net;
 using System.Collections;
 using System.Runtime.Serialization;
+using Socks = System.Net.Sockets;
+
 
 namespace MonoTests.System.Net {
 
@@ -325,6 +327,42 @@ namespace MonoTests.System.Net {
 		}
 	}
 
+	[Test] //BNC#323452
+	public void TestFailedConnection ()
+	{
+		try {
+			WebRequest.Create ("http://127.0.0.1:0/non-existant.txt").GetResponse ();
+			Assert.Fail ("Should have raised an exception");
+		} catch (Exception e) {
+			Assert.IsTrue (e is WebException, "Got " + e.GetType ().Name + ": " + e.Message);
+			//#if NET_2_0 e.Message == "Unable to connect to the remote server"
+			//#if NET_1_1 e.Message == "The underlying connection was closed: Unable to connect to the remote server."
+
+			Assert.AreEqual (((WebException)e).Status, WebExceptionStatus.ConnectFailure);
+
+			//#if !NET_1_1 (this is not true in .NET 1.x)
+			Assert.IsNotNull (e.InnerException);
+			Assert.IsTrue (e.InnerException is Socks.SocketException, "InnerException should be SocketException");
+			//e.Message == "The requested address is not valid in its context 127.0.0.1:0"
+			//#endif
+		}
+	}
+
+	[Test] //BNC#323452
+	public void TestFailedResolution ()
+	{
+		try {
+			WebRequest.Create ("http://thisdomaindoesnotexist.monotestcase.x/non-existant.txt").GetResponse ();
+			Assert.Fail ("Should have raised an exception");
+		} catch (Exception e) {
+			Assert.IsTrue (e is WebException);
+			//#if NET_2_0 e.Message == "The underlying connection was closed: The remote name could not be resolved."
+			//#if NET_1_1 e.Message == "The remote name could not be resolved: 'thisdomaindoesnotexist.monotestcase.x'"
+			Assert.AreEqual (((WebException)e).Status, WebExceptionStatus.NameResolutionFailure);
+			Assert.IsNull (e.InnerException);
+		}
+	}
+
 	internal class TestWebRequestCreator : IWebRequestCreate
 	{
 		internal TestWebRequestCreator () { }
diff --git a/mcs/class/System/Test/System/ChangeLog b/mcs/class/System/Test/System/ChangeLog
index 4600452..7a85eb1 100644
--- a/mcs/class/System/Test/System/ChangeLog
+++ b/mcs/class/System/Test/System/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-01  Andres Aragoneses  <aaragoneses at novell.com>
+
+	* UriTest.cs: New tests from #533572.
+
 2009-15-01  Leszek Ciesielski <skolima at gmail.com>
 
 	* UriTest3.cs: test for bug #464235
diff --git a/mcs/class/System/Test/System/UriTest.cs b/mcs/class/System/Test/System/UriTest.cs
index 5dce563..78fba2a 100644
--- a/mcs/class/System/Test/System/UriTest.cs
+++ b/mcs/class/System/Test/System/UriTest.cs
@@ -15,6 +15,9 @@ using System;
 using System.IO;
 using System.Text;
 
+// cheap hack to avoid backporting the new NUnit syntax patch
+using NAssert = NUnit.Framework.Assert;
+
 namespace MonoTests.System
 {
 	[TestFixture]
@@ -23,7 +26,7 @@ namespace MonoTests.System
 		protected bool isWin32 = false;
 
 		[TestFixtureSetUp]
-		public void GetReady () 
+		public void GetReady ()
 		{
 			isWin32 = (Path.DirectorySeparatorChar == '\\');
 		}
@@ -45,21 +48,21 @@ namespace MonoTests.System
 
 			uri = new Uri("http://[11:22:33::88]:9090");
 			Print (uri);
-			
+
 			uri = new Uri("http://[::127.11.22.33]:8080");
 			Print (uri);
-			
+
 			uri = new Uri("http://[abcde::127.11.22.33]:8080");
-			Print (uri);			
+			Print (uri);
 			*/
-			
+
 			/*
 			uri = new Uri ("http://www.contoso.com:1234/foo/bar/");
 			Print (uri);
 
 			uri = new Uri ("http://www.contoso.com:1234/foo/bar");
 			Print (uri);
-			
+
 			uri = new Uri ("http://www.contoso.com:1234/");
 			Print (uri);
 
@@ -480,7 +483,7 @@ namespace MonoTests.System
 		{
 			new Uri ("http:a");
 		}
-		
+
 		[Test]
 		[ExpectedException (typeof (UriFormatException))]
 		public void HttpHostname3 ()
@@ -713,13 +716,13 @@ namespace MonoTests.System
 			AssertEquals ("QE1", u1.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=/SearchDoc/Searcher.aspx");
 			AssertEquals ("QE2", u2.ToString (), "http://localhost:8080/test.aspx?ReturnUrl=%2fSearchDoc%2fSearcher.aspx");
 		}
-		
+
 		[Test]
 		public void UnixPath () {
 			if (!isWin32)
 				AssertEquals ("#6a", "file:///cygwin/tmp/hello.txt", new Uri ("/cygwin/tmp/hello.txt").ToString ());
 		}
-		
+
 		[Test]
 		public void Unc ()
 		{
@@ -750,7 +753,7 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		public void FromHex () 
+		public void FromHex ()
 		{
 			AssertEquals ("#1", 0, Uri.FromHex ('0'));
 			AssertEquals ("#2", 9, Uri.FromHex ('9'));
@@ -801,7 +804,7 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		public void HexEscape () 
+		public void HexEscape ()
 		{
 			AssertEquals ("#1","%20", Uri.HexEscape (' ')); 
 			AssertEquals ("#2","%A9", Uri.HexEscape ((char) 0xa9)); 
@@ -822,7 +825,7 @@ namespace MonoTests.System
         }
 
 		[Test]
-		public void HexUnescape () 
+		public void HexUnescape ()
 		{
 			int i = 0;
 			AssertEquals ("#1", ' ', Uri.HexUnescape ("%20", ref i));
@@ -853,7 +856,7 @@ namespace MonoTests.System
 		[Category ("NotDotNet")]
 #endif
 		[Test]
-		public void HexUnescapeMultiByte () 
+		public void HexUnescapeMultiByte ()
 		{
 			// Tests from bug 74872
 			// Note: These won't pass exactly with MS.NET, due to differences in the
@@ -884,7 +887,7 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		public void IsHexDigit () 
+		public void IsHexDigit ()
 		{
 			Assert ("#1", Uri.IsHexDigit ('a'));	
 			Assert ("#2", Uri.IsHexDigit ('f'));
@@ -897,14 +900,14 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		public void IsHexEncoding () 
+		public void IsHexEncoding ()
 		{
 			Assert ("#1", Uri.IsHexEncoding ("test%a9test", 4));
 			Assert ("#2", !Uri.IsHexEncoding ("test%a9test", 3));
 			Assert ("#3", Uri.IsHexEncoding ("test%a9", 4));
 			Assert ("#4", !Uri.IsHexEncoding ("test%a", 4));
 		}
-		
+
 		[Test]
 		public void GetLeftPart ()
 		{
@@ -1059,7 +1062,7 @@ namespace MonoTests.System
 			AssertEquals ("#46", UriHostNameType.Unknown, Uri.CheckHostName ("*.go-mono.com"));
 			AssertEquals ("#47", UriHostNameType.Unknown, Uri.CheckHostName ("www*.go-mono.com"));
 		}
-		
+
 		[Test]
 		public void IsLoopback ()
 		{
@@ -1191,7 +1194,7 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		public void GetHashCodeTest () 
+		public void GetHashCodeTest ()
 		{
 			Uri uri1 = new Uri ("http://www.contoso.com/index.htm#main");
 			Uri uri2 = new Uri ("http://www.contoso.com/index.htm#fragment");
@@ -1247,7 +1250,7 @@ namespace MonoTests.System
 			Uri u = new Uri ("foo", UriKind.Relative);
 			u.GetLeftPart (UriPartial.Path);
 		}
-		
+
 		[Test]
 		public void TestPartialToString ()
 		{
@@ -1257,7 +1260,7 @@ namespace MonoTests.System
 			AssertEquals ("#4", new Uri ("foo#dingus?aa", UriKind.Relative).ToString (), "foo#dingus?aa");
 			AssertEquals ("#4", new Uri ("foo?dingus#aa", UriKind.Relative).ToString (), "foo?dingus#aa");
 		}
-		
+
 		[Test]
 		public void RelativeGetHashCodeTest()
 		{
@@ -1612,7 +1615,7 @@ namespace MonoTests.System
 		public void TestEscapeDataString ()
 		{
 			StringBuilder sb = new StringBuilder ();
-			
+
 			for (int i = 0; i < 128; i++)
 				sb.Append ((char) i);
 			
@@ -1647,7 +1650,7 @@ namespace MonoTests.System
 		}
 
 		// This test doesn't work on Linux, and arguably shouldn't work.
-		// new Uri("file:///tmp/foo/bar").AbsolutePath returns "/tmp/foo/bar" 
+		// new Uri("file:///tmp/foo/bar").AbsolutePath returns "/tmp/foo/bar"
 		// on Linux, as anyone sane would expect.  It *doesn't* under .NET 1.1
 		// Apparently "tmp" is supposed to be a hostname (!)...
 		// Since "correct" behavior would confuse all Linux developers, and having
@@ -1680,7 +1683,7 @@ namespace MonoTests.System
 
 		public static void Print (Uri uri)
 		{
-			Console.WriteLine ("ToString: " + uri.ToString ());	
+			Console.WriteLine ("ToString: " + uri.ToString ());
 
 			Console.WriteLine ("AbsolutePath: " + uri.AbsolutePath);
 			Console.WriteLine ("AbsoluteUri: " + uri.AbsoluteUri);
@@ -1702,12 +1705,126 @@ namespace MonoTests.System
 
 			Console.WriteLine ("Segments:");
 			string [] segments = uri.Segments;
-			if (segments == null) 
+			if (segments == null)
 				Console.WriteLine ("\tNo Segments");
-			else 
-				for (int i = 0; i < segments.Length; i++) 
+			else
+				for (int i = 0; i < segments.Length; i++)
 					Console.WriteLine ("\t" + segments[i]);
 			Console.WriteLine ("");
 		}
+
+//BNC#533572
+#if NET_2_0
+		[Test]
+		public void LocalPath_FileNameWithAtSign1 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "http://thehost" + path;
+			Uri fileUri = new Uri (fullpath);
+
+			NAssert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo");
+			NAssert.AreEqual (fileUri.Host, "thehost", "LocalPath_FileNameWithAtSign Host");
+			NAssert.IsFalse (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile");
+			NAssert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri");
+			NAssert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc");
+
+			NAssert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString");
+			NAssert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape");
+			NAssert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath");
+			NAssert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath");
+		}
+
+		[Test]
+		public void LocalPath_FileNameWithAtSign2 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "http://user:password@thehost" + path;
+			Uri fileUri = new Uri (fullpath);
+
+			NAssert.AreEqual (fileUri.UserInfo, "user:password", "LocalPath_FileNameWithAtSign UserInfo");
+			NAssert.AreEqual (fileUri.Host, "thehost", "LocalPath_FileNameWithAtSign Host");
+			NAssert.IsFalse (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile");
+			NAssert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri");
+			NAssert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc");
+
+			NAssert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString");
+			NAssert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape");
+			NAssert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath");
+			NAssert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath");
+		}
+
+		[Test]
+		public void LocalPath_FileNameWithAtSign3 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "file://" + path;
+			Uri fileUri = new Uri (fullpath);
+
+			NAssert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo");
+			NAssert.AreEqual (fileUri.Host, String.Empty, "LocalPath_FileNameWithAtSign Host");
+			NAssert.IsTrue (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile");
+			NAssert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri");
+			NAssert.IsFalse (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc");
+
+			NAssert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString");
+			NAssert.AreEqual (path, new DerivedUri (fullpath).TestUnescape(path), "LocalPath_FileNameWithAtSign ProtectedUnescape");
+			NAssert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath");
+			NAssert.AreEqual (path, fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath");
+		}
+
+		[Test]
+		public void LocalPath_FileNameWithAtSign4 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "file://localhost" + path;
+			Uri fileUri = new Uri (fullpath);
+
+			NAssert.AreEqual (fileUri.UserInfo, String.Empty, "LocalPath_FileNameWithAtSign UserInfo");
+			NAssert.AreEqual (fileUri.Host, "localhost", "LocalPath_FileNameWithAtSign Host");
+			NAssert.IsTrue (fileUri.IsFile, "LocalPath_FileNameWithAtSign IsFile");
+			NAssert.IsTrue (fileUri.IsAbsoluteUri, "LocalPath_FileNameWithAtSign IsAbsUri");
+			NAssert.IsTrue (fileUri.IsUnc, "LocalPath_FileNameWithAtSign IsUnc");
+
+			NAssert.AreEqual (fullpath, fileUri.OriginalString, "LocalPath_FileNameWithAtSign OriginalString");
+			NAssert.AreEqual (path, new DerivedUri (fullpath).TestUnescape (path), "LocalPath_FileNameWithAtSign ProtectedUnescape");
+			NAssert.AreEqual (path, fileUri.AbsolutePath, "LocalPath_FileNameWithAtSign AbsPath");
+			//this test is marked as NotWorking below:
+			//NAssert.AreEqual ("\\\\localhost" + path.Replace ("/", "\\"), fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath");
+		}
+
+		[Test]
+		[Category ("NotWorking")]
+		public void LocalPath_FileNameWithAtSign5 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "file://localhost" + path;
+			Uri fileUri = new Uri (fullpath);
+
+			NAssert.AreEqual ("\\\\localhost" + path.Replace ("/", "\\"), fileUri.LocalPath, "LocalPath_FileNameWithAtSign LocalPath");
+		}
+
+		[Test]
+		[Category ("NotWorking")] // MS.NET seems not to like userinfo in a file:// uri...
+		[ExpectedException (typeof (UriFormatException))]
+		public void LocalPath_FileNameWithAtSign6 ()
+		{
+			string path = "/some/path/file_with_an_ at _sign.mp3";
+			string fullpath = "file://user:password@localhost" + path;
+			Uri fileUri = new Uri (fullpath);
+		}
+
+
+		public class DerivedUri : Uri
+		{
+			public DerivedUri (string uriString) : base (uriString)
+			{
+			}
+
+			internal string TestUnescape (string path)
+			{
+				return base.Unescape (path);
+			}
+		}
+#endif
 	}
 }
diff --git a/mcs/class/System/net_2_1_raw_System.dll.sources b/mcs/class/System/net_2_1_raw_System.dll.sources
index ae16d6a..e6bc7f1 100644
--- a/mcs/class/System/net_2_1_raw_System.dll.sources
+++ b/mcs/class/System/net_2_1_raw_System.dll.sources
@@ -64,7 +64,7 @@ System/UriIdnScope.cs
 System/UriTypeConverter.cs
 System.IO.Compression/CompressionMode.cs
 System.IO.Compression/DeflateStream.cs
-System.IO.Compression/GzipStream.cs
+System.IO.Compression/GZipStream.cs
 System.IO/ErrorEventArgs.cs
 System.IO/ErrorEventHandler.cs
 System.IO/FileAction.cs
diff --git a/mcs/class/corlib/System.Collections/ChangeLog b/mcs/class/corlib/System.Collections/ChangeLog
index e24a549..fb73439 100644
--- a/mcs/class/corlib/System.Collections/ChangeLog
+++ b/mcs/class/corlib/System.Collections/ChangeLog
@@ -1,3 +1,13 @@
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Hashtable.cs: MS (at least latest and greatest) does not always
+	serialized the HashCodeProvider. Ignoring the error when the field
+	is not found.
+
+2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SortedList.cs: same issue as bug #521750 in System.
+
 2008-08-31  Zoltan Varga  <vargaz at gmail.com>
 
 	* BitArray.cs (CopyTo): Allow an index equal to the array length if
diff --git a/mcs/class/corlib/System.Collections/Hashtable.cs b/mcs/class/corlib/System.Collections/Hashtable.cs
index 0a28178..97bbd61 100644
--- a/mcs/class/corlib/System.Collections/Hashtable.cs
+++ b/mcs/class/corlib/System.Collections/Hashtable.cs
@@ -563,7 +563,8 @@ namespace System.Collections {
 #else
 				info.AddValue ("Comparer", comparerRef);
 #endif
-			info.AddValue ("HashCodeProvider", hcpRef);
+			if (hcpRef != null)
+				info.AddValue ("HashCodeProvider", hcpRef);
 			info.AddValue ("HashSize", this.table.Length);
 // Create Keys
                         Object [] keys = new Object[inUse];
@@ -602,8 +603,9 @@ namespace System.Collections {
 #else
 			comparerRef = (IComparer) serializationInfo.GetValue ("Comparer", typeof (object));
 #endif
-			
-			hcpRef = (IHashCodeProvider) serializationInfo.GetValue ("HashCodeProvider", typeof (object));
+			try {
+				hcpRef = (IHashCodeProvider) serializationInfo.GetValue ("HashCodeProvider", typeof (object));
+			} catch {} // Missing value => null
 			int size = (int) serializationInfo.GetValue ("HashSize", typeof(int));
 			
 			Object [] keys = (Object []) serializationInfo.GetValue("Keys", typeof(Object [] ));
diff --git a/mcs/class/corlib/System.Collections/SortedList.cs b/mcs/class/corlib/System.Collections/SortedList.cs
index 02974a9..c3896e5 100644
--- a/mcs/class/corlib/System.Collections/SortedList.cs
+++ b/mcs/class/corlib/System.Collections/SortedList.cs
@@ -597,10 +597,10 @@ namespace System.Collections {
 			while (left <= right) {
 				int guess = (left + right) >> 1;
 
-				int cmp = comparer.Compare (key, table[guess].key);
+				int cmp = comparer.Compare (table[guess].key, key);
 				if (cmp == 0) return guess;
 
-				if (cmp >  0) left = guess+1;
+				if (cmp <  0) left = guess+1;
 				else right = guess-1;
 			}
 
diff --git a/mcs/class/corlib/System.Globalization/ChangeLog b/mcs/class/corlib/System.Globalization/ChangeLog
index 9cd130e..a357215 100644
--- a/mcs/class/corlib/System.Globalization/ChangeLog
+++ b/mcs/class/corlib/System.Globalization/ChangeLog
@@ -1,3 +1,9 @@
+2009-10-29  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* CompareInfo.cs: Fix bug in length calculation in one of the (too
+	many) Compare overloads
+	[Partial backport of r145023]
+
 2009-01-07  Atsushi Enomoto  <atsushi at ximian.com>
 
 	* CompareInfo.cs : Fixed bug #462957. With empty target string it
diff --git a/mcs/class/corlib/System.Globalization/CompareInfo.cs b/mcs/class/corlib/System.Globalization/CompareInfo.cs
index 296cd4c..89380d0 100644
--- a/mcs/class/corlib/System.Globalization/CompareInfo.cs
+++ b/mcs/class/corlib/System.Globalization/CompareInfo.cs
@@ -252,7 +252,7 @@ namespace System.Globalization
 			return(internal_compare_switch (string1, offset1,
 						 string1.Length-offset1,
 						 string2, offset2,
-						 string2.Length-offset1,
+						 string2.Length-offset2,
 						 options));
 		}
 
diff --git a/mcs/class/corlib/System.IO/ChangeLog b/mcs/class/corlib/System.IO/ChangeLog
index 8bb5078..0c80581 100644
--- a/mcs/class/corlib/System.IO/ChangeLog
+++ b/mcs/class/corlib/System.IO/ChangeLog
@@ -1,8 +1,23 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* UnmanagedMemoryStream.cs: Fix some and add missing validations
+	[Backport r144226]
+
+2009-09-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DirectoryInfo.cs: throw if FullPath is not a directory.
+	Fixes bug #539791.
+
+2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Path.cs: only trim the end of the file.
+	Fixes bug #521924.
+
 2009-05-05  Miguel de Icaza  <miguel at novell.com>
 
 	* Contribution from David Uvalle <david.uvalle at gmail.com> that
 	implements FileInfo.Replace.
-	
+
 2009-04-25  Miguel de Icaza  <miguel at novell.com>
 
 	* StreamReader.cs (DataAvailable): New internal function to work
diff --git a/mcs/class/corlib/System.IO/DirectoryInfo.cs b/mcs/class/corlib/System.IO/DirectoryInfo.cs
index 756d048..8ff4284 100644
--- a/mcs/class/corlib/System.IO/DirectoryInfo.cs
+++ b/mcs/class/corlib/System.IO/DirectoryInfo.cs
@@ -202,6 +202,8 @@ namespace System.IO {
 			if (searchPattern == null)
 				throw new ArgumentNullException ("searchPattern");
 
+			if (!Directory.Exists (FullPath))
+				throw new IOException ("Invalid directory");
 			string [] dirs = Directory.GetDirectories (FullPath, searchPattern);
 			string [] files = Directory.GetFiles (FullPath, searchPattern);
 
diff --git a/mcs/class/corlib/System.IO/Path.cs b/mcs/class/corlib/System.IO/Path.cs
index 6d936fe..b9ea964 100644
--- a/mcs/class/corlib/System.IO/Path.cs
+++ b/mcs/class/corlib/System.IO/Path.cs
@@ -667,7 +667,7 @@ namespace System.IO {
 			for (int i = 0; i < dirs.Length; i++) {
 				// WIN32 path components must be trimmed
 				if (Environment.IsRunningOnWindows)
-					dirs[i] = dirs[i].Trim ();
+					dirs[i] = dirs[i].TrimEnd ();
 				
 				if (dirs[i] == "." || (i != 0 && dirs[i].Length == 0))
 					continue;
diff --git a/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs b/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs
index bc1e88d..5ec8e34 100644
--- a/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs
+++ b/mcs/class/corlib/System.IO/UnmanagedMemoryStream.cs
@@ -6,8 +6,9 @@
 // Authors:
 // 	Sridhar Kulkarni (sridharkulkarni at gmail.com)
 // 	Gert Driesen (drieseng at users.sourceforge.net)
+//	Sebastien Pouliot  <sebastien at ximian.com>
 //
-// Copyright (C) 2005-2006 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2005-2006, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -42,7 +43,6 @@ namespace System.IO
 	{
 		long length;
 		bool closed;
-//		bool canseek;
 		long capacity;
 		FileAccess fileaccess;
 		IntPtr initial_pointer;
@@ -54,50 +54,24 @@ namespace System.IO
 #region Constructor
 		protected UnmanagedMemoryStream()
 		{
-			fileaccess = FileAccess.Read;
-//			canseek = true;
+			closed = true;
 		}
 		
 		public unsafe UnmanagedMemoryStream (byte *pointer, long length)
-			: this ()
 		{
-			if (pointer == null)
-				throw new ArgumentNullException("pointer");
-			if (length < 0)
-				throw new ArgumentOutOfRangeException("length", "Non-negative number required.");
-
-			this.length = length;
-			capacity = length;
-			initial_pointer = new IntPtr((void*)pointer);
+			Initialize (pointer, length, length, FileAccess.Read);
 		}
 		
 		public unsafe UnmanagedMemoryStream (byte *pointer, long length, long capacity, FileAccess access)
 		{
-			if (pointer == null)
-				throw new ArgumentNullException("pointer");
-			if (length < 0)
-				throw new ArgumentOutOfRangeException("length", "Non-negative number required.");
-			if (capacity < 0)
-				throw new ArgumentOutOfRangeException("capacity", "Non-negative number required.");
-			if (length > capacity)
-				throw new ArgumentOutOfRangeException("length", "The length cannot be greater than the capacity.");
-			if (!Enum.IsDefined (typeof (FileAccess), access))
-				throw new ArgumentOutOfRangeException ("access", "Enum value was out of legal range.");
-				
-			fileaccess = access;
-			this.length = length;
-			this.capacity = capacity;
-//			canseek = true;
-			initial_pointer = new IntPtr ((void*)pointer);
+			Initialize (pointer, length, capacity, access);
 		}
 #endregion
 	
 #region Properties
 		public override bool CanRead {
 			get {
-				if (closed)
-					return false;
-				return (fileaccess == FileAccess.Read || fileaccess == FileAccess.ReadWrite);
+				return (!closed && (fileaccess != FileAccess.Write));
 			}
 		}
 
@@ -109,9 +83,7 @@ namespace System.IO
 		
 		public override bool CanWrite {
 			get {
-				if (closed)
-					return (false);
-				return (fileaccess == FileAccess.Write || fileaccess == FileAccess.ReadWrite);
+				return (!closed && (fileaccess != FileAccess.Read));
 			}
 		}
 		public long Capacity {
@@ -152,16 +124,21 @@ namespace System.IO
 #endif
 		public unsafe byte* PositionPointer {
 			get {
+				if (closed)
+					throw new ObjectDisposedException("The stream is closed");
+				if (current_position >= length)
+					throw new IndexOutOfRangeException ("value");
+
 				return (byte *) initial_pointer + current_position;
 			}
 			set {
+				if (closed)
+					throw new ObjectDisposedException("The stream is closed");
+
 				if (value < (byte *)initial_pointer)
 					throw new IOException ("Address is below the inital address");
 
-				if (value >= (byte *) ((byte *)initial_pointer + length))
-					throw new ArgumentOutOfRangeException ("value");
-
-				current_position = (long) (value - (byte *) initial_pointer);
+				Position = value - (byte*) initial_pointer;
 			}
 		}
 #endregion
@@ -230,7 +207,7 @@ namespace System.IO
 			default:
 				throw new ArgumentException("Invalid SeekOrigin option");
 			}
-			refpoint += (int)offset;
+			refpoint += offset;
 			if (refpoint < initial_position)
 				throw new IOException("An attempt was made to seek before the beginning of the stream");
 			current_position = refpoint;
@@ -275,14 +252,14 @@ namespace System.IO
 				throw new ObjectDisposedException("The stream is closed");
 			if (buffer == null)
 				throw new ArgumentNullException("The buffer parameter is a null reference");
-			if ((current_position + count) > capacity)
-				throw new NotSupportedException ("Unable to expand length of this stream beyond its capacity.");
 			if (offset < 0)
 				throw new ArgumentOutOfRangeException("offset", "Non-negative number required.");
 			if (count < 0)
 				throw new ArgumentOutOfRangeException("count", "Non-negative number required.");
 			if ((buffer.Length - offset) < count)
 				throw new ArgumentException("The length of the buffer array minus the offset parameter is less than the count parameter");
+			if (current_position > capacity - count)
+				throw new NotSupportedException ("Unable to expand length of this stream beyond its capacity.");
 			if (fileaccess == FileAccess.Read)
 				throw new NotSupportedException ("Stream does not support writing.");
 			else {
@@ -321,13 +298,23 @@ namespace System.IO
 						  long capacity,
 						  FileAccess access)
 		{
+			if (pointer == null)
+				throw new ArgumentNullException("pointer");
+			if (length < 0)
+				throw new ArgumentOutOfRangeException("length", "Non-negative number required.");
+			if (capacity < 0)
+				throw new ArgumentOutOfRangeException("capacity", "Non-negative number required.");
+			if (length > capacity)
+				throw new ArgumentOutOfRangeException("length", "The length cannot be greater than the capacity.");
+			if ((access < FileAccess.Read) || (access > FileAccess.ReadWrite))
+				throw new ArgumentOutOfRangeException ("access", "Enum value was out of legal range.");
+				
 			fileaccess = access;
 			this.length = length;
 			this.capacity = capacity;
 			initial_position = 0;
 			current_position = initial_position;
-//			canseek = true;
-			initial_pointer = new IntPtr ((void *)pointer);
+			initial_pointer = new IntPtr ((void*)pointer);
 			closed = false;
 		}
 #endregion
diff --git a/mcs/class/corlib/System.Reflection/Assembly.cs b/mcs/class/corlib/System.Reflection/Assembly.cs
index 07a74f9..3a530d8 100644
--- a/mcs/class/corlib/System.Reflection/Assembly.cs
+++ b/mcs/class/corlib/System.Reflection/Assembly.cs
@@ -445,9 +445,16 @@ namespace System.Reflection {
 
 			aname.CultureInfo = culture;
 			aname.Name = aname.Name + ".resources";
-			Assembly assembly = AppDomain.CurrentDomain.LoadSatellite (aname);
-			if (assembly != null)
-				return assembly;
+			Assembly assembly;
+
+			try {
+				assembly = AppDomain.CurrentDomain.LoadSatellite (aname);
+				if (assembly != null)
+					return assembly;
+			} catch (FileNotFoundException ex) {
+				assembly = null;
+				// ignore
+			}
 
 			// Try the assembly directory
 			string fullName = Path.Combine (Path.GetDirectoryName (Location), Path.Combine (culture.Name, aname.Name + ".dll"));
@@ -465,9 +472,16 @@ namespace System.Reflection {
 
 			aname.CultureInfo = culture;
 			aname.Name = aname.Name + ".resources";
-			Assembly assembly = AppDomain.CurrentDomain.LoadSatellite (aname);
-			if (assembly != null)
-				return assembly;
+			Assembly assembly;
+			
+			try {
+				assembly = AppDomain.CurrentDomain.LoadSatellite (aname);
+				if (assembly != null)
+					return assembly;
+			} catch (FileNotFoundException ex) {
+				assembly = null;
+				// ignore
+			}
 
 			// Try the assembly directory
 			string fullName = Path.Combine (Path.GetDirectoryName (Location), Path.Combine (culture.Name, aname.Name + ".dll"));
diff --git a/mcs/class/corlib/System.Reflection/Binder.cs b/mcs/class/corlib/System.Reflection/Binder.cs
index 91f3bf0..b73dd80 100644
--- a/mcs/class/corlib/System.Reflection/Binder.cs
+++ b/mcs/class/corlib/System.Reflection/Binder.cs
@@ -165,7 +165,7 @@ namespace System.Reflection
 							types [i] = args [i].GetType ();
 					}
 				}
-				MethodBase selected = SelectMethod (bindingAttr, match, types, modifiers);
+				MethodBase selected = SelectMethod (bindingAttr, match, types, modifiers, true);
 				state = null;
 				if (names != null)
 					ReorderParameters (names, ref args, selected);
@@ -354,15 +354,27 @@ namespace System.Reflection
 				}
 			}
 
-			private static bool check_arguments (Type[] types, ParameterInfo[] args) {
+			private static bool check_arguments (Type[] types, ParameterInfo[] args, bool allowByRefMatch) {
 				for (int i = 0; i < types.Length; ++i) {
-					if (!check_type (types [i], args [i].ParameterType))
+					bool match = check_type (types [i], args [i].ParameterType);
+					if (!match && allowByRefMatch) {
+						Type param_type = args [i].ParameterType;
+						if (param_type.IsByRef)
+							match = check_type (types [i], param_type.GetElementType ());
+					}
+					if (!match)
 						return false;
 				}
 				return true;
 			}
 
-			public override MethodBase SelectMethod (BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[] modifiers)
+			public override MethodBase SelectMethod (BindingFlags bindingAttr, MethodBase [] match, Type [] types, ParameterModifier [] modifiers)
+			{
+				return SelectMethod (bindingAttr, match, types, modifiers,
+					false);
+			}
+
+			MethodBase SelectMethod (BindingFlags bindingAttr, MethodBase[] match, Type[] types, ParameterModifier[] modifiers, bool allowByRefMatch)
 			{
 				MethodBase m;
 				int i, j;
@@ -417,7 +429,7 @@ namespace System.Reflection
 					ParameterInfo[] args = m.GetParameters ();
 					if (args.Length != types.Length)
 						continue;
-					if (!check_arguments (types, args))
+					if (!check_arguments (types, args, allowByRefMatch))
 						continue;
 
 					if (result != null)
diff --git a/mcs/class/corlib/System.Reflection/ChangeLog b/mcs/class/corlib/System.Reflection/ChangeLog
index c785740..264d1ce 100644
--- a/mcs/class/corlib/System.Reflection/ChangeLog
+++ b/mcs/class/corlib/System.Reflection/ChangeLog
@@ -1,3 +1,20 @@
+2009-11-03  Marek Habersack  <mhabersack at novell.com>
+
+	* Assembly.cs: GetSatelliteAssembly must catch
+	AppDomain.LoadSatellite FileNotFoundException and attempt to load
+	satellites from subdirectories of current assembly's
+	directory. Fixes bug #548768
+
+2009-07-12  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* Binder.cs: Only allow a type to match its byref version for
+	BindToMethod (and not for SelectMethod).
+
+2009-07-10  Zoltan Varga  <vargaz at gmail.com>
+
+	* Binder.cs (check_arguments): Allow a type to match its byref version.
+	Fixes #520690.
+
 2009-03-11  Zoltan Varga  <vargaz at gmail.com>
 
 	Backport of r129069.
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog b/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
index 5c8e409..12e1e83 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* RuntimeHelpers.cs: Add missing validations
+	[Backport r144208]
+
 2008-04-02  Andreas Nahr  <ClassDevelopment at A-SoftTech.com>
 
 	* IndexerNameAttribute.cs
diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
index 11a193b..0218422 100644
--- a/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
+++ b/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs
@@ -55,6 +55,9 @@ namespace System.Runtime.CompilerServices
 
 		public static void InitializeArray (Array array, RuntimeFieldHandle fldHandle)
 		{
+			if ((array == null) || (fldHandle.Value == IntPtr.Zero))
+				throw new ArgumentNullException ();
+
 			InitializeArray (array, fldHandle.Value);
 		}
 
@@ -92,6 +95,9 @@ namespace System.Runtime.CompilerServices
 
 		public static void RunClassConstructor (RuntimeTypeHandle type)
 		{
+			if (type.Value == IntPtr.Zero)
+				throw new ArgumentException ("Handle is not initialized.", "type");
+
 			RunClassConstructor (type.Value);
 		}
 
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
index 720f30c..71bbb74 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* GCHandle.cs: Add missing validations
+	[Backport r144204]
+
 2009-03-05  Tom Hindle <tom_hindle at sil.org>
 	
 	* Marshal.cs: Implemented GenerateGuidForType
diff --git a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs b/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
index 12b0c55..0221006 100644
--- a/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
+++ b/mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs
@@ -7,7 +7,7 @@
 //
 
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -57,6 +57,9 @@ namespace System.Runtime.InteropServices
 
 		private GCHandle(object value, GCHandleType type)
 		{
+			// MS does not crash/throw on (most) invalid GCHandleType values (except -1)
+			if ((type < GCHandleType.Weak) || (type > GCHandleType.Pinned))
+				type = GCHandleType.Normal;
 			handle = GetTargetHandle (value, 0, type);
 		}
 
@@ -74,6 +77,8 @@ namespace System.Runtime.InteropServices
 		{ 
 			get
 			{
+				if (!IsAllocated)
+					throw new InvalidOperationException (Locale.GetText ("Handle is not allocated"));
 				return GetTarget (handle);
 			} 
 			set
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
index 4ebb240..7753408 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/AsyncResult.cs
@@ -142,7 +142,7 @@ public class AsyncResult : IAsyncResult, IMessageSink {
 
 	internal IMessage EndInvoke ()
 	{
-		handle.WaitOne ();
+		AsyncWaitHandle.WaitOne ();
 		return reply_message;
 	}
 
@@ -150,11 +150,12 @@ public class AsyncResult : IAsyncResult, IMessageSink {
 	{
 		reply_message = msg;
 
-		completed = true;
-		NativeEventCalls.SetEvent_internal (handle.Handle);
+		lock (this) {
+			completed = true;
+			((ManualResetEvent) AsyncWaitHandle).Set ();
+		}
 		
-		if (async_callback != null)
-		{
+		if (async_callback != null) {
 			AsyncCallback ac = (AsyncCallback) async_callback;
 			ac (this);
 		}
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
index 402cfe8..6952f47 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-12 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* AsyncResult.cs: lock when setting the 'completed' field and use the
+	property instead of the 'handle' field.
+
 2008-11-10 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* CADMessages.cs: when the method is generic, return a constructed
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
index dbcffd8..c9235c6 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* RealProxy.cs: for a custom proxy, retrieve the OutArgs before
+	allowing EndInvoke to proceed because after that, OutArgs will throw
+	because there is no method. Fixes remoting2 and remoting3 tests.
+
 2009-05-06  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* RealProxy.cs: If async dispatch crashes, don't propagate the
diff --git a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
index 39823ff..0f95a9c 100644
--- a/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
+++ b/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
@@ -169,6 +169,7 @@ namespace System.Runtime.Remoting.Proxies
 			CallType call_type = mMsg.CallType;
 			bool is_remproxy = (rp is RemotingProxy);
 
+			out_args = null;
 			IMethodReturnMessage res_msg = null;
 			
 			if (call_type == CallType.BeginInvoke) 
@@ -214,6 +215,7 @@ namespace System.Runtime.Remoting.Proxies
 
 					// allow calltype EndInvoke to finish
 					asyncMsg = mMsg.AsyncResult.SyncProcessMessage (res_msg as IMessage);
+					out_args = res_msg.OutArgs;
 					res_msg = new ReturnMessage (asyncMsg, null, 0, null, res_msg as IMethodCallMessage);
 				}
 			}
@@ -229,7 +231,8 @@ namespace System.Runtime.Remoting.Proxies
 				throw exc.FixRemotingException();
 			}
 			else if (res_msg is IConstructionReturnMessage || mMsg.CallType == CallType.BeginInvoke) {
-				out_args = res_msg.OutArgs;
+				if (out_args == null)
+					out_args = res_msg.OutArgs;
 			}
 			else if (mMsg.CallType == CallType.Sync) {
 				out_args = ProcessResponse (res_msg, mMsg);
@@ -238,7 +241,8 @@ namespace System.Runtime.Remoting.Proxies
 				out_args = ProcessResponse (res_msg, mMsg.AsyncResult.CallMessage);
 			}
 			else {
-				out_args = res_msg.OutArgs;
+				if (out_args == null)
+					out_args = res_msg.OutArgs;
 			}
 
 			return res_msg.ReturnValue;
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs
index a5a744b..c10b32f 100644
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs
+++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs
@@ -161,20 +161,20 @@ namespace System.Runtime.Serialization.Formatters.Binary {
 			// Messages are read using a special static method, which does not use ObjectReader
 			// if it is not needed. This saves time and memory.
 
-			BinaryElement elem = (BinaryElement) reader.PeekChar();
+			BinaryElement elem = (BinaryElement) reader.Read ();
 
 			if (elem == BinaryElement.MethodCall) {
-				return MessageFormatter.ReadMethodCall (reader, hasHeader, handler, this);
+				return MessageFormatter.ReadMethodCall (elem, reader, hasHeader, handler, this);
 			}
 			else if (elem == BinaryElement.MethodResponse) {
-				return MessageFormatter.ReadMethodResponse (reader, hasHeader, handler, null, this);
+				return MessageFormatter.ReadMethodResponse (elem, reader, hasHeader, handler, null, this);
 			}
 			else {
 				ObjectReader serializer = new ObjectReader (this);
 
 				object result;
 				Header[] headers;
-				serializer.ReadObjectGraph (reader, hasHeader, out result, out headers);
+				serializer.ReadObjectGraph (elem, reader, hasHeader, out result, out headers);
 				if (handler != null) handler(headers);
 				return result;
 			}
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog
index 71c4fdb..8d68453 100644
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog
+++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ChangeLog
@@ -1,3 +1,20 @@
+2009-09-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* BinaryFormatter.cs: NoCheckDeserialize() was using PeekChar() on a
+	reader when it should only read 1 byte. Also BinaryReader.PeekChar()
+	tries to set the position of hte stream back to where it was before
+	the read, which does not work well with broken Stream
+	implementations like BZip2InputStream (reports CanSeek is true when
+	it really can't seek). Now we do a Read() and then pass the value we
+	read on to the next methods.
+
+	* MessageFormatter.cs: 
+	* ObjectReader.cs: added overloads that take a BinaryElement instead
+	of reading it from the reader. Only for the methods used in
+	NoCheckDeserialize.
+
+	Fixes bug #503435.
+
 2009-03-29  Zoltan Varga  <vargaz at gmail.com>
 
 	* CodeGenerator.cs: Add synchronization as SRE is not thread safe.
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs
index b4cd1c0..6726dbf 100644
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs
+++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs
@@ -278,6 +278,11 @@ namespace System.Runtime.Serialization.Formatters.Binary
 		public static object ReadMethodCall (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, BinaryFormatter formatter)
 		{
 			BinaryElement elem = (BinaryElement)reader.ReadByte();	// The element code
+			return ReadMethodCall (elem, reader, hasHeaders, headerHandler, formatter);
+		}
+
+		public static object ReadMethodCall (BinaryElement elem, BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, BinaryFormatter formatter)
+		{
 			if (elem != BinaryElement.MethodCall) throw new SerializationException("Invalid format. Expected BinaryElement.MethodCall, found " +  elem);
 
 			MethodFlags flags = (MethodFlags) reader.ReadInt32();
@@ -381,7 +386,12 @@ namespace System.Runtime.Serialization.Formatters.Binary
 
 		public static object ReadMethodResponse (BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, IMethodCallMessage methodCallMessage, BinaryFormatter formatter)
 		{
-			BinaryElement elem = (BinaryElement)reader.ReadByte();	// The element code
+			BinaryElement elem = (BinaryElement) reader.ReadByte ();
+			return ReadMethodResponse (elem, reader, hasHeaders, headerHandler, methodCallMessage, formatter);
+		}
+
+		public static object ReadMethodResponse (BinaryElement elem, BinaryReader reader, bool hasHeaders, HeaderHandler headerHandler, IMethodCallMessage methodCallMessage, BinaryFormatter formatter)
+		{
 			if (elem != BinaryElement.MethodResponse) throw new SerializationException("Invalid format. Expected BinaryElement.MethodResponse, found " +  elem);
 
 			MethodFlags flags = (MethodFlags) reader.ReadByte ();
diff --git a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs
index 5e90a40..bc267be 100644
--- a/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs
+++ b/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs
@@ -91,20 +91,50 @@ namespace System.Runtime.Serialization.Formatters.Binary
 
 		public void ReadObjectGraph (BinaryReader reader, bool readHeaders, out object result, out Header[] headers)
 		{
+			BinaryElement elem = (BinaryElement)reader.ReadByte ();
+			ReadObjectGraph (elem, reader, readHeaders, out result, out headers);
+		}
+
+		public void ReadObjectGraph (BinaryElement elem, BinaryReader reader, bool readHeaders, out object result, out Header[] headers)
+		{
 			headers = null;
 
 			// Reads the objects. The first object in the stream is the
 			// root object.
+			bool next = ReadNextObject (elem, reader);
+			if (next) {
+				do {
+					if (readHeaders && (headers == null))
+						headers = (Header[])CurrentObject;
+					else
+						if (_rootObjectID == 0) _rootObjectID = _lastObjectID;
+				} while (ReadNextObject (reader));
+			}
+
+			result = _manager.GetObject (_rootObjectID);
+		}
 
-			while (ReadNextObject (reader))
+		bool ReadNextObject (BinaryElement element, BinaryReader reader)
+		{
+			if (element == BinaryElement.End)
 			{
-				if (readHeaders && (headers == null))
-					headers = (Header[])CurrentObject;
-				else
-					if (_rootObjectID == 0) _rootObjectID = _lastObjectID;
+				_manager.DoFixups();
+
+				_manager.RaiseDeserializationEvent();
+				return false;
 			}
 
-			result = _manager.GetObject (_rootObjectID);
+			SerializationInfo info;
+			long objectId;
+
+			ReadObject (element, reader, out objectId, out _lastObject, out info);
+
+			if (objectId != 0) {
+				RegisterObject (objectId, _lastObject, info, 0, null, null);
+				_lastObjectID = objectId;		
+			}
+	
+			return true;
 		}
 
 		public bool ReadNextObject (BinaryReader reader)
diff --git a/mcs/class/corlib/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
index 7993ad9..9bbbe52 100644
--- a/mcs/class/corlib/System.Security.Cryptography/ChangeLog
+++ b/mcs/class/corlib/System.Security.Cryptography/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-23  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* CryptoStream.cs: Fix [Input|Output]BlockSize for custom streams.
+	Patches by Santa Marta (via Atsushi).
+	[Fix bug #539288 and #539229]
+	[Backport r142435]
+
 2008-09-17  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* CryptoConfig.cs: Add missing URI for HMAC algorithms.
diff --git a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
index 9190921..bdbbbdc 100644
--- a/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
+++ b/mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
@@ -72,11 +72,14 @@ namespace System.Security.Cryptography {
 			_mode = mode;
 			_disposed = false;
 			if (transform != null) {
-				_workingBlock = new byte [transform.InputBlockSize];
-				if (mode == CryptoStreamMode.Read)
+				if (mode == CryptoStreamMode.Read) {
 					_currentBlock = new byte [transform.InputBlockSize];
-				else if (mode == CryptoStreamMode.Write)
+					_workingBlock = new byte [transform.InputBlockSize];
+				}
+				else if (mode == CryptoStreamMode.Write) {
 					_currentBlock = new byte [transform.OutputBlockSize];
+					_workingBlock = new byte [transform.OutputBlockSize];
+				}
 			}
 		}
 
@@ -212,7 +215,7 @@ namespace System.Security.Cryptography {
 					_transformedCount += transformed;
 				}
 				// compaction
-				if (_transformedPos > _transform.InputBlockSize) {
+				if (_transformedPos > _transform.OutputBlockSize) {
 					Buffer.BlockCopy (_transformedBlock, _transformedPos, _transformedBlock, 0, length);
 					_transformedCount -= _transformedPos;
 					_transformedPos = 0;
@@ -285,12 +288,13 @@ namespace System.Security.Cryptography {
 
 				if (_transform.CanTransformMultipleBlocks) {
 					// get the biggest multiple of InputBlockSize in count (without mul or div)
-					int size = (count & ~(_transform.OutputBlockSize - 1));
-					int rem = (count & (_transform.OutputBlockSize - 1));
+					int size = (count & ~(_transform.InputBlockSize - 1));
+					int rem = (count & (_transform.InputBlockSize - 1));
 					// avoid reallocating memory at each call (reuse same buffer whenever possible)
-					if (_workingBlock.Length < size) {
+					int sizeWorkingBlock = (1 + size / _transform.InputBlockSize) * _transform.OutputBlockSize;
+					if (_workingBlock.Length < sizeWorkingBlock) {
 						Array.Clear (_workingBlock, 0, _workingBlock.Length);
-						_workingBlock = new byte [size];
+						_workingBlock = new byte [sizeWorkingBlock];
 					}
 
 					if (size > 0) {
diff --git a/mcs/class/corlib/System.Text/ChangeLog b/mcs/class/corlib/System.Text/ChangeLog
index 1e01d44..0a61436 100644
--- a/mcs/class/corlib/System.Text/ChangeLog
+++ b/mcs/class/corlib/System.Text/ChangeLog
@@ -1,3 +1,12 @@
+2009-07-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* StringBuilder.cs: don't throw on null values in ctor(string, int).
+	Unify another ctor into the main one to account for MaxCapacity.
+
+2009-07-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* StringBuilder.cs: small fixes dealing with _maxCapacity.
+
 2009-01-13  Jb Evain  <jbevain at novell.com>
 
 	* Encoding.cs: when creating a ForwardingEncoder or a
diff --git a/mcs/class/corlib/System.Text/StringBuilder.cs b/mcs/class/corlib/System.Text/StringBuilder.cs
index d1d077b..abd8e12 100644
--- a/mcs/class/corlib/System.Text/StringBuilder.cs
+++ b/mcs/class/corlib/System.Text/StringBuilder.cs
@@ -56,10 +56,15 @@ namespace System.Text {
 		private string _str;
 		private string _cached_str;
 		
-		private int _maxCapacity = Int32.MaxValue;
+		private int _maxCapacity;
 		private const int constDefaultCapacity = 16;
 
 		public StringBuilder(string value, int startIndex, int length, int capacity) 
+			: this (value, startIndex, length, capacity, Int32.MaxValue)
+		{
+		}
+
+		private StringBuilder(string value, int startIndex, int length, int capacity, int maxCapacity)
 		{
 			// first, check the parameters and throw appropriate exceptions if needed
 			if (null == value)
@@ -76,15 +81,26 @@ namespace System.Text {
 			if (capacity < 0)
 				throw new System.ArgumentOutOfRangeException ("capacity", capacity, "capacity must be greater than zero.");
 
+			if (maxCapacity < 1)
+				throw new System.ArgumentOutOfRangeException ("maxCapacity", "maxCapacity is less than one.");
+			if (capacity > maxCapacity)
+				throw new System.ArgumentOutOfRangeException ("capacity", "Capacity exceeds maximum capacity.");
+
 			// make sure startIndex and length give a valid substring of value
 			// re-ordered to avoid possible integer overflow
 			if (startIndex > value.Length - length)
 				throw new System.ArgumentOutOfRangeException ("startIndex", startIndex, "StartIndex and length must refer to a location within the string.");
 
-			if (capacity == 0)
-				capacity = constDefaultCapacity;
+			if (capacity == 0) {
+				if (maxCapacity > constDefaultCapacity)
+					capacity = constDefaultCapacity;
+				else
+					_str = _cached_str = String.Empty;
+			}
+			_maxCapacity = maxCapacity;
 
-			_str = String.InternalAllocateStr ((length > capacity) ? length : capacity);
+			if (_str == null)
+				_str = String.InternalAllocateStr ((length > capacity) ? length : capacity);
 			if (length > 0)
 				String.CharCopy (_str, 0, value, startIndex, length);
 			
@@ -95,14 +111,7 @@ namespace System.Text {
 
 		public StringBuilder(int capacity) : this (String.Empty, 0, 0, capacity) {}
 
-		public StringBuilder(int capacity, int maxCapacity) : this (String.Empty, 0, 0, capacity) {
-			if (maxCapacity < 1)
-				throw new System.ArgumentOutOfRangeException ("maxCapacity", "maxCapacity is less than one.");
-			if (capacity > maxCapacity)
-				throw new System.ArgumentOutOfRangeException ("capacity", "Capacity exceeds maximum capacity.");
-
-			_maxCapacity = maxCapacity;
-		}
+		public StringBuilder(int capacity, int maxCapacity) : this (String.Empty, 0, 0, capacity, maxCapacity) { }
 
 		public StringBuilder (string value)
 		{
@@ -116,13 +125,13 @@ namespace System.Text {
 			
 			_length = value.Length;
 			_str = _cached_str = value;
+			_maxCapacity = Int32.MaxValue;
 		}
 	
-		public StringBuilder( string value, int capacity) : this(value, 0, value.Length, capacity) {}
+		public StringBuilder( string value, int capacity) : this(value == null ? "" : value, 0, value == null ? 0 : value.Length, capacity) {}
 	
 		public int MaxCapacity {
 			get {
-				// MS runtime always returns Int32.MaxValue.
 				return _maxCapacity;
 			}
 		}
@@ -130,7 +139,7 @@ namespace System.Text {
 		public int Capacity {
 			get {
 				if (_str.Length == 0)
-					return constDefaultCapacity;
+					return Math.Min (_maxCapacity, constDefaultCapacity);
 				
 				return _str.Length;
 			}
@@ -139,6 +148,9 @@ namespace System.Text {
 				if (value < _length)
 					throw new ArgumentException( "Capacity must be larger than length" );
 
+				if (value > _maxCapacity)
+					throw new ArgumentOutOfRangeException ("value", "Should be less than or equal to MaxCapacity");
+
 				InternalEnsureCapacity(value);
 			}
 		}
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
index 568ec9a..8b8f56c 100644
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ b/mcs/class/corlib/System.Threading/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-02  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* Thread.cs (set_CurrentUICulture): Delay setting in_currentculture
+	to true until after the null check and the return statement.
+	[Backport r145215]
+
+2009-10-21  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* WaitHandle.cs: Add missing validations for 'millisecondsTimeout'
+	in Wait[One|Any|All]. Also call the overloaded (bool) methods for
+	WaitAll to reduce code duplication.
+	[Backport r144529]
+
 2009-02-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* WaitHandle.cs: implemented SignalAndWait.
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
index 4ad5b32..7f9888f 100644
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ b/mcs/class/corlib/System.Threading/Thread.cs
@@ -543,8 +543,6 @@ namespace System.Threading {
 			}
 			
 			set {
-				in_currentculture = true;
-				
 				if (value == null)
 					throw new ArgumentNullException ("value");
 
@@ -552,6 +550,7 @@ namespace System.Threading {
 				if (culture == value)
 					return;
 
+				in_currentculture = true;
 				try {
 					SetCachedCurrentUICulture (value);
 
diff --git a/mcs/class/corlib/System.Threading/WaitHandle.cs b/mcs/class/corlib/System.Threading/WaitHandle.cs
index 2d7f4f4..44dfccc 100644
--- a/mcs/class/corlib/System.Threading/WaitHandle.cs
+++ b/mcs/class/corlib/System.Threading/WaitHandle.cs
@@ -111,6 +111,10 @@ namespace System.Threading
 		public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext)
 		{
 			CheckArray (waitHandles, true);
+			// check negative - except for -1 (which is Timeout.Infinite)
+			if (millisecondsTimeout < Timeout.Infinite)
+				throw new ArgumentOutOfRangeException ("millisecondsTimeout");
+
 			try {
 				if (exitContext) SynchronizationAttribute.ExitContext ();
 				return(WaitAll_internal(waitHandles, millisecondsTimeout, false));
@@ -160,6 +164,10 @@ namespace System.Threading
 					  bool exitContext)
 		{
 			CheckArray (waitHandles, false);
+			// check negative - except for -1 (which is Timeout.Infinite)
+			if (millisecondsTimeout < Timeout.Infinite)
+				throw new ArgumentOutOfRangeException ("millisecondsTimeout");
+
 			try {
 				if (exitContext) SynchronizationAttribute.ExitContext ();
 				return(WaitAny_internal(waitHandles, millisecondsTimeout, exitContext));
@@ -331,6 +339,10 @@ namespace System.Threading
 		public virtual bool WaitOne(int millisecondsTimeout, bool exitContext)
 		{
 			CheckDisposed ();
+			// check negative - except for -1 (which is Timeout.Infinite)
+			if (millisecondsTimeout < Timeout.Infinite)
+				throw new ArgumentOutOfRangeException ("millisecondsTimeout");
+
 			bool release = false;
 			try {
 				if (exitContext)
@@ -385,19 +397,12 @@ namespace System.Threading
 
 		public static bool WaitAll(WaitHandle[] waitHandles, int millisecondsTimeout)
 		{
-			CheckArray (waitHandles, true);
-			return WaitAll_internal (waitHandles, millisecondsTimeout, false);
+			return WaitAll (waitHandles, millisecondsTimeout, false);
 		}
 
 		public static bool WaitAll(WaitHandle[] waitHandles, TimeSpan timeout)
 		{
-			CheckArray (waitHandles, true);
-			long ms = (long) timeout.TotalMilliseconds;
-			
-			if (ms < -1 || ms > Int32.MaxValue)
-				throw new ArgumentOutOfRangeException ("timeout");
-
-			return (WaitAll_internal (waitHandles, (int) ms, false));
+			return WaitAll (waitHandles, timeout, false);
 		}
 		
 #else
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs
index 09e176b..0d8a9df 100644
--- a/mcs/class/corlib/System/AppDomain.cs
+++ b/mcs/class/corlib/System/AppDomain.cs
@@ -857,7 +857,7 @@ namespace System {
 		[MethodImplAttribute (MethodImplOptions.InternalCall)]
 		private static extern AppDomain createDomain (string friendlyName, AppDomainSetup info);
 
-		[MonoTODO ("Currently it does not allow the setup in the other domain")]
+		[MonoLimitationAttribute ("Currently it does not allow the setup in the other domain")]
 		[SecurityPermission (SecurityAction.Demand, ControlAppDomain = true)]
 		public static AppDomain CreateDomain (string friendlyName, Evidence securityInfo, AppDomainSetup info)
 		{
diff --git a/mcs/class/corlib/System/AppDomainManager.cs b/mcs/class/corlib/System/AppDomainManager.cs
index 9cf025e..6fb0efe 100644
--- a/mcs/class/corlib/System/AppDomainManager.cs
+++ b/mcs/class/corlib/System/AppDomainManager.cs
@@ -59,9 +59,8 @@ namespace System {
 			}
 		}
 
-		[MonoTODO]
 		public virtual Assembly EntryAssembly {
-			get { throw new NotImplementedException (); }
+			get { return Assembly.GetEntryAssembly (); }
 		}
 
 		[MonoTODO]
diff --git a/mcs/class/corlib/System/AppDomainSetup.cs b/mcs/class/corlib/System/AppDomainSetup.cs
index 5320c08..4746489 100644
--- a/mcs/class/corlib/System/AppDomainSetup.cs
+++ b/mcs/class/corlib/System/AppDomainSetup.cs
@@ -231,7 +231,7 @@ namespace System
 			}
 		}
 
-		[MonoTODO ("In Mono this is controlled by the --share-code flag")]
+		[MonoLimitation ("In Mono this is controlled by the --share-code flag")]
 		public LoaderOptimization LoaderOptimization {
 			get {
 				return loader_optimization;
diff --git a/mcs/class/corlib/System/Array.cs b/mcs/class/corlib/System/Array.cs
index f6d635a..1357152 100644
--- a/mcs/class/corlib/System/Array.cs
+++ b/mcs/class/corlib/System/Array.cs
@@ -289,12 +289,12 @@ namespace System
 		object IList.this [int index] {
 			get {
 				if (unchecked ((uint) index) >= unchecked ((uint) Length))
-					throw new ArgumentOutOfRangeException ("index");
+					throw new IndexOutOfRangeException ("index");
 				return GetValueImpl (index);
 			} 
 			set {
 				if (unchecked ((uint) index) >= unchecked ((uint) Length))
-					throw new ArgumentOutOfRangeException ("index");
+					throw new IndexOutOfRangeException ("index");
 				SetValueImpl (value, index);
 			}
 		}
@@ -1120,8 +1120,13 @@ namespace System
 			if (array.Rank > 1)
 				throw new RankException (Locale.GetText ("Only single dimension arrays are supported."));
 
-			if (count < 0 || startIndex < array.GetLowerBound (0) ||
-				startIndex > array.GetUpperBound (0) ||	startIndex - count + 1 < array.GetLowerBound (0))
+			int lb = array.GetLowerBound (0);
+			// Empty arrays do not throw ArgumentOutOfRangeException
+			if (array.Length == 0)
+				return lb - 1;
+
+			if (count < 0 || startIndex < lb ||
+				startIndex > array.GetUpperBound (0) ||	startIndex - count + 1 < lb)
 				throw new ArgumentOutOfRangeException ();
 
 			for (int i = startIndex; i >= startIndex - count + 1; i--) {
@@ -1129,7 +1134,7 @@ namespace System
 					return i;
 			}
 
-			return array.GetLowerBound (0) - 1;
+			return lb - 1;
 		}
 
 #if !BOOTSTRAP_WITH_OLDLIB
diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog
index 09a6a86..eb99cb8 100644
--- a/mcs/class/corlib/System/ChangeLog
+++ b/mcs/class/corlib/System/ChangeLog
@@ -1,3 +1,77 @@
+2009-10-28  Lluis Sanchez Gual  <lluis at novell.com>
+
+	* MarshalByRefObject.cs: In InitializeLifetimeService, if a lease
+	exists for the object return it, instead of always creating
+	a new one. Fixes bug #544357.
+
+2009-10-06  Jonathan Chambers  <joncham at gmail.com>
+
+	* String.cs (Contains): Use CompareOptions.Ordinal. Fixes bug
+	#535425.
+
+2009-09-24  Zoltan Varga  <vargaz at gmail.com>
+
+	* Type.cs: Initialize the Missing field.
+
+2009-09-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Console.cs: mark methods/properties that only work on windows.
+	Fixes bug #540593.
+
+2009-09-04  Miguel de Icaza  <miguel at novell.com>
+
+	* TermInfoDriver.cs: Handle a few more key combinations.
+
+2009-07-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Array.cs: empty arrays just return -1 in LastIndexOf().
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DateTime.cs: if the DateTimeOffset is out of bounds, let Parse
+	report the error. Fix stupid harmless typo.
+	* DateTimeOffset.cs: report error if the UTC date/time is out of
+	bounds.
+
+2009-06-25  Miguel de Icaza  <miguel at novell.com>
+
+	* Array.cs: IList.this needs to throw IndexOutOfRangeException
+	when the index is invalid, not ArgumentOutOfRangeException.
+
+	* Int32.cs: Do not crash if the FormatProvider returns a null
+	value on the call to GetFormat (Type).
+
+	Validate the NumberStyles, passes Int/Int32Parse2.exe
+
+	Fix regression introduced in 2005, we need to throw
+	ArgumentNullException on Parse.
+
+2009-06-25  Miguel de Icaza  <miguel at novell.com>
+
+	* Int32.cs: Fix regression introduced in 2005, we need to throw
+	ArgumentNullException on Parse.
+	
+2009-06-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DateTime.cs: ignore MinValue to avoid DateTimeOffset ctor throwing
+	when adjusting for TZ.
+
+2009-06-18 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DateTime.cs: quick fix for the 1.x build.
+
+2009-06-18 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* AppDomainSetup.cs: update attribute.
+	* TermInfoDriver.cs: ensure we are initialized in CheckWindowDimensions().
+	* DateTimeOffset.cs: Implement Parse().
+	* DateTime.cs: add 'zzz' to the list of default time formats. Return a
+	DateTimeOffset from _DoParse. Fixed the offset minutes when the
+	timezone is specified as a negative one.
+	* Console.cs: updates for MoveBufferArea().
+	* AppDomainManager.cs: implement EntryAssembly.
+	* AppDomain.cs: update attribute.
+
 2009-05-27  Zoltan Varga  <vargaz at gmail.com>
 
 	* AppDomain.cs (DoAssemblyResolve): Fix recursion detection. Fixes #507003.
diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs
index 1611bcc..7ef85da 100644
--- a/mcs/class/corlib/System/Console.cs
+++ b/mcs/class/corlib/System/Console.cs
@@ -515,14 +515,17 @@ namespace System
 
 		public static int BufferHeight {
 			get { return ConsoleDriver.BufferHeight; }
+			[MonoLimitation ("Implemented only on Windows")]
 			set { ConsoleDriver.BufferHeight = value; }
 		}
 
 		public static int BufferWidth {
 			get { return ConsoleDriver.BufferWidth; }
+			[MonoLimitation ("Implemented only on Windows")]
 			set { ConsoleDriver.BufferWidth = value; }
 		}
 
+		[MonoLimitation ("Implemented only on Windows")]
 		public static bool CapsLock {
 			get { return ConsoleDriver.CapsLock; }
 		}
@@ -564,6 +567,7 @@ namespace System
 			get { return ConsoleDriver.LargestWindowWidth; }
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static bool NumberLock {
 			get { return ConsoleDriver.NumberLock; }
 		}
@@ -578,21 +582,25 @@ namespace System
 			set { ConsoleDriver.TreatControlCAsInput = value; }
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static int WindowHeight {
 			get { return ConsoleDriver.WindowHeight; }
 			set { ConsoleDriver.WindowHeight = value; }
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static int WindowLeft {
 			get { return ConsoleDriver.WindowLeft; }
 			set { ConsoleDriver.WindowLeft = value; }
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static int WindowTop {
 			get { return ConsoleDriver.WindowTop; }
 			set { ConsoleDriver.WindowTop = value; }
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static int WindowWidth {
 			get { return ConsoleDriver.WindowWidth; }
 			set { ConsoleDriver.WindowWidth = value; }
@@ -619,19 +627,20 @@ namespace System
 			ConsoleDriver.Clear ();
 		}
 
-		[MonoTODO ("Not implemented")]
+		[MonoLimitation ("Implemented only on Windows")]
 		public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
 						int targetLeft, int targetTop)
 		{
-			throw new NotImplementedException ();
+			ConsoleDriver.MoveBufferArea (sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop);
 		}
 
-		[MonoTODO("Not implemented")]
+		[MonoLimitation ("Implemented only on Windows")]
 		public static void MoveBufferArea (int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
 						int targetLeft, int targetTop, Char sourceChar,
 						ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
 		{
-			throw new NotImplementedException ();
+			ConsoleDriver.MoveBufferArea (sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop,
+							sourceChar, sourceForeColor, sourceBackColor);
 		}
 
 		public static ConsoleKeyInfo ReadKey ()
@@ -649,6 +658,7 @@ namespace System
 			ConsoleDriver.ResetColor ();
 		}
 
+		[MonoLimitation ("Only works on windows")]
 		public static void SetBufferSize (int width, int height)
 		{
 			ConsoleDriver.SetBufferSize (width, height);
diff --git a/mcs/class/corlib/System/DateTime.cs b/mcs/class/corlib/System/DateTime.cs
index bc7238e..d550135 100644
--- a/mcs/class/corlib/System/DateTime.cs
+++ b/mcs/class/corlib/System/DateTime.cs
@@ -54,6 +54,26 @@ namespace System
 #if NET_2_0
 		DateTimeKind kind;
 #endif
+#if !NET_2_0
+		internal struct DateTimeOffset {
+			public DateTime DateTime;
+			public TimeSpan Offset;
+
+			public DateTimeOffset (DateTime dt) : this (dt, TimeSpan.Zero)
+			{
+			}
+
+			public DateTimeOffset (long ticks, TimeSpan offset) : this (new DateTime (ticks), offset)
+			{
+			}
+
+			public DateTimeOffset (DateTime dt, TimeSpan offset)
+			{
+				DateTime = dt;
+				Offset = offset;
+			}
+		}
+#endif
 
 		private const int dp400 = 146097;
 		private const int dp100 = 36524;
@@ -88,6 +108,7 @@ namespace System
 		private static readonly string[] ParseTimeFormats = new string [] {
 			"H:m:s.fffffffzzz",
 			"H:m:s.fffffff",
+			"H:m:s tt zzz",
 			"H:m:szzz",
 			"H:m:s",
 			"H:mzzz",
@@ -889,8 +910,9 @@ namespace System
 				throw new ArgumentNullException ("s");
 
 			DateTime res;
+			DateTimeOffset dto;
 			Exception exception = null;
-			if (!CoreParse (s, provider, styles, out res, true, ref exception))
+			if (!CoreParse (s, provider, styles, out res, out dto, true, ref exception))
 				throw exception;
 			
 			return res;
@@ -898,9 +920,10 @@ namespace System
 
 		const string formatExceptionMessage = "String was not recognized as a valid DateTime.";
 		
-		static bool CoreParse (string s, IFormatProvider provider, DateTimeStyles styles,
-					      out DateTime result, bool setExceptionOnError, ref Exception exception)
+		internal static bool CoreParse (string s, IFormatProvider provider, DateTimeStyles styles,
+ 					      out DateTime result, out DateTimeOffset dto, bool setExceptionOnError, ref Exception exception)
 		{
+ 			dto = new DateTimeOffset (0, TimeSpan.Zero);
 			if (s == null || s.Length == 0) {
 				if (setExceptionOnError)
 					exception = new FormatException (formatExceptionMessage);
@@ -918,19 +941,19 @@ namespace System
 				result = MinValue;
 				return false;
 			}
-					
+
 			bool longYear = false;
 			for (int i = 0; i < allDateFormats.Length; i++) {
 				string firstPart = allDateFormats [i];
 				bool incompleteFormat = false;
-				if (_DoParse (s, firstPart, "", false, out result, dfi, styles, true, ref incompleteFormat, ref longYear))
+				if (_DoParse (s, firstPart, "", false, out result, out dto, dfi, styles, true, ref incompleteFormat, ref longYear))
 					return true;
 
 				if (!incompleteFormat)
 					continue;
 
 				for (int j = 0; j < ParseTimeFormats.Length; j++) {
-					if (_DoParse (s, firstPart, ParseTimeFormats [j], false, out result, dfi, styles, true, ref incompleteFormat, ref longYear))
+					if (_DoParse (s, firstPart, ParseTimeFormats [j], false, out result, out dto, dfi, styles, true, ref incompleteFormat, ref longYear))
 						return true;
 				}
 			}
@@ -950,27 +973,27 @@ namespace System
 			string[] monthDayFormats = is_day_before_month ? DayMonthShortFormats : MonthDayShortFormats;
 			for (int i = 0; i < monthDayFormats.Length; i++) {
 				bool incompleteFormat = false;
-				if (_DoParse (s, monthDayFormats[i], "", false, out result, dfi, styles, true, ref incompleteFormat, ref longYear))
+				if (_DoParse (s, monthDayFormats[i], "", false, out result, out dto, dfi, styles, true, ref incompleteFormat, ref longYear))
 					return true;
 			}
 			
 			for (int j = 0; j < ParseTimeFormats.Length; j++) {
 				string firstPart = ParseTimeFormats [j];
 				bool incompleteFormat = false;
-				if (_DoParse (s, firstPart, "", false, out result, dfi, styles, false, ref incompleteFormat, ref longYear))
+				if (_DoParse (s, firstPart, "", false, out result, out dto, dfi, styles, false, ref incompleteFormat, ref longYear))
 					return true;
 				if (!incompleteFormat)
 					continue;
 
 				for (int i = 0; i < monthDayFormats.Length; i++) {
-					if (_DoParse (s, firstPart, monthDayFormats [i], false, out result, dfi, styles, false, ref incompleteFormat, ref longYear))
+					if (_DoParse (s, firstPart, monthDayFormats [i], false, out result, out dto, dfi, styles, false, ref incompleteFormat, ref longYear))
 						return true;
 				}
 				for (int i = 0; i < allDateFormats.Length; i++) {
 					string dateFormat = allDateFormats [i];
 					if (dateFormat[dateFormat.Length - 1] == 'T')
 						continue; // T formats must be before the time part
-					if (_DoParse (s, firstPart, dateFormat, false, out result, dfi, styles, false, ref incompleteFormat, ref longYear))
+					if (_DoParse (s, firstPart, dateFormat, false, out result, out dto, dfi, styles, false, ref incompleteFormat, ref longYear))
 						return true;
 				}
 			}
@@ -1196,6 +1219,7 @@ namespace System
 					      string secondPart,
 					      bool exact,
 					      out DateTime result,
+					      out DateTimeOffset dto,
 					      DateTimeFormatInfo dfi,
 					      DateTimeStyles style,
 					      bool firstPartIsDate,
@@ -1205,6 +1229,7 @@ namespace System
 			bool useutc = false;
 			bool use_invariant = false;
 			bool sloppy_parsing = false;
+			dto = new DateTimeOffset (0, TimeSpan.Zero);
 #if !NET_2_0
 			bool afterTimePart = firstPartIsDate && secondPart == "";
 #endif
@@ -1769,20 +1794,29 @@ namespace System
 			if (dayofweek != -1 && dayofweek != (int) result.DayOfWeek)
 				return false;
 
-			TimeSpan utcoffset;
-
-			bool adjustToUniversal = (style & DateTimeStyles.AdjustToUniversal) != 0;
-			
-			if (tzsign != -1) {
+			if (tzsign == -1) {
+				if (result != DateTime.MinValue) {
+					try {
+						dto = new DateTimeOffset (result);
+					} catch { } // We handle this error in DateTimeOffset.Parse
+				}
+			} else {
 				if (tzoffmin == -1)
 					tzoffmin = 0;
 				if (tzoffset == -1)
 					tzoffset = 0;
-				if (tzsign == 1)
+				if (tzsign == 1) {
 					tzoffset = -tzoffset;
-
-				utcoffset = new TimeSpan (tzoffset, tzoffmin, 0);
-				long newticks = (result.ticks - utcoffset).Ticks;
+					tzoffmin = -tzoffmin;
+				}
+				try {
+					dto = new DateTimeOffset (result, new TimeSpan (tzoffset, tzoffmin, 0));
+				} catch {} // We handle this error in DateTimeOffset.Parse
+			}
+			bool adjustToUniversal = (style & DateTimeStyles.AdjustToUniversal) != 0;
+			
+			if (tzsign != -1) {
+				long newticks = (result.ticks - dto.Offset).Ticks;
 				if (newticks < 0)
 					newticks += TimeSpan.TicksPerDay;
 				result = new DateTime (false, new TimeSpan (newticks));
@@ -1866,8 +1900,9 @@ namespace System
 			if (s != null){
 				try {
 					Exception exception = null;
+					DateTimeOffset dto;
 
-					return CoreParse (s, null, DateTimeStyles.AllowWhiteSpaces, out result, false, ref exception);
+					return CoreParse (s, null, DateTimeStyles.AllowWhiteSpaces, out result, out dto, false, ref exception);
 				} catch { }
 			}
 			result = MinValue;
@@ -1879,8 +1914,9 @@ namespace System
 			if (s != null){
 				try {
 					Exception exception = null;
+					DateTimeOffset dto;
 					
-					return CoreParse (s, provider, styles, out result, false, ref exception);
+					return CoreParse (s, provider, styles, out result, out dto, false, ref exception);
 				} catch {}
 			} 
 			result = MinValue;
@@ -1926,7 +1962,8 @@ namespace System
 				if (format == null || format == String.Empty)
 					break;
 
-				if (_DoParse (s, formats[i], null, exact, out result, dfi, style, false, ref incompleteFormat, ref longYear)) {
+				DateTimeOffset dto;
+				if (_DoParse (s, formats[i], null, exact, out result, out dto, dfi, style, false, ref incompleteFormat, ref longYear)) {
 					ret = result;
 					return true;
 				}
diff --git a/mcs/class/corlib/System/DateTimeOffset.cs b/mcs/class/corlib/System/DateTimeOffset.cs
index a9fb290..2a324ea 100644
--- a/mcs/class/corlib/System/DateTimeOffset.cs
+++ b/mcs/class/corlib/System/DateTimeOffset.cs
@@ -282,13 +282,21 @@ namespace System
 			return Parse (input, formatProvider, DateTimeStyles.AllowWhiteSpaces);
 		}
 
-		[MonoTODO]
 		public static DateTimeOffset Parse (string input, IFormatProvider formatProvider, DateTimeStyles styles)
 		{
 			if (input == null)
 				throw new ArgumentNullException ("input");
 
-			throw new NotImplementedException ();
+			DateTime d;
+			DateTimeOffset dto;
+			Exception exception = null;
+			if (!DateTime.CoreParse (input, formatProvider, styles, out d, out dto, true, ref exception))
+				throw exception;
+
+			if (d.Ticks != 0 && dto.Ticks == 0)
+				throw new ArgumentOutOfRangeException ("The UTC representation falls outside the 1-9999 year range");
+
+			return dto;
 		}
 
 		public static DateTimeOffset ParseExact (string input, string format, IFormatProvider formatProvider)
@@ -326,7 +334,7 @@ namespace System
 
 			DateTimeOffset result;
 			if (!ParseExact (input, formats, DateTimeFormatInfo.GetInstance (formatProvider), styles, out result))
-				throw new FormatException ();
+				throw new FormatException ("Invalid format string");
 
 			return result;
 		}
@@ -337,7 +345,7 @@ namespace System
 			foreach (string format in formats)
 			{
 				if (format == null || format == String.Empty)
-					throw new FormatException ("Invlid Format Sting");
+					throw new FormatException ("Invalid format string");
 
 				DateTimeOffset result;
 				if (DoParse (input, format, false, out result, dfi, styles)) {
diff --git a/mcs/class/corlib/System/Int32.cs b/mcs/class/corlib/System/Int32.cs
index 302ffbf..712d044 100644
--- a/mcs/class/corlib/System/Int32.cs
+++ b/mcs/class/corlib/System/Int32.cs
@@ -229,6 +229,10 @@ namespace System {
 							"are permitted.");
 					return false;
 				}
+			} else if ((uint) style > (uint) NumberStyles.Any){
+				if (!tryParse)
+					exc = new ArgumentException ("Not a valid number style");
+				return false;
 			}
 
 			return true;
@@ -329,12 +333,6 @@ namespace System {
 
 			if (s == null) {
 				if (!tryParse)
-					exc = GetFormatException ();
-				return false;
-			}
-			
-			if (s == null) {
-				if (!tryParse)
 					exc = new ArgumentNullException ();
 				return false;
 			}
@@ -345,12 +343,12 @@ namespace System {
 				return false;
 			}
 
-			NumberFormatInfo nfi;
+			NumberFormatInfo nfi = null;
 			if (fp != null) {
 				Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
 				nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
 			}
-			else
+			if (nfi == null)
 				nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;
 
 			if (!CheckStyle (style, tryParse, ref exc))
diff --git a/mcs/class/corlib/System/MarshalByRefObject.cs b/mcs/class/corlib/System/MarshalByRefObject.cs
index 6c20772..40522bd 100644
--- a/mcs/class/corlib/System/MarshalByRefObject.cs
+++ b/mcs/class/corlib/System/MarshalByRefObject.cs
@@ -92,7 +92,10 @@ namespace System
 		[SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
 		public virtual object InitializeLifetimeService ()
 		{
-			return new System.Runtime.Remoting.Lifetime.Lease();
+			if (_identity != null && _identity.Lease != null)
+				return _identity.Lease;
+			else
+				return new System.Runtime.Remoting.Lifetime.Lease();
 		}
 
 #if NET_2_0
diff --git a/mcs/class/corlib/System/String.cs b/mcs/class/corlib/System/String.cs
index 7533f40..6f8b101 100644
--- a/mcs/class/corlib/System/String.cs
+++ b/mcs/class/corlib/System/String.cs
@@ -1183,7 +1183,7 @@ namespace System
 				return 0;
 			if (this.length == 0)
 				return -1;
-			return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, 0, length);
+			return CultureInfo.CurrentCulture.CompareInfo.IndexOf (this, value, 0, length, CompareOptions.Ordinal);
 		}
 
 		public int IndexOf (String value, int startIndex)
diff --git a/mcs/class/corlib/System/TermInfoDriver.cs b/mcs/class/corlib/System/TermInfoDriver.cs
index aefe922..09068d4 100644
--- a/mcs/class/corlib/System/TermInfoDriver.cs
+++ b/mcs/class/corlib/System/TermInfoDriver.cs
@@ -356,8 +356,10 @@ namespace System {
 				break;
 			case ConsoleKey.Tab:
 				int n = 8 - (cursorLeft % 8);
-				for (int i = 0; i < n; i++)
+				for (int i = 0; i < n; i++){
 					IncrementX ();
+				}
+				WriteConsole ("\t");
 				break;
 			case ConsoleKey.Clear:
 				WriteConsole (clear);
@@ -703,6 +705,9 @@ namespace System {
 
 		unsafe void CheckWindowDimensions ()
 		{
+			if (!inited)
+				Init ();
+
 			if (terminal_size == *native_terminal_size)
 				return;
 
@@ -854,23 +859,45 @@ namespace System {
 			bool shift = false;
 			bool ctrl = false;
 
-			if (n == 10) {
+			switch (n){
+			case 10:
 				key = ConsoleKey.Enter;
-			} else if (n == 8 || n == 9 || n == 12 || n == 13 || n == 19) {
+				break;
+			case 0x20:
+				key = ConsoleKey.Spacebar;
+				break;
+			case 45:
+				key = ConsoleKey.Subtract;
+				break;
+			case 43:
+				key = ConsoleKey.Add;
+				break;
+			case 47:
+				key = ConsoleKey.Divide;
+				break;
+			case 42:
+				key = ConsoleKey.Multiply;
+				break;
+			case 8: case 9: case 12: case 13: case 19:
 				/* Values in ConsoleKey */
-			} else if (n >= 1 && n <= 26) {
-				// For Ctrl-a to Ctrl-z.
-				ctrl = true;
-				key = ConsoleKey.A + n - 1;
-			} else if (n == 27) {
+				break;
+			case 27:
 				key = ConsoleKey.Escape;
-			} else if (n >= 'a' && n <= 'z') {
-				key = ConsoleKey.A - 'a' + n;
-			} else if (n >= 'A' && n <= 'Z') {
-				shift = true;
-			} else if (n >= '0' && n <= '9') {
-			} else {
-				key = 0;
+				break;
+				
+			default:
+				if (n >= 1 && n <= 26) {
+					// For Ctrl-a to Ctrl-z.
+					ctrl = true;
+					key = ConsoleKey.A + n - 1;
+				} else if (n >= 'a' && n <= 'z') {
+					key = ConsoleKey.A - 'a' + n;
+				} else if (n >= 'A' && n <= 'Z') {
+					shift = true;
+				} else if (n >= '0' && n <= '9') {
+				} else
+					key = 0;
+				break;
 			}
 
 			return new ConsoleKeyInfo (c, key, shift, alt, ctrl);
diff --git a/mcs/class/corlib/System/Type.cs b/mcs/class/corlib/System/Type.cs
index 01f137b..78e97cd 100644
--- a/mcs/class/corlib/System/Type.cs
+++ b/mcs/class/corlib/System/Type.cs
@@ -55,7 +55,7 @@ namespace System {
 		public static readonly MemberFilter FilterAttribute = new MemberFilter (FilterAttribute_impl);
 		public static readonly MemberFilter FilterName = new MemberFilter (FilterName_impl);
 		public static readonly MemberFilter FilterNameIgnoreCase = new MemberFilter (FilterNameIgnoreCase_impl);
-		public static readonly object Missing;
+		public static readonly object Missing = System.Reflection.Missing.Value;
 
 		internal const BindingFlags DefaultBindingFlags =
 		BindingFlags.Public | BindingFlags.Static | BindingFlags.Instance;
diff --git a/mcs/class/corlib/Test/System.Collections/ChangeLog b/mcs/class/corlib/Test/System.Collections/ChangeLog
index bde6081..a170c79 100644
--- a/mcs/class/corlib/Test/System.Collections/ChangeLog
+++ b/mcs/class/corlib/Test/System.Collections/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* SortedListTest.cs: new tests by Kevin Fitzgerald.
+
 2008-08-31  Zoltan Varga  <vargaz at gmail.com>
 
 	* BitArrayTest.cs: Add a test for #421803.
diff --git a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
index 2800559..9c570da 100644
--- a/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
+++ b/mcs/class/corlib/Test/System.Collections/SortedListTest.cs
@@ -1104,6 +1104,123 @@ namespace MonoTests.System.Collections
 			SortedList clone = (SortedList) sl.Clone ();
 		}
 
+		sealed class StartsWithComparator : IComparer {
+			public static readonly StartsWithComparator Instance = new StartsWithComparator();
+
+			public int Compare(object p, object w)
+			{
+				string part = (string) p;
+				string whole = (string) w;
+				// let the default string comparer deal with null or when part is not smaller then whole
+				if (part == null || whole == null || part.Length >= whole.Length)
+					return String.Compare (part, whole);
+
+				// loop through all characters that part and whole have in common
+				int pos = 0;
+				bool match;
+				do {
+					match = (part[pos] == whole[pos]);
+				} while (match && ++pos < part.Length);
+
+				// return result of last comparison
+				return match ? 0 : (part[pos] < whole[pos] ? -1 : 1);
+			}
+		}
+
+		sealed class StartsWithComparatorPartWholeCheck : IComparer
+		{
+			public static readonly StartsWithComparator Instance = new StartsWithComparator();
+
+			public int Compare(object p, object w)
+			{
+				string part = (string) p;
+				string whole = (string) w;
+				Assert.IsTrue(part == "Part", "#PWC0");
+				Assert.IsTrue(whole == "Whole", "#PWC1");
+
+				// let the default string comparer deal with null or when part is not smaller then whole
+				if (part == null || whole == null || part.Length >= whole.Length)
+					return String.Compare(part, whole);
+
+				// loop through all characters that part and whole have in common
+				int pos = 0;
+				bool match;
+				do {
+					match = (part[pos] == whole[pos]);
+				} while (match && ++pos < part.Length);
+
+				// return result of last comparison
+				return match ? 0 : (part[pos] < whole[pos] ? -1 : 1);
+			}
+		}
+
+		[Test]
+		public void ComparatorUsageTest()
+		{
+			SortedList sl = new SortedList(StartsWithComparator.Instance);
+
+			sl.Add("Apples", "Value-Apples");
+			sl.Add("Bananas", "Value-Bananas");
+			sl.Add("Oranges", "Value-Oranges");
+
+			// Ensure 3 objects exist in the collection
+			Assert.IsTrue(sl.Count == 3, "Count");
+
+			// Complete Match Test Set
+			Assert.IsTrue(sl.ContainsKey("Apples"), "#A0");
+			Assert.IsTrue(sl.ContainsKey("Bananas"), "#A1");
+			Assert.IsTrue(sl.ContainsKey("Oranges"), "#A2");
+
+			// Partial Match Test Set
+			Assert.IsTrue(sl.ContainsKey("Apples are great fruit!"), "#B0");
+			Assert.IsTrue(sl.ContainsKey("Bananas are better fruit."), "#B1");
+			Assert.IsTrue(sl.ContainsKey("Oranges are fun to peel."), "#B2");
+
+			// Reversed Match Test Set
+			Assert.IsFalse(sl.ContainsKey("Value"), "#C0");
+
+			// No match tests
+			Assert.IsFalse(sl.ContainsKey("I forgot to bring my bananas."), "#D0");
+			Assert.IsFalse(sl.ContainsKey("My apples are on vacation."), "#D0");
+			Assert.IsFalse(sl.ContainsKey("The oranges are not ripe yet."), "#D0");
+
+		}
+
+		[Test]
+		public void ComparatorPartWholeCheck()
+		{
+			SortedList sl = new SortedList (StartsWithComparatorPartWholeCheck.Instance);
+			sl.Add("Part", "Value-Part");
+			Assert.IsFalse(sl.ContainsKey("Whole"), "#PWC2");
+		}
+
+		[Test]
+		public void NonComparatorStringCheck()
+		{
+			SortedList sl = new SortedList ();
+
+			sl.Add("Oranges", "Value-Oranges");
+			sl.Add("Apples", "Value-Apples");
+			sl.Add("Bananas", "Value-Bananas");
+
+			int i = 0;
+			Assert.IsTrue(sl.Count == 3, "NCSC #A0");
+
+			Assert.IsTrue(sl.ContainsKey("Apples"), "NCSC #B1");
+			Assert.IsTrue(sl.ContainsKey("Bananas"), "NCSC #B2");
+			Assert.IsTrue(sl.ContainsKey("Oranges"), "NCSC #B3");
+
+			Assert.IsFalse(sl.ContainsKey("XApples"), "NCSC #C1");
+			Assert.IsFalse(sl.ContainsKey("XBananas"), "NCSC #C2");
+			Assert.IsFalse(sl.ContainsKey("XOranges"), "NCSC #C3");
+
+			string [] keys = new string [sl.Keys.Count];
+			sl.Keys.CopyTo (keys, 0);
+			Assert.IsTrue(keys [0] == "Apples", "NCSC #D1");
+			Assert.IsTrue(keys [1] == "Bananas", "NCSC #D2");
+			Assert.IsTrue(keys [2] == "Oranges", "NCSC #D3");
+		}
+
 		private static byte [] _serializedValues = new byte [] {
 			0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
 			0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
diff --git a/mcs/class/corlib/Test/System.IO/ChangeLog b/mcs/class/corlib/Test/System.IO/ChangeLog
index 0a27fd9..029ff3b 100644
--- a/mcs/class/corlib/Test/System.IO/ChangeLog
+++ b/mcs/class/corlib/Test/System.IO/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* UnmanagedMemoryStream.cs: Fix some and add missing validations
+	[Backport r144226]
+
 2009-04-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* StreamReaderTest.cs: new test. Using Peek() when we did a short read
diff --git a/mcs/class/corlib/Test/System.IO/UnmanagedMemoryStreamTest.cs b/mcs/class/corlib/Test/System.IO/UnmanagedMemoryStreamTest.cs
index fa406aa..5805df0 100644
--- a/mcs/class/corlib/Test/System.IO/UnmanagedMemoryStreamTest.cs
+++ b/mcs/class/corlib/Test/System.IO/UnmanagedMemoryStreamTest.cs
@@ -4,9 +4,10 @@
 // Authors:
 // 	Sridhar Kulkarni (sridharkulkarni at gmail.com)
 // 	Gert Driesen (drieseng at users.sourceforge.net)
+//	Sebastien Pouliot  <sebastien at ximian.com>
 //
 // (c) 2006 Sridhar Kulkarni.
-// Copyright (C) 2004 Novell (http://www.novell.com)
+// Copyright (C) 2004, 2009 Novell (http://www.novell.com)
 //
 
 #if NET_2_0 && !TARGET_JVM
@@ -431,7 +432,6 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
-		//[Category ("NotWorking")] // when reading on or beyond the end of the stream we must return 0
 		public void Read_EndOfStream ()
 		{
 			UnmanagedMemoryStream ums = new 
@@ -468,6 +468,44 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
+		public void Read_Offset_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, length, length, FileAccess.ReadWrite)) {
+				ums.Write (testStreamData, 0, testStreamData.Length);
+				ums.Position = 0;
+				try {
+					ums.Read (readData, Int32.MaxValue, 0);
+					Assert.Fail ("#1");
+				}
+				catch (ArgumentException ex) {
+					Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.ParamName, "#5");
+				}
+			}
+		}
+
+		[Test]
+		public void Read_Count_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, length, length, FileAccess.ReadWrite)) {
+				ums.Write (testStreamData, 0, testStreamData.Length);
+				ums.Position = 0;
+				try {
+					ums.Read (readData, 0, Int32.MaxValue);
+					Assert.Fail ("#1");
+				}
+				catch (ArgumentException ex) {
+					Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.ParamName, "#5");
+				}
+			}
+		}
+
+		[Test]
 		public void Read_WriteOnly ()
 		{
 			UnmanagedMemoryStream ums = new
@@ -507,7 +545,6 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
-		//[Category ("NotWorking")] // when reading on or beyond the end of the stream we must return -1
 		public void ReadByte_EndOfStream ()
 		{
 			UnmanagedMemoryStream ums = new
@@ -629,6 +666,57 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
+		public void Seek_Begin_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, 5, 10, FileAccess.Read)) {
+				Assert.AreEqual (Int64.MaxValue, ums.Seek (Int64.MaxValue, SeekOrigin.Begin), "Seek");
+				Assert.AreEqual (Int64.MaxValue, ums.Position, "Position");
+				try {
+					byte* p = ums.PositionPointer;
+					Assert.Fail ("#1");
+				}
+				catch (IndexOutOfRangeException ex) {
+					Assert.AreEqual (typeof (IndexOutOfRangeException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+				}
+			}
+		}
+
+		[Test]
+		public void Seek_Current_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, 5, 10, FileAccess.Read)) {
+				ums.ReadByte ();
+				try {
+					ums.Seek (Int64.MaxValue, SeekOrigin.Current);
+					Assert.Fail ("#1");
+				}
+				catch (IOException ex) {
+					Assert.AreEqual (typeof (IOException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+				}
+			}
+		}
+
+		[Test]
+		public void Seek_End_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, 5, 10, FileAccess.Read)) {
+				try {
+					ums.Seek (Int64.MaxValue, SeekOrigin.End);
+					Assert.Fail ("#1");
+				}
+				catch (IOException ex) {
+					Assert.AreEqual (typeof (IOException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+				}
+			}
+		}
+
+		[Test]
 		[ExpectedException (typeof (ObjectDisposedException))]
 		public void Seek_Stream_Closed () 
 		{
@@ -721,6 +809,40 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
+		public void Write_Offset_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, length, capacity, FileAccess.ReadWrite)) {
+				try {
+					ums.Write (testStreamData, Int32.MaxValue, 1);
+					Assert.Fail ("#1");
+				}
+				catch (ArgumentException ex) {
+					Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.ParamName, "#5");
+				}
+			}
+		}
+
+		[Test]
+		public void Write_Count_Overflow ()
+		{
+			using (UnmanagedMemoryStream ums = new UnmanagedMemoryStream (mem_byteptr, length, capacity, FileAccess.ReadWrite)) {
+				try {
+					ums.Write (testStreamData, 1, Int32.MaxValue);
+					Assert.Fail ("#1");
+				}
+				catch (ArgumentException ex) {
+					Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
+					Assert.IsNull (ex.InnerException, "#3");
+					Assert.IsNotNull (ex.Message, "#4");
+					Assert.IsNull (ex.ParamName, "#5");
+				}
+			}
+		}
+
+		[Test]
 		[ExpectedException (typeof (ObjectDisposedException))]
 		public void Write_Stream_Closed ()
 		{
@@ -986,6 +1108,25 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
+		public void Position_Overflow ()
+		{
+			byte [] n = new byte [8];
+			fixed (byte* p = n) {
+				UnmanagedMemoryStream m = new UnmanagedMemoryStream (p, 8);
+				Assert.AreEqual (0, m.Position, "Position-0");
+				m.Position += 9;
+				Assert.AreEqual (9, m.Position, "Position-1");
+				try {
+					byte* p2 = m.PositionPointer;
+					Assert.Fail ("PositionPointer");
+				}
+				catch (IndexOutOfRangeException) {
+					// expected
+				}
+			}
+		}
+
+		[Test]
 		public void Position_Stream_Closed ()
 		{
 			UnmanagedMemoryStream ums = new 
@@ -1005,7 +1146,6 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
-		[Category ("NotWorking")]
 		public void PositionPointer_Stream_Closed ()
 		{
 			UnmanagedMemoryStream ums = new 
@@ -1037,13 +1177,21 @@ namespace MonoTests.System.IO
 		}
 
 		[Test]
-		[ExpectedException (typeof(ArgumentOutOfRangeException))]
 		public void PositionPointer_Overflow ()
 		{
 			byte [] n = new byte [8];
-			fixed (byte *p = n){
+			fixed (byte* p = n) {
 				UnmanagedMemoryStream m = new UnmanagedMemoryStream (p, 8);
-				m.PositionPointer = p+9;
+				Assert.AreEqual (0, m.Position, "Position-0");
+				m.PositionPointer = p + 9;
+				Assert.AreEqual (9, m.Position, "Position-1");
+				try {
+					byte* p2 = m.PositionPointer;
+					Assert.Fail ("PositionPointer");
+				}
+				catch (IndexOutOfRangeException) {
+					// expected
+				}
 			}
 		}
 
@@ -1052,13 +1200,119 @@ namespace MonoTests.System.IO
 		{
 			byte [] n = new byte [8];
 			n [4] = 65;
-			fixed (byte *p = n){
-				UnmanagedMemoryStream m = new UnmanagedMemoryStream (p, 8);
+			fixed (byte* p = n) {
+				UnmanagedMemoryStream m = new UnmanagedMemoryStream (p, 8, 8, FileAccess.ReadWrite);
 				m.PositionPointer = p + 4;
-				Assert.AreEqual (65, m.ReadByte ());
+				Assert.AreEqual (65, m.ReadByte (), "read");
+				m.WriteByte (42);
 			}
+			Assert.AreEqual (42, n [5], "write");
 		}
 		
+		class MyUnmanagedMemoryStream : UnmanagedMemoryStream {
+
+			public MyUnmanagedMemoryStream ()
+			{
+			}
+
+			public void MyInitialize (byte* pointer, long length, long capacity, FileAccess access)
+			{
+				Initialize (pointer, length, capacity, access);
+			}
+		}
+
+		[Test]
+		public void Defaults_Can_Properties ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.IsFalse (s.CanRead, "CanRead");
+			Assert.IsFalse (s.CanSeek, "CanSeek");
+			Assert.IsFalse (s.CanWrite, "CanWrite");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ObjectDisposedException))]
+		public void Defaults_Capacity ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.AreEqual (0, s.Capacity, "Capacity");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ObjectDisposedException))]
+		public void Defaults_Length ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.AreEqual (0, s.Length, "Length");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ObjectDisposedException))]
+		public void Defaults_Position ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.AreEqual (0, s.Position, "Position");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ObjectDisposedException))]
+		public void Defaults_PositionPointer ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			byte* pp = s.PositionPointer;
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void Defaults_ReadTimeout ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.AreEqual (0, s.ReadTimeout, "ReadTimeout");
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void Defaults_WriteTimeout ()
+		{
+			MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ();
+			Assert.AreEqual (0, s.WriteTimeout, "WriteTimeout");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void Initialize_Pointer_Null ()
+		{
+			using (MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ()) {
+				s.MyInitialize (null, 0, 0, FileAccess.Read);
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void Initialize_Length_Negative ()
+		{
+			using (MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ()) {
+				s.MyInitialize (mem_byteptr, -1, 0, FileAccess.Read);
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void Initialize_Capacity_Negative ()
+		{
+			using (MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ()) {
+				s.MyInitialize (mem_byteptr, 0, -1, FileAccess.Read);
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void Initialize_Access_Invalid ()
+		{
+			using (MyUnmanagedMemoryStream s = new MyUnmanagedMemoryStream ()) {
+				s.MyInitialize (mem_byteptr, 0, 1, (FileAccess) Int32.MinValue);
+			}
+		}
 	}
 }
 #endif
diff --git a/mcs/class/corlib/Test/System.Reflection/BinderTests.cs b/mcs/class/corlib/Test/System.Reflection/BinderTests.cs
index ebbb3f4..9b896ab 100644
--- a/mcs/class/corlib/Test/System.Reflection/BinderTests.cs
+++ b/mcs/class/corlib/Test/System.Reflection/BinderTests.cs
@@ -11,6 +11,7 @@ using NUnit.Framework;
 using System;
 using System.IO;
 using System.Reflection;
+using System.Globalization;
 
 namespace MonoTests.System.Reflection
 {
@@ -203,6 +204,49 @@ namespace MonoTests.System.Reflection
 			Assert.IsNotNull (prop, "short");
 		}
 
+#if NET_2_0
+		[Test]
+		public void SelectMethod_ByRef ()
+		{
+			Type type = typeof (ByRefMatch);
+			BindingFlags flags = BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance;
+			MethodBase [] match;
+			Type [] types;
+			MethodBase selected;
+
+			MethodInfo mi_run = type.GetMethod ("Run", flags, binder,
+				new Type [] { typeof (int) }, null);
+			Assert.IsFalse (mi_run.GetParameters () [0].ParameterType.IsByRef, "#A1");
+			MethodInfo mi_run_ref = type.GetMethod ("Run", flags, binder,
+				new Type [] { typeof (int).MakeByRefType () }, null);
+			Assert.IsTrue (mi_run_ref.GetParameters () [0].ParameterType.IsByRef, "#A2");
+
+			match = new MethodBase [] { mi_run_ref };
+			types = new Type [] { typeof (int) };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.IsNull (selected, "#B1");
+			types = new Type [] { typeof (int).MakeByRefType () };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.AreSame (mi_run_ref, selected, "#B2");
+
+			match = new MethodBase [] { mi_run };
+			types = new Type [] { typeof (int) };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.AreSame (mi_run, selected, "#C1");
+			types = new Type [] { typeof (int).MakeByRefType () };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.IsNull (selected, "#C1");
+
+			match = new MethodBase [] { mi_run, mi_run_ref };
+			types = new Type [] { typeof (int) };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.AreSame (mi_run, selected, "#D1");
+			types = new Type [] { typeof (int).MakeByRefType () };
+			selected = binder.SelectMethod (flags, match, types, null);
+			Assert.AreSame (mi_run_ref, selected, "#D2");
+		}
+#endif
+
 		[Test]
 		public void ArgNullOnMethod () // see bug 58846. We throwed nullref here.
 		{
@@ -223,6 +267,47 @@ namespace MonoTests.System.Reflection
 			Assert.IsNotNull (prop);
 		}
 
+#if NET_2_0
+		[Test]
+		public void BindToMethod_ByRef ()
+		{
+			Type type = typeof (ByRefMatch);
+			BindingFlags flags = BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance;
+			MethodBase [] match;
+			object [] args = new object [] { 5 };
+			object state;
+			MethodBase selected;
+			CultureInfo culture = CultureInfo.InvariantCulture;
+
+			MethodInfo mi_run = type.GetMethod ("Run", flags, binder,
+				new Type [] { typeof (int) }, null);
+			Assert.IsFalse (mi_run.GetParameters () [0].ParameterType.IsByRef, "#A1");
+			MethodInfo mi_run_ref = type.GetMethod ("Run", flags, binder,
+				new Type [] { typeof (int).MakeByRefType () }, null);
+			Assert.IsTrue (mi_run_ref.GetParameters () [0].ParameterType.IsByRef, "#A2");
+
+			match = new MethodBase [] { mi_run };
+			selected = binder.BindToMethod (flags, match, ref args, null, culture,
+				null, out state);
+			Assert.AreSame (mi_run, selected, "#1");
+
+			match = new MethodBase [] { mi_run_ref };
+			selected = binder.BindToMethod (flags, match, ref args, null, culture,
+				null, out state);
+			Assert.AreSame (mi_run_ref, selected, "#2");
+
+			match = new MethodBase [] { mi_run, mi_run_ref };
+			selected = binder.BindToMethod (flags, match, ref args, null, culture,
+				null, out state);
+			Assert.AreSame (mi_run, selected, "#3");
+
+			match = new MethodBase [] { mi_run_ref, mi_run };
+			selected = binder.BindToMethod (flags, match, ref args, null, culture,
+				null, out state);
+			Assert.AreSame (mi_run, selected, "#4");
+		}
+#endif
+
 		[Test] // bug #41691
 		public void BindToMethodNamedArgs ()
 		{
@@ -474,6 +559,175 @@ namespace MonoTests.System.Reflection
             MethodInfo mi = type.GetMethod ("Bug380361", BindingFlags.NonPublic | BindingFlags.Instance, binder, new Type [] { typeof (MyEnum) }, null);
             mi.Invoke (this, new object [] { (long)MyEnum.Zero });
         }
-    }
+
+		class AssertingBinder : Binder {
+
+			public static readonly AssertingBinder Instance = new AssertingBinder ();
+
+			public override FieldInfo BindToField (BindingFlags bindingAttr, FieldInfo [] match, object value, CultureInfo culture)
+			{
+				Assert.IsNotNull (match);
+
+				return Type.DefaultBinder.BindToField (bindingAttr, match, value, culture);
+			}
+
+			public override MethodBase BindToMethod (BindingFlags bindingAttr, MethodBase [] match, ref object [] args, ParameterModifier [] modifiers, CultureInfo culture, string [] names, out object state)
+			{
+				Assert.IsNotNull (match);
+				Assert.IsNotNull (args);
+
+				return Type.DefaultBinder.BindToMethod (bindingAttr, match, ref args, modifiers, culture, names, out state);
+			}
+
+			public override object ChangeType (object value, Type type, CultureInfo culture)
+			{
+				Assert.IsNotNull (value);
+				Assert.IsNotNull (type);
+
+				return Type.DefaultBinder.ChangeType (value, type, culture);
+			}
+
+			public override void ReorderArgumentArray (ref object [] args, object state)
+			{
+				Assert.IsNotNull (args);
+
+				Type.DefaultBinder.ReorderArgumentArray (ref args, state);
+			}
+
+			public override MethodBase SelectMethod (BindingFlags bindingAttr, MethodBase [] match, Type [] types, ParameterModifier [] modifiers)
+			{
+				Assert.IsNotNull (match);
+				Assert.IsNotNull (types);
+
+				return Type.DefaultBinder.SelectMethod (bindingAttr, match, types, modifiers);
+			}
+
+			public override PropertyInfo SelectProperty (BindingFlags bindingAttr, PropertyInfo [] match, Type returnType, Type [] indexes, ParameterModifier [] modifiers)
+			{
+				Assert.IsNotNull (match);
+
+				return Type.DefaultBinder.SelectProperty (bindingAttr, match, returnType, indexes, modifiers);
+			}
+		}
+
+		class BaseFoo {
+			public void Bar ()
+			{
+			}
+
+			public int Add(int x, int y)
+			{
+				return x + y;	
+			}
+		}
+
+		class Foo : BaseFoo {
+
+			public bool Barred;
+
+			public new void Bar ()
+			{
+				Barred = true;
+			}
+		}
+
+		class ByRefMatch {
+			public void Run (int i)
+			{
+			}
+
+			public void Run (out int i)
+			{
+				i = 0;
+			}
+		}
+
+		[Test] // bug  #471257
+		public void TestCustomBinderNonNullArgs ()
+		{
+			var foo = new Foo ();
+
+			typeof (Foo).InvokeMember (
+				"Bar",
+				BindingFlags.InvokeMethod,
+				AssertingBinder.Instance,
+				foo,
+				null);
+
+			Assert.IsTrue (foo.Barred);
+		}
+
+		class Int32Binder : AssertingBinder
+		{
+			public override object ChangeType(Object value, Type type, CultureInfo ci)
+			{
+				if (value.GetType() == type) {
+					return value;
+				} else if (type.IsPrimitive) {
+					if (type == typeof(Int32))
+						return Convert.ToInt32(value);
+
+					throw new ArgumentException("missing support for primitive: " + type);
+				}
+
+				throw new ArgumentException("Could not ChangeType to " + type.FullName);
+			}
+		}
+
+		[Test]
+		[ExpectedException(typeof (TargetParameterCountException))]
+		public void TestTargetParameterCountExceptionA ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), 0, null, null, null);
+		}
+
+		[Test]
+		[ExpectedException(typeof (TargetParameterCountException))]
+		public void TestTargetParameterCountExceptionB ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke(new Foo (), 0, null, new object [] {1}, null);
+		}
+
+		[Test]
+		public void TestBindingFlagsA ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), 0, null, new object [] {1, 2}, null);
+		}
+
+		[Test]
+		[ExpectedException(typeof (ArgumentException))]
+		public void TestBindingFlagsB ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), 0, null, new object [] {1, "2"}, null);
+		}
+
+		[Test]
+		public void TestBindingFlagsExactBindingA ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), BindingFlags.ExactBinding, null, new object [] {1, 2}, null);
+		}
+
+		/*
+		[Test]
+		[ExpectedException(typeof (ArgumentException))]
+		public void TestBindingFlagsExactBindingB ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), BindingFlags.ExactBinding, new Int32Binder (), new object [] {1, "2"}, null);
+		}
+		*/
+
+		[Test]
+		public void TestBindingFlagsExactBindingC ()
+		{
+			MethodInfo method = typeof (Foo).GetMethod ("Add");
+			method.Invoke((new Foo ()), 0, new Int32Binder (), new object [] {1, "2"}, null);
+		}
+	}
 }
 
diff --git a/mcs/class/corlib/Test/System.Reflection/ChangeLog b/mcs/class/corlib/Test/System.Reflection/ChangeLog
index 685e6aa..a493331 100644
--- a/mcs/class/corlib/Test/System.Reflection/ChangeLog
+++ b/mcs/class/corlib/Test/System.Reflection/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-12  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* BinderTest.cs: Added SelectMethod/BindToMethod tests for methods
+	with byref arguments.
+
 2009-05-03  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* MethodInfoTest.cs: Add test cases from Joachim Ante for bug
diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/ChangeLog b/mcs/class/corlib/Test/System.Runtime.CompilerServices/ChangeLog
index ba64cde..a044d51 100644
--- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/ChangeLog
+++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* RuntimeHelpers.cs: Add missing validations
+	[Backport up to r144208]
+
 2006-11-01  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* RuntimeWrappedExceptionCas.cs: New. CAS tests for 
diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs
index 8197f26..e7e9199 100644
--- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs
+++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/RuntimeHelpersTest.cs
@@ -13,7 +13,7 @@ using NUnit.Framework;
 namespace MonoTests.System.Runtime.CompilerServices {
 
 	[TestFixture]
-	public class RuntimeHelpersTest : Assertion {
+	public class RuntimeHelpersTest {
 	    struct FooStruct {
 			public int i;
 			public string j;
@@ -23,7 +23,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
 			}
 
 			public override bool Equals (object o) {
-				Fail ();
+				Assert.Fail ();
 				return false;
 			}
 		}
@@ -40,16 +40,16 @@ namespace MonoTests.System.Runtime.CompilerServices {
 			}
 
 			public override bool Equals (object o) {
-				Fail ();
+				Assert.Fail ();
 				return true;
 			}
 		}
 
 		public void TestOffsetToStringData () 
 		{
-			AssertEquals ("OffsetToStringData is not constant",
+			Assert.AreEqual (
 						  RuntimeHelpers.OffsetToStringData,
-						  RuntimeHelpers.OffsetToStringData);
+						  RuntimeHelpers.OffsetToStringData, "OffsetToStringData is not constant");
 		}
 
 		public void TestGetObjectValue ()
@@ -58,13 +58,11 @@ namespace MonoTests.System.Runtime.CompilerServices {
 			FooStruct s2;
 
 			// Test null
-			AssertEquals ("",
-						  RuntimeHelpers.GetObjectValue (null),
+			Assert.AreEqual (RuntimeHelpers.GetObjectValue (null),
 						  null);
 			
 			// Test non-valuetype
-			AssertEquals ("",
-						  RuntimeHelpers.GetObjectValue (this),
+			Assert.AreEqual (RuntimeHelpers.GetObjectValue (this),
 						  this);
 
 			// Test valuetype
@@ -73,34 +71,102 @@ namespace MonoTests.System.Runtime.CompilerServices {
 			s2 = (FooStruct)RuntimeHelpers.GetObjectValue(s1);
 			s1.i = 43;
 			s1.j = "BAR";
-			AssertEquals ("", s2.i, 42);
-			AssertEquals ("", s2.j, "FOO");
+			Assert.AreEqual (s2.i, 42);
+			Assert.AreEqual (s2.j, "FOO");
 		}
 
 		public void TestRunClassConstructor ()
 		{
 			RuntimeHelpers.RunClassConstructor (typeof(FooClass).TypeHandle);
-			AssertEquals ("", FooClass.counter, 1);
+			Assert.AreEqual (FooClass.counter, 1);
 
 			// Each static constructor should only be run once
 			RuntimeHelpers.RunClassConstructor (typeof(FooClass).TypeHandle);
-			AssertEquals ("", FooClass.counter, 1);
+			Assert.AreEqual (FooClass.counter, 1);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void RunClassConstructor_Default ()
+		{
+			RuntimeTypeHandle rth = new RuntimeTypeHandle ();
+			Assert.AreEqual (IntPtr.Zero, rth.Value, "Value");
+			RuntimeHelpers.RunClassConstructor (rth);
+		}
+
+		static RuntimeTypeHandle handle;
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void RunClassConstructor_Uninitialized ()
+		{
+			RuntimeHelpers.RunClassConstructor (handle);
+		}
+
+		class Thrower {
+			static Thrower ()
+			{
+				throw new NotFiniteNumberException ();
+			}
+		}
+
+		[Test]
+		[ExpectedException (typeof (TypeInitializationException))]
+		public void RunClassConstructor_Throw ()
+		{
+			RuntimeHelpers.RunClassConstructor (typeof (Thrower).TypeHandle);
+		}
+
+		class Fielder {
+			public byte [] array = new byte [1];
+		}
+
+		static RuntimeFieldHandle rfh = typeof (Fielder).GetField ("array").FieldHandle;
+		static RuntimeFieldHandle static_rfh;
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void InitializeArray_Null ()
+		{
+			RuntimeHelpers.InitializeArray (null, rfh);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void InitializeArray_Default ()
+		{
+			RuntimeFieldHandle h = new RuntimeFieldHandle ();
+			RuntimeHelpers.InitializeArray (new Fielder ().array, h);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentNullException))]
+		public void InitializeArray_Uninitialized ()
+		{
+			RuntimeHelpers.InitializeArray (new Fielder ().array, static_rfh);
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentException))]
+		public void InitializeArray ()
+		{
+			RuntimeHelpers.InitializeArray (new Fielder ().array, rfh);
 		}
 
 #if NET_1_1
 		public void TestGetHashCode ()
 		{
-			AssertEquals ("Null has hash code 0", 0, RuntimeHelpers.GetHashCode (null));
+			Assert.AreEqual (0, RuntimeHelpers.GetHashCode (null));
 			object o = new object ();
-			AssertEquals ("", o.GetHashCode (), RuntimeHelpers.GetHashCode (o));
-			Assert ("", 5 != RuntimeHelpers.GetHashCode (new FooClass ()));
+			Assert.AreEqual (o.GetHashCode (), RuntimeHelpers.GetHashCode (o));
+			Assert.IsTrue (5 != RuntimeHelpers.GetHashCode (new FooClass ()));
 		}			
 
 		public void TestEquals ()
 		{
-			Assert (RuntimeHelpers.Equals (null, null));
-			Assert (!RuntimeHelpers.Equals (new object (), null));
-			Assert (!RuntimeHelpers.Equals (null, new object ()));
+			Assert.IsTrue (RuntimeHelpers.Equals (null, null));
+			Assert.IsTrue (!RuntimeHelpers.Equals (new object (), null));
+			Assert.IsTrue (!RuntimeHelpers.Equals (null, new object ()));
 
 			FooStruct f1 = new FooStruct ();
 			f1.i = 5;
@@ -110,11 +176,11 @@ namespace MonoTests.System.Runtime.CompilerServices {
 			object o2 = o1;
 			object o3 = f2;
 			object o4 = "AAA";
-			Assert (RuntimeHelpers.Equals (o1, o2));
+			Assert.IsTrue (RuntimeHelpers.Equals (o1, o2));
 
 			// This should do a bit-by-bit comparison for valuetypes
-			Assert (RuntimeHelpers.Equals (o1, o3));
-			Assert (!RuntimeHelpers.Equals (o1, o4));
+			Assert.IsTrue (RuntimeHelpers.Equals (o1, o3));
+			Assert.IsTrue (!RuntimeHelpers.Equals (o1, o4));
 		}
 #endif
 	}
diff --git a/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog b/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
index 2e9d53b..1d48ccc 100644
--- a/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
+++ b/mcs/class/corlib/Test/System.Runtime.InteropServices/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* GCHandleTest.cs: Add more test cases for validations
+	[Backport up to r144204]
+
 2008-06-21  Gert Driesen  <drieseng at users.sourceforge.net>
 
 	* MarshalTest.cs: Added tests for GetHINSTANCE. Improved existing
diff --git a/mcs/class/corlib/Test/System.Runtime.InteropServices/GCHandleTest.cs b/mcs/class/corlib/Test/System.Runtime.InteropServices/GCHandleTest.cs
index 9ae2d85..98e99c7 100644
--- a/mcs/class/corlib/Test/System.Runtime.InteropServices/GCHandleTest.cs
+++ b/mcs/class/corlib/Test/System.Runtime.InteropServices/GCHandleTest.cs
@@ -4,7 +4,7 @@
 // Authors:
 // 	Paolo Molaro (lupus at ximian.com)
 //
-// (c) 2005 Novell, Inc. (http://www.novell.com)
+// Copyright (C) 2005, 2009 Novell, Inc (http://www.novell.com)
 //
 
 using NUnit.Framework;
@@ -14,21 +14,39 @@ using System.Runtime.InteropServices;
 namespace MonoTests.System.Runtime.InteropServices
 {
 	[TestFixture]
-	public class GCHandleTest : Assertion
+	public class GCHandleTest
 	{
 		static GCHandle handle;
 
 		[Test]
-		public void DefaultZeroValue ()
+		public void DefaultZeroValue_Allocated ()
 		{
-			AssertEquals (false, handle.IsAllocated);
+			Assert.IsFalse (handle.IsAllocated, "IsAllocated");
+		}
+
+		[Test]
+		[ExpectedException (typeof (InvalidOperationException))]
+		public void DefaultZeroValue_Target ()
+		{
+			Assert.IsNull (handle.Target, "Target");
 		}
 
 		[Test]
 		public void AllocNull ()
 		{
-			IntPtr ptr = (IntPtr)GCHandle.Alloc(null);
-			GCHandle gch = (GCHandle)ptr;
+			IntPtr ptr = (IntPtr) GCHandle.Alloc (null);
+			Assert.IsFalse (ptr == IntPtr.Zero, "ptr");
+			GCHandle gch = (GCHandle) ptr;
+			Assert.IsTrue (gch.IsAllocated, "IsAllocated");
+			Assert.IsNull (gch.Target, "Target");
+		}
+
+		[Test]
+		public void AllocNullWeakTrack ()
+		{
+			GCHandle gch = GCHandle.Alloc (null, GCHandleType.WeakTrackResurrection);
+			Assert.IsTrue (gch.IsAllocated, "IsAllocated");
+			Assert.IsNull (gch.Target, "Target");
 		}
 
 		[Test]
@@ -76,12 +94,35 @@ namespace MonoTests.System.Runtime.InteropServices
 			GCHandle handle = GCHandle.Alloc (null, GCHandleType.Pinned);
 			try {
 				IntPtr ptr = handle.AddrOfPinnedObject();
-				AssertEquals (new IntPtr (0), ptr);
+				Assert.AreEqual (new IntPtr (0), ptr);
 			}
 			finally {
 				handle.Free();
 			}
 		}
+
+		[Test]
+		[Ignore ("throw non-catchable ExecutionEngineException")]
+		[ExpectedException (typeof (ExecutionEngineException))]
+		public void AllocMinusOne ()
+		{
+			// -1 is a special value used by the mono runtime
+			// looks like it's special too in MS CLR (since it will crash)
+			GCHandle.Alloc (null, (GCHandleType) (-1));
+		}
+
+		[Test]
+		public void AllocInvalidType ()
+		{
+			GCHandle gch = GCHandle.Alloc (null, (GCHandleType) Int32.MinValue);
+			try {
+				Assert.IsTrue (gch.IsAllocated, "IsAllocated");
+				Assert.IsNull (gch.Target, "Target");
+			}
+			finally {
+				gch.Free ();
+			}
+		}
 	}
 }
 
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog b/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
index 21684a4..ad2a6fe 100644
--- a/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
+++ b/mcs/class/corlib/Test/System.Security.Cryptography/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-07  Sebastien Pouliot  <sebastien at ximian.com> 
+
+	* CryptoStreamTest.cs: Make latest test cases compilable using
+	older 2.4 mcs (which does not support automatically implemented 
+	properties and implicitly typed arrays)implicitly typed arrays
+
+2009-09-22  Sebastien Pouliot  <sebastien at ximian.com> 
+
+	* CryptoStreamTest.cs: Add (nunit-ized) test cases provided by
+	Santa Marta (via Atsushi) as repro for bugs #539288 and #539229
+
+2009-09-22  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* CryptoStreamTest.cs: Convert to newer nunit syntax
+
 2008-09-17  Sebastien Pouliot  <sebastien at ximian.com>
 
 	* CryptoConfigTest.cs: Add test cases for HMAC URI.
diff --git a/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs b/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs
index 3fba4b2..8c0e2fd 100644
--- a/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs
+++ b/mcs/class/corlib/Test/System.Security.Cryptography/CryptoStreamTest.cs
@@ -139,7 +139,7 @@ namespace MonoTests.System.Security.Cryptography {
 	}
 
 	[TestFixture]
-	public class CryptoStreamTest : Assertion {
+	public class CryptoStreamTest {
 
 		Stream readStream;
 		Stream writeStream;
@@ -162,7 +162,7 @@ namespace MonoTests.System.Security.Cryptography {
 
 		public void AssertEquals (string msg, byte[] array1, byte[] array2)
 		{
-			AllTests.AssertEquals (msg, array1, array2);
+			Assert.AreEqual (array1, array2, msg);
 		}
 
 		[Test]
@@ -186,9 +186,9 @@ namespace MonoTests.System.Security.Cryptography {
 		public void StreamReadModeRead () 
 		{
 			cs = new CryptoStream (readStream, encryptor, CryptoStreamMode.Read);
-			Assert ("Read.CanRead", cs.CanRead);
-			Assert ("Read.CanWrite", !cs.CanWrite);
-			Assert ("Read.CanSeek", !cs.CanSeek);
+			Assert.IsTrue (cs.CanRead, "Read.CanRead");
+			Assert.IsFalse (cs.CanWrite, "Read.CanWrite");
+			Assert.IsFalse (cs.CanSeek, "Read.CanSeek");
 		}
 
 		[Test]
@@ -217,9 +217,9 @@ namespace MonoTests.System.Security.Cryptography {
 		public void StreamWriteModeWrite () 
 		{
 			cs = new CryptoStream (writeStream, encryptor, CryptoStreamMode.Write);
-			Assert ("Read.CanRead", !cs.CanRead);
-			Assert ("Read.CanWrite", cs.CanWrite);
-			Assert ("Read.CanSeek", !cs.CanSeek);
+			Assert.IsFalse (cs.CanRead, "Read.CanRead");
+			Assert.IsTrue (cs.CanWrite, "Read.CanWrite");
+			Assert.IsFalse (cs.CanSeek, "Read.CanSeek");
 		}
 
 		[Test]
@@ -328,7 +328,7 @@ namespace MonoTests.System.Security.Cryptography {
 				byte[] buffer = new byte [8];
 				cs = new CryptoStream (s, encryptor, CryptoStreamMode.Read);
 				cs.Clear ();
-				AssertEquals ("Read from disposed", 0, cs.Read (buffer, 0, 8));
+				Assert.AreEqual (0, cs.Read (buffer, 0, 8), "Read from disposed");
 			}
 		}
 
@@ -348,7 +348,7 @@ namespace MonoTests.System.Security.Cryptography {
 				byte[] buffer = new byte [8];
 				cs = new CryptoStream (s, encryptor, CryptoStreamMode.Read);
 				int len = cs.Read (buffer, 0, 4);
-				AssertEquals ("Read 4", 4, len);
+				Assert.AreEqual (4, len, "Read 4");
 				cs.Clear ();
 				len = cs.Read (buffer, 3, 4);
 			}
@@ -377,7 +377,7 @@ namespace MonoTests.System.Security.Cryptography {
 			byte[] buffer = new byte [0];
 			cs = new CryptoStream (readStream, encryptor, CryptoStreamMode.Read);
 			int len = cs.Read (buffer, 0, 0);
-			AssertEquals ("Read 0", 0, len);
+			Assert.AreEqual (0, len, "Read 0");
 		}
 
 		[Test]
@@ -395,7 +395,7 @@ namespace MonoTests.System.Security.Cryptography {
 			byte[] buffer = new byte [8];
 			cs = new CryptoStream (readStream, encryptor, CryptoStreamMode.Read);
 			int len = cs.Read (buffer, 0, 0);
-			AssertEquals ("Read 0", 0, len);
+			Assert.AreEqual (0, len, "Read 0");
 		}
 
 		[Test]
@@ -552,8 +552,8 @@ namespace MonoTests.System.Security.Cryptography {
 				CryptoStream cr = new CryptoStream (mem2, aes.CreateDecryptor (), CryptoStreamMode.Read);
 				int len = cr.Read (buffer, 0, buffer.Length);
 				cr.Close ();
-				AssertEquals ("Full Length Read", 34, len);
-				AssertEquals ("Full Block Read", "Please encode me!", Encoding.Unicode.GetString (buffer, 0, len));
+				Assert.AreEqual (34, len, "Full Length Read");
+				Assert.AreEqual ("Please encode me!", Encoding.Unicode.GetString (buffer, 0, len), "Full Block Read");
 			}
 		}
 
@@ -577,8 +577,8 @@ namespace MonoTests.System.Security.Cryptography {
 				int len = cr.Read (buffer, 0, 20);
 				cr.Clear ();
 				cr.Close ();
-				AssertEquals ("Partial Length Read", 20, len);
-				AssertEquals ("Partial Block Read", "Please enc", Encoding.Unicode.GetString (buffer, 0, len));
+				Assert.AreEqual (20, len, "Partial Length Read");
+				Assert.AreEqual ("Please enc", Encoding.Unicode.GetString (buffer, 0, len), "Partial Block Read");
 	                }
 		}
 
@@ -596,7 +596,7 @@ namespace MonoTests.System.Security.Cryptography {
 			enc.Write (data, 0, 2200);
 			enc.FlushFinalBlock ();
 			msin.Position = 0;
-			AssertEquals ("Encryped Write Length", 2208, msin.Length); // 2200 + padding
+			Assert.AreEqual (2208, msin.Length, "Encryped Write Length"); // 2200 + padding
 
 			MemoryStream msout = new MemoryStream ();
 			msout.SetLength (0);
@@ -612,14 +612,14 @@ namespace MonoTests.System.Security.Cryptography {
 				readlen += len;
 				len = msin.Read (tmp, 0, 1024);
 			}
-			AssertEquals ("Decryped Write Length", 2200, msout.Length);
+			Assert.AreEqual (2200, msout.Length, "Decryped Write Length");
 
 			dec.Close ();
 			dec.Clear ();
 			msout.Close ();
 			msin.Close ();
 
-			AssertEquals ("Read Length", 2208, readlen); // 2200 + padding
+			Assert.AreEqual (2208, readlen, "Read Length"); // 2200 + padding
 		}
 
 		[Test]
@@ -640,31 +640,31 @@ namespace MonoTests.System.Security.Cryptography {
 				string result = BitConverter.ToString (msin.ToArray ());
 				switch (i) {
 					case 0:
-						AssertEquals (msg, "92-C9-DB-45-30-0B-93-2F", result); 
+						Assert.AreEqual ("92-C9-DB-45-30-0B-93-2F", result, msg); 
 						break;
 					case 1:
-						AssertEquals (msg, "08-CF-A1-37-BD-56-D0-65", result); 
+						Assert.AreEqual ("08-CF-A1-37-BD-56-D0-65", result, msg); 
 						break;
 					case 2:
-						AssertEquals (msg, "58-87-D4-9B-2C-27-97-0C", result); 
+						Assert.AreEqual ("58-87-D4-9B-2C-27-97-0C", result, msg); 
 						break;
 					case 3:
-						AssertEquals (msg, "07-35-90-94-68-7D-51-FB", result); 
+						Assert.AreEqual ("07-35-90-94-68-7D-51-FB", result, msg); 
 						break;
 					case 4:
-						AssertEquals (msg, "BF-00-98-C5-20-71-D0-DB", result); 
+						Assert.AreEqual ("BF-00-98-C5-20-71-D0-DB", result, msg); 
 						break;
 					case 5:
-						AssertEquals (msg, "1A-55-C8-6E-C1-9B-31-82", result); 
+						Assert.AreEqual ("1A-55-C8-6E-C1-9B-31-82", result, msg); 
 						break;
 					case 6:
-						AssertEquals (msg, "2D-2B-76-41-61-0E-00-0C", result); 
+						Assert.AreEqual ("2D-2B-76-41-61-0E-00-0C", result, msg); 
 						break;
 					case 7:
-						AssertEquals (msg, "DC-FF-73-D2-7F-D7-48-5D", result); 
+						Assert.AreEqual ("DC-FF-73-D2-7F-D7-48-5D", result, msg); 
 						break;
 					case 8:
-						AssertEquals (msg, "E1-B2-46-E5-A7-C7-4C-BC-0E-40-4A-FC-08-92-B1-EB", result); 
+						Assert.AreEqual ("E1-B2-46-E5-A7-C7-4C-BC-0E-40-4A-FC-08-92-B1-EB", result, msg); 
 						break;
 				}
 			}
@@ -688,7 +688,7 @@ namespace MonoTests.System.Security.Cryptography {
 		public void EmptyStreamWithPaddingNone () 
 		{
 			byte[] result = EmptyStream (PaddingMode.None);
-			AssertEquals ("Result Length", 0, result.Length);
+			Assert.AreEqual (0, result.Length, "Result Length");
 		}
 
 		[Test]
@@ -696,15 +696,15 @@ namespace MonoTests.System.Security.Cryptography {
 		{
 			byte[] expected = { 0x07, 0xFE, 0xEF, 0x74, 0xE1, 0xD5, 0x03, 0x6E, 0x90, 0x0E, 0xEE, 0x11, 0x8E, 0x94, 0x92, 0x93 };
 			byte[] result = EmptyStream (PaddingMode.PKCS7);
-			AssertEquals ("Result Length", 16, result.Length);
-			AssertEquals ("Result", expected, result);
+			Assert.AreEqual (16, result.Length, "Result Length");
+			Assert.AreEqual (expected, result, "Result");
 		}
 
 		[Test]
 		public void EmptyStreamWithPaddingZeros () 
 		{
 			byte[] result = EmptyStream (PaddingMode.Zeros);
-			AssertEquals ("Result Length", 0, result.Length);
+			Assert.AreEqual (0, result.Length, "Result Length");
 		}
 
 		// bugzilla: 49323 (adapted from test case by Carlos Guzmán Álvarez)
@@ -731,7 +731,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 			byte[] encrypted = ms.ToArray ();
 			byte[] expected = new byte[] { 0x9c, 0x99, 0x56, 0x8e, 0x75, 0x3e, 0x02, 0x95, 0x5b, 0x5c, 0x46, 0x8b, 0xcf, 0xf8, 0x27, 0x21, 0x53, 0x5f, 0x3d, 0xd8, 0x16, 0x95, 0x82, 0x3d, 0x88, 0x9b, 0x9a, 0x47, 0xda, 0x97, 0x90, 0x86, 0x50, 0x0e, 0x48, 0xee, 0xe7, 0x9b, 0x25, 0x41 };
-			AssertEquals ("MultiblocksWithPartial", expected, encrypted);
+			Assert.AreEqual (expected, encrypted, "MultiblocksWithPartial");
 		}
 
 		// Adapted from Subba Rao Thirumoorthy email on mono-devel-list (december 2003)
@@ -755,10 +755,10 @@ namespace MonoTests.System.Security.Cryptography {
 			}
 			CryptStream.FlushFinalBlock ();
 			// we must ensure that the result is correct
-			AssertEquals ("Length(final)", 64, len);
+			Assert.AreEqual (64, len, "Length(final)");
 			byte[] result = stream.ToArray ();
 			string end = BitConverter.ToString (result, 65520, 16);
-			AssertEquals ("End part", "04-70-19-1D-28-C5-BD-9A-23-C6-60-E2-28-96-38-65", end);
+			Assert.AreEqual ("04-70-19-1D-28-C5-BD-9A-23-C6-60-E2-28-96-38-65", end, "End part");
 
 			CryptStream.Close();
 			stream.Close();
@@ -799,11 +799,11 @@ namespace MonoTests.System.Security.Cryptography {
 			RijndaelManaged aes = new RijndaelManaged ();
 			ICryptoTransform encryptor = aes.CreateEncryptor (key, iv);
 			byte[] encdata = NonMultipleOfBlockSize_Encrypt (encryptor, data);
-			AssertEquals ("Encrypted Data Length", (data.Length + (aes.BlockSize >> 3)), encdata.Length);
+			Assert.AreEqual ((data.Length + (aes.BlockSize >> 3)), encdata.Length, "Encrypted Data Length");
 			
 			ICryptoTransform decryptor = aes.CreateDecryptor (key, iv);
 			byte[] decdata = NonMultipleOfBlockSize_Decrypt (decryptor, encdata);
-			AssertEquals ("Decrypted Data Length", data.Length, decdata.Length);
+			Assert.AreEqual (data.Length, decdata.Length, "Decrypted Data Length");
 
 			int i = 0;
 			bool b = true;
@@ -811,7 +811,7 @@ namespace MonoTests.System.Security.Cryptography {
 				b = (data [i] == decdata [i]);
 				i++;
 			}
-			Assert ("NonMultipleOfBlockSize", b);
+			Assert.IsTrue (b, "NonMultipleOfBlockSize");
 		}
 
 		// bugzilla: 51322 - indirectly related but it explains why my first (unapplied) patch didn't work
@@ -833,8 +833,8 @@ namespace MonoTests.System.Security.Cryptography {
 			cs = new CryptoStream (decrypted, des.CreateDecryptor (key, iv), CryptoStreamMode.Read);
 			int len = cs.Read (data, 0, data.Length);
 			cs.Close ();
-			AssertEquals ("Length", 12, len);
-			AssertEquals ("Unicode DES Roundtrip", "ximian", Encoding.Unicode.GetString (data, 0, len));
+			Assert.AreEqual (12, len, "Length");
+			Assert.AreEqual ("ximian", Encoding.Unicode.GetString (data, 0, len), "Unicode DES Roundtrip");
 		}
 
 #if NET_2_0
@@ -857,11 +857,11 @@ namespace MonoTests.System.Security.Cryptography {
 			DebugStream decrypted = new DebugStream (data);
 			cs = new CryptoStream (decrypted, des.CreateDecryptor (key, iv), CryptoStreamMode.Read);
 			int len = cs.Read (data, 0, 6);
-			AssertEquals ("Length (1st pass)", 6, len);
-			AssertEquals ("Partial DES Roundtrip", "xim", Encoding.Unicode.GetString (data, 0, len));
+			Assert.AreEqual (6, len, "Length (1st pass)");
+			Assert.AreEqual ("xim", Encoding.Unicode.GetString (data, 0, len), "Partial DES Roundtrip");
 			len += cs.Read (data, 6, 8);
-			AssertEquals ("Length (1st+2nd)", 12, len);
-			AssertEquals ("Full DES Roundtrip", "ximian", Encoding.Unicode.GetString (data, 0, len));
+			Assert.AreEqual (12, len, "Length (1st+2nd)");
+			Assert.AreEqual ("ximian", Encoding.Unicode.GetString (data, 0, len), "Full DES Roundtrip");
 			cs.Close ();
 		}
 
@@ -886,7 +886,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 
 			byte[] result = encrypted.ToArray ();
-			AssertEquals ("Encrypted", "18-EA-93-3F-20-86-D2-AA-78-02-D7-6F-E4-47-17-9C", BitConverter.ToString (result));
+			Assert.AreEqual ("18-EA-93-3F-20-86-D2-AA-78-02-D7-6F-E4-47-17-9C", BitConverter.ToString (result), "Encrypted");
 
 			encrypted = new DebugStream (result);
 			DebugStream decrypted = new DebugStream ();
@@ -897,7 +897,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 			decrypted.Close ();
 
-			AssertEquals ("W/R Byte Roundtrip", "ximian", Encoding.Unicode.GetString (decrypted.ToArray ()));
+			Assert.AreEqual ("ximian", Encoding.Unicode.GetString (decrypted.ToArray ()), "W/R Byte Roundtrip");
 		}
 
 		// based http://www.4guysfromrolla.com/webtech/090501-1.shtml
@@ -950,218 +950,218 @@ namespace MonoTests.System.Security.Cryptography {
 			string data = sb.ToString ();
 			string encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			string decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "9YVfvrh5yj0=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("9YVfvrh5yj0=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "qNe4d0UlkU8=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("qNe4d0UlkU8=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "OcernYAQ1NAME/Gny+ZuaA==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("OcernYAQ1NAME/Gny+ZuaA==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "H5UveR2lds1T+IWN4pks2Q==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("H5UveR2lds1T+IWN4pks2Q==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "dDQ3HAVtTbiRwwUqWANaeA==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("dDQ3HAVtTbiRwwUqWANaeA==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "At1r7dVDjJlQidf4QzCNkw==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("At1r7dVDjJlQidf4QzCNkw==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "DFDJWJGaNrFVBDXovsq1ew==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("DFDJWJGaNrFVBDXovsq1ew==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "gM040QGMPOBj3u1lEK4XHQ==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("gM040QGMPOBj3u1lEK4XHQ==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "P5hRUhrxOWFX0ER/IjJL/Q==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("P5hRUhrxOWFX0ER/IjJL/Q==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "uDIaQ1uXtWUIboGFLt306Q==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("uDIaQ1uXtWUIboGFLt306Q==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "giJKTXfad5Z8hebhXtYZ4hmKX/EC8w6x", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("giJKTXfad5Z8hebhXtYZ4hmKX/EC8w6x", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "lBehBplIrjjrlIrMjYcNz1DOoXLHjZdn", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("lBehBplIrjjrlIrMjYcNz1DOoXLHjZdn", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "2elWrUnjmsAOpo2s4voJyZXEJ/rtKB7P", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("2elWrUnjmsAOpo2s4voJyZXEJ/rtKB7P", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "GB3BaIZGf9K+T82j7T8Fri2rQ2/YUdSe", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("GB3BaIZGf9K+T82j7T8Fri2rQ2/YUdSe", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "Gc+wkJL+CVjdJchgcIoi8dkH2BVpHJgB", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("Gc+wkJL+CVjdJchgcIoi8dkH2BVpHJgB", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "loeuyII/PvWb91M4pFVkyaPxQoQVYpNb", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("loeuyII/PvWb91M4pFVkyaPxQoQVYpNb", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "PHXmi/sxNIgApXAfdm+Bf54/nCM//N8o", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("PHXmi/sxNIgApXAfdm+Bf54/nCM//N8o", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "xpb+wj/8LmH2ScTg3OU4JOsE5Owj6flF", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("xpb+wj/8LmH2ScTg3OU4JOsE5Owj6flF", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "WJz4VfsZ2emzhYWoSf+PNBDpHooxEregqMWnzm4gcqU=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("WJz4VfsZ2emzhYWoSf+PNBDpHooxEregqMWnzm4gcqU=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "PaouZu1iOKbCMRJSu04y/kB+TcOk4yp8K2BOGDs1PPE=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("PaouZu1iOKbCMRJSu04y/kB+TcOk4yp8K2BOGDs1PPE=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "qbTDs4dFy7eERdn5vV7JRPk2/m9smtwvZjA6+TmGlkI=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("qbTDs4dFy7eERdn5vV7JRPk2/m9smtwvZjA6+TmGlkI=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "f2FsphcpM7Fu90S5V17ptly44lL4GvFCCaFdnnU4twk=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("f2FsphcpM7Fu90S5V17ptly44lL4GvFCCaFdnnU4twk=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "imD+ntHsUmp9ALJedzC1JmAJY0r2O4KkP8271+XuG4g=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("imD+ntHsUmp9ALJedzC1JmAJY0r2O4KkP8271+XuG4g=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "80QLLUmHwx1fcEYGeFz1WXlS13kUy994sQLI6GhcjuM=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("80QLLUmHwx1fcEYGeFz1WXlS13kUy994sQLI6GhcjuM=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "DtIIlj8BCOppmIgQ9AEdUj7pBB49S/9Q38kbWLjwiVs=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("DtIIlj8BCOppmIgQ9AEdUj7pBB49S/9Q38kbWLjwiVs=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "LNkprYaaUFtyan204OzX+a2pzOb/Pg5WXzXJ6WWB1rQ=", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("LNkprYaaUFtyan204OzX+a2pzOb/Pg5WXzXJ6WWB1rQ=", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "FRgx9m2lT2PxtYSIdRwc+SznJetNiRk1MEIZDl3D13pvo2yOtJ1MSQ==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("FRgx9m2lT2PxtYSIdRwc+SznJetNiRk1MEIZDl3D13pvo2yOtJ1MSQ==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "V7JlnpJscrdIpX4z5S+/Q5WDjKzK4aB5TiqI3JZOYJ+KE1CWQNNeow==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("V7JlnpJscrdIpX4z5S+/Q5WDjKzK4aB5TiqI3JZOYJ+KE1CWQNNeow==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "wVwPv1c2KQynbwiOBCAhmQlReOQT52qFR34AX4dtjEeQ1oCQ1N1tHg==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("wVwPv1c2KQynbwiOBCAhmQlReOQT52qFR34AX4dtjEeQ1oCQ1N1tHg==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "Zi+G0yfmuFjSjP455pjVeKBDDWB4qvTb0K0h20UtflrYG6wcWqUzDw==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("Zi+G0yfmuFjSjP455pjVeKBDDWB4qvTb0K0h20UtflrYG6wcWqUzDw==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 
 			sb.Append ("a");
 			data = sb.ToString ();
 			encdata = EncryptData (des.CreateEncryptor (key, iv), data);
 			decdata = DecryptData (des.CreateDecryptor (key, iv), encdata);
-			AssertEquals ("Encrypt-" + data, "0hGoonZ8jrLhMNDKBuWrlvFnq15ZLvnyq+Ilq8r4aYUEDxttQMwi5w==", encdata);
-			AssertEquals ("Decrypt-" + data, data, decdata);
+			Assert.AreEqual ("0hGoonZ8jrLhMNDKBuWrlvFnq15ZLvnyq+Ilq8r4aYUEDxttQMwi5w==", encdata, "Encrypt-" + data);
+			Assert.AreEqual (data, decdata, "Decrypt-" + data);
 		}
 
 		// based on System.Security assembly XmlDsigBase64TransformTest
@@ -1182,7 +1182,7 @@ namespace MonoTests.System.Security.Cryptography {
 			byte[] encoded = debug.ToArray ();
 
 			string result = Encoding.UTF8.GetString (encoded);
-			AssertEquals ("FromBase64_Write", expected, result);
+			Assert.AreEqual (expected, result, "FromBase64_Write");
 		}
 
 		[Test]
@@ -1199,7 +1199,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 
 			string result = Encoding.UTF8.GetString (data, 0, length);
-			AssertEquals ("ToBase64_Read", "http://www.go-mono.com/", result);
+			Assert.AreEqual ("http://www.go-mono.com/", result, "ToBase64_Read");
 		}
 
 		[Test]
@@ -1215,7 +1215,7 @@ namespace MonoTests.System.Security.Cryptography {
 			byte[] encoded = debug.ToArray ();
 
 			string result = Encoding.UTF8.GetString (encoded);
-			AssertEquals ("ToBase64_Write", "aHR0cDovL3d3dy5nby1tb25vLmNvbS8=", result);
+			Assert.AreEqual ("aHR0cDovL3d3dy5nby1tb25vLmNvbS8=", result, "ToBase64_Write");
 		}
 
 		[Test]
@@ -1232,7 +1232,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 
 			string result = Encoding.UTF8.GetString (data, 0, length);
-			AssertEquals ("ToBase64_Read", "aHR0cDovL3d3dy5nby1tb25vLmNvbS8=", result);
+			Assert.AreEqual ("aHR0cDovL3d3dy5nby1tb25vLmNvbS8=", result, "ToBase64_Read");
 		}
 
 		// Cascaded CryptoStream - like sample in book .NET Framework Security, chapter 30
@@ -1256,9 +1256,9 @@ namespace MonoTests.System.Security.Cryptography {
 			csh.FlushFinalBlock ();
 
 			byte[] result = debug.ToArray ();
-			AssertEquals ("Encrypted", "8C-24-76-74-09-79-2B-D3-47-C3-32-F5-F3-1A-5E-57-04-33-2E-B8-50-77-B2-A1", BitConverter.ToString (result));
+			Assert.AreEqual ("8C-24-76-74-09-79-2B-D3-47-C3-32-F5-F3-1A-5E-57-04-33-2E-B8-50-77-B2-A1", BitConverter.ToString (result), "Encrypted");
 			byte[] digest = hash.Hash;
-			AssertEquals ("Hash", "71-04-12-D1-95-01-CF-F9-8D-8F-F8-0D-F9-AA-11-7D", BitConverter.ToString (digest));
+			Assert.AreEqual ("71-04-12-D1-95-01-CF-F9-8D-8F-F8-0D-F9-AA-11-7D", BitConverter.ToString (digest), "Hash");
 		}
 #if NET_2_0
 		[Category ("NotWorking")]
@@ -1283,9 +1283,9 @@ namespace MonoTests.System.Security.Cryptography {
 			csh.Close ();
                         
 			string result = Encoding.UTF8.GetString (data, 0, length);
-			AssertEquals ("Decrypted", "http://www.go-mono.com/", result);
+			Assert.AreEqual ("http://www.go-mono.com/", result, "Decrypted");
 			byte[] digest = hash.Hash;
-			AssertEquals ("Hash Validation", "71-04-12-D1-95-01-CF-F9-8D-8F-F8-0D-F9-AA-11-7D", BitConverter.ToString (digest));
+			Assert.AreEqual ("71-04-12-D1-95-01-CF-F9-8D-8F-F8-0D-F9-AA-11-7D", BitConverter.ToString (digest), "Hash Validation");
 		}
 
 		// bugzilla: 60573 - the number of block is not reduced for encryptors
@@ -1302,7 +1302,7 @@ namespace MonoTests.System.Security.Cryptography {
 
 			byte[] data = new byte [64];
 			cse.Write (data, 0, 64);
-			AssertEquals ("Length", 64, debug.Length);
+			Assert.AreEqual (64, debug.Length, "Length");
 			cse.Close ();
 		}
 
@@ -1318,7 +1318,7 @@ namespace MonoTests.System.Security.Cryptography {
 
 			byte[] data = new byte [64] { 0xE1, 0xB2, 0x46, 0xE5, 0xA7, 0xC7, 0x4C, 0xBC, 0xD5, 0xF0, 0x8E, 0x25, 0x3B, 0xFA, 0x23, 0x80, 0x03, 0x16, 0x18, 0x17, 0xA3, 0x59, 0xBA, 0xAC, 0xFC, 0x47, 0x57, 0x2A, 0xF9, 0x44, 0x07, 0x84, 0x20, 0x74, 0x06, 0x38, 0xC2, 0xF3, 0xA1, 0xCE, 0x8C, 0x73, 0xB1, 0xE3, 0x75, 0x03, 0x66, 0x89, 0xF0, 0x4E, 0x98, 0x68, 0xB1, 0xBD, 0x85, 0x25, 0xFF, 0x4B, 0x11, 0x74, 0xEF, 0x14, 0xC8, 0xE9 };
 			csd.Write (data, 0, 64);
-			AssertEquals ("Length", 56, debug.Length);
+			Assert.AreEqual (56, debug.Length, "Length");
 			// last block is kept for later processing
 		}
 
@@ -1339,7 +1339,7 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Write (Buffer, 0, 64);
 			cs.Close ();
 
-			AssertEquals ("Length", 64, cms.ToArray ().Length);
+			Assert.AreEqual (64, cms.ToArray ().Length, "Length");
 		}
 
 		private void WriteByte (PaddingMode mode, bool padded)
@@ -1362,7 +1362,7 @@ namespace MonoTests.System.Security.Cryptography {
 			byte[] result = cms.ToArray ();
 			// if padded then add one block, if not then it's the original length
 			int len = padded ? 80: 64;
-			AssertEquals (mode.ToString () + ".Encrypted.Length", len, result.Length);
+			Assert.AreEqual (len, result.Length, mode.ToString () + ".Encrypted.Length");
 
 			cms = new MemoryStream ();
 			ct = alg.CreateDecryptor (Key, IV);
@@ -1372,9 +1372,9 @@ namespace MonoTests.System.Security.Cryptography {
 			cs.Close ();
 
 			byte[] plaintext = cms.ToArray ();
-			AssertEquals (mode.ToString () + ".Decrypted.Length", 64, plaintext.Length);
+			Assert.AreEqual (64, plaintext.Length, mode.ToString () + ".Decrypted.Length");
 
-			AssertEquals (mode.ToString () + ".Date", Buffer, plaintext);
+			Assert.AreEqual (Buffer, plaintext, mode.ToString () + ".Date");
 		}
 
 		[Test]
@@ -1388,5 +1388,171 @@ namespace MonoTests.System.Security.Cryptography {
 			WriteByte (PaddingMode.ISO10126, true);
 #endif
 		}
+
+		class ExpandTransform : ICryptoTransform {
+
+			private bool can_transform_multiple_blocks;
+			private int output_block_size;
+
+			public bool CanReuseTransform {
+				get { return true; }
+			}
+
+			public bool CanTransformMultipleBlocks {
+				get { return can_transform_multiple_blocks; }
+				private set { can_transform_multiple_blocks = value; }
+			}
+
+			public int InputBlockSize {
+				get { return 1; }
+			}
+
+			public int OutputBlockSize {
+				get { return output_block_size; }
+				private set { output_block_size = value; }
+			}
+
+			public ExpandTransform (bool canTranformMultipleBlocks, int outputBlockSize)
+			{
+				this.CanTransformMultipleBlocks = canTranformMultipleBlocks;
+				this.OutputBlockSize = outputBlockSize;
+			}
+
+			public void Dispose ()
+			{
+			}
+
+			public int TransformBlock (byte [] inputBuffer, int inputOffset, int inputCount, byte [] outputBuffer, int outputOffset)
+			{
+				int ret = 0;
+				for (int i = 0; i < inputCount; i++, inputOffset++) {
+					for (int j = 0; j < OutputBlockSize; j++, outputOffset++, ret++) {
+						outputBuffer [outputOffset] = inputBuffer [inputOffset];
+					}
+				}
+				return ret;
+			}
+
+			public byte [] TransformFinalBlock (byte [] inputBuffer, int inputOffset, int inputCount)
+			{
+				byte[] outputBuffer = new byte [inputCount * OutputBlockSize];
+				TransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, 0);
+				return outputBuffer;
+			}
+		}
+
+		static string[] expand_values = {
+			"00-01-02-03-04-05-06-07",
+			"00-00-01-01-02-02-03-03-04-04-05-05-06-06-07-07",
+			"00-00-00-01-01-01-02-02-02-03-03-03-04-04-04-05-05-05-06-06-06-07-07-07",
+			"00-00-00-00-01-01-01-01-02-02-02-02-03-03-03-03-04-04-04-04-05-05-05-05-06-06-06-06-07-07-07-07",
+			"00-01-02-03-04-05-06-07",
+			"00-00-01-01-02-02-03-03-04-04-05-05-06-06-07-07",
+			"00-00-00-01-01-01-02-02-02-03-03-03-04-04-04-05-05-05-06-06-06-07-07-07",
+			"00-00-00-00-01-01-01-01-02-02-02-02-03-03-03-03-04-04-04-04-05-05-05-05-06-06-06-06-07-07-07-07"
+		};
+
+		[Test]
+		public void Expand ()
+		{
+			int n = 0;
+			foreach (bool transformMultiple in new bool [] { false, true }) {
+				foreach (int outputBlockSize in new int [] { 1, 2, 3, 4 }) {
+					MemoryStream expantedStream = new MemoryStream ();
+					byte[] inputData = new byte [] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
+
+					using (CryptoStream stream = new CryptoStream (expantedStream, new ExpandTransform (transformMultiple, outputBlockSize), CryptoStreamMode.Write)) {
+						stream.Write (inputData, 0, inputData.Length);
+					}
+					expantedStream.Close ();
+
+					string value = BitConverter.ToString (expantedStream.ToArray ());
+					Assert.AreEqual (expand_values [n++], value);
+				}
+			}
+		}
+
+		class CompressTransform : ICryptoTransform {
+
+			private int input_block_size;
+
+			public bool CanReuseTransform {
+				get { return true; }
+			}
+
+			public bool CanTransformMultipleBlocks {
+				get { return true; }
+			}
+
+			public int InputBlockSize {
+				get { return input_block_size; }
+				private set { input_block_size = value; }
+			}
+
+			public int OutputBlockSize {
+				get { return 1; }
+			}
+
+			public CompressTransform (int inputBlockSize)
+			{
+				this.InputBlockSize = inputBlockSize;
+			}
+
+			public void Dispose ()
+			{
+			}
+
+			private int bufferedCount = 0;
+
+			public int TransformBlock (byte [] inputBuffer, int inputOffset, int inputCount, byte [] outputBuffer, int outputOffset)
+			{
+				int ret = 0;
+				for (int i = 0; i < inputCount; i++, inputOffset++) {
+					if (++bufferedCount == InputBlockSize) {
+						outputBuffer [outputOffset++] = inputBuffer [inputOffset];
+						ret++;
+						bufferedCount = 0;
+					}
+				}
+				return ret;
+			}
+
+			public byte [] TransformFinalBlock (byte [] inputBuffer, int inputOffset, int inputCount)
+			{
+				byte[] outputBuffer = new byte [inputCount * OutputBlockSize];
+				int ret = TransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, 0);
+				byte[] result = new byte [ret];
+				Array.Copy (outputBuffer, result, ret);
+				return result;
+			}
+		}
+
+		static string[] compress_values = {
+			"00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F",
+			"01-03-05-07-09-0B-0D-0F-11-13-15-17-19-1B-1D-1F",
+			"02-05-08-0B-0E-11-14-17-1A-1D",
+			"03-07-0B-0F-13-17-1B-1F",
+		};
+
+		[Test]
+		public void Compress ()
+		{
+			int n = 0;
+			foreach (int inputBlockSize in new int [] { 1, 2, 3, 4 }) {
+				byte[] inputData = new byte [] {
+					0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+					0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+					0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+					0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+				};
+
+				using (CryptoStream stream = new CryptoStream (new MemoryStream (inputData), new CompressTransform (inputBlockSize), CryptoStreamMode.Read)) {
+					byte[] buffer = new byte [inputData.Length];
+					int ret = stream.Read (buffer, 0, buffer.Length);
+					string value = BitConverter.ToString (buffer, 0, ret);
+					Assert.AreEqual (compress_values [n++], value);
+				}
+			}
+		}
 	}
 }
diff --git a/mcs/class/corlib/Test/System.Text/ChangeLog b/mcs/class/corlib/Test/System.Text/ChangeLog
index cca04e8..24d7f3b 100644
--- a/mcs/class/corlib/Test/System.Text/ChangeLog
+++ b/mcs/class/corlib/Test/System.Text/ChangeLog
@@ -1,3 +1,7 @@
+2009-07-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* StringBuilderTest.cs: new overflow tests.
+
 2009-01-13  Jb Evain  <jbevain at novell.com>
 
 	* EncoderTest.cs: Make sure we can get an encoder for a custom
diff --git a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
index 94b45a2..f2ecaeb 100644
--- a/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
+++ b/mcs/class/corlib/Test/System.Text/StringBuilderTest.cs
@@ -27,44 +27,48 @@ using System;
 namespace MonoTests.System.Text {
 
 	[TestFixture]
-	public class StringBuilderTest : Assertion {
+	public class StringBuilderTest  {
 
 		private StringBuilder sb;
 
+		[Test]
 		public void TestConstructor1() 
 		{
 			// check the parameterless ctor
 			sb = new StringBuilder();
-			AssertEquals(String.Empty, sb.ToString());
-			AssertEquals(0, sb.Length);
-			AssertEquals(16, sb.Capacity);
+			Assert.AreEqual(String.Empty, sb.ToString());
+			Assert.AreEqual(0, sb.Length);
+			Assert.AreEqual(16, sb.Capacity);
 		}
 
+		[Test]
 		public void TestConstructor2() 
 		{
 			// check ctor that specifies the capacity
 			sb = new StringBuilder(10);
-			AssertEquals(String.Empty, sb.ToString());
-			AssertEquals(0, sb.Length);
+			Assert.AreEqual(String.Empty, sb.ToString());
+			Assert.AreEqual(0, sb.Length);
 			// check that capacity is not less than default
-			AssertEquals(10, sb.Capacity);
+			Assert.AreEqual(10, sb.Capacity);
 
 			sb = new StringBuilder(42);
-			AssertEquals(String.Empty, sb.ToString());
-			AssertEquals(0, sb.Length);
+			Assert.AreEqual(String.Empty, sb.ToString());
+			Assert.AreEqual(0, sb.Length);
 			// check that capacity is set
-			AssertEquals(42, sb.Capacity);
+			Assert.AreEqual(42, sb.Capacity);
 		}
-		
+
+		[Test]		
 		public void TestConstructor3() {
 			// check ctor that specifies the capacity & maxCapacity
 			sb = new StringBuilder(444, 1234);
-			AssertEquals(String.Empty, sb.ToString());
-			AssertEquals(0, sb.Length);
-			AssertEquals(444, sb.Capacity);
-			AssertEquals(1234, sb.MaxCapacity);
+			Assert.AreEqual(String.Empty, sb.ToString());
+			Assert.AreEqual(0, sb.Length);
+			Assert.AreEqual(444, sb.Capacity);
+			Assert.AreEqual(1234, sb.MaxCapacity);
 		}
 
+		[Test]
 		public void TestConstructor4() 
 		{
 			// check for exception in ctor that specifies the capacity & maxCapacity
@@ -75,15 +79,17 @@ namespace MonoTests.System.Text {
 				return;
 			}
 			// if we didn't catch an exception, then we have a problem Houston.
-			NUnit.Framework.Assertion.Fail("Capacity exeeds MaxCapacity");
+			NUnit.Framework.Assertion.Fail("Capacity exceeds MaxCapacity");
 		}
 
+		[Test]
 	public void TestConstructor5() {
 		String someString = null;
 		sb = new StringBuilder(someString);
-		AssertEquals("Should be empty string", String.Empty, sb.ToString());
+		Assert.AreEqual(String.Empty, sb.ToString(), "Should be empty string");
 	}
 
+		[Test]
 	public void TestConstructor6() {
 		// check for exception in ctor that prevents startIndex less than zero
 		try {
@@ -97,6 +103,7 @@ namespace MonoTests.System.Text {
 		NUnit.Framework.Assertion.Fail("StartIndex not allowed to be less than zero.");
 	}
 
+		[Test]
 	public void TestConstructor7() {
 		// check for exception in ctor that prevents length less than zero
 		try {
@@ -110,6 +117,7 @@ namespace MonoTests.System.Text {
 		NUnit.Framework.Assertion.Fail("Length not allowed to be less than zero.");
 	}
 
+		[Test]
 	public void TestConstructor8() {
 		// check for exception in ctor that ensures substring is contained in given string
 		// check that startIndex is not too big
@@ -124,6 +132,7 @@ namespace MonoTests.System.Text {
 		NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
 	}
 
+		[Test]
 	public void TestConstructor9() {
 		// check for exception in ctor that ensures substring is contained in given string
 		// check that length doesn't go beyond end of string
@@ -138,79 +147,84 @@ namespace MonoTests.System.Text {
 		NUnit.Framework.Assertion.Fail("StartIndex and length must refer to a location within the string.");
 	}
 
+		[Test]
 	public void TestConstructor10() {
 		// check that substring is taken properly and made into a StringBuilder
 		String someString = "someString";
 		sb = new StringBuilder(someString, 4, 6, 18);
 		string expected = "String";
-		AssertEquals( expected, sb.ToString());
+		Assert.AreEqual( expected, sb.ToString());
 	}
 
+		[Test]
 	[ExpectedException(typeof(ArgumentOutOfRangeException))]
 	public void TestConstructor11 () {
 		new StringBuilder (-1);
 	}
-		
+
+		[Test]		
 	public void TestAppend() {
                 StringBuilder sb = new StringBuilder( "Foo" );
                 sb.Append( "Two" );
                 string expected = "FooTwo";
-                AssertEquals( expected, sb.ToString() );
+                Assert.AreEqual( expected, sb.ToString() );
         }
 
+		[Test]
         public void TestInsert() {
                 StringBuilder sb = new StringBuilder();
 
-                AssertEquals( String.Empty, sb.ToString() ); 
+                Assert.AreEqual( String.Empty, sb.ToString() ); 
                         /* Test empty StringBuilder conforms to spec */
 
                 sb.Insert( 0, "Foo" ); /* Test insert at start of empty string */
 
-                AssertEquals( "Foo", sb.ToString() );
+                Assert.AreEqual( "Foo", sb.ToString() );
 
                 sb.Insert( 1, "!!" ); /* Test insert not at start of string */
 
-                AssertEquals( "F!!oo", sb.ToString() );
+                Assert.AreEqual( "F!!oo", sb.ToString() );
 
                 sb.Insert( 5, ".." ); /* Test insert at end of string */
 
-                AssertEquals( "F!!oo..", sb.ToString() );
+                Assert.AreEqual( "F!!oo..", sb.ToString() );
         
                 sb.Insert( 0, 1234 ); /* Test insert of a number (at start of string) */
                 
 				// FIX: Why does this test fail?
-                //AssertEquals( "1234F!!oo..", sb.ToString() );
+                //Assert.AreEqual( "1234F!!oo..", sb.ToString() );
                 
                 sb.Insert( 5, 1.5 ); /* Test insert of a decimal (and end of string) */
                 
 				// FIX: Why does this test fail?
-				//AssertEquals( "1234F1.5!!oo..", sb.ToString() );
+				//Assert.AreEqual( "1234F1.5!!oo..", sb.ToString() );
 
                 sb.Insert( 4, 'A' ); /* Test char insert in middle of string */
 
 				// FIX: Why does this test fail?
-				//AssertEquals( "1234AF1.5!!oo..", sb.ToString() );
+				//Assert.AreEqual( "1234AF1.5!!oo..", sb.ToString() );
 
         }
 
+		[Test]
         public void TestReplace() {
                 StringBuilder sb = new StringBuilder( "Foobarbaz" );
 
                 sb.Replace( "bar", "!!!" );             /* Test same length replace in middle of string */
                 
-                AssertEquals( "Foo!!!baz", sb.ToString() );
+                Assert.AreEqual( "Foo!!!baz", sb.ToString() );
 
                 sb.Replace( "Foo", "ABcD" );            /* Test longer replace at start of string */
 
-                AssertEquals( "ABcD!!!baz", sb.ToString() );
+                Assert.AreEqual( "ABcD!!!baz", sb.ToString() );
 
                 sb.Replace( "baz", "00" );              /* Test shorter replace at end of string */
                         
-                AssertEquals( "ABcD!!!00", sb.ToString() );
+                Assert.AreEqual( "ABcD!!!00", sb.ToString() );
 
                 sb.Replace( sb.ToString(), null );      /* Test string clear as in spec */
 
-                AssertEquals( String.Empty, sb.ToString() );
+                Assert.AreEqual( String.Empty, sb.ToString() );
 
                 /*           |         10        20        30
                 /*         |0123456789012345678901234567890| */
@@ -218,17 +232,18 @@ namespace MonoTests.System.Text {
 
                 sb.Replace( "abc", "!!!", 0, 31 ); /* Partial replace at start of string */
 
-                AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
+                Assert.AreEqual( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
 
                 sb.Replace( "testing", "", 0, 15 ); /* Test replace across boundary */
 
-                AssertEquals( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
+                Assert.AreEqual( "!!! this is testing !!! the !!! abc partial replace abc", sb.ToString() );
 
                 sb.Replace( "!!!", "" ); /* Test replace with empty string */
 
-                AssertEquals(" this is testing  the  abc partial replace abc", sb.ToString() );
+                Assert.AreEqual(sb.ToString() , " this is testing  the  abc partial replace abc");
         }
 
+		[Test]
         public void TestAppendFormat() {
         }
 
@@ -240,12 +255,12 @@ namespace MonoTests.System.Text {
 		sb.Append ("Second");
 		sb.Append ("Third");
 		sb.Replace ("Second", "Gone", 2, sb.Length-2);
-		AssertEquals ("#01", "FirstGoneThird", sb.ToString ());
+		Assert.AreEqual ("FirstGoneThird", sb.ToString (), "#01");
 
 		sb.Length = 0;
 		sb.Append ("This, is, a, list");
 		sb.Replace (",", "comma-separated", 11, sb.Length-11);
-		AssertEquals ("#02", "This, is, acomma-separated list", sb.ToString ());
+		Assert.AreEqual ("This, is, acomma-separated list", sb.ToString (), "#02");
 	}
 
 	[Test]
@@ -254,7 +269,7 @@ namespace MonoTests.System.Text {
 		StringBuilder sb = new StringBuilder();
 		sb.Append("testtesttest");
 		sb.Insert(0, '^');
-		AssertEquals ("#01", "^testtesttest", sb.ToString ());
+		Assert.AreEqual ("^testtesttest", sb.ToString (), "#01");
 	}
 
 	[Test]
@@ -263,7 +278,7 @@ namespace MonoTests.System.Text {
 		StringBuilder sb = new StringBuilder();
 		char [] ca = new char [] { 'c' };
 		sb.Append (ca);
-		AssertEquals ("#01", "c", sb.ToString ());
+		Assert.AreEqual ("c", sb.ToString (), "#01");
 	}
 
 
@@ -273,7 +288,7 @@ namespace MonoTests.System.Text {
 		StringBuilder b = new StringBuilder ();
 		b.Append ("Hello, I am a StringBuilder");
 		b.Remove (0, 7);  // Should remove "Hello, "
-		AssertEquals ("#01", "I am a StringBuilder", b.ToString ());
+		Assert.AreEqual ("I am a StringBuilder", b.ToString (), "#01");
 	}
 
 	[Test]
@@ -281,14 +296,14 @@ namespace MonoTests.System.Text {
 	{
 		StringBuilder sb = new StringBuilder();
 		sb.Insert(0, "aa");
-		AssertEquals ("#01", "aa", sb.ToString ());
+		Assert.AreEqual ("aa", sb.ToString (), "#01");
 
 		char [] charArr = new char [] { 'b', 'c', 'd' };
 		sb.Insert(1, charArr, 1, 1);
-		AssertEquals ("#02", "aca", sb.ToString ());
+		Assert.AreEqual ("aca", sb.ToString (), "#02");
 
 		sb.Insert (1, null, 0, 0);
-		AssertEquals ("#03", "aca", sb.ToString ());
+		Assert.AreEqual ("aca", sb.ToString (), "#03");
 		
 		try {
 			sb.Insert (1, null, 1, 1);
@@ -439,8 +454,8 @@ namespace MonoTests.System.Text {
 		} catch (ArgumentOutOfRangeException) {
 		}
 
-		AssertEquals (2, sb.Capacity);
-		AssertEquals (3, sb.MaxCapacity);
+		Assert.AreEqual (2, sb.Capacity);
+		Assert.AreEqual (3, sb.MaxCapacity);
 	}
 	
 	[Test]
@@ -464,27 +479,46 @@ namespace MonoTests.System.Text {
 	public void CapacityFromString ()
 	{
 		StringBuilder sb = new StringBuilder ("hola").Append ("lala");
-		AssertEquals ("#01", "holalala", sb.ToString ());
+		Assert.AreEqual ("holalala", sb.ToString (), "#01");
 	}
 
 	[Test]
 	public void ReplaceWithLargerString ()
 	{
 		StringBuilder sb = new StringBuilder ("ABCDE");
-		AssertEquals ("#1", "ABCDE", sb.ToString ());
+		Assert.AreEqual ("ABCDE", sb.ToString (), "#1");
 		sb.Replace ("ABC", "abcaa", 0, 3);
-		AssertEquals ("#2", "abcaaDE", sb.ToString ());
+		Assert.AreEqual ("abcaaDE", sb.ToString (), "#2");
 	}
 
 	[Test]
+	public void MaxCapacity_Overflow4 ()
+	{
+		StringBuilder sb = new StringBuilder (2, 3);
+		Assert.AreEqual (2, sb.Capacity);
+		Assert.AreEqual (3, sb.MaxCapacity);
+		try {
+			sb.Length = 4;
+			Assert.Fail ("#01");
+		} catch (ArgumentOutOfRangeException) {
+		}
+
+		try {
+			sb.EnsureCapacity (5);
+			Assert.Fail ("#02");
+		} catch (ArgumentOutOfRangeException) {
+		}
+	}
+	
+	[Test]
 	public void SetLength ()
 	{
 		StringBuilder sb = new StringBuilder ("Text");
-		AssertEquals ("#1", 4, sb.Length);
-		AssertEquals ("#2", "Text", sb.ToString ());
+		Assert.AreEqual (4, sb.Length, "#1");
+		Assert.AreEqual ("Text", sb.ToString (), "#2");
 		sb.Length = 8;
-		AssertEquals ("#3", 8, sb.Length);
-		AssertEquals ("#4", "Text\0\0\0\0", sb.ToString ());
+		Assert.AreEqual (8, sb.Length, "#3");
+		Assert.AreEqual ("Text\0\0\0\0", sb.ToString (), "#4");
 	}
 }
 
diff --git a/mcs/class/corlib/Test/System.Threading/TimerTest.cs b/mcs/class/corlib/Test/System.Threading/TimerTest.cs
index 2749d99..3581d49 100644
--- a/mcs/class/corlib/Test/System.Threading/TimerTest.cs
+++ b/mcs/class/corlib/Test/System.Threading/TimerTest.cs
@@ -29,9 +29,13 @@ namespace MonoTests.System.Threading {
 			// this makes fair for the "DueTime" test since it 
 			// doesn't have to wait for the scheduler thread to be 
 			// created. 
-			new Timer (null, null, Timeout.Infinite, 0);
+			new Timer (new TimerCallback (DoNothing), null, Timeout.Infinite, 0);
 		}
-		
+
+		void DoNothing (object foo)
+		{
+		}
+
 		[Test]
 		public void TestDueTime ()
 		{
diff --git a/mcs/class/corlib/Test/System/ArrayTest.cs b/mcs/class/corlib/Test/System/ArrayTest.cs
index a18f160..47e552b 100644
--- a/mcs/class/corlib/Test/System/ArrayTest.cs
+++ b/mcs/class/corlib/Test/System/ArrayTest.cs
@@ -298,6 +298,20 @@ public class ArrayTest : Assertion
 		AssertEquals("#D07", d1[0], d2[0]);
 	}
 
+	[Test] public void TestIndexer ()
+	{
+		int [] a = new int [10];
+		IList b = a;
+		try {
+			object c = b [-1];
+			Fail ("IList.this [-1] should throw");
+		} catch (IndexOutOfRangeException) {
+			// Good
+		} catch (Exception){
+			Fail ("Should have thrown an IndexOutOfRangeException");
+		}
+	}
+		
 	[Test]
 	public void TestCopy() {
 		{
@@ -1562,6 +1576,35 @@ public class ArrayTest : Assertion
 	}
 
 	[Test]
+	public void LastIndexOf_0LengthArray ()
+	{
+		Array array = Array.CreateInstance (typeof (char), 0);
+		int idx = Array.LastIndexOf (array, (object) null, -1, 0);
+		NUnit.Framework.Assert.IsTrue (idx == -1, "#01");
+		idx = Array.LastIndexOf (array, (object) null, -1, 10);
+		NUnit.Framework.Assert.IsTrue (idx == -1, "#02");
+		idx = Array.LastIndexOf (array, (object) null, -100, 10);
+		NUnit.Framework.Assert.IsTrue (idx == -1, "#02");
+
+		array = Array.CreateInstance (typeof (char), 1);
+		try {
+			Array.LastIndexOf (array, (object) null, -1, 0);
+			NUnit.Framework.Assert.Fail ("#04");
+		} catch (ArgumentOutOfRangeException e) {
+		}
+		try {
+			Array.LastIndexOf (array, (object) null, -1, 10);
+			NUnit.Framework.Assert.Fail ("#05");
+		} catch (ArgumentOutOfRangeException e) {
+		}
+		try {
+			Array.LastIndexOf (array, (object) null, -100, 10);
+			NUnit.Framework.Assert.Fail ("#06");
+		} catch (ArgumentOutOfRangeException e) {
+		}
+	}
+
+	[Test]
 	public void TestReverse() {
 		{
 			bool errorThrown = false;
diff --git a/mcs/class/corlib/Test/System/ChangeLog b/mcs/class/corlib/Test/System/ChangeLog
index cadda28..3325b2a 100644
--- a/mcs/class/corlib/Test/System/ChangeLog
+++ b/mcs/class/corlib/Test/System/ChangeLog
@@ -1,3 +1,24 @@
+<<<<<<< HEAD
+2009-09-17 Rodrigo Kumpera  <rkumpera at novell.com>
+=======
+2009-07-12  Gert Driesen  <drieseng at users.sourceforge.net>
+
+	* TypeTest.cs: Enabled test that was failing due to regression.
+
+2009-07-10  Zoltan Varga  <vargaz at gmail.com>
+>>>>>>> bd6ddee... * BinderTest.cs: Added SelectMethod/BindToMethod tests for methods
+
+	* ArrayTest.cs: Fix the build.
+
+2009-07-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* ArrayTest.cs: new LastIndexOf test for 0-length arrays.
+
+2009-06-18 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* DateTimeTest.cs: add test for parsing a negative timezone.
+	* DateTimeOffsetTest.cs: several tests for Parse.
+
 2009-05-14 Gonzalo Paniagua Javier <gonzalo at novell.com>
 
 	* TypeTest.cs: test for bug #503728
diff --git a/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs b/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs
index 7b96bf0..2cd5196 100644
--- a/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs
+++ b/mcs/class/corlib/Test/System/DateTimeOffsetTest.cs
@@ -345,6 +345,74 @@ namespace MonoTests.System {
 		}
 
 		[Test]
+		public void ParseDateOnly ()
+		{
+			DateTimeOffset dto = DateTimeOffset.Parse ("2009/06/14");
+			Assert.AreEqual (14, dto.Day, "Day");
+			Assert.AreEqual (6, dto.Month, "Month");
+			Assert.AreEqual (2009, dto.Year, "Year");
+		}
+
+		[Test]
+		public void ParseTimeOnly ()
+		{
+			DateTimeOffset dto = DateTimeOffset.Parse ("2:3:4");
+			Assert.AreEqual (2, dto.Hour, "Hour");
+			Assert.AreEqual (3, dto.Minute, "Minute");
+			Assert.AreEqual (4, dto.Second, "Second");
+		}
+
+		[Test]
+		public void ParseTimeTZ ()
+		{
+			DateTimeOffset dto = DateTimeOffset.Parse ("2:30:40 +3:4");
+			Assert.AreEqual (2, dto.Hour, "Hour");
+			Assert.AreEqual (30, dto.Minute, "Minute");
+			Assert.AreEqual (40, dto.Second, "Second");
+			Assert.AreEqual (3, dto.Offset.Hours, "Offset Hours");
+			Assert.AreEqual (4, dto.Offset.Minutes, "Offset Minutes");
+		}
+
+		[Test]
+		public void ParseTimePMTZ ()
+		{
+			DateTimeOffset dto = DateTimeOffset.Parse ("3:30:40 PM -3:4");
+			Assert.AreEqual (15, dto.Hour, "Hour");
+			Assert.AreEqual (30, dto.Minute, "Minute");
+			Assert.AreEqual (40, dto.Second, "Second");
+			Assert.AreEqual (-3, dto.Offset.Hours, "Offset Hours");
+			Assert.AreEqual (-4, dto.Offset.Minutes, "Offset Minutes");
+		}
+
+		[Test]
+		public void ParseFull1 ()
+		{
+			DateTimeOffset dto = DateTimeOffset.Parse ("2009/06/14 2:30:40 AM -03:04");
+			Assert.AreEqual (14, dto.Day, "Day");
+			Assert.AreEqual (6, dto.Month, "Month");
+			Assert.AreEqual (2009, dto.Year, "Year");
+			Assert.AreEqual (2, dto.Hour, "Hour");
+			Assert.AreEqual (30, dto.Minute, "Minute");
+			Assert.AreEqual (40, dto.Second, "Second");
+			Assert.AreEqual (-3, dto.Offset.Hours, "Offset Hours");
+			Assert.AreEqual (-4, dto.Offset.Minutes, "Offset Minutes");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void ParseUnderflow ()
+		{
+			DateTimeOffset.Parse ("01/01/0001 0:0 +09:00");
+		}
+
+		[Test]
+		[ExpectedException (typeof (ArgumentOutOfRangeException))]
+		public void ParseOverflow ()
+		{
+			DateTimeOffset.Parse ("12/31/9999 23:59 -09:00");
+		}
+
+		[Test]
 		public void ParseExactWithFractions ()
 		{
 			CultureInfo fp = CultureInfo.InvariantCulture;
diff --git a/mcs/class/corlib/Test/System/DateTimeTest.cs b/mcs/class/corlib/Test/System/DateTimeTest.cs
index 88fece6..7ea8ad2 100644
--- a/mcs/class/corlib/Test/System/DateTimeTest.cs
+++ b/mcs/class/corlib/Test/System/DateTimeTest.cs
@@ -563,6 +563,18 @@ namespace MonoTests.System
 		}
 
 		[Test]
+		public void TestParseExact5 ()
+		{
+			DateTime dt = DateTime.ParseExact ("Wed, 12 May 2004 20:51:09 -02:30",
+							@"ddd, d MMM yyyy H:m:s zzz",
+							CultureInfo.CreateSpecificCulture("en-us"),
+							DateTimeStyles.AllowInnerWhite);
+			dt = dt.ToUniversalTime ();
+			Assert.AreEqual (23, dt.Hour, "Hour");
+			Assert.AreEqual (21, dt.Minute, "Minute");
+		}
+
+		[Test]
 		public void TestParseExact ()
 		{
 			// Standard patterns
diff --git a/mcs/class/corlib/Test/System/Int32Test.cs b/mcs/class/corlib/Test/System/Int32Test.cs
index 4c2b7ae..71ec6d3 100644
--- a/mcs/class/corlib/Test/System/Int32Test.cs
+++ b/mcs/class/corlib/Test/System/Int32Test.cs
@@ -209,6 +209,25 @@ public class Int32Test : Assertion
 		} catch (Exception e) {
 			Assert ("C#38", typeof (OverflowException) == e.GetType ());
 		}
+
+		try {
+			Int32.Parse (null);
+			Fail ("C#39: Should raise an ArgumentNullException");
+		} catch (Exception e){
+			Assert ("C#40", typeof (ArgumentNullException) == e.GetType ());
+		}
+
+		try {
+			Int32.Parse ("123", (NumberStyles) 60000);
+			Fail ("C#41 Should raise an ArgumentException");
+		} catch (Exception e){
+			Assert ("C#42", typeof (ArgumentException) == e.GetType ());
+		}
+
+		// Pass a DateTimeFormatInfo, it is unable to format
+		// numbers, but we should not crash
+		
+		Int32.Parse ("123", new DateTimeFormatInfo ());
 	}
 
 #if NET_2_0	
diff --git a/mcs/class/lib/monolite/System.Xml.dll b/mcs/class/lib/monolite/System.Xml.dll
index b4a31f3..2fa544d 100755
Binary files a/mcs/class/lib/monolite/System.Xml.dll and b/mcs/class/lib/monolite/System.Xml.dll differ
diff --git a/mcs/class/lib/monolite/System.dll b/mcs/class/lib/monolite/System.dll
index 59167b7..9883db5 100755
Binary files a/mcs/class/lib/monolite/System.dll and b/mcs/class/lib/monolite/System.dll differ
diff --git a/mcs/class/lib/monolite/mcs.exe b/mcs/class/lib/monolite/mcs.exe
index c8f4635..8d42390 100755
Binary files a/mcs/class/lib/monolite/mcs.exe and b/mcs/class/lib/monolite/mcs.exe differ
diff --git a/mcs/class/lib/monolite/mscorlib.dll b/mcs/class/lib/monolite/mscorlib.dll
index d8dea3a..07e50b7 100755
Binary files a/mcs/class/lib/monolite/mscorlib.dll and b/mcs/class/lib/monolite/mscorlib.dll differ
diff --git a/mcs/errors/gcs0202.cs b/mcs/errors/gcs0202.cs
new file mode 100644
index 0000000..bdd9a9e
--- /dev/null
+++ b/mcs/errors/gcs0202.cs
@@ -0,0 +1,18 @@
+// CS0202: foreach statement requires that the return type `System.Collections.Generic.IEnumerable<string>' of `Test.GetEnumerator()' must have a suitable public MoveNext method and public Current property
+// Line: 10
+using System;
+using System.Collections.Generic;
+
+class Test {
+        static void Main ()
+        {
+                Test obj = new Test ();
+                foreach (string s in obj) {
+                }
+        }
+
+        public IEnumerable<string> GetEnumerator ()
+        {
+		return null;
+        }
+}
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog
index f269a93..3bf71f7 100644
--- a/mcs/mcs/ChangeLog
+++ b/mcs/mcs/ChangeLog
@@ -1,3 +1,34 @@
+2009-10-29  Marek Safar  <marek.safar at gmail.com>
+
+	A fix for bug #550580	
+	* convert.cs: Don't eliminate explicit precission casts.
+
+2009-09-30  Marek Safar  <marek.safar at gmail.com>
+
+	A fix for bug #542959
+	* delegate.cs: Emit correct delegate instance variable when there
+	are static and non-static overloads.
+
+2009-08-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* statement.cs: avoid nullref when the return value of GetEnumerator()
+	does not contain any MoveNext() method.
+
+2009-07-22  Marek Safar  <marek.safar at gmail.com>
+
+	A fix for bug #522789
+	* expression.cs: Mutate invocation return type.
+
+2009-07-16  Marek Safar  <marek.safar at gmail.com>
+
+	A fix for bug #521671
+	* statement.cs: Fixed crash when checking missing type.
+
+2009-06-17  Marek Safar  <marek.safar at gmail.com>
+
+	A fix for bug #514096
+	* class.cs: Allow IntPtr/UIntPtr fields to be volatile.
+
 2009-05-21  Marek Safar  <marek.safar at gmail.com>
 
 	A fix for bug #504667
diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs
index 0fd417e..eb06c43 100644
--- a/mcs/mcs/class.cs
+++ b/mcs/mcs/class.cs
@@ -5837,7 +5837,8 @@ namespace Mono.CSharp {
 				MemberType == TypeManager.sbyte_type || MemberType == TypeManager.byte_type ||
 				MemberType == TypeManager.short_type || MemberType == TypeManager.ushort_type ||
 				MemberType == TypeManager.int32_type || MemberType == TypeManager.uint32_type ||
-				MemberType == TypeManager.float_type)
+				MemberType == TypeManager.float_type ||
+				MemberType == TypeManager.intptr_type || MemberType == TypeManager.uintptr_type)
 				return true;
 
 			return false;
diff --git a/mcs/mcs/convert.cs b/mcs/mcs/convert.cs
index 89d20c7..dcb1032 100644
--- a/mcs/mcs/convert.cs
+++ b/mcs/mcs/convert.cs
@@ -1864,8 +1864,20 @@ namespace Mono.CSharp {
 			Type target_type, Location loc)
 		{
 			Expression e = ExplicitConversionCore (ec, expr, target_type, loc);
-			if (e != null)
+			if (e != null) {
+				//
+				// Don't eliminate explicit precission casts
+				//
+				if (e == expr) {
+					if (target_type == TypeManager.float_type)
+						return new OpcodeCast (expr, target_type, OpCodes.Conv_R4);
+					
+					if (target_type == TypeManager.double_type)
+						return new OpcodeCast (expr, target_type, OpCodes.Conv_R8);
+				}
+					
 				return e;
+			}
 
 #if GMCS_SOURCE
 			Type expr_type = expr.Type;
diff --git a/mcs/mcs/delegate.cs b/mcs/mcs/delegate.cs
index 2baa0b2..6d229bc 100644
--- a/mcs/mcs/delegate.cs
+++ b/mcs/mcs/delegate.cs
@@ -790,6 +790,11 @@ namespace Mono.CSharp {
 			if (delegate_instance_expression != null)
 				return;
 
+			if (method_group.IsStatic) {
+				delegate_instance_expression = null;
+				return;
+			}
+
 			Expression instance = method_group.InstanceExpression;
 			if (instance != null && instance != EmptyExpression.Null) {
 				delegate_instance_expression = instance;
@@ -798,7 +803,7 @@ namespace Mono.CSharp {
 					delegate_instance_expression = new BoxedCast (
 						delegate_instance_expression, TypeManager.object_type);
 				}
-			} else if (!delegate_method.IsStatic && !ec.IsStatic) {
+			} else {
 				delegate_instance_expression = ec.GetThis (loc);
 			}
 		}
diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs
index 240ebc4..2ce4cab 100644
--- a/mcs/mcs/expression.cs
+++ b/mcs/mcs/expression.cs
@@ -5136,6 +5136,7 @@ namespace Mono.CSharp {
 		public override void MutateHoistedGenericType (AnonymousMethodStorey storey)
 		{
 			mg.MutateHoistedGenericType (storey);
+			type = storey.MutateType (type);
 			if (Arguments != null) {
 				foreach (Argument a in Arguments)
 					a.Expr.MutateHoistedGenericType (storey);
diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs
index 54fdd23..0ec0964 100644
--- a/mcs/mcs/statement.cs
+++ b/mcs/mcs/statement.cs
@@ -4796,8 +4796,10 @@ namespace Mono.CSharp {
 					vi.VariableInfo = null;
 				}
 
-				if (!c.Resolve (ec))
+				if (!c.Resolve (ec)) {
 					ok = false;
+					continue;
+				}
 
 				Type resolved_type = c.CatchType;
 				for (int ii = 0; ii < last_index; ++ii) {
@@ -5511,7 +5513,8 @@ namespace Mono.CSharp {
 					t, MemberTypes.Method,
 					BindingFlags.Public | BindingFlags.Instance,
 					Type.FilterName, "MoveNext");
-				if (move_next_list.Count == 0)
+
+				if (move_next_list == null)
 					return false;
 
 				foreach (MemberInfo m in move_next_list){
diff --git a/mcs/tests/gtest-etree-01.cs b/mcs/tests/gtest-etree-01.cs
index 8ec7c8c..c492bb5 100644
--- a/mcs/tests/gtest-etree-01.cs
+++ b/mcs/tests/gtest-etree-01.cs
@@ -977,9 +977,9 @@ class Tester
 	void ConvertCheckedTest_3 ()
 	{
 		checked {
-			Expression<Func<float?, float>> e3 = (float? a) => ((float) a);
-			AssertNodeType (e3, ExpressionType.ConvertChecked);
-			Assert (-0.456f, e3.Compile ().Invoke (-0.456f));
+//			Expression<Func<float?, float>> e3 = (float? a) => ((float) a);
+//			AssertNodeType (e3, ExpressionType.ConvertChecked);
+//			Assert (-0.456f, e3.Compile ().Invoke (-0.456f));
 		}
 	}
 
diff --git a/mcs/tests/ver-il-gmcs.xml b/mcs/tests/ver-il-gmcs.xml
index 9da41f7..3c1db0b 100644
--- a/mcs/tests/ver-il-gmcs.xml
+++ b/mcs/tests/ver-il-gmcs.xml
@@ -3177,7 +3177,7 @@
         <size>7</size>
       </method>
       <method name="Void Main(System.String[])">
-        <size>500</size>
+        <size>501</size>
       </method>
     </type>
     <type name="Mapper`2[A,R]">
@@ -14386,7 +14386,7 @@
         <size>83</size>
       </method>
       <method name="Void ConvertTest_3()">
-        <size>93</size>
+        <size>108</size>
       </method>
       <method name="Void ConvertTest_4()">
         <size>102</size>
@@ -14431,7 +14431,7 @@
         <size>83</size>
       </method>
       <method name="Void ConvertCheckedTest_3()">
-        <size>93</size>
+        <size>1</size>
       </method>
       <method name="Void ConvertCheckedTest_4()">
         <size>102</size>
@@ -23649,7 +23649,7 @@
         <size>7</size>
       </method>
       <method name="Void Main()">
-        <size>32</size>
+        <size>36</size>
       </method>
     </type>
     <type name="Blah">
diff --git a/mcs/tools/Makefile b/mcs/tools/Makefile
index 74ffcb3..735a222 100644
--- a/mcs/tools/Makefile
+++ b/mcs/tools/Makefile
@@ -36,6 +36,7 @@ net_2_0_dirs := \
 	al			\
 	corcompare	\
 	csharp		\
+	lc		\
 	mono-xsd	\
 	wsdl		\
 	compiler-tester	\
diff --git a/mcs/tools/lc/AssemblyInfo.cs b/mcs/tools/lc/AssemblyInfo.cs
new file mode 100644
index 0000000..eb02f77
--- /dev/null
+++ b/mcs/tools/lc/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("LC")]
+[assembly: AssemblyDescription(" license compiler for .NET/Mono license resources")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("RemObjects Software")]
+[assembly: AssemblyProduct("LC")]
+[assembly: AssemblyCopyright("Copyright © RemObjects Software 2009")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("b781c2df-fefa-4c87-a5c9-ce2553c4edb1")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/mcs/tools/lc/ChangeLog b/mcs/tools/lc/ChangeLog
new file mode 100644
index 0000000..2a315d3
--- /dev/null
+++ b/mcs/tools/lc/ChangeLog
@@ -0,0 +1,8 @@
+2009-10-22  Carlo Kok  <ck at remobjects.com>
+
+	* Fixed AssemblyInfo.cs to reflect proper copyright.
+
+2009-10-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Initial check in of lc. Code from Carlo Kok.
+
diff --git a/mcs/tools/lc/Makefile b/mcs/tools/lc/Makefile
new file mode 100644
index 0000000..ae9ffac
--- /dev/null
+++ b/mcs/tools/lc/Makefile
@@ -0,0 +1,11 @@
+thisdir = tools/lc
+SUBDIRS = 
+include ../../build/rules.make
+
+LOCAL_MCS_FLAGS = -r:System.dll
+PROGRAM = lc.exe
+
+CLEAN_FILES = lc.exe lc.exe.mdb
+
+include ../../build/executable.make
+
diff --git a/mcs/class/Mono.Options/Mono.Options/Options.cs b/mcs/tools/lc/Options.cs
similarity index 100%
copy from mcs/class/Mono.Options/Mono.Options/Options.cs
copy to mcs/tools/lc/Options.cs
diff --git a/mcs/tools/lc/lc.cs b/mcs/tools/lc/lc.cs
new file mode 100644
index 0000000..317932b
--- /dev/null
+++ b/mcs/tools/lc/lc.cs
@@ -0,0 +1,302 @@
+//
+// License compiler for mono
+//
+// Authors:
+//   Carlo Kok (ck at remobjects.com)
+//
+// (C) 2009 RemObjects Software
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Mono.Options;
+using System.ComponentModel.Design;
+using System.IO;
+using System.Reflection;
+using System.Globalization;
+using System.ComponentModel;
+using System.Runtime.Serialization.Formatters.Binary;
+
+namespace LC
+{
+    public class LCLicenseContext : DesigntimeLicenseContext
+    {
+        public string OutputFilename { get; set; }
+        public string LicxFilename { get; set; }
+    }
+
+    class Program
+    {
+        static List<String> privatePaths = new List<string>();
+
+        static int Main(string[] args)
+        {
+            bool verbose = false;
+            string target = null;
+            string complist = null;
+            string targetdir = ".";
+            List<string> references = new List<string>();
+
+            bool nologo = false;
+            bool help = false;
+            OptionSet p = new OptionSet() {
+                {"v|verbose", "Verbose output", v => verbose = v!= null },
+                {"t|target=", "Target assembly name", v => target = v },
+                {"c|complist=","licx file to compile", v => complist = v },
+                {"i|load=", "Reference to load", v=> {if (v != null) references.Add(v);}},
+                {"o|outdir=", "Output directory for the .licenses file", v=> targetdir = v },
+                {"nologo", "Do not display logo", v=> nologo = null != v },
+                {"h|?|help", "Show help", v=>help = v != null }
+            };
+            List<string> extra;
+            try
+            {
+                extra = p.Parse(args);
+            }
+            catch(OptionException e) 
+            {
+                Console.WriteLine("lc: " + e.Message);
+                Console.WriteLine("try lc --help for more information");
+                return 1;
+            }
+            if (!nologo) {
+                Console.WriteLine("Mono License Compiler");
+                Console.WriteLine("Copyright (c) 2009 by RemObjects Software");
+            }
+            if (help) {
+                Console.WriteLine();
+                Console.WriteLine("lc -c filename -t targetassembly [-i references] [-v] [-o] [-nologo]");
+                Console.WriteLine();
+                Console.WriteLine("Options:");
+                p.WriteOptionDescriptions(Console.Out);
+                return 1;
+            }
+            if (extra.Count > 0) {
+                Console.WriteLine("Unexpected arguments passed on cmd line");
+                return 1;
+            }
+            if (target == null || complist == null){
+                Console.WriteLine("No target/complist passed");
+                return 1;
+            }
+            try {
+                if (!File.Exists(complist)) {
+                    Console.WriteLine("Could not find file: "+complist);
+                    return 1;
+                }
+
+                LCLicenseContext ctx = new LCLicenseContext();
+                ctx.LicxFilename = complist;
+                if (verbose) Console.WriteLine("Input file: "+complist);
+                ctx.OutputFilename = Path.Combine(targetdir ??".", target)+".licenses";
+                if (verbose) Console.WriteLine("Output filename: "+ctx.OutputFilename);
+                AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
+                privatePaths.Add(".");
+                Dictionary<string, Assembly> loaded = new Dictionary<string, Assembly>();
+                foreach (string reference in references) {
+                    string path = Path.GetDirectoryName(reference);
+                    if (!privatePaths.Contains(path))
+                    {
+                        if (verbose) Console.WriteLine("Adding " + Path.GetDirectoryName(reference) + " to private paths");
+                        privatePaths.Add(path);
+                       }
+                    Assembly asm = Assembly.LoadFrom(reference);
+                    loaded.Add(asm.GetName().Name, asm);
+                    if (verbose) Console.WriteLine("Loaded assembly: "+asm.GetName().ToString());
+
+                }
+
+                using (StreamReader sr = new StreamReader(complist))
+                {
+                    int lineno = 0;
+                    string line = "";
+                    while (sr.Peek() != -1)
+                    {
+                        try
+                        {
+                            line = sr.ReadLine();
+                            if (line == null || line == "" || line[0] == '#' ) continue;
+                            if (verbose) Console.WriteLine("Generating license for: "+line);
+
+                            string[] sLine = line.Split(new char[] { ',' }, 2);
+                            Type stype = null;
+                            if (sLine.Length == 1)
+                            {
+                                stype = Type.GetType(line, false, true);
+                                if (stype == null)
+                                {
+                                    foreach (KeyValuePair<string, Assembly> et in loaded)
+                                    {
+                                        stype = et.Value.GetType(sLine[0], false, true);
+                                        if (stype != null) {
+                                            if (verbose) Console.WriteLine("Found type in "+et.Key);
+                                            break;
+                                        }
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                if (sLine[1].IndexOf(',') >= 0)
+                                {
+                                    stype = Type.GetType(line, false, true);
+                                }
+                                else
+                                {
+                                    string s = sLine[1].Trim();
+                                    foreach (KeyValuePair<string, Assembly> et in loaded)
+                                    {
+                                        if (String.Compare(et.Key, s, true, CultureInfo.InvariantCulture) == 0)
+                                        {
+                                            stype = et.Value.GetType(sLine[0], false, true);
+                                            if (stype != null) {
+                                                if (verbose) Console.WriteLine("Found type in "+et.Key);
+                                                break;
+                                            }
+                                        }
+                                    }
+                                    if (stype == null)
+                                    {
+                                        foreach (KeyValuePair<string, Assembly> et in loaded)
+                                        {
+                                            stype = et.Value.GetType(sLine[0], false, true);
+                                            if (stype != null) {
+                                                if (verbose) Console.WriteLine("Found type in "+et.Key);
+                                                break;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                            if (stype == null)
+                                throw new Exception("Unable to find type: " + line);
+                            LicenseManager.CreateWithContext(stype, ctx);
+                        }
+                        catch(Exception e)
+                        {
+                            Console.WriteLine("Exception during compiling " + complist + ": " + lineno);
+                            Console.WriteLine(e.ToString());
+                        }
+                    }
+                }
+
+                using (FileStream fs = new FileStream(ctx.OutputFilename, FileMode.Create)) {
+                    try {
+                    DesigntimeLicenseContextSerializer.Serialize(fs, target.ToUpper(CultureInfo.InvariantCulture), ctx);
+                    } catch {}
+                    if (fs.Length == 0) // older mono does not support this, but when it does, we should use the proper version.
+                        IntSerialize(fs, target.ToUpper(CultureInfo.InvariantCulture), ctx);
+                }
+                if (verbose)
+                    Console.WriteLine("Saved to: "+ Path.GetFullPath(ctx.OutputFilename));
+                return 0;
+            } catch(Exception e){
+                Console.WriteLine("Exception: "+e.ToString());
+                return 1;
+            }
+
+        }
+
+
+        private static void IntSerialize(Stream o,
+                          string cryptoKey,
+                          DesigntimeLicenseContext context)
+        {
+            Object[] lData = new Object[2];
+            lData[0] = cryptoKey;
+            Hashtable lNewTable = new Hashtable();
+            FieldInfo fi =
+                typeof(DesigntimeLicenseContext).GetField("savedLicenseKeys", BindingFlags.NonPublic | BindingFlags.Instance) ??
+                typeof(DesigntimeLicenseContext).GetField("keys", BindingFlags.NonPublic | BindingFlags.Instance)
+                ;
+            Hashtable lOrgTable = (Hashtable)fi.GetValue(context);
+            foreach (DictionaryEntry et in lOrgTable)
+            {
+                if (et.Key is string)
+                    lNewTable.Add(et.Key, et.Value);
+                else
+                    lNewTable.Add(((Type)et.Key).AssemblyQualifiedName, et.Value);
+            }
+            lData[1] = lNewTable;
+
+            BinaryFormatter lFormatter = new BinaryFormatter();
+            lFormatter.Serialize(o, lData);
+
+        }
+        static Dictionary<string, Assembly> loadedAssemblies = new Dictionary<string, Assembly>();
+
+        static bool CompareAssemblyName(string s1, string s2)
+        {
+            s1 = s1.ToLowerInvariant().Replace(" ", "");
+            s2 = s2.ToLowerInvariant().Replace(" ", "");
+            return s1 == s2;
+        }
+
+        static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
+        {
+            string[] lArgs = args.Name.Split(',');
+            string lName = lArgs[0].Trim();
+            if (loadedAssemblies.ContainsKey(args.Name))
+            {
+                return loadedAssemblies[args.Name];
+            }
+            for (int i = 0; i < privatePaths.Count; i++)
+            {
+                string sPath = Path.Combine(privatePaths[i].ToString(), lName);
+                if (File.Exists(sPath + ".dll"))
+                    sPath += ".dll";
+                else if (File.Exists(sPath + ".DLL"))
+                    sPath += ".DLL";
+                else if (File.Exists(sPath + ".exe"))
+                    sPath += ".exe";
+                else if (File.Exists(sPath + ".EXE"))
+                    sPath += ".EXE";
+                else
+                    continue;
+                AssemblyName an2 = AssemblyName.GetAssemblyName(sPath);
+                if (CompareAssemblyName(an2.ToString(), args.Name) || (lArgs.Length == 1 && CompareAssemblyName(an2.Name, lName)))
+                {
+                    Assembly asm;
+                    try
+                    {
+                        asm = Assembly.LoadFrom(sPath);
+                    }
+                    catch
+                    {
+                        asm = Assembly.LoadFile(sPath);
+                    }
+                    if (asm != null)
+                    {
+                        loadedAssemblies.Add(args.Name, asm);
+                        return asm;
+                    }
+                }
+            }
+            throw new Exception("Unable to find assembly "+args.Name);
+        }
+    }
+}
diff --git a/mcs/tools/lc/lc.exe.sources b/mcs/tools/lc/lc.exe.sources
new file mode 100644
index 0000000..0e37e3a
--- /dev/null
+++ b/mcs/tools/lc/lc.exe.sources
@@ -0,0 +1,3 @@
+AssemblyInfo.cs
+lc.cs
+Options.cs
diff --git a/mcs/tools/mdoc/ChangeLog b/mcs/tools/mdoc/ChangeLog
index bb4e734..8c882cc 100644
--- a/mcs/tools/mdoc/ChangeLog
+++ b/mcs/tools/mdoc/ChangeLog
@@ -1,3 +1,15 @@
+2009-06-23  Jonathan Pryor <jpryor at novell.com>
+
+	* Mono.Documentation/monodocer.cs: Don't generate an exception when an
+	  enumeration contains multiple names with the same value.
+	  Fixes #515030.
+	* Test/DocTest-v1.cs: Add test for #515030.
+	* Test/en.expected/Mono.DocTest/Color.xml,
+	  Test/en.expected.since/Mono.DocTest/Color.xml,
+	  Test/html.expected/Mono.DocTest/Color.html,
+	  Test/msxdoc-expected.importslashdoc.xml,
+	  Test/en.expected.importslashdoc/Mono.DocTest/Color.xml: Flush.
+
 2009-04-09  Jonathan Pryor <jpryor at novell.com>
 
 	* Mono.Documentation/monodocer.cs: Using a single IAssemblyResolver is
diff --git a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs
index 490a9e9..9899d43 100644
--- a/mcs/tools/mdoc/Mono.Documentation/monodocer.cs
+++ b/mcs/tools/mdoc/Mono.Documentation/monodocer.cs
@@ -2286,11 +2286,14 @@ class MDocUpdater : MDocCommand
 
 	private static Dictionary<ulong, string> GetEnumerationValues (TypeDefinition type)
 	{
-		return
-			(from f in type.Fields.Cast<FieldDefinition> ()
-			 where !(f.IsRuntimeSpecialName || f.IsSpecialName)
-			 select f)
-			.ToDictionary (f => Convert.ToUInt64 (f.Constant), f => f.Name);
+		var values = new Dictionary<ulong, string> ();
+		foreach (var f in 
+				(from f in type.Fields.Cast<FieldDefinition> ()
+				 where !(f.IsRuntimeSpecialName || f.IsSpecialName)
+				 select f)) {
+			values [Convert.ToUInt64 (f.Constant)] = f.Name;
+		}
+		return values;
 	}
 	
 	private static void MakeParameters (XmlElement root, ParameterDefinitionCollection parameters)
diff --git a/mcs/tools/mdoc/Test/DocTest-v1.cs b/mcs/tools/mdoc/Test/DocTest-v1.cs
index 354bd39..30f9070 100644
--- a/mcs/tools/mdoc/Test/DocTest-v1.cs
+++ b/mcs/tools/mdoc/Test/DocTest-v1.cs
@@ -110,7 +110,9 @@ namespace Mono.DocTest {
 		Blue, 
 		/// <summary>Insert Green summary here</summary>
 		/// <remarks><c>F:Mono.DocTest.Color.Green</c>.</remarks>
-		Green
+		Green,
+
+		AnotherGreen = Green,
 	}
 
 	/// <summary>Process interface</summary>
diff --git a/mcs/tools/mdoc/Test/en.expected.importslashdoc/Mono.DocTest/Color.xml b/mcs/tools/mdoc/Test/en.expected.importslashdoc/Mono.DocTest/Color.xml
index 30b228f..7c8322d 100644
--- a/mcs/tools/mdoc/Test/en.expected.importslashdoc/Mono.DocTest/Color.xml
+++ b/mcs/tools/mdoc/Test/en.expected.importslashdoc/Mono.DocTest/Color.xml
@@ -13,6 +13,19 @@
       <see cref="T:Mono.DocTest.Color" />.</remarks>
   </Docs>
   <Members>
+    <Member MemberName="AnotherGreen">
+      <MemberSignature Language="C#" Value="AnotherGreen" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.DocTest.Color</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
     <Member MemberName="Blue">
       <MemberSignature Language="C#" Value="Blue" />
       <MemberType>Field</MemberType>
diff --git a/mcs/tools/mdoc/Test/en.expected.since/Mono.DocTest/Color.xml b/mcs/tools/mdoc/Test/en.expected.since/Mono.DocTest/Color.xml
index 4dfecb8..6a1f914 100644
--- a/mcs/tools/mdoc/Test/en.expected.since/Mono.DocTest/Color.xml
+++ b/mcs/tools/mdoc/Test/en.expected.since/Mono.DocTest/Color.xml
@@ -13,6 +13,20 @@
     <remarks>To be added.</remarks>
   </Docs>
   <Members>
+    <Member MemberName="AnotherGreen">
+      <MemberSignature Language="C#" Value="AnotherGreen" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+        <AssemblyVersion>2.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.DocTest.Color</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
     <Member MemberName="Blue">
       <MemberSignature Language="C#" Value="Blue" />
       <MemberType>Field</MemberType>
diff --git a/mcs/tools/mdoc/Test/en.expected/Mono.DocTest/Color.xml b/mcs/tools/mdoc/Test/en.expected/Mono.DocTest/Color.xml
index c9c477f..b2cb4f0 100644
--- a/mcs/tools/mdoc/Test/en.expected/Mono.DocTest/Color.xml
+++ b/mcs/tools/mdoc/Test/en.expected/Mono.DocTest/Color.xml
@@ -12,6 +12,19 @@
     <remarks>To be added.</remarks>
   </Docs>
   <Members>
+    <Member MemberName="AnotherGreen">
+      <MemberSignature Language="C#" Value="AnotherGreen" />
+      <MemberType>Field</MemberType>
+      <AssemblyInfo>
+        <AssemblyVersion>0.0.0.0</AssemblyVersion>
+      </AssemblyInfo>
+      <ReturnValue>
+        <ReturnType>Mono.DocTest.Color</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+      </Docs>
+    </Member>
     <Member MemberName="Blue">
       <MemberSignature Language="C#" Value="Blue" />
       <MemberType>Field</MemberType>
diff --git a/mcs/tools/mdoc/Test/html.expected/Mono.DocTest/Color.html b/mcs/tools/mdoc/Test/html.expected/Mono.DocTest/Color.html
index 9e740c6..df5931b 100644
--- a/mcs/tools/mdoc/Test/html.expected/Mono.DocTest/Color.html
+++ b/mcs/tools/mdoc/Test/html.expected/Mono.DocTest/Color.html
@@ -228,6 +228,14 @@
             <th>Description</th>
           </tr>
           <tr valign="top">
+            <td id="F:Mono.DocTest.Color.AnotherGreen">
+              <b>AnotherGreen</b>
+            </td>
+            <td>
+              <span class="NotEntered">Documentation for this section has not yet been entered.</span>
+            </td>
+          </tr>
+          <tr valign="top">
             <td id="F:Mono.DocTest.Color.Blue">
               <b>Blue</b>
             </td>
diff --git a/mcs/tools/mdoc/Test/msxdoc-expected.importslashdoc.xml b/mcs/tools/mdoc/Test/msxdoc-expected.importslashdoc.xml
index b245908..8d6d19c 100644
--- a/mcs/tools/mdoc/Test/msxdoc-expected.importslashdoc.xml
+++ b/mcs/tools/mdoc/Test/msxdoc-expected.importslashdoc.xml
@@ -16,6 +16,9 @@
             <remarks>
                 <see cref="T:Mono.DocTest.Color" />.</remarks>
         </member>
+        <member name="F:Mono.DocTest.Color.AnotherGreen">
+            <summary>To be added.</summary>
+        </member>
         <member name="F:Mono.DocTest.Color.Blue">
             <summary>Insert Blue summary here</summary>
             <remarks>
diff --git a/mcs/tools/security/ChangeLog b/mcs/tools/security/ChangeLog
index 4a65a88..662599b 100644
--- a/mcs/tools/security/ChangeLog
+++ b/mcs/tools/security/ChangeLog
@@ -1,3 +1,10 @@
+2009-10-08  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* certmgr.cs: Don't throw if we're missing an argument. Fix by
+	Romain Tartiere (bug #464765). Updated help to specify that 
+	"option type" is mandatory in some cases.
+	[Backport from HEAD to fix #544518]
+
 2008-10-17  Jonathan Pryor  <jpryor at novell.com>
 
 	* Makefile: Add doc-update target support.
diff --git a/mcs/tools/security/certmgr.cs b/mcs/tools/security/certmgr.cs
index fceff4f..8c79e2d 100644
--- a/mcs/tools/security/certmgr.cs
+++ b/mcs/tools/security/certmgr.cs
@@ -36,9 +36,9 @@ namespace Mono.Tools {
 
 		static private void Help () 
 		{
-			Console.WriteLine ("Usage: certmgr [action] [object type] [options] store [filename]");
-			Console.WriteLine ("   or: certmgr -list [object type] [options] store");
-			Console.WriteLine ("   or: certmgr -del [object type] [options] store certhash");
+			Console.WriteLine ("Usage: certmgr [action] [object-type] [options] store [filename]");
+			Console.WriteLine ("   or: certmgr -list object-type [options] store");
+			Console.WriteLine ("   or: certmgr -del object-type [options] store certhash");
 			Console.WriteLine ("   or: certmgr -ssl [options] url");
 			Console.WriteLine ();
 			Console.WriteLine ("actions");
@@ -492,8 +492,11 @@ namespace Mono.Tools {
 			ObjectType type = ObjectType.None;
 
 			int n = 1;
-			if (action != Action.Ssl)
-				type = GetObjectType (args [n++]);
+			if (action != Action.Ssl) {
+				type = GetObjectType (args [n]);
+				if (type != ObjectType.None)
+					n++;
+			}
 			
 			bool verbose = (GetCommand (args [n]) == "V");
 			if (verbose)
diff --git a/mcs/tools/xbuild/ChangeLog b/mcs/tools/xbuild/ChangeLog
index 501cbb2..3032b94 100644
--- a/mcs/tools/xbuild/ChangeLog
+++ b/mcs/tools/xbuild/ChangeLog
@@ -1,3 +1,245 @@
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: For referenced projects,
+	when trying to get the deploy items, ensure that the split
+	lists of project references are available.
+	(SplitProjectReferencesByExistent): New.
+	Set DependsOnTargets appropriately.
+
+2009-10-12  Ankit Jain  <jankit at novell.com>
+
+	* SolutionParser.cs: Handle non-existing project files, and
+	project file load errors. Raise warnings instead of failing.
+	* xbuild/Microsoft.Common.targets: Handle non-existant
+	Project references, skip instead of failing.
+
+2009-10-11  Ankit Jain  <jankit at novell.com>
+
+	* Main.cs: Add support for emitting messages in color.
+	Taking relevant code from mcs/report.cs . Using ANSI
+	color codes here instead of Console.ForegroundColor
+	because of a bug in Console.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Don't get list of files
+	to deploy, for 'Private' project references.
+	Fix target named for *CopyDeploy*.
+
+2009-10-08  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.tasks: Add RemoveDuplicates task.
+
+2009-10-03  Ankit Jain  <jankit at novell.com>
+
+	Fix bug#542461.
+	* xbuild/Microsoft.Common.targets (KeyOriginatorFile): Set to
+	$(AssemblyOriginatorKeyFile), if SignAssembly is true.
+	Use it for satellite assemblies also.
+
+2009-09-29  Ankit Jain  <jankit at novell.com>
+
+	* SolutionParser.cs (Insert): Show project name in case of a cyclic
+	dependency.
+
+2009-09-27  Ankit Jain  <jankit at novell.com>
+
+	* SolutionParser.cs: Implement support for WebSite projects. These
+	projects lack a project file, so properties like references are read
+	from the .sln file, and targets are generated for build/clean etc.
+
+2009-09-26  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Remove _ValidateEssentialProperties
+	from BuildDependsOn, which was a hack. It will get invoked from the
+	InitialTargets now.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* Makefile(EXTRA_DISTFILES): Add Microsoft.WebApplication.targets
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Emit list of files written
+	during the build, even if the build fails.
+
+2009-09-25  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #534992.
+	* xbuild/Microsoft.Common.targets: Add support for copying
+	app.config to AssemblyName.config
+	* xbuild/Microsoft.Common.tasks: Add FindAppConfigFile task.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* Parameters.cs (ParseArguments): If no project file is specified,
+	then look for a .sln or *proj file in the current directory.
+
+2009-09-24  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Create dir for WebApplication.targets .
+	* Microsoft.Common.targets (_ValidateEssentialProperties): New.
+	(BuildDependsOn): Add _ValidateEssentialProperties, temporary.
+	This should actually work via InitialTargets, which will be fixed
+	in a subsequent commit. Add PrepareForRun.
+	(PrepareForRun): New.
+	* xbuild/Microsoft.WebApplication.targets: New.
+
+2009-09-23  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Add 'Rebuild' target.
+	Also, set DefaultTargets to "Build".
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Remove dummy
+	@(_TargetPathItem), since we support item refs with transforms
+	as a property value.
+
+2009-08-26  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #533903.
+	* xbuild/Microsoft.Common.targets: Support building projects
+	directly from command line. Builds referenced projects. Honors
+	$(BuildingSolutionFile) and $(BuildingInsideVisualStudio) now.
+	Also, clean referenced projects.
+
+2009-08-21  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #531926
+	* xbuild/Microsoft.Common.targets: Add $(ConfigurationName)
+	and $(PlatformName) default values.
+	Move CoreCompile to a Compile target with corresponding
+	Before/After hooks and *DependsOn.
+	Add Pre/PostBuildEvents handling.
+
+2009-08-20  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #532264.
+	* Main.cs: Dont generate .sln.proj, project.Load can handle
+	.sln directly now. Show stack trace for exceptions if logger
+	verbosity is > normal
+	* SolutionParser.cs (ParseSolution): Add a param for a raise
+	warning delegate. Use Dictionary.TryGetValue, key might not
+	be present.
+
+2009-08-20  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (ResolveReferences*): Add
+	a *DependsOn property and Before/After hooks. Change output
+	of ResolvedFiles to @(ReferencePath).
+	* xbuild/Microsoft.CSharp.targets (Csc): Use @(ReferencePath)
+	for references.
+
+2009-08-19  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (ResolveAssemblyReference):
+	Make SearchPaths get value from a property (AssemblySearchPaths)
+	to allow it to be overridden.
+
+2009-08-18  Ankit Jain  <jankit at novell.com>
+
+	* SolutionParser.cs (ParseSolution): Project reference in a project
+	file, but not found in .sln file is ignored. Also, add dependencies
+	specified in the .sln file.
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #530368.
+	* SolutionParser.cs (AddProjectTargets): If a project name matches one
+	of the targets that we emit (Build/Clean etc), then rename to
+	"Solution:<project name>".
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (AllowUnsafeBlocks): Don't set any
+	default value.
+	(OutputPath): Set a default value.
+	(DeployOutputFiles): Copy only if something available to copy.
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
+
+	* SolutionParser.cs (ProjectInfo.Dependencies): Change to a dictionary
+	to keep track of corresponding ProjectInfo objects.
+	(ParseSolution): Refactor to populate the ProjectInfo.Dependencies
+	dictionary. Use AddBuildLevels to emit build levels to allow
+	parallel builds.
+	(AddProjectTargets): Dependency's projectInfo is directly available now.
+	(AddBuildLevels): New. Emit items named BuildLevelN, where each level
+	has projects that can be built in parallel. Lower levels represent
+	dependencies for higher levels.
+	(AddSolutionTargets): Instead of using CallTarget, directly use MSBuild
+	task with the new BuildLevelN stuff. Also tell the user about disabled
+	projects or missing project configs.
+	(TopologicalSort): New.
+	(Insert): New. Based on code from monodevelop.
+
+2009-08-14  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (ResolveAssemblyReference): Add
+	'{PkgConfig}' to SearchPaths.
+
+2009-07-31  Ankit Jain  <jankit at novell.com>
+
+	* ErrorUtilities.cs (ShowUsage): Implement.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	Fix bug #484771.
+	* xbuild/Microsoft.Common.targets (ResolveAssemblyReference): Add support
+	for $(OutDir).
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* ErrorUtilities.cs: Set version to Consts.MonoVersion .
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (ResolveAssemblyReference): Output
+	ResolvedFiles to @(ReferencePath), required for IDE integration.
+
+2009-07-30  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Implement 'Clean' target. Currently
+	just handles clean for a full build.
+
+2009-07-28  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Add missing 'SkipUnchangedFiles=true'
+	for the Copy tasks.
+	(CopyDeployFiles*): Fix typos, Add inputs/outputs for the
+	PreserveNewest case and remove for copy always case.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets: Oops, forgot to remove some
+	debug stuff.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* Makefile: Create a lib/mono/xbuild directory for xbuild
+	extensions.
+
+2009-07-23  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.Common.targets (AssignProjectConfigurations): New.
+	(ResolveProjectReferences): Add dependency on AssignProjectConfigurations
+	target. Also, set the config and platform properties for the msbuild task
+	being invoked.
+	* xbuild/Microsoft.Common.tasks: Add AssignProjectConfiguration .
+
+2009-07-22  Ankit Jain  <jankit at novell.com>
+
+	* xbuild/Microsoft.VisualBasic.targets (Vbc.References): Remove
+	"@(ChildProjectReferences)" as it gets resolved earlier
+	and is part of @(ResolvedFiles).
+
+2009-07-22  Ankit Jain  <jankit at novell.com>
+
+	* xbuild.Microsoft.CSharp.targets (Csc.References): Remove
+	"@(ChildProjectReferences)" as it gets resolved earlier
+	and is part of @(ResolvedFiles).
+
 2009-06-12  Ankit Jain  <jankit at novell.com>
 
 	* xbuild/Microsoft.Common.targets (ProjectDir): Fix typo.
diff --git a/mcs/tools/xbuild/ErrorUtilities.cs b/mcs/tools/xbuild/ErrorUtilities.cs
index 425bf7b..78c078b 100644
--- a/mcs/tools/xbuild/ErrorUtilities.cs
+++ b/mcs/tools/xbuild/ErrorUtilities.cs
@@ -32,15 +32,10 @@ using System;
 namespace Mono.XBuild.CommandLine {
 	public static class ErrorUtilities {
 
-		static string[] usage = {
-			"",
-			"No usage help yet"
-		};
-		
 		static string[] version = {
-			"XBuild Engine Version 0.1",
+			String.Format ("XBuild Engine Version {0}", Consts.MonoVersion),
 			String.Format ("Mono, Version {0}", Consts.MonoVersion),
-			"Copyright (C) Marek Sieradzki 2005. All rights reserved.",
+			"Copyright (C) Marek Sieradzki 2005-2008, Novell 2008-2009.",
 		};
 
 		
@@ -82,9 +77,24 @@ namespace Mono.XBuild.CommandLine {
 
 		static public void ShowUsage ()
 		{
-			Display (usage);
+			Display (version);
+			Console.WriteLine ("xbuild [options] [project-file]");
+			Console.WriteLine (
+				"    /version		Show the xbuild version\n" +
+				"    /noconsolelogger	Disable the default console logger\n" +
+				"    /target:T1[,TN]	List of targets to build\n" +
+				"    /property:Name=Value\n" +
+				"			Set or override project properties\n" +
+				"    /logger:<logger>	Custom logger to log events\n" +
+				"    /verbosity:<level>	Logger verbosity level : quiet, minimal, normal, detailed, diagnostic\n" +
+				"    /validate		Validate the project file against the schema\n" +
+				"    /validate:<schema>	Validate the project file against the specified schema\n" +
+				"    /consoleloggerparameters:<params>\n" +
+				"			Parameters for the console logger\n" +
+				"    /nologo		Don't show the initial banner\n" +
+				"    /help		Show this help\n"
+				);
 			Environment.Exit (0);
-			
 		}
 
 		static public void ShowVersion (bool exit)
diff --git a/mcs/tools/xbuild/Main.cs b/mcs/tools/xbuild/Main.cs
index dea952d..346e9a2 100644
--- a/mcs/tools/xbuild/Main.cs
+++ b/mcs/tools/xbuild/Main.cs
@@ -3,8 +3,11 @@
 //
 // Author:
 //   Marek Sieradzki (marek.sieradzki at gmail.com)
+//   Miguel de Icaza (miguel at ximian.com)
+//   Marek Safar (marek.safar at seznam.cz)
 //
 // (C) 2005 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -46,6 +49,8 @@ namespace Mono.XBuild.CommandLine {
 		
 		Engine		engine;
 		Project		project;
+		ConsoleReportPrinter printer;
+
 		
 		public static void Main (string[] args)
 		{
@@ -64,9 +69,12 @@ namespace Mono.XBuild.CommandLine {
 		public void Execute ()
 		{
 			bool result = false;
+			bool show_stacktrace = false;
 			
 			try {
 				parameters.ParseArguments (args);
+				show_stacktrace = (parameters.LoggerVerbosity == LoggerVerbosity.Detailed ||
+					parameters.LoggerVerbosity == LoggerVerbosity.Diagnostic);
 				
 				if (parameters.DisplayVersion)
 					ErrorUtilities.ShowVersion (false);
@@ -76,7 +84,10 @@ namespace Mono.XBuild.CommandLine {
 				engine.GlobalProperties = this.parameters.Properties;
 				
 				if (!parameters.NoConsoleLogger) {
-					ConsoleLogger cl = new ConsoleLogger ();
+					printer = new ConsoleReportPrinter ();
+					ConsoleLogger cl = new ConsoleLogger (parameters.LoggerVerbosity,
+							printer.Print, printer.SetForeground, printer.ResetColor);
+
 					cl.Parameters = parameters.ConsoleLoggerParameters;
 					cl.Verbosity = parameters.LoggerVerbosity; 
 					engine.RegisterLogger (cl);
@@ -108,9 +119,6 @@ namespace Mono.XBuild.CommandLine {
 					return;
 				}
 
-				if (projectFile.EndsWith (".sln"))
-					projectFile = GenerateSolutionProject (projectFile);
-
 				project.Load (projectFile);
 				
 				string oldCurrentDirectory = Environment.CurrentDirectory;
@@ -122,11 +130,11 @@ namespace Mono.XBuild.CommandLine {
 			}
 			
 			catch (InvalidProjectFileException ipfe) {
-				ErrorUtilities.ReportError (0, ipfe.Message);
+				ErrorUtilities.ReportError (0, show_stacktrace ? ipfe.ToString () : ipfe.Message);
 			}
 
 			catch (InternalLoggerException ile) {
-				ErrorUtilities.ReportError (0, ile.Message);
+				ErrorUtilities.ReportError (0, show_stacktrace ? ile.ToString () : ile.Message);
 			}
 
 			catch (Exception) {
@@ -142,17 +150,162 @@ namespace Mono.XBuild.CommandLine {
 
 		}
 
-		string GenerateSolutionProject (string solutionFile)
+	}
+
+	// code from mcs/report.cs
+	class ConsoleReportPrinter
+	{
+		string prefix, postfix;
+		bool color_supported;
+		TextWriter writer;
+		string [] colorPrefixes;
+
+		public ConsoleReportPrinter ()
+			: this (Console.Out)
+		{
+		}
+
+		public ConsoleReportPrinter (TextWriter writer)
+		{
+			this.writer = writer;
+
+			string term = Environment.GetEnvironmentVariable ("TERM");
+			bool xterm_colors = false;
+
+			color_supported = false;
+			switch (term){
+			case "xterm":
+			case "rxvt":
+			case "rxvt-unicode":
+				if (Environment.GetEnvironmentVariable ("COLORTERM") != null){
+					xterm_colors = true;
+				}
+				break;
+
+			case "xterm-color":
+				xterm_colors = true;
+				break;
+			}
+			if (!xterm_colors)
+				return;
+
+			if (!(UnixUtils.isatty (1) && UnixUtils.isatty (2)))
+				return;
+
+			color_supported = true;
+			PopulateColorPrefixes ();
+			postfix = "\x001b[0m";
+		}
+
+		void PopulateColorPrefixes ()
+		{
+			colorPrefixes = new string [16];
+
+			colorPrefixes [(int)ConsoleColor.Black] = GetForeground ("black");
+			colorPrefixes [(int)ConsoleColor.DarkBlue] = GetForeground ("blue");
+			colorPrefixes [(int)ConsoleColor.DarkGreen] = GetForeground ("green");
+			colorPrefixes [(int)ConsoleColor.DarkCyan] = GetForeground ("cyan");
+			colorPrefixes [(int)ConsoleColor.DarkRed] = GetForeground ("red");
+			colorPrefixes [(int)ConsoleColor.DarkMagenta] = GetForeground ("magenta");
+			colorPrefixes [(int)ConsoleColor.DarkYellow] = GetForeground ("yellow");
+			colorPrefixes [(int)ConsoleColor.DarkGray] = GetForeground ("grey");
+
+			colorPrefixes [(int)ConsoleColor.Gray] = GetForeground ("brightgrey");
+			colorPrefixes [(int)ConsoleColor.Blue] = GetForeground ("brightblue");
+			colorPrefixes [(int)ConsoleColor.Green] = GetForeground ("brightgreen");
+			colorPrefixes [(int)ConsoleColor.Cyan] = GetForeground ("brightcyan");
+			colorPrefixes [(int)ConsoleColor.Red] = GetForeground ("brightred");
+			colorPrefixes [(int)ConsoleColor.Magenta] = GetForeground ("brightmagenta");
+			colorPrefixes [(int)ConsoleColor.Yellow] = GetForeground ("brightyellow");
+
+			colorPrefixes [(int)ConsoleColor.White] = GetForeground ("brightwhite");
+		}
+
+		public void SetForeground (ConsoleColor color)
 		{
-			SolutionParser s = new SolutionParser ();
-			Project p = engine.CreateNewProject ();
-			s.ParseSolution (solutionFile, p);
-			string projectFile = solutionFile + ".proj";
-			p.Save (projectFile);
+			if (color_supported)
+				prefix = colorPrefixes [(int)color];
+		}
 
-			return projectFile;
+		public void ResetColor ()
+		{
+			prefix = "\x001b[0m";
 		}
+
+		static int NameToCode (string s)
+		{
+			switch (s) {
+			case "black":
+				return 0;
+			case "red":
+				return 1;
+			case "green":
+				return 2;
+			case "yellow":
+				return 3;
+			case "blue":
+				return 4;
+			case "magenta":
+				return 5;
+			case "cyan":
+				return 6;
+			case "grey":
+			case "white":
+				return 7;
+			}
+			return 7;
+		}
+
+		//
+		// maps a color name to its xterm color code
+		//
+		static string GetForeground (string s)
+		{
+			string highcode;
+
+			if (s.StartsWith ("bright")) {
+				highcode = "1;";
+				s = s.Substring (6);
+			} else
+				highcode = "";
+
+			return "\x001b[" + highcode + (30 + NameToCode (s)).ToString () + "m";
+		}
+
+		static string GetBackground (string s)
+		{
+			return "\x001b[" + (40 + NameToCode (s)).ToString () + "m";
+		}
+
+		string FormatText (string txt)
+		{
+			if (prefix != null && color_supported)
+				return prefix + txt + postfix;
+
+			return txt;
+		}
+
+		public void Print (string message)
+		{
+			writer.WriteLine (FormatText (message));
+		}
+
 	}
+
+	class UnixUtils {
+		[System.Runtime.InteropServices.DllImport ("libc", EntryPoint="isatty")]
+		extern static int _isatty (int fd);
+
+		public static bool isatty (int fd)
+		{
+			try {
+				return _isatty (fd) == 1;
+			} catch {
+				return false;
+			}
+		}
+	}
+
 }
 
 #endif
diff --git a/mcs/tools/xbuild/Makefile b/mcs/tools/xbuild/Makefile
index db9ee29..1672dd2 100644
--- a/mcs/tools/xbuild/Makefile
+++ b/mcs/tools/xbuild/Makefile
@@ -9,6 +9,7 @@ include ../../build/executable.make
 
 install-local:	install-extras
 
+WEBAPP_DIR = Microsoft/VisualStudio/v9.0/WebApplications
 EXTRAS_DIR = $(mono_libdir)/mono/2.0
 install-extras: 
 	$(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR)
@@ -21,6 +22,9 @@ install-extras:
 	$(MKINSTALLDIRS) $(DESTDIR)$(EXTRAS_DIR)/MSBuild
 	$(INSTALL_DATA) xbuild/MSBuild/Microsoft.Build.CommonTypes.xsd $(DESTDIR)$(EXTRAS_DIR)/MSBuild
 	$(INSTALL_DATA) xbuild/MSBuild/Microsoft.Build.Core.xsd $(DESTDIR)$(EXTRAS_DIR)/MSBuild
+	$(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild
+	$(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild/$(WEBAPP_DIR)
+	$(INSTALL_DATA) xbuild/Microsoft.WebApplication.targets $(DESTDIR)$(mono_libdir)/mono/xbuild/$(WEBAPP_DIR)
 
 EXTRA_DISTFILES = \
 	xbuild/xbuild.rsp \
@@ -30,4 +34,6 @@ EXTRA_DISTFILES = \
 	xbuild/Microsoft.Common.targets \
 	xbuild/MSBuild/Microsoft.Build.CommonTypes.xsd \
 	xbuild/MSBuild/Microsoft.Build.Core.xsd		\
-	xbuild/Microsoft.VisualBasic.targets
+	xbuild/Microsoft.VisualBasic.targets \
+	xbuild/Microsoft.WebApplication.targets
+
diff --git a/mcs/tools/xbuild/Parameters.cs b/mcs/tools/xbuild/Parameters.cs
index 3596bd9..1f36902 100644
--- a/mcs/tools/xbuild/Parameters.cs
+++ b/mcs/tools/xbuild/Parameters.cs
@@ -104,11 +104,22 @@ namespace Mono.XBuild.CommandLine {
 					remainingArguments.Add (s);
 			}
 			if (remainingArguments.Count == 0) {
-				string[] files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*.??proj");
-				if (files.Length > 0)
-					projectFile = files [0];
+				string[] sln_files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*.sln");
+				string[] proj_files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*proj");
+
+				if (sln_files.Length == 0 && proj_files.Length == 0)
+					ErrorUtilities.ReportError (3, "Please specify the project or solution file " +
+							"to build, as none was found in the current directory.");
+
+				if (sln_files.Length + proj_files.Length > 1)
+					ErrorUtilities.ReportError (5, "Please specify the project or solution file " +
+							"to build, as more than one solution or project file was found " +
+							"in the current directory");
+
+				if (sln_files.Length == 1)
+					projectFile = sln_files [0];
 				else
-					ErrorUtilities.ReportError (3, "No .proj file specified and no found in current directory.");
+					projectFile = proj_files [0];
 			} else if (remainingArguments.Count == 1) {
 				projectFile = (string) remainingArguments [0];
 			} else {
diff --git a/mcs/tools/xbuild/SolutionParser.cs b/mcs/tools/xbuild/SolutionParser.cs
index 5d7e6c4..a9fecfd 100644
--- a/mcs/tools/xbuild/SolutionParser.cs
+++ b/mcs/tools/xbuild/SolutionParser.cs
@@ -3,8 +3,11 @@
 //
 // Author:
 //   Jonathan Chambers (joncham at gmail.com)
+//   Ankit Jain <jankit at novell.com>
+//   Lluis Sanchez Gual <lluis at novell.com>
 //
 // (C) 2009 Jonathan Chambers
+// Copyright 2008, 2009 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -38,6 +41,7 @@ namespace Mono.XBuild.CommandLine {
 	class ProjectInfo {
 		public string Name;
 		public string FileName;
+		public Guid Guid;
 
 		public ProjectInfo (string name, string fileName)
 		{
@@ -46,7 +50,19 @@ namespace Mono.XBuild.CommandLine {
 		}
 
 		public Dictionary<TargetInfo, TargetInfo> TargetMap = new Dictionary<TargetInfo, TargetInfo> ();
-		public List<Guid> Dependencies = new List<Guid> ();
+		public Dictionary<Guid, ProjectInfo> Dependencies = new Dictionary<Guid, ProjectInfo> ();
+		public Dictionary<string, ProjectSection> ProjectSections = new Dictionary<string, ProjectSection> ();
+		public List<string> AspNetConfigurations = new List<string> ();
+	}
+
+	class ProjectSection {
+		public string Name;
+		public Dictionary<string, string> Properties = new Dictionary<string, string> ();
+
+		public ProjectSection (string name)
+		{
+			Name = name;
+		}
 	}
 
 	struct TargetInfo {
@@ -68,6 +84,8 @@ namespace Mono.XBuild.CommandLine {
 	}
 
 
+	internal delegate void RaiseWarningHandler (int errorNumber, string message);
+
 	class SolutionParser {
 		static string[] buildTargets = new string[] { "Build", "Clean", "Rebuild", "Publish" };
 
@@ -76,6 +94,7 @@ namespace Mono.XBuild.CommandLine {
 		static Regex projectRegex = new Regex ("Project\\(\"(" + guidExpression + ")\"\\) = \"(.*?)\", \"(.*?)\", \"(" + guidExpression + ")\"(\\s*?)((\\s*?)ProjectSection\\((.*?)\\) = (.*?)EndProjectSection(\\s*?))*(\\s*?)EndProject?", RegexOptions.Singleline);
 		static Regex projectDependenciesRegex = new Regex ("ProjectSection\\((.*?)\\) = \\w*(.*?)EndProjectSection", RegexOptions.Singleline);
 		static Regex projectDependencyRegex = new Regex ("\\s*(" + guidExpression + ") = (" + guidExpression + ")");
+		static Regex projectSectionPropertiesRegex = new Regex ("\\s*(?<name>.*) = \"(?<value>.*)\"");
 
 		static Regex globalRegex = new Regex ("Global(.*)EndGlobal", RegexOptions.Singleline);
 		static Regex globalSectionRegex = new Regex ("GlobalSection\\((.*?)\\) = \\w*(.*?)EndGlobalSection", RegexOptions.Singleline);
@@ -86,9 +105,13 @@ namespace Mono.XBuild.CommandLine {
 
 		static string solutionFolderGuid = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}";
 		static string vcprojGuid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
+		static string websiteProjectGuid = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}";
+
+		RaiseWarningHandler RaiseWarning;
 
-		public void ParseSolution (string file, Project p)
+		public void ParseSolution (string file, Project p, RaiseWarningHandler RaiseWarning)
 		{
+			this.RaiseWarning = RaiseWarning;
 			AddGeneralSettings (file, p);
 
 			StreamReader reader = new StreamReader (file);
@@ -98,6 +121,8 @@ namespace Mono.XBuild.CommandLine {
 
 			List<TargetInfo> solutionTargets = new List<TargetInfo> ();
 			Dictionary<Guid, ProjectInfo> projectInfos = new Dictionary<Guid, ProjectInfo> ();
+			Dictionary<Guid, ProjectInfo> websiteProjectInfos = new Dictionary<Guid, ProjectInfo> ();
+			List<ProjectInfo>[] infosByLevel = null;
 
 			Match m = projectRegex.Match (line);
 			while (m.Success) {
@@ -108,37 +133,97 @@ namespace Mono.XBuild.CommandLine {
 					m = m.NextMatch ();
 					continue;
 				}
+
 				if (String.Compare (m.Groups [1].Value, vcprojGuid,
 						StringComparison.InvariantCultureIgnoreCase) == 0) {
 					// Ignore vcproj 
-					ErrorUtilities.ReportWarning (0, string.Format("Ignoring vcproj '{0}'.", projectInfo.Name));
+					RaiseWarning (0, string.Format("Ignoring vcproj '{0}'.", projectInfo.Name));
 					m = m.NextMatch ();
 					continue;
 				}
 
-				projectInfos.Add (new Guid (m.Groups[4].Value), projectInfo);
+				if (String.Compare (m.Groups [1].Value, websiteProjectGuid,
+						StringComparison.InvariantCultureIgnoreCase) == 0)
+					websiteProjectInfos.Add (new Guid (m.Groups[4].Value), projectInfo);
+				else
+					projectInfos.Add (new Guid (m.Groups[4].Value), projectInfo);
 
-				Project currentProject = p.ParentEngine.CreateNewProject ();
-				currentProject.Load (Path.Combine (solutionDir,
-							projectInfo.FileName.Replace ('\\', Path.DirectorySeparatorChar)));
-
-				foreach (BuildItem bi in currentProject.GetEvaluatedItemsByName ("ProjectReference")) {
-					string projectReferenceGuid = bi.GetEvaluatedMetadata ("Project");
-					projectInfo.Dependencies.Add (new Guid (projectReferenceGuid));
-				}
+				projectInfo.Guid = new Guid (m.Groups [4].Value);
 
 				Match projectSectionMatch = projectDependenciesRegex.Match (m.Groups[6].Value);
 				while (projectSectionMatch.Success) {
-					Match projectDependencyMatch = projectDependencyRegex.Match (projectSectionMatch.Value);
-					while (projectDependencyMatch.Success) {
-						projectInfo.Dependencies.Add (new Guid (projectDependencyMatch.Groups[1].Value));
-						projectDependencyMatch = projectDependencyMatch.NextMatch ();
+					string section_name = projectSectionMatch.Groups [1].Value;
+					if (String.Compare (section_name, "ProjectDependencies") == 0) {
+						Match projectDependencyMatch = projectDependencyRegex.Match (projectSectionMatch.Value);
+						while (projectDependencyMatch.Success) {
+							// we might not have projectInfo available right now, so
+							// set it to null, and fill it in later
+							projectInfo.Dependencies [new Guid (projectDependencyMatch.Groups[1].Value)] = null;
+							projectDependencyMatch = projectDependencyMatch.NextMatch ();
+						}
+					} else {
+						ProjectSection section = new ProjectSection (section_name);
+						Match propertiesMatch = projectSectionPropertiesRegex.Match (
+									projectSectionMatch.Groups [2].Value);
+						while (propertiesMatch.Success) {
+							section.Properties [propertiesMatch.Groups ["name"].Value] =
+								propertiesMatch.Groups ["value"].Value;
+
+							propertiesMatch = propertiesMatch.NextMatch ();
+						}
+
+						projectInfo.ProjectSections [section_name] = section;
 					}
 					projectSectionMatch = projectSectionMatch.NextMatch ();
 				}
 				m = m.NextMatch ();
 			}
 
+			foreach (ProjectInfo projectInfo in projectInfos.Values) {
+				string filename = Path.Combine (solutionDir,
+							projectInfo.FileName.Replace ('\\', Path.DirectorySeparatorChar));
+
+				if (!File.Exists (filename)) {
+					RaiseWarning (0, String.Format ("Project file {0} referenced in the solution file, " +
+								"not found. Ignoring.", filename));
+					continue;
+				}
+
+				Project currentProject = p.ParentEngine.CreateNewProject ();
+				try {
+					currentProject.Load (filename);
+				} catch (InvalidProjectFileException e) {
+					RaiseWarning (0, e.Message);
+					continue;
+				}
+
+				foreach (BuildItem bi in currentProject.GetEvaluatedItemsByName ("ProjectReference")) {
+					string projectReferenceGuid = bi.GetEvaluatedMetadata ("Project");
+					Guid guid = new Guid (projectReferenceGuid);
+					ProjectInfo info;
+					if (projectInfos.TryGetValue (guid, out info))
+						// ignore if not found
+						projectInfo.Dependencies [guid] = info;
+				}
+			}
+
+			// fill in the project info for deps found in the .sln file
+			foreach (ProjectInfo projectInfo in projectInfos.Values) {
+				List<Guid> missingInfos = new List<Guid> ();
+				foreach (KeyValuePair<Guid, ProjectInfo> dependency in projectInfo.Dependencies) {
+					if (dependency.Value == null)
+						missingInfos.Add (dependency.Key);
+				}
+
+				foreach (Guid guid in missingInfos) {
+					ProjectInfo info;
+					if (projectInfos.TryGetValue (guid, out info))
+						projectInfo.Dependencies [guid] = info;
+					else
+						projectInfo.Dependencies.Remove (guid);
+				}
+			}
+
 			Match globalMatch = globalRegex.Match (line);
 			Match globalSectionMatch = globalSectionRegex.Match (globalMatch.Groups[1].Value);
 			while (globalSectionMatch.Success) {
@@ -148,7 +233,8 @@ namespace Mono.XBuild.CommandLine {
 						ParseSolutionConfigurationPlatforms (globalSectionMatch.Groups[2].Value, solutionTargets);
 						break;
 					case "ProjectConfigurationPlatforms":
-						ParseProjectConfigurationPlatforms (globalSectionMatch.Groups[2].Value, projectInfos);
+						ParseProjectConfigurationPlatforms (globalSectionMatch.Groups[2].Value,
+								projectInfos, websiteProjectInfos);
 						break;
 					case "SolutionProperties":
 						ParseSolutionProperties (globalSectionMatch.Groups[2].Value);
@@ -156,17 +242,22 @@ namespace Mono.XBuild.CommandLine {
 					case "NestedProjects":
 						break;
 					default:
-						ErrorUtilities.ReportWarning (0, string.Format("Don't know how to handle GlobalSection {0}, Ignoring.", sectionType));
+						RaiseWarning (0, string.Format("Don't know how to handle GlobalSection {0}, Ignoring.", sectionType));
 						break;
 				}
 				globalSectionMatch = globalSectionMatch.NextMatch ();
 			}
 
-			AddCurrentSolutionConfigurationContents (p, solutionTargets, projectInfos);
+			int num_levels = AddBuildLevels (p, solutionTargets, projectInfos, ref infosByLevel);
+
+			AddCurrentSolutionConfigurationContents (p, solutionTargets, projectInfos, websiteProjectInfos);
+			AddWebsiteProperties (p, websiteProjectInfos, projectInfos);
 			AddValidateSolutionConfiguration (p);
-			AddProjectTargets (p, solutionTargets, projectInfos);
-			AddSolutionTargets (p, projectInfos);
 
+			AddGetFrameworkPathTarget (p);
+			AddWebsiteTargets (p, websiteProjectInfos, projectInfos, infosByLevel, solutionTargets);
+			AddProjectTargets (p, solutionTargets, projectInfos);
+			AddSolutionTargets (p, num_levels, websiteProjectInfos.Values);
 		}
 
 		void AddGeneralSettings (string solutionFile, Project p)
@@ -176,10 +267,6 @@ namespace Mono.XBuild.CommandLine {
 			p.AddNewUsingTaskFromAssemblyName ("CreateTemporaryVCProject", "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
 			p.AddNewUsingTaskFromAssemblyName ("ResolveVCProjectOutput", "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
 
-			BuildPropertyGroup aspNetConfigurationPropertyGroup = p.AddNewPropertyGroup (true);
-			aspNetConfigurationPropertyGroup.Condition = " ('$(AspNetConfiguration)' == '') ";
-			aspNetConfigurationPropertyGroup.AddNewProperty ("AspNetConfiguration", "$(Configuration)");
-
 			string solutionFilePath = Path.GetFullPath (solutionFile);
 			BuildPropertyGroup solutionPropertyGroup = p.AddNewPropertyGroup (true);
 			solutionPropertyGroup.AddNewProperty ("SolutionDir", Path.GetDirectoryName (solutionFilePath) + Path.DirectorySeparatorChar);
@@ -200,7 +287,9 @@ namespace Mono.XBuild.CommandLine {
 			}
 		}
 
-		void ParseProjectConfigurationPlatforms (string section, Dictionary<Guid, ProjectInfo> projectInfos)
+		// ignores the website projects, in the websiteProjectInfos
+		void ParseProjectConfigurationPlatforms (string section, Dictionary<Guid, ProjectInfo> projectInfos,
+				Dictionary<Guid, ProjectInfo> websiteProjectInfos)
 		{
 			List<Guid> missingGuids = new List<Guid> ();
 			Match projectConfigurationPlatform = projectConfigurationActiveCfgRegex.Match (section);
@@ -209,7 +298,9 @@ namespace Mono.XBuild.CommandLine {
 				ProjectInfo projectInfo;
 				if (!projectInfos.TryGetValue (guid, out projectInfo)) {
 					if (!missingGuids.Contains (guid)) {
-						ErrorUtilities.ReportWarning (0, string.Format("Failed to find project {0}", guid));
+						if (!websiteProjectInfos.ContainsKey (guid))
+							// ignore website projects
+							RaiseWarning (0, string.Format("Failed to find project {0}", guid));
 						missingGuids.Add (guid);
 					}
 					projectConfigurationPlatform = projectConfigurationPlatform.NextMatch ();
@@ -231,7 +322,7 @@ namespace Mono.XBuild.CommandLine {
 				ProjectInfo projectInfo;
 				if (!projectInfos.TryGetValue (guid, out projectInfo)) {
 					if (!missingGuids.Contains (guid)) {
-						ErrorUtilities.ReportWarning (0, string.Format("Failed to find project {0}", guid));
+						RaiseWarning (0, string.Format("Failed to find project {0}", guid));
 						missingGuids.Add (guid);
 					}
 					projectConfigurationPlatformBuild = projectConfigurationPlatformBuild.NextMatch ();
@@ -253,12 +344,26 @@ namespace Mono.XBuild.CommandLine {
 		{
 		}
 
-		void AddCurrentSolutionConfigurationContents (Project p, List<TargetInfo> solutionTargets, Dictionary<Guid, ProjectInfo> projectInfos)
+		void AddCurrentSolutionConfigurationContents (Project p, List<TargetInfo> solutionTargets,
+				Dictionary<Guid, ProjectInfo> projectInfos,
+				Dictionary<Guid, ProjectInfo> websiteProjectInfos)
 		{
-			AddDefaultSolutionConfiguration (p,
-					solutionTargets.Count > 0 ?
-						solutionTargets [0] :
-						new TargetInfo ("Debug", "Any CPU"));
+			TargetInfo default_target_info = new TargetInfo ("Debug", "Any CPU");
+			if (solutionTargets.Count > 0) {
+				bool found = false;
+				foreach (TargetInfo tinfo in solutionTargets) {
+					if (String.Compare (tinfo.Platform, "Mixed Platforms") == 0) {
+						default_target_info = tinfo;
+						found = true;
+						break;
+					}
+				}
+
+				if (!found)
+					default_target_info = solutionTargets [0];
+			}
+
+			AddDefaultSolutionConfiguration (p, default_target_info);
 
 			foreach (TargetInfo solutionTarget in solutionTargets) {
 				BuildPropertyGroup platformPropertyGroup = p.AddNewPropertyGroup (false);
@@ -268,18 +373,28 @@ namespace Mono.XBuild.CommandLine {
 					solutionTarget.Platform
 					);
 
-				string solutionConfigurationContents = "<SolutionConfiguration xmlns=\"\">";
+				StringBuilder solutionConfigurationContents = new StringBuilder ();
+				solutionConfigurationContents.Append ("<SolutionConfiguration xmlns=\"\">");
 				foreach (KeyValuePair<Guid, ProjectInfo> projectInfo in projectInfos) {
-					foreach (KeyValuePair<TargetInfo, TargetInfo> targetInfo in projectInfo.Value.TargetMap) {
-						if (solutionTarget.Configuration == targetInfo.Key.Configuration && solutionTarget.Platform == targetInfo.Key.Platform) {
-							solutionConfigurationContents += string.Format ("<ProjectConfiguration Project=\"{0}\">{1}|{2}</ProjectConfiguration>",
-								projectInfo.Key.ToString ("B").ToUpper (), targetInfo.Value.Configuration, targetInfo.Value.Platform);
-						}
-					}
+					AddProjectConfigurationItems (projectInfo.Key, projectInfo.Value, solutionTarget, solutionConfigurationContents);
 				}
-				solutionConfigurationContents += "</SolutionConfiguration>";
+				solutionConfigurationContents.Append ("</SolutionConfiguration>");
 
-				platformPropertyGroup.AddNewProperty ("CurrentSolutionConfigurationContents", solutionConfigurationContents);
+				platformPropertyGroup.AddNewProperty ("CurrentSolutionConfigurationContents",
+						solutionConfigurationContents.ToString ());
+			}
+		}
+
+		void AddProjectConfigurationItems (Guid guid, ProjectInfo projectInfo, TargetInfo solutionTarget,
+				StringBuilder solutionConfigurationContents)
+		{
+			foreach (KeyValuePair<TargetInfo, TargetInfo> targetInfo in projectInfo.TargetMap) {
+				if (solutionTarget.Configuration == targetInfo.Key.Configuration &&
+						solutionTarget.Platform == targetInfo.Key.Platform) {
+					solutionConfigurationContents.AppendFormat (
+							"<ProjectConfiguration Project=\"{0}\">{1}|{2}</ProjectConfiguration>",
+					guid.ToString ("B").ToUpper (), targetInfo.Value.Configuration, targetInfo.Value.Platform);
+				}
 			}
 		}
 
@@ -292,6 +407,11 @@ namespace Mono.XBuild.CommandLine {
 			BuildPropertyGroup platformPropertyGroup = p.AddNewPropertyGroup (true);
 			platformPropertyGroup.Condition = " '$(Platform)' == '' ";
 			platformPropertyGroup.AddNewProperty ("Platform", target.Platform);
+			
+			// emit default for AspNetConfiguration also
+			BuildPropertyGroup aspNetConfigurationPropertyGroup = p.AddNewPropertyGroup (true);
+			aspNetConfigurationPropertyGroup.Condition = " ('$(AspNetConfiguration)' == '') ";
+			aspNetConfigurationPropertyGroup.AddNewProperty ("AspNetConfiguration", "$(Configuration)");
 		}
 
 		void AddWarningForMissingProjectConfiguration (Target target, string slnConfig, string slnPlatform, string projectName)
@@ -306,6 +426,224 @@ namespace Mono.XBuild.CommandLine {
 
 		}
 
+		// Website project methods
+
+		void AddWebsiteProperties (Project p, Dictionary<Guid, ProjectInfo> websiteProjectInfos,
+				Dictionary<Guid, ProjectInfo> projectInfos)
+		{
+			var propertyGroupByConfig = new Dictionary<string, BuildPropertyGroup> ();
+			foreach (KeyValuePair<Guid, ProjectInfo> infoPair in websiteProjectInfos) {
+				ProjectInfo info = infoPair.Value;
+				string projectGuid = infoPair.Key.ToString ();
+
+				ProjectSection section;
+				if (!info.ProjectSections.TryGetValue ("WebsiteProperties", out section)) {
+					RaiseWarning (0, String.Format ("Website project '{0}' does not have the required project section: WebsiteProperties. Ignoring project.", info.Name));
+					return;
+				}
+
+				//parse project references
+				string [] ref_guids = null;
+				string references;
+				if (section.Properties.TryGetValue ("ProjectReferences", out references)) {
+					ref_guids = references.Split (new char [] {';'}, StringSplitOptions.RemoveEmptyEntries);
+					for (int i = 0; i < ref_guids.Length; i ++) {
+						// "{guid}|foo.dll"
+						ref_guids [i] = ref_guids [i].Split ('|') [0];
+
+						Guid r_guid = new Guid (ref_guids [i]);
+						ProjectInfo ref_info;
+						if (projectInfos.TryGetValue (r_guid, out ref_info))
+							// ignore if not found
+							info.Dependencies [r_guid] = ref_info;
+					}
+				}
+
+				foreach (KeyValuePair<string, string> pair in section.Properties) {
+					//looking for -- ConfigName.AspNetCompiler.PropName
+					string [] parts = pair.Key.Split ('.');
+					if (parts.Length != 3 || String.Compare (parts [1], "AspNetCompiler") != 0)
+						continue;
+
+					string config = parts [0];
+					string propertyName = parts [2];
+
+					BuildPropertyGroup bpg;
+					if (!propertyGroupByConfig.TryGetValue (config, out bpg)) {
+						bpg = p.AddNewPropertyGroup (true);
+						bpg.Condition = String.Format (" '$(AspNetConfiguration)' == '{0}' ", config);
+						propertyGroupByConfig [config] = bpg;
+					}
+
+					bpg.AddNewProperty (String.Format ("Project_{0}_AspNet{1}", projectGuid, propertyName),
+								pair.Value);
+
+					if (!info.AspNetConfigurations.Contains (config))
+						info.AspNetConfigurations.Add (config);
+				}
+			}
+		}
+
+		// For WebSite projects
+		// The main "Build" target:
+		//	1. builds all non-website projects
+		//	2. calls target for website project
+		//		- gets target path for the referenced projects
+		//		- Resolves dependencies, satellites etc for the
+		//		  referenced project assemblies, and copies them
+		//		  to bin/ folder
+		void AddWebsiteTargets (Project p, Dictionary<Guid, ProjectInfo> websiteProjectInfos,
+				Dictionary<Guid, ProjectInfo> projectInfos, List<ProjectInfo>[] infosByLevel,
+				List<TargetInfo> solutionTargets)
+		{
+			foreach (ProjectInfo w_info in websiteProjectInfos.Values) {
+				// gets a linear list of dependencies
+				List<ProjectInfo> depInfos = new List<ProjectInfo> ();
+				foreach (List<ProjectInfo> pinfos in infosByLevel) {
+					foreach (ProjectInfo pinfo in pinfos)
+						if (w_info.Dependencies.ContainsKey (pinfo.Guid))
+							depInfos.Add (pinfo);
+				}
+
+				foreach (string buildTarget in new string [] {"Build", "Rebuild"})
+					AddWebsiteTarget (p, w_info, projectInfos, depInfos, solutionTargets, buildTarget);
+
+				// clean/publish are not supported for website projects
+				foreach (string buildTarget in new string [] {"Clean", "Publish"})
+					AddWebsiteUnsupportedTarget (p, w_info, depInfos, buildTarget);
+			}
+		}
+
+		void AddWebsiteTarget (Project p, ProjectInfo webProjectInfo,
+				Dictionary<Guid, ProjectInfo> projectInfos, List<ProjectInfo> depInfos,
+				List<TargetInfo> solutionTargets, string buildTarget)
+		{
+			string w_guid = webProjectInfo.Guid.ToString ().ToUpper ();
+
+			Target target = p.Targets.AddNewTarget (GetTargetNameForProject (webProjectInfo.Name, buildTarget));
+			target.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; 
+			target.DependsOnTargets = GetWebsiteDependsOnTarget (depInfos, buildTarget);
+
+			// this item collects all the references
+			string final_ref_item = String.Format ("Project_{0}_References{1}", w_guid,
+							buildTarget != "Build" ? "_" + buildTarget : String.Empty);
+
+			foreach (TargetInfo targetInfo in solutionTargets) {
+				int ref_num = 0;
+				foreach (ProjectInfo depInfo in depInfos) {
+					TargetInfo projectTargetInfo;
+					if (!depInfo.TargetMap.TryGetValue (targetInfo, out projectTargetInfo))
+						// Ignore, no config, so no target path
+						continue;
+
+					// GetTargetPath from the referenced project
+					AddWebsiteMSBuildTaskForReference (target, depInfo, projectTargetInfo, targetInfo,
+							final_ref_item, ref_num);
+					ref_num ++;
+				}
+			}
+
+			// resolve the references
+			AddWebsiteResolveAndCopyReferencesTasks (target, webProjectInfo, final_ref_item, w_guid);
+		}
+
+		// emits the MSBuild task to GetTargetPath for the referenced project
+		void AddWebsiteMSBuildTaskForReference (Target target, ProjectInfo depInfo, TargetInfo projectTargetInfo,
+				TargetInfo solutionTargetInfo, string final_ref_item, int ref_num)
+		{
+			BuildTask task = target.AddNewTask ("MSBuild");
+			task.SetParameterValue ("Projects", depInfo.FileName);
+			task.SetParameterValue ("Targets", "GetTargetPath");
+
+			task.SetParameterValue ("Properties", string.Format ("Configuration={0}; Platform={1}; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)", projectTargetInfo.Configuration, projectTargetInfo.Platform));
+			task.Condition = string.Format (" ('$(Configuration)' == '{0}') and ('$(Platform)' == '{1}') ", solutionTargetInfo.Configuration, solutionTargetInfo.Platform);
+
+			string ref_item = String.Format ("{0}_{1}",
+						final_ref_item, ref_num); 
+
+			task.AddOutputItem ("TargetOutputs", ref_item);
+
+			task = target.AddNewTask ("CreateItem");
+			task.SetParameterValue ("Include", String.Format ("@({0})", ref_item));
+			task.SetParameterValue ("AdditionalMetadata", String.Format ("Guid={{{0}}}",
+						depInfo.Guid.ToString ().ToUpper ()));
+			task.AddOutputItem ("Include", final_ref_item);
+		}
+
+		void AddWebsiteResolveAndCopyReferencesTasks (Target target, ProjectInfo webProjectInfo,
+				string final_ref_item, string w_guid)
+		{
+			BuildTask task = target.AddNewTask ("ResolveAssemblyReference");
+			task.SetParameterValue ("Assemblies", String.Format ("@({0}->'%(FullPath)')", final_ref_item));
+			task.SetParameterValue ("TargetFrameworkDirectories", "$(TargetFrameworkPath)");
+			task.SetParameterValue ("SearchPaths", "{RawFileName};{TargetFrameworkDirectory};{GAC}");
+			task.SetParameterValue ("FindDependencies", "true");
+			task.SetParameterValue ("FindSatellites", "true");
+			task.SetParameterValue ("FindRelatedFiles", "true");
+			task.Condition = String.Format ("Exists ('%({0}.Identity)')", final_ref_item);
+
+			string copylocal_item = String.Format ("{0}_CopyLocalFiles", final_ref_item);
+			task.AddOutputItem ("CopyLocalFiles", copylocal_item);
+
+			// Copy the references
+			task = target.AddNewTask ("Copy");
+			task.SetParameterValue ("SourceFiles", String.Format ("@({0})", copylocal_item));
+			task.SetParameterValue ("DestinationFiles", String.Format (
+						"@({0}->'$(Project_{1}_AspNetPhysicalPath)\\Bin\\%(DestinationSubDirectory)%(Filename)%(Extension)')",
+						copylocal_item, w_guid));
+
+			// AspNetConfiguration, is config for the website project, useful
+			// for overriding from command line
+			StringBuilder cond = new StringBuilder ();
+			foreach (string config in webProjectInfo.AspNetConfigurations) {
+				if (cond.Length > 0)
+					cond.Append (" or ");
+				cond.AppendFormat (" ('$(AspNetConfiguration)' == '{0}') ", config);
+			}
+			task.Condition = cond.ToString ();
+
+			task = target.AddNewTask ("Message");
+			cond = new StringBuilder ();
+			foreach (string config in webProjectInfo.AspNetConfigurations) {
+				if (cond.Length > 0)
+					cond.Append (" and ");
+				cond.AppendFormat (" ('$(AspNetConfiguration)' != '{0}') ", config);
+			}
+			task.Condition = cond.ToString ();
+			task.SetParameterValue ("Text", "Skipping as the '$(AspNetConfiguration)' configuration is " +
+						"not supported by this website project.");
+		}
+
+		void AddWebsiteUnsupportedTarget (Project p, ProjectInfo webProjectInfo, List<ProjectInfo> depInfos,
+				string buildTarget)
+		{
+			Target target = p.Targets.AddNewTarget (GetTargetNameForProject (webProjectInfo.Name, buildTarget));
+			target.DependsOnTargets = GetWebsiteDependsOnTarget (depInfos, buildTarget);
+
+			BuildTask task = target.AddNewTask ("Message");
+			task.SetParameterValue ("Text", String.Format (
+						"Target '{0}' not support for website projects", buildTarget));
+		}
+
+		string GetWebsiteDependsOnTarget (List<ProjectInfo> depInfos, string buildTarget)
+		{
+			StringBuilder deps = new StringBuilder ();
+			foreach (ProjectInfo pinfo in depInfos) {
+				if (deps.Length > 0)
+					deps.Append (";");
+				deps.Append (GetTargetNameForProject (pinfo.Name, buildTarget));
+			}
+			deps.Append (";GetFrameworkPath");
+			return deps.ToString ();
+		}
+
+		void AddGetFrameworkPathTarget (Project p)
+		{
+			Target t = p.Targets.AddNewTarget ("GetFrameworkPath");
+			BuildTask task = t.AddNewTask ("GetFrameworkPath");
+			task.AddOutputProperty ("Path", "TargetFrameworkPath");
+		}
+
 		void AddValidateSolutionConfiguration (Project p)
 		{
 			Target t = p.Targets.AddNewTarget ("ValidateSolutionConfiguration");
@@ -325,21 +663,23 @@ namespace Mono.XBuild.CommandLine {
 			foreach (KeyValuePair<Guid, ProjectInfo> projectInfo in projectInfos) {
 				ProjectInfo project = projectInfo.Value;
 				foreach (string buildTarget in buildTargets) {
-					Target target = p.Targets.AddNewTarget (project.Name + (buildTarget == "Build" ? string.Empty : ":" + buildTarget));
+					string target_name = GetTargetNameForProject (project.Name, buildTarget);
+					Target target = p.Targets.AddNewTarget (target_name);
 					target.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; 
-					string dependencies = string.Empty;
-					foreach (Guid dependency in project.Dependencies) {
-						ProjectInfo dependentInfo;
-						if (projectInfos.TryGetValue (dependency, out dependentInfo)) {
+
+					if (project.Dependencies.Count > 0) {
+						StringBuilder dependencies = new StringBuilder ();
+						foreach (ProjectInfo dependentInfo in project.Dependencies.Values) {
 							if (dependencies.Length > 0)
-								dependencies += ";";
-							dependencies += dependentInfo.Name;
+								dependencies.Append (";");
+							if (IsBuildTargetName (dependentInfo.Name))
+								dependencies.Append ("Solution:");
+							dependencies.Append (dependentInfo.Name);
 							if (buildTarget != "Build")
-								dependencies += ":" + buildTarget;
+								dependencies.Append (":" + buildTarget);
 						}
+						target.DependsOnTargets = dependencies.ToString ();
 					}
-					if (dependencies != string.Empty)
-						target.DependsOnTargets = dependencies;
 
 					foreach (TargetInfo targetInfo in solutionTargets) {
 						BuildTask task = null;
@@ -352,7 +692,7 @@ namespace Mono.XBuild.CommandLine {
 						if (projectTargetInfo.Build) {
 							task = target.AddNewTask ("MSBuild");
 							task.SetParameterValue ("Projects", project.FileName);
-							
+
 							if (buildTarget != "Build")
 								task.SetParameterValue ("Targets", buildTarget);
 							task.SetParameterValue ("Properties", string.Format ("Configuration={0}; Platform={1}; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)", projectTargetInfo.Configuration, projectTargetInfo.Platform));
@@ -366,24 +706,185 @@ namespace Mono.XBuild.CommandLine {
 			}
 		}
 
-		void AddSolutionTargets (Project p, Dictionary<Guid, ProjectInfo> projectInfos)
+
+		string GetTargetNameForProject (string projectName, string buildTarget)
+		{
+			//FIXME: hack
+			projectName = projectName.Replace ("\\", "/").Replace (".", "_");
+			string target_name = projectName +
+					(buildTarget == "Build" ? string.Empty : ":" + buildTarget);
+
+			if (IsBuildTargetName (projectName))
+				target_name = "Solution:" + target_name;
+
+			return target_name;
+		}
+
+		bool IsBuildTargetName (string name)
+		{
+			foreach (string tgt in buildTargets)
+				if (name == tgt)
+					return true;
+			return false;
+		}
+
+		// returns number of levels
+		int AddBuildLevels (Project p, List<TargetInfo> solutionTargets, Dictionary<Guid, ProjectInfo> projectInfos,
+				ref List<ProjectInfo>[] infosByLevel)
+		{
+			infosByLevel = TopologicalSort<ProjectInfo> (projectInfos.Values);
+
+			foreach (TargetInfo targetInfo in solutionTargets) {
+				BuildItemGroup big = p.AddNewItemGroup ();
+				big.Condition = String.Format (" ('$(Configuration)' == '{0}') and ('$(Platform)' == '{1}') ",
+						targetInfo.Configuration, targetInfo.Platform);
+
+				//FIXME: every level has projects that can be built in parallel.
+				//	 levels are ordered on the basis of the dependency graph
+
+				for (int i = 0; i < infosByLevel.Length; i ++) {
+					string build_level = String.Format ("BuildLevel{0}", i);
+					string skip_level = String.Format ("SkipLevel{0}", i);
+					string missing_level = String.Format ("MissingConfigLevel{0}", i);
+
+					foreach (ProjectInfo projectInfo in infosByLevel [i]) {
+						TargetInfo projectTargetInfo;
+						if (!projectInfo.TargetMap.TryGetValue (targetInfo, out projectTargetInfo)) {
+							// missing project config
+							big.AddNewItem (missing_level, projectInfo.Name);
+							continue;
+						}
+
+						if (projectTargetInfo.Build) {
+							BuildItem item = big.AddNewItem (build_level, projectInfo.FileName);
+							item.SetMetadata ("Configuration", projectTargetInfo.Configuration);
+							item.SetMetadata ("Platform", projectTargetInfo.Platform);
+						} else {
+							// build disabled
+							big.AddNewItem (skip_level, projectInfo.Name);
+						}
+					}
+				}
+			}
+
+			return infosByLevel.Length;
+		}
+
+		void AddSolutionTargets (Project p, int num_levels, IEnumerable<ProjectInfo> websiteProjectInfos)
 		{
 			foreach (string buildTarget in buildTargets) {
 				Target t = p.Targets.AddNewTarget (buildTarget);
 				t.Condition = "'$(CurrentSolutionConfigurationContents)' != ''";
-				BuildTask task = t.AddNewTask ("CallTarget");
-				string targets = string.Empty;
-				foreach (KeyValuePair<Guid, ProjectInfo> projectInfo in projectInfos) {
-					if (targets.Length > 0)
-						targets += ";";
-					targets += projectInfo.Value.Name;
+
+				BuildTask task = null;
+				for (int i = 0; i < num_levels; i ++) {
+					string level_str = String.Format ("BuildLevel{0}", i);
+					task = t.AddNewTask ("MSBuild");
+					task.SetParameterValue ("Condition", String.Format ("'@({0})' != ''", level_str));
+					task.SetParameterValue ("Projects", String.Format ("@({0})", level_str));
+					task.SetParameterValue ("Properties",
+						string.Format ("Configuration=%(Configuration); Platform=%(Platform); BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)"));
 					if (buildTarget != "Build")
-						targets += ":" + buildTarget;
+						task.SetParameterValue ("Targets", buildTarget);
+					//FIXME: change this to BuildInParallel=true, when parallel
+					//	 build support gets added
+					task.SetParameterValue ("RunEachTargetSeparately", "true");
+
+					level_str = String.Format ("SkipLevel{0}", i);
+					task = t.AddNewTask ("Message");
+					task.Condition = String.Format ("'@({0})' != ''", level_str);
+					task.SetParameterValue ("Text",
+						String.Format ("The project '%({0}.Identity)' is disabled for solution " +
+							"configuration '$(Configuration)|$(Platform)'.", level_str));
+
+					level_str = String.Format ("MissingConfigLevel{0}", i);
+					task = t.AddNewTask ("Warning");
+					task.Condition = String.Format ("'@({0})' != ''", level_str);
+					task.SetParameterValue ("Text",
+						String.Format ("The project configuration for project '%({0}.Identity)' " +
+							"corresponding to the solution configuration " +
+							"'$(Configuration)|$(Platform)' was not found.", level_str));
+				}
+
+				// "build" website projects also
+				StringBuilder w_targets = new StringBuilder ();
+				foreach (ProjectInfo info in websiteProjectInfos) {
+					if (w_targets.Length > 0)
+						w_targets.Append (";");
+					w_targets.Append (GetTargetNameForProject (info.Name, buildTarget));
 				}
-				task.SetParameterValue ("Targets", targets);
+
+				task = t.AddNewTask ("CallTarget");
+				task.SetParameterValue ("Targets", w_targets.ToString ());
 				task.SetParameterValue ("RunEachTargetSeparately", "true");
 			}
 		}
+
+		// Sorts the ProjectInfo dependency graph, to obtain
+		// a series of build levels with projects. Projects
+		// in each level can be run parallel (no inter-dependency).
+		static List<T>[] TopologicalSort<T> (IEnumerable<T> items) where T: ProjectInfo
+		{
+			IList<T> allItems;
+			allItems = items as IList<T>;
+			if (allItems == null)
+				allItems = new List<T> (items);
+
+			bool[] inserted = new bool[allItems.Count];
+			bool[] triedToInsert = new bool[allItems.Count];
+			int[] levels = new int [allItems.Count];
+
+			int maxdepth = 0;
+			for (int i = 0; i < allItems.Count; ++i) {
+				int d = Insert<T> (i, allItems, levels, inserted, triedToInsert);
+				if (d > maxdepth)
+					maxdepth = d;
+			}
+
+			// Separate out the project infos by build level
+			List<T>[] infosByLevel = new List<T>[maxdepth];
+			for (int i = 0; i < levels.Length; i ++) {
+				int level = levels [i] - 1;
+				if (infosByLevel [level] == null)
+					infosByLevel [level] = new List<T> ();
+
+				infosByLevel [level].Add (allItems [i]);
+			}
+
+			return infosByLevel;
+		}
+
+		// returns level# for the project
+		static int Insert<T> (int index, IList<T> allItems, int[] levels, bool[] inserted, bool[] triedToInsert)
+			where T: ProjectInfo
+		{
+			if (inserted [index])
+				return levels [index];
+
+			if (triedToInsert[index])
+				throw new InvalidOperationException (String.Format (
+						"Cyclic dependency involving project {0} found in the project dependency graph",
+						allItems [index].Name));
+
+			triedToInsert[index] = true;
+			ProjectInfo insertItem = allItems[index];
+
+			int maxdepth = 0;
+			foreach (ProjectInfo dependency in insertItem.Dependencies.Values) {
+				for (int j = 0; j < allItems.Count; ++j) {
+					ProjectInfo checkItem = allItems [j];
+					if (dependency.FileName == checkItem.FileName) {
+						int d = Insert (j, allItems, levels, inserted, triedToInsert);
+						maxdepth = d > maxdepth ? d : maxdepth;
+						break;
+					}
+				}
+			}
+			levels [index] = maxdepth + 1;
+			inserted [index] = true;
+
+			return levels [index];
+		}
 	}
 }
 
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.CSharp.targets b/mcs/tools/xbuild/xbuild/Microsoft.CSharp.targets
index ded6904..087bd4b 100644
--- a/mcs/tools/xbuild/xbuild/Microsoft.CSharp.targets
+++ b/mcs/tools/xbuild/xbuild/Microsoft.CSharp.targets
@@ -51,7 +51,7 @@
 			OutputAssembly="@(IntermediateAssembly)"
 			PdbFile="$(PdbFile)" 
 			Platform="$(PlatformTarget)"
-		 	References="@(ResolvedFiles);@(ChildProjectReferences)"
+			References="@(ReferencePath)"
 			ResponseFiles="$(CompilerResponseFile)"
 			Sources="@(Compile)"
 			TargetType="$(OutputType)"
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.Common.targets b/mcs/tools/xbuild/xbuild/Microsoft.Common.targets
index 3b9c23f..0fd7688 100644
--- a/mcs/tools/xbuild/xbuild/Microsoft.Common.targets
+++ b/mcs/tools/xbuild/xbuild/Microsoft.Common.targets
@@ -1,4 +1,4 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" InitialTargets="_ValidateEssentialProperties" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
 	<PropertyGroup>
 		<TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt>
@@ -12,14 +12,26 @@
 	</PropertyGroup>
 
 	<PropertyGroup>
-		<AllowUnsafeBlocks Condition="'$(AllowUnsafeBlocks)' == ''">false</AllowUnsafeBlocks>
 		<AssemblyName Condition="'$(AssemblyName)' == ''">$(RootNamespace)</AssemblyName>
 		<OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath> 
+		<OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath>
 		<WarningLevel Condition="'$(WarningLevel)' == ''" >2</WarningLevel>
 	</PropertyGroup>
 
 	<PropertyGroup>
+		<OutDir Condition="'$(OutDir)' == ''">$(OutputPath)</OutDir>
+		<OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir>
+
+		<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+		<ConfigurationName Condition="'$(ConfigurationName)' == ''">$(Configuration)</ConfigurationName>
+
+		<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+		<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName>
+	</PropertyGroup>
+
+	<PropertyGroup>
 		<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">obj\</BaseIntermediateOutputPath>
+		<CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FilesWrittenAbsolute.txt</CleanFile>
 	</PropertyGroup>
 
 	<PropertyGroup Condition="'$(IntermediateOutputPath)' == ''">
@@ -29,17 +41,44 @@
 
 	<ItemGroup>
 		<IntermediateAssembly Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)" />
-	</ItemGroup>
 
-	<ItemGroup>
-		<TargetPath Include="$(OutputPath)" />
+		<!-- creating this as a item to use FullPath on it, to build TargetPath -->
+		<_OutDirItem Include="$(OutDir)"/>
 	</ItemGroup>
 
+	<PropertyGroup>
+		<TargetName Condition="'$(TargetName)' == '' ">$(AssemblyName)</TargetName>
+		<TargetFileName Condition="'$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName>
+		<TargetPath>@(_OutDirItem->'%(FullPath)\$(TargetFileName)')</TargetPath>
+
+		<KeyOriginatorFile Condition=" '$(SignAssembly)' == 'true' ">$(AssemblyOriginatorKeyFile)</KeyOriginatorFile>
+	</PropertyGroup>
+
+	<Target Name="_ValidateEssentialProperties">
+		<!-- If OutDir is specified via the command line, then the earlier check
+		     to add a trailing slash won't have any affect, so error here. -->
+		<Error
+			Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')"
+			Text="OutDir property must end with a slash."/>
+	</Target>
+
 	<Target Name="PrepareForBuild">
 		<Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/>
-		
+
+		<!-- Look for app.config, if $(AppConfig) is specified, then use that. Else look in
+		     @(None) and @(Content) -->
+		<CreateItem Include="$(AppConfig)" Condition="'$(AppConfig)' != ''"
+			AdditionalMetadata="TargetPath=$(TargetFileName).config">
+			<Output TaskParameter="Include" ItemName="AppConfigWithTargetPath" />
+		</CreateItem>
+
+		<FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config"
+			Condition="'$(AppConfig)' == ''">
+			<Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/>
+		</FindAppConfigFile>
+
 		<MakeDir 
-			Directories="$(OutputPath);$(IntermediateOutputPath)"
+			Directories="$(OutDir);$(IntermediateOutputPath)"
 		/>
 
 		<GetFrameworkPath>
@@ -56,13 +95,35 @@
 		<AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' ">
 			.mdb
 		</AllowedReferenceRelatedFileExtensions>
+
+		<AssemblySearchPaths Condition="'$(AssemblySearchPaths)' == ''">
+			{CandidateAssemblyFiles};
+			{HintPathFromItem};
+			{TargetFrameworkDirectory};
+			{PkgConfig};
+			{GAC};
+			{RawFileName};
+			$(OutDir)
+		</AssemblySearchPaths>
+
+		<ResolveReferencesDependsOn>
+			BeforeResolveReferences;
+			ResolveProjectReferences;
+			ResolveAssemblyReferences;
+			AfterResolveReferences
+		</ResolveReferencesDependsOn>
 	</PropertyGroup>
 
+	<Target Name="ResolveReferences" DependsOnTargets="$(ResolveReferencesDependsOn)"/>
+
+	<Target Name="BeforeResolveReferences" />
+	<Target Name="AfterResolveReferences" />
+
 	<Target Name="ResolveAssemblyReferences">
 		<ResolveAssemblyReference
 			Assemblies="@(Reference)"
 			AssemblyFiles="@(ChildProjectReferences)"
-			SearchPaths="{CandidateAssemblyFiles};{HintPathFromItem};{TargetFrameworkDirectory};{GAC};{RawFileName};$(OutputPath)"
+			SearchPaths="$(AssemblySearchPaths)"
 			CandidateAssemblyFiles="@(Content);@(None)"
 			TargetFrameworkDirectories="$(TargetFrameworkPath)"
 			AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)"
@@ -72,6 +133,7 @@
 			FindRelatedFiles="true"
 		>
 			<Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/>
+			<Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/>
 			<Output TaskParameter="ResolvedDependencyFiles" ItemName="_ResolveAssemblyReferenceResolvedFiles"/>
 			<Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/>
 			<Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/>
@@ -80,23 +142,76 @@
 	</Target>
 
 	<Target
+		Name="AssignProjectConfigurations"
+		Condition="'@(ProjectReference)' != ''">
+
+		<!-- assign configs if building a solution file -->
+		<AssignProjectConfiguration
+			ProjectReferences = "@(ProjectReference)"
+			SolutionConfigurationContents = "$(CurrentSolutionConfigurationContents)"
+			Condition="'$(BuildingSolutionFile)' == 'true'">
+
+			<Output TaskParameter = "AssignedProjects" ItemName = "ProjectReferenceWithConfiguration"/>
+		</AssignProjectConfiguration>
+
+		<!-- Else, just -->
+		<CreateItem Include="@(ProjectReference)" Condition="'$(BuildingSolutionFile)' != 'true'">
+			<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfiguration"/>
+		</CreateItem>
+
+	</Target>
+
+	<!-- Split projects into 2 lists
+		ProjectReferenceWithConfigurationExistent: Projects existent on disk
+		ProjectReferenceWithConfigurationNonExistent: Projects non-existent on disk -->
+
+	<Target Name="SplitProjectReferencesByExistent"
+		DependsOnTargets="AssignProjectConfigurations">
+
+		<CreateItem Include="@(ProjectReferenceWithConfiguration)" Condition="'@(ProjectReferenceWithConfiguration)' != ''">
+			<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationExistent"
+				Condition="Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
+
+			<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationNonExistent"
+				Condition="!Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/>
+		</CreateItem>
+	</Target>
+
+	<Target
 		Name="ResolveProjectReferences"
-		Condition=" '@(ProjectReference)' != ''"
+		DependsOnTargets="SplitProjectReferencesByExistent"
 	>
-		<!-- FIXME: don't build if building a .sln, since project ref would already have been built -->
+		<!-- If building from a .sln.proj or from IDE, then referenced projects have already
+		     been built, so just get the target paths -->
 		<MSBuild
-			Projects="@(ProjectReference)"
+			Projects="@(ProjectReferenceWithConfigurationExistent)"
 			Targets="GetTargetPath"
-		>
+			Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
+			Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')">
+
 			<Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
 		</MSBuild>
+
+		<!-- Building a project directly, build the referenced the projects also -->
+		<MSBuild
+			Projects="@(ProjectReferenceWithConfigurationExistent)"
+			Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)"
+			Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' ">
+
+			<Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
+		</MSBuild>
+
+		<Warning Text="Referenced Project %(ProjectReferenceWithConfigurationNonExistent.Identity) not found, ignoring."
+			 Condition="'@(ProjectReferenceWithConfigurationNonExistent)' != ''"/>
 	</Target>
 
 	<Target Name = "CopyFilesMarkedCopyLocal">
 		<Copy
 			SourceFiles="@(ReferenceCopyLocalPaths)"
-			DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutputPath)%(DestinationSubDirectory)%(Filename)%(Extension)')"
-		/>
+			DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')"
+			SkipUnchangedFiles="true">
+			<Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
+		</Copy>
 	</Target>
 
 <!--
@@ -124,20 +239,51 @@
 	<PropertyGroup>
 		<CoreBuildDependsOn>
 			PrepareForBuild;
-			ResolveProjectReferences;
-			ResolveAssemblyReferences;
+			PreBuildEvent;
+			ResolveReferences;
 			CopyFilesMarkedCopyLocal;
 			BuildResources;
-			CoreCompile;
-			DeployOutputFiles
+			Compile;
+			PrepareForRun;
+			DeployOutputFiles;
+			_RecordCleanFile;
+			PostBuildEvent
 		</CoreBuildDependsOn>
 	</PropertyGroup>
 
 	<Target
 		Name="CoreBuild"
 		DependsOnTargets="$(CoreBuildDependsOn)"
-		Outputs="$(OutputPath)$(AssemblyName)$(TargetExt)"
-	/>
+		Outputs="$(OutDir)$(AssemblyName)$(TargetExt)">
+
+		<OnError ExecuteTargets="_TimestampAfterCompile;PostBuildEvent"
+			Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'"/>
+
+		<OnError ExecuteTargets="_RecordCleanFile" />
+	</Target>
+
+	<PropertyGroup>
+		<CompileDependsOn>
+			ResolveReferences;
+			BeforeCompile;
+			_TimestampBeforeCompile;
+			CoreCompile;
+			_TimestampAfterCompile;
+			AfterCompile
+		</CompileDependsOn>
+	</PropertyGroup>
+
+	<Target Name="BeforeCompile" />
+	<Target Name="AfterCompile" />
+
+	<Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/>
+
+	<PropertyGroup>
+		<PrepareForRunDependsOn>
+			DeployOutputFiles
+		</PrepareForRunDependsOn>
+	</PropertyGroup>
+	<Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/>
 
 	<Target Name="BuildResources"
 		DependsOnTargets="AssignTargetPaths;SplitResourcesByCulture;CreateManifestResourceNames;CopyNonResxEmbeddedResources;GenerateResources;GenerateSatelliteAssemblies">
@@ -172,13 +318,17 @@
 
 		<MakeDir Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"/>
 		<Copy SourceFiles = "@(NonResxWithCulture)"
-			DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')">
+			DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')"
+			SkipUnchangedFiles="true">
 			<Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithCultureOnDisk"/>
+			<Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
 		</Copy>
 
 		<Copy SourceFiles = "@(NonResxWithNoCulture)"
-			DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')">
+			DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')"
+			SkipUnchangedFiles="true">
 			<Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithNoCultureOnDisk"/>
+			<Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/>
 		</Copy>
 	</Target>
 
@@ -190,6 +340,7 @@
 			Condition = "'@(ResxWithNoCulture)' != '' ">
 
 			<Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithNoCulture"/>
+			<Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
 		</GenerateResource>
 
 		<GenerateResource
@@ -199,6 +350,7 @@
 			Condition = "'@(ResxWithCulture)' != '' ">
 
 			<Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithCulture"/>
+			<Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/>
 		</GenerateResource>
 	</Target>
 
@@ -211,9 +363,13 @@
 
 		<AL
 			Culture = "%(Culture)"
+			DelaySign="$(DelaySign)"
 			EmbedResources = "@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)"
-			OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll"
-		/>
+			KeyFile="$(KeyOriginatorFile)"
+			OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" >
+			<Output TaskParameter="OutputAssembly" ItemName="FileWrites"/>
+		</AL>
+
 
 		<CreateItem
 			Include = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll"
@@ -239,53 +395,79 @@
 	</Target>
 
 	<Target Name="DeployOutputFiles"
-		DependsOnTargets="BuildResources;CoreCompile;_CopyDeployFilesToOutputDirectory">
+		DependsOnTargets="BuildResources;CoreCompile;_CopyDeployFilesToOutputDirectory;_CopyAppConfigFile">
 
 		<Copy 
 			SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
 			Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
-			DestinationFolder="$(OutputPath)" />
+			DestinationFolder="$(OutDir)"
+			SkipUnchangedFiles="true" >
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
 
-		<Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(OutputPath)" />
+		<Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true">
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
 
 		<Copy
 			SourceFiles = "@(IntermediateSatelliteAssemblies)"
-			DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutputPath)\%(Culture)\$(AssemblyName).resources.dll')" />
+			DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutDir)\%(Culture)\$(AssemblyName).resources.dll')"
+			Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
+			SkipUnchangedFiles="true">
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
 	</Target>
 
 	<Target Name="_CopyDeployFilesToOutputDirectory"
 		DependsOnTargets="GetCopyToOutputDirectoryItems;
-			_CopyDeployFilesToOutputDirectoryToOutputDirectoryAlways;
-			CopyDeployFilesToOutputDirectoryPreserveNewest"/>
+			_CopyDeployFilesToOutputDirectoryAlways;
+			_CopyDeployFilesToOutputDirectoryPreserveNewest"/>
 
-	<Target Name="CopyDeployFilesToOutputDirectoryPreserveNewest"
-		Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''">
+	<Target Name="_CopyDeployFilesToOutputDirectoryPreserveNewest"
+		Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''"
+		Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
+		Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')">
 
-		<Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)"
-			DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutputPath)%(TargetPath)')"/>
+		<Copy SourceFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
+			DestinationFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')">
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
 	</Target>
 
 	<!-- Copy if newer -->
-	<Target Name="_CopyDeployFilesToOutputDirectoryToOutputDirectoryAlways"
-		Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''"
-		Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)"
-		Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutputPath)%(TargetPath)'">
+	<Target Name="_CopyDeployFilesToOutputDirectoryAlways"
+		Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''">
 
 		<Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)"
-			DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutputPath)%(TargetPath)')"/>
+			DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')">
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
+	</Target>
+
+
+	<Target Name="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != ''"
+		Inputs="@(AppConfigWithTargetPath)"
+		Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
+
+		<Copy SourceFiles="@(AppConfigWithTargetPath)"
+			DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')">
+			<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+		</Copy>
 	</Target>
 
-	<Target Name="GetTargetPath" Outputs="@(TargetPath->'%(FullPath)\$(AssemblyName)$(TargetExt)')"/>
+	<Target Name="GetTargetPath" Outputs="$(TargetPath)"/>
 
 	<Target Name="GetCopyToOutputDirectoryItems"
 		Outputs="@(AllItemsFullPathWithTargetPath)"
-		DependsOnTargets="AssignTargetPaths">
+		DependsOnTargets="AssignTargetPaths;SplitProjectReferencesByExistent">
 
-		<!-- FIXME: handle .vcproj -->
+		<!-- FIXME: handle .vcproj
+		     FIXME: Private ProjectReferences are honored only in 3.5
+		-->
 		<MSBuild
-			Projects="@(ProjectReference)"
+			Projects="@(ProjectReferenceWithConfigurationExistent)"
 			Targets="GetCopyToOutputDirectoryItems"
-			Condition="'@(ProjectReference)' != ''">
+			Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '%(ProjectReferenceWithConfigurationExistent.Private)' != 'false'">
 
 			<Output TaskParameter="TargetOutputs" ItemName="AllChildProjectItemsWithTargetPath"/>
 		</MSBuild>
@@ -339,24 +521,136 @@
 
 	</Target>
 
+	<!-- Pre/Post BuildEvents -->
+	<PropertyGroup>
+		<PreBuildEventDependsOn />
+	</PropertyGroup>
+
+	<Target Name="PreBuildEvent"
+		Condition="'$(PreBuildEvent)' != ''"
+		DependsOnTargets="$(PreBuildEventDependsOn)">
+
+		<Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" />
+	</Target>
+
+	<!-- PostBuildEvent depends on $(RunPostBuildEvent)
+
+		Default: OnBuildSuccess
+		OnBuildSuccess: Run after a successful build
+		OnOutputUpdated: Run only if the output assembly got updates
+		Always: Run always
+	-->
+	<PropertyGroup>
+		<PostBuildEventDependsOn />
+	</PropertyGroup>
+
+	<!-- this gets invoked in two cases, from CoreBuildDependsOn, if the build completes
+	     successfully, OR from OnError in CoreBuild, if the build failed and $(RunPostBuildEvent)
+	     is 'Always' or 'OnOutputUpdated' -->
+	<Target Name="PostBuildEvent"
+		Condition="'$(PostBuildEvent)' != '' and
+			('$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnBuildSuccess' or
+			  ('$(RunPostBuildEvent)' == 'OnOutputUpdated' and
+			    '$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')
+			)"
+		DependsOnTargets="$(PostBuildEventDependsOn)">
+
+		<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" />
+	</Target>
+
+	<!-- Timestamp the output assemblies, required for PostBuildEvent -->
+	<Target Name="_TimestampBeforeCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
+		<CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
+			<Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeBeforeCompile" />
+		</CreateItem>
+	</Target>
+	<Target Name="_TimestampAfterCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'">
+		<CreateItem Include="%(IntermediateAssembly.ModifiedTime)">
+			<Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeAfterCompile" />
+		</CreateItem>
+	</Target>
+
+	<!-- Rebuild -->
+	<PropertyGroup>
+		<RebuildDependsOn>
+			BeforeRebuild;
+			Clean;
+			$(MSBuildProjectDefaultTargets);
+			AfterRebuild;
+		</RebuildDependsOn>
+
+		<RebuildDependsOn Condition="'$(MSBuildProjectDefaultTargets)' == 'Rebuild'">
+			BeforeRebuild;
+			Clean;
+			Build;
+			AfterRebuild;
+		</RebuildDependsOn>
+	</PropertyGroup>
+
+	<Target Name="BeforeRebuild" />
+	<Target Name="AfterRebuild" />
+
+	<Target Name="Rebuild"
+		DependsOnTargets="$(RebuildDependsOn)"
+		Outputs="$(TargetPath)"/>
+
+	<!-- Clean -->
+	<Target Name="_RecordCleanFile"
+		DependsOnTargets="_GetCompileOutputsForClean">
+		<WriteLinesToFile
+			File="$(BaseIntermediateOutputPath)$(CleanFile)"
+			Lines="@(FileWrites->'%(FullPath)')"
+			Overwrite="true"/>
+	</Target>
+
 	<PropertyGroup>
 		<CleanDependsOn>
 			BeforeClean;
+			CleanReferencedProjects;
 			CoreClean;
 			AfterClean
 		</CleanDependsOn>
 	</PropertyGroup>
 
-	<!-- FIXME: Include all generated files -->
+	<Target Name="_GetCompileOutputsForClean">
+		<CreateItem Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')">
+			<Output TaskParameter="Include" ItemName="FileWrites"/>
+		</CreateItem>
+
+		<CreateItem Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
+			Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')">
+			<Output TaskParameter="Include" ItemName="FileWrites"/>
+		</CreateItem>
+	</Target>
+
+	<!-- Get the list of files written, for clean -->
+	<Target Name="_GetCleanFileWrites"
+		DependsOnTargets="_GetCompileOutputsForClean">
+		<ReadLinesFromFile File="$(BaseIntermediateOutputPath)$(CleanFile)">
+			<Output TaskParameter="Lines" ItemName="FileWrites"/>
+		</ReadLinesFromFile>
+	</Target>
+
+	<Target Name="CleanReferencedProjects"
+		DependsOnTargets="AssignProjectConfigurations">
+
+		<!-- If building from .sln.proj or from IDE, clean will get handled by them,
+		     else we are building a project directly, from the command line, so
+		     clean the referenced projects -->
+		<MSBuild Projects="@(ProjectReferenceWithConfigurationExistent)"
+			Targets="Clean"
+			Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '@(ProjectReferenceWithConfigurationExistent)' != ''" />
+
+	</Target>
+
 	<Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/>
 
 	<!-- Override in project to run before/after clean tasks -->
 	<Target Name="BeforeClean" />
 	<Target Name="AfterClean" />
 
-	<Target Name="CoreClean">
-		<Message Text="Trying to delete $(OutputPath)$(AssemblyName)$(TargetExt)"/>
-		<Delete Files="$(OutputPath)$(AssemblyName)$(TargetExt)" />
+	<Target Name="CoreClean" DependsOnTargets="_GetCleanFileWrites">
+		<Delete Files="@(FileWrites)" TreatErrorsAsWarnings="true"/>
 	</Target>
 
 </Project>
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.Common.tasks b/mcs/tools/xbuild/xbuild/Microsoft.Common.tasks
index 2047131..49c5ef8 100644
--- a/mcs/tools/xbuild/xbuild/Microsoft.Common.tasks
+++ b/mcs/tools/xbuild/xbuild/Microsoft.Common.tasks
@@ -2,6 +2,7 @@
 	<UsingTask TaskName="Microsoft.Build.Tasks.AL"			AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.AssignTargetPath"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.AssignCulture"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+	<UsingTask TaskName="Microsoft.Build.Tasks.AssignProjectConfiguration"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.CallTarget"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.Copy"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -11,6 +12,7 @@
 	<UsingTask TaskName="Microsoft.Build.Tasks.Delete"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.Error"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.Exec"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+	<UsingTask TaskName="Microsoft.Build.Tasks.FindAppConfigFile"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.FindUnderPath"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.GenerateResource"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.GetFrameworkPath"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -20,6 +22,7 @@
 	<UsingTask TaskName="Microsoft.Build.Tasks.MSBuild"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.ReadLinesFromFile"	AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.RemoveDir"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+	<UsingTask TaskName="Microsoft.Build.Tasks.RemoveDuplicates"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.ResolveAssemblyReference"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.SignFile"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
 	<UsingTask TaskName="Microsoft.Build.Tasks.Touch"		AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.VisualBasic.targets b/mcs/tools/xbuild/xbuild/Microsoft.VisualBasic.targets
index 2ec9e22..2a7f911 100644
--- a/mcs/tools/xbuild/xbuild/Microsoft.VisualBasic.targets
+++ b/mcs/tools/xbuild/xbuild/Microsoft.VisualBasic.targets
@@ -63,7 +63,7 @@
 			OptionStrictType="$(OptionStrictType)" 
 			OutputAssembly="$(IntermediateAssembly)"
 			Platform="$(PlatformTarget)"
-			References="@(ResolvedFiles);@(ChildProjectReferences)"
+			References="@(ResolvedFiles)"
 			RemoveIntegerChecks="$(RemoveIntegerChecks)"
 			Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
 			ResponseFiles="$(CompilerResponseFile)"
diff --git a/mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets b/mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets
new file mode 100644
index 0000000..0f61904
--- /dev/null
+++ b/mcs/tools/xbuild/xbuild/Microsoft.WebApplication.targets
@@ -0,0 +1,31 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+	<PropertyGroup>
+		<WebApplicationOutputDir Condition="'$(OutDir)' != '$(OutputPath)'">$(OutDir)_PublishedWebsites\$(MSBuildProjectName)</WebApplicationOutputDir>
+
+		<PrepareForRunDependsOn>
+			$(PrepareForRunDependsOn);
+			_CopyWebApplication
+		</PrepareForRunDependsOn>
+	</PropertyGroup>
+
+	<!-- OutDir has been overridden, so copy all the relevant files to that -->
+	<Target Name="_CopyWebApplication" Condition="'$(OutDir)' != '$(OutputPath)'">
+		<MakeDir Directories="$(WebApplicationOutputDir)\bin"/>
+		<Copy SourceFiles="@(IntermediateAssembly)" DestinationFolder="$(WebApplicationOutputDir)\bin" SkipUnchangedFiles="true"/>
+		<Copy
+			SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb"
+			Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"
+			DestinationFolder="$(WebApplicationOutputDir)\bin"
+			SkipUnchangedFiles="true" />
+
+		<Copy
+			SourceFiles = "@(IntermediateSatelliteAssemblies)"
+			DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(WebApplicationOutputDir)\bin\%(Culture)\$(AssemblyName).resources.dll')"
+			Condition = "'@(IntermediateSatelliteAssemblies)' != ''"
+			SkipUnchangedFiles="true" />
+
+		<!-- Copy the referenced assemblies -->
+		<Copy SourceFiles="@(ReferenceCopyLocalPaths)" DestinationFolder="$(WebApplicationOutputDir)\bin" SkipUnchangedFiles="true" />
+		<Copy SourceFiles="@(Content)" DestinationFolder="$(WebApplicationOutputDir)\%(Content.RelativeDir)" />
+	</Target>
+</Project>
diff --git a/mono/Makefile.in b/mono/Makefile.in
index bba89f4..3d28ff0 100644
--- a/mono/Makefile.in
+++ b/mono/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,10 +84,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -94,14 +93,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -119,6 +117,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -127,6 +126,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -138,11 +138,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -171,8 +174,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,6 +214,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -235,6 +238,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = utils io-layer os cil metadata \
diff --git a/mono/arch/ChangeLog b/mono/arch/ChangeLog
index 470d44d..a8477ce 100644
--- a/mono/arch/ChangeLog
+++ b/mono/arch/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-13  Zoltan Varga  <vargaz at gmail.com>
+
+	* x86/x86-codegen.h: Applied patch from Marian Salaj <salo3 at atlas.cz>.
+	Fix encoding of PMINSW and PMINSD. Fixes #521662.
+
 2009-03-06  Zoltan Varga  <vargaz at gmail.com>
 
 	* arm/tramp.c: Include a change from the debian patches. Avoid #include-ing
diff --git a/mono/arch/Makefile.in b/mono/arch/Makefile.in
index d825c9e..885d8fd 100644
--- a/mono/arch/Makefile.in
+++ b/mono/arch/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -96,10 +99,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -109,14 +108,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -134,6 +132,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -142,6 +141,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -153,11 +153,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -186,8 +189,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -227,6 +229,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -250,6 +253,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 DIST_SUBDIRS = x86 ppc sparc arm s390 s390x alpha hppa amd64 ia64 mips
diff --git a/mono/arch/alpha/Makefile.in b/mono/arch/alpha/Makefile.in
index 376253b..4c49961 100644
--- a/mono/arch/alpha/Makefile.in
+++ b/mono/arch/alpha/Makefile.in
@@ -38,7 +38,10 @@ noinst_PROGRAMS = test$(EXEEXT)
 subdir = mono/arch/alpha
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -91,10 +94,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -104,14 +103,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -129,6 +127,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -137,6 +136,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -148,11 +148,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -181,8 +184,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -222,6 +224,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -245,6 +248,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/amd64/Makefile.in b/mono/arch/amd64/Makefile.in
index c85efb9..4c2d66b 100644
--- a/mono/arch/amd64/Makefile.in
+++ b/mono/arch/amd64/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/amd64
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,10 +88,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -98,14 +97,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -123,6 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -131,6 +130,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -142,11 +142,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -175,8 +178,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -216,6 +218,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -239,6 +242,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/arm/Makefile.in b/mono/arch/arm/Makefile.in
index 57e730e..0b8bc91 100644
--- a/mono/arch/arm/Makefile.in
+++ b/mono/arch/arm/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/arm
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -87,10 +90,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -100,14 +99,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -125,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -133,6 +132,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -144,11 +144,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -177,8 +180,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -218,6 +220,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -241,6 +244,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/hppa/Makefile.in b/mono/arch/hppa/Makefile.in
index 053e946..d37bcc1 100644
--- a/mono/arch/hppa/Makefile.in
+++ b/mono/arch/hppa/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/hppa
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,10 +88,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -98,14 +97,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -123,6 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -131,6 +130,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -142,11 +142,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -175,8 +178,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -216,6 +218,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -239,6 +242,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/ia64/Makefile.in b/mono/arch/ia64/Makefile.in
index 72dad0f..a9c02e4 100644
--- a/mono/arch/ia64/Makefile.in
+++ b/mono/arch/ia64/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono/arch/ia64
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = ia64-codegen.h
diff --git a/mono/arch/mips/Makefile.in b/mono/arch/mips/Makefile.in
index 6945481..201dea0 100644
--- a/mono/arch/mips/Makefile.in
+++ b/mono/arch/mips/Makefile.in
@@ -38,7 +38,10 @@ noinst_PROGRAMS = test$(EXEEXT)
 subdir = mono/arch/mips
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -91,10 +94,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -104,14 +103,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -129,6 +127,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -137,6 +136,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -148,11 +148,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -181,8 +184,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -222,6 +224,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -245,6 +248,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/ppc/Makefile.in b/mono/arch/ppc/Makefile.in
index becb14e..5320488 100644
--- a/mono/arch/ppc/Makefile.in
+++ b/mono/arch/ppc/Makefile.in
@@ -38,7 +38,10 @@ target_triplet = @target@
 subdir = mono/arch/ppc
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -93,10 +96,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -106,14 +105,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -131,6 +129,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -139,6 +138,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -150,11 +150,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -183,8 +186,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -224,6 +226,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -247,6 +250,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @INTERP_SUPPORTED_TRUE at INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/s390/Makefile.in b/mono/arch/s390/Makefile.in
index 1604d45..0d66d2d 100644
--- a/mono/arch/s390/Makefile.in
+++ b/mono/arch/s390/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/s390
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,10 +88,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -98,14 +97,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -123,6 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -131,6 +130,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -142,11 +142,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -175,8 +178,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -216,6 +218,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -239,6 +242,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/s390x/Makefile.in b/mono/arch/s390x/Makefile.in
index eeb930b..73b0830 100644
--- a/mono/arch/s390x/Makefile.in
+++ b/mono/arch/s390x/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/s390x
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,10 +88,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -98,14 +97,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -123,6 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -131,6 +130,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -142,11 +142,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -175,8 +178,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -216,6 +218,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -239,6 +242,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/sparc/Makefile.in b/mono/arch/sparc/Makefile.in
index 81ef8ed..aad6ee1 100644
--- a/mono/arch/sparc/Makefile.in
+++ b/mono/arch/sparc/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/sparc
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -85,10 +88,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -98,14 +97,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -123,6 +121,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -131,6 +130,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -142,11 +142,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -175,8 +178,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -216,6 +218,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -239,6 +242,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/x86/Makefile.in b/mono/arch/x86/Makefile.in
index a40d8cd..aae15e3 100644
--- a/mono/arch/x86/Makefile.in
+++ b/mono/arch/x86/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/arch/x86
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -87,10 +90,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -100,14 +99,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -125,6 +123,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -133,6 +132,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -144,11 +144,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -177,8 +180,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -218,6 +220,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -241,6 +244,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @INTERP_SUPPORTED_TRUE at INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/arch/x86/x86-codegen.h b/mono/arch/x86/x86-codegen.h
index 5bdb79a..ad8e13a 100644
--- a/mono/arch/x86/x86-codegen.h
+++ b/mono/arch/x86/x86-codegen.h
@@ -1756,8 +1756,8 @@ typedef enum {
 	X86_SSE_PMAXUD = 0x3F, /*sse41*/
 
 	X86_SSE_PMINSB = 0x38, /*sse41*/
-	X86_SSE_PMINSW = 0x39, 
-	X86_SSE_PMINSD = 0xEA,/*sse41*/
+	X86_SSE_PMINSW = 0xEA, 
+	X86_SSE_PMINSD = 0x39,/*sse41*/
 
 	X86_SSE_PMINUB = 0xDA,
 	X86_SSE_PMINUW = 0x3A, /*sse41*/
diff --git a/mono/benchmark/Makefile.in b/mono/benchmark/Makefile.in
index 12f2c11..a787b85 100644
--- a/mono/benchmark/Makefile.in
+++ b/mono/benchmark/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono/benchmark
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 TEST_PROG = ../mini/mono
diff --git a/mono/cil/Makefile.in b/mono/cil/Makefile.in
index 4fb5d1c..dca34b8 100644
--- a/mono/cil/Makefile.in
+++ b/mono/cil/Makefile.in
@@ -37,7 +37,10 @@ subdir = mono/cil
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \
 	TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,10 +84,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -94,14 +93,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -119,6 +117,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -127,6 +126,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -138,11 +138,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -171,8 +174,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,6 +214,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -235,6 +238,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 defdir = $(includedir)/mono-$(API_VER)/mono/cil
diff --git a/mono/dis/Makefile.in b/mono/dis/Makefile.in
index 45679ff..4e32ffb 100644
--- a/mono/dis/Makefile.in
+++ b/mono/dis/Makefile.in
@@ -39,7 +39,10 @@ subdir = mono/dis
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog \
 	TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -102,10 +105,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -115,14 +114,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -140,6 +138,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -148,6 +147,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -159,11 +159,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -192,8 +195,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -233,6 +235,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -256,6 +259,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = $(GLIB_CFLAGS) -I$(top_srcdir)
diff --git a/mono/interpreter/Makefile.in b/mono/interpreter/Makefile.in
index fe1d040..63de5cb 100644
--- a/mono/interpreter/Makefile.in
+++ b/mono/interpreter/Makefile.in
@@ -40,7 +40,10 @@ subdir = mono/interpreter
 DIST_COMMON = $(libmintinclude_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -115,10 +118,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -128,14 +127,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -153,6 +151,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -161,6 +160,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -172,11 +172,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -205,8 +208,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -246,6 +248,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -269,6 +272,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = \
diff --git a/mono/io-layer/ChangeLog b/mono/io-layer/ChangeLog
index 1af0208..13fe782 100644
--- a/mono/io-layer/ChangeLog
+++ b/mono/io-layer/ChangeLog
@@ -1,3 +1,54 @@
+2009-05-26  Zoltan Varga  <vargaz at gmail.com>
+
+	* shared.c (_wapi_shm_file): Avoid creating a .wapi directory here, create
+	it in _wapi_shm_file_open (), since platforms using posix shm don't need it.
+
+2009-01-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* shared.c: Fall back to file based shared storage if shm_open () fails
+	because /dev/shm is not mounted.
+	
+	* shared.c: Add an alternative implementation using shared memory instead of
+	files. This fixes problems where the mono process would spin up the disk
+	every x secs on laptops. Fixes #434566, #415373 and #321949.
+
+2009-10-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* sockets.[ch]: fix function definition.
+
+2009-10-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* sockets.[ch]: added TransmitFile implementation.
+
+2009-09-24  Zoltan Varga  <vargaz at gmail.com>
+
+	* processes.c (load_modules): Applied patch from Thomas Philpot
+	(tom.philpot at logos.com). Fixes #533893.
+
+2009-09-05  Zoltan Varga  <vargaz at gmail.com>
+
+	* handles.c (_wapi_handle_real_new): Call _wapi_process_reap () when running
+	out of shared handes. Fixes #536776.
+
+	* processes.c (CreateProcess): Return false and set the error to
+	ERROR_OUTOFMEMORY when a process handle cannot be created.
+	(ShellExecuteEx): Propagate an ERROR_OUTOFMEMORY error code. Fixes part of
+	#536776.
+
+2009-09-01  Zoltan Varga  <vargaz at gmail.com>
+
+	* processes.c (EnumProcessModules): Applied patch from Romain Tartière
+	(romain at blogreen.org). Fix this on freebsd/OSX. Fixes #533893.
+
+2009-06-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* sockets.c: add the error number to the message so we can figure out
+	when this happens.
+
+2009-06-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* wait.c: add missing 'break'.
+
 2009-05-28  Mark Probst  <mark.probst at gmail.com>
 
 	* collection.c (_wapi_collection_init): If pthread_create() fails,
diff --git a/mono/io-layer/Makefile.in b/mono/io-layer/Makefile.in
index 17d5929..f0b5799 100644
--- a/mono/io-layer/Makefile.in
+++ b/mono/io-layer/Makefile.in
@@ -38,7 +38,10 @@ subdir = mono/io-layer
 DIST_COMMON = $(am__libwapiinclude_HEADERS_DIST) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -136,10 +139,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -149,14 +148,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -174,6 +172,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -182,6 +181,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -193,11 +193,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -226,8 +229,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -267,6 +269,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -290,6 +293,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 noinst_LTLIBRARIES = libwapi.la
diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c
index 077ad84..187ad13 100644
--- a/mono/io-layer/handles.c
+++ b/mono/io-layer/handles.c
@@ -473,6 +473,7 @@ static gpointer _wapi_handle_real_new (WapiHandleType type, gpointer handle_spec
 		ref = _wapi_handle_new_shared (type, handle_specific);
 		if (ref == 0) {
 			_wapi_handle_collect ();
+			_wapi_process_reap ();
 			ref = _wapi_handle_new_shared (type, handle_specific);
 			if (ref == 0) {
 				/* FIXME: grow the arrays */
diff --git a/mono/io-layer/processes.c b/mono/io-layer/processes.c
index 19e1b9c..f37ff93 100644
--- a/mono/io-layer/processes.c
+++ b/mono/io-layer/processes.c
@@ -60,6 +60,7 @@ extern char **environ;
 #undef DEBUG
 
 static guint32 process_wait (gpointer handle, guint32 timeout);
+FILE *open_process_map (int pid, const char *mode);
 
 struct _WapiHandleOps _wapi_process_ops = {
 	NULL,				/* close_shared */
@@ -470,6 +471,9 @@ gboolean ShellExecuteEx (WapiShellExecuteInfo *sei)
 			     CREATE_UNICODE_ENVIRONMENT, NULL,
 			     sei->lpDirectory, NULL, &process_info);
 	g_free (args);
+
+	if (!ret && GetLastError () == ERROR_OUTOFMEMORY)
+		return ret;
 	
 	if (!ret) {
 		static char *handler;
@@ -1033,7 +1037,8 @@ gboolean CreateProcess (const gunichar2 *appname, const gunichar2 *cmdline,
 	if (handle == _WAPI_HANDLE_INVALID) {
 		g_warning ("%s: error creating process handle", __func__);
 
-		SetLastError (ERROR_PATH_NOT_FOUND);
+		ret = FALSE;
+		SetLastError (ERROR_OUTOFMEMORY);
 		goto free_strings;
 	}
 
@@ -1742,6 +1747,11 @@ static GSList *load_modules ()
 		hdr = _dyld_get_image_header (i);
 		sec = getsectbynamefromheader (hdr, SEG_DATA, SECT_DATA);
 
+		/* Some dynlibs do not have data sections on osx (#533893) */
+		if (sec == 0) {
+			continue;
+		}
+			
 		mod = g_new0 (WapiProcModule, 1);
 		mod->address_start = sec->addr;
 		mod->address_end = sec->addr+sec->size;
@@ -1903,12 +1913,31 @@ static gboolean match_procname_to_modulename (gchar *procname, gchar *modulename
 	return (FALSE);
 }
 
+FILE *open_process_map (int pid, const char *mode)
+{
+	FILE *fp = NULL;
+	const gchar *proc_path[] = {
+		"/proc/%d/maps",	/* GNU/Linux */
+		"/proc/%d/map",		/* FreeBSD */
+		NULL
+	};
+	int i;
+	gchar *filename;
+
+	for (i = 0; fp == NULL && proc_path [i]; i++) {
+ 		filename = g_strdup_printf (proc_path[i], pid);
+		fp = fopen (filename, mode);
+		g_free (filename);
+	}
+
+	return fp;
+}
+
 gboolean EnumProcessModules (gpointer process, gpointer *modules,
 			     guint32 size, guint32 *needed)
 {
 	struct _WapiHandle_process *process_handle;
 	gboolean ok;
-	gchar *filename = NULL;
 	FILE *fp;
 	GSList *mods = NULL;
 	WapiProcModule *module;
@@ -1922,8 +1951,9 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
 	 * token.  (Use 'NULL' as an alternative for the main module
 	 * so that the simple implementation can just return one item
 	 * for now.)  Get the info from /proc/<pid>/maps on linux,
-	 * other systems will have to implement /dev/kmem reading or
-	 * whatever other horrid technique is needed.
+	 * /proc/<pid>/map on FreeBSD, other systems will have to
+	 * implement /dev/kmem reading or whatever other horrid
+	 * technique is needed.
 	 */
 	if (size < sizeof(gpointer)) {
 		return(FALSE);
@@ -1950,8 +1980,7 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
 	{
 		mods = load_modules ();
 #else
-	filename = g_strdup_printf ("/proc/%d/maps", pid);
-	if ((fp = fopen (filename, "r")) == NULL) {
+	if ((fp = open_process_map (pid, "r")) == NULL) {
 		/* No /proc/<pid>/maps so just return the main module
 		 * shortcut for now
 		 */
@@ -1990,8 +2019,6 @@ gboolean EnumProcessModules (gpointer process, gpointer *modules,
 		g_slist_free (mods);
 	}
 
-	g_free (filename);
-	
 	return(TRUE);
 }
 
@@ -2066,7 +2093,6 @@ static guint32 get_module_name (gpointer process, gpointer module,
 	gchar *procname_ext = NULL;
 	glong len;
 	gsize bytes;
-	gchar *filename = NULL;
 	FILE *fp;
 	GSList *mods = NULL;
 	WapiProcModule *found_module;
@@ -2111,8 +2137,7 @@ static guint32 get_module_name (gpointer process, gpointer module,
 	{
 		mods = load_modules ();
 #else
-	filename = g_strdup_printf ("/proc/%d/maps", pid);
-	if ((fp = fopen (filename, "r")) == NULL) {
+	if ((fp = open_process_map (pid, "r")) == NULL) {
 		if (errno == EACCES && module == NULL && base == TRUE) {
 			procname_ext = get_process_name_from_proc (pid);
 		} else {
@@ -2120,7 +2145,6 @@ static guint32 get_module_name (gpointer process, gpointer module,
 			 * for now
 			 */
 			g_free (proc_name);
-			g_free (filename);
 			return(0);
 		}
 	} else {
@@ -2158,7 +2182,6 @@ static guint32 get_module_name (gpointer process, gpointer module,
 		}
 
 		g_slist_free (mods);
-		g_free (filename);
 		g_free (proc_name);
 	}
 
@@ -2222,7 +2245,6 @@ gboolean GetModuleInformation (gpointer process, gpointer module,
 	struct _WapiHandle_process *process_handle;
 	gboolean ok;
 	pid_t pid;
-	gchar *filename = NULL;
 	FILE *fp;
 	GSList *mods = NULL;
 	WapiProcModule *found_module;
@@ -2266,13 +2288,11 @@ gboolean GetModuleInformation (gpointer process, gpointer module,
 		mods = load_modules ();
 #else
 	/* Look up the address in /proc/<pid>/maps */
-	filename = g_strdup_printf ("/proc/%d/maps", pid);
-	if ((fp = fopen (filename, "r")) == NULL) {
+	if ((fp = open_process_map (pid, "r")) == NULL) {
 		/* No /proc/<pid>/maps, so just return failure
 		 * for now
 		 */
 		g_free (proc_name);
-		g_free (filename);
 		return(FALSE);
 	} else {
 		mods = load_modules (fp);
@@ -2299,7 +2319,6 @@ gboolean GetModuleInformation (gpointer process, gpointer module,
 		}
 
 		g_slist_free (mods);
-		g_free (filename);
 		g_free (proc_name);
 	}
 
diff --git a/mono/io-layer/shared.c b/mono/io-layer/shared.c
index 259c2f9..a79d954 100644
--- a/mono/io-layer/shared.c
+++ b/mono/io-layer/shared.c
@@ -30,6 +30,15 @@
 #include <mono/io-layer/shared.h>
 #include <mono/io-layer/handles-private.h>
 
+/*
+ * Use POSIX shared memory if possible, it is simpler, and it has the advantage that 
+ * writes to the shared area does not need to be written to disk, avoiding spinning up 
+ * the disk every x secs on laptops.
+ */
+#ifdef HAVE_SHM_OPEN
+#define USE_SHM 1
+#endif
+
 #undef DEBUG
 
 #ifdef DISABLE_SHARED_HANDLES
@@ -38,10 +47,10 @@ gboolean _wapi_shm_disabled = TRUE;
 gboolean _wapi_shm_disabled = FALSE;
 #endif
 
-static gchar *_wapi_shm_file (_wapi_shm_t type)
+static gchar *
+_wapi_shm_base_name (_wapi_shm_t type)
 {
-	static gchar file[_POSIX_PATH_MAX];
-	gchar *name = NULL, *filename, *dir, *wapi_dir;
+	gchar *name = NULL;
 	gchar machine_name[256];
 	const gchar *fake_name;
 	struct utsname ubuf;
@@ -85,6 +94,45 @@ static gchar *_wapi_shm_file (_wapi_shm_t type)
 		break;
 	}
 
+	return name;
+}
+
+#ifdef USE_SHM
+
+static gchar *_wapi_shm_shm_name (_wapi_shm_t type)
+{
+	char *base_name = _wapi_shm_base_name (type);
+
+	/* Also add the uid to avoid permission problems */
+	return g_strdup_printf ("/mono-shared-%d-%s", getuid (), base_name);
+}
+
+static int
+_wapi_shm_open (const char *filename, int size)
+{
+	int fd;
+
+	fd = shm_open (filename, O_CREAT|O_RDWR, S_IRUSR|S_IWUSR|S_IRGRP);
+	if (fd == -1)
+		/* Maybe /dev/shm is not mounted */
+		return -1;
+	if (ftruncate (fd, size) != 0) {
+		perror ("_wapi_shm_open (): ftruncate ()");
+		g_assert_not_reached ();
+	}
+
+	return fd;
+}
+
+#endif
+
+static gchar *_wapi_shm_file (_wapi_shm_t type)
+{
+	static gchar file[_POSIX_PATH_MAX];
+	gchar *name = NULL, *filename, *wapi_dir;
+
+	name = _wapi_shm_base_name (type);
+
 	/* I don't know how nfs affects mmap.  If mmap() of files on
 	 * nfs mounts breaks, then there should be an option to set
 	 * the directory.
@@ -100,14 +148,6 @@ static gchar *_wapi_shm_file (_wapi_shm_t type)
 
 	g_snprintf (file, _POSIX_PATH_MAX, "%s", filename);
 	g_free (filename);
-		
-	/* No need to check if the dir already exists or check
-	 * mkdir() errors, because on any error the open() call will
-	 * report the problem.
-	 */
-	dir = g_path_get_dirname (file);
-	mkdir (dir, 0755);
-	g_free (dir);
 	
 	return(file);
 }
@@ -119,6 +159,15 @@ static int _wapi_shm_file_open (const gchar *filename, guint32 wanted_size)
 	int ret, tries = 0;
 	gboolean created = FALSE;
 	mode_t oldmask;
+	gchar *dir;
+		
+	/* No need to check if the dir already exists or check
+	 * mkdir() errors, because on any error the open() call will
+	 * report the problem.
+	 */
+	dir = g_path_get_dirname (filename);
+	mkdir (dir, 0755);
+	g_free (dir);
 
 try_again:
 	if (tries++ > 10) {
@@ -214,12 +263,7 @@ try_again:
 	if (statbuf.st_size < wanted_size) {
 		close (fd);
 		if (created == TRUE) {
-#ifdef HAVE_LARGE_FILE_SUPPORT
-			/* Keep gcc quiet... */
-			g_critical ("%s: shared file [%s] is not big enough! (found %lld, need %d bytes)", __func__, filename, statbuf.st_size, wanted_size);
-#else
-			g_critical ("%s: shared file [%s] is not big enough! (found %ld, need %d bytes)", __func__, filename, statbuf.st_size, wanted_size);
-#endif
+			g_critical ("%s: shared file [%s] is not big enough! (found %ld, need %d bytes)", __func__, filename, (long)statbuf.st_size, wanted_size);
 			unlink (filename);
 			return(-1);
 		} else {
@@ -256,9 +300,9 @@ gpointer _wapi_shm_attach (_wapi_shm_t type)
 	gpointer shm_seg;
 	int fd;
 	struct stat statbuf;
-	gchar *filename=_wapi_shm_file (type);
+	gchar *filename = _wapi_shm_file (type);
 	guint32 size;
-	
+
 	switch(type) {
 	case WAPI_SHM_DATA:
 		size = sizeof(struct _WapiHandleSharedLayout);
@@ -276,13 +320,21 @@ gpointer _wapi_shm_attach (_wapi_shm_t type)
 		return g_malloc0 (size);
 	}
 
-	fd = _wapi_shm_file_open (filename, size);
+#ifdef USE_SHM
+	fd = _wapi_shm_open (_wapi_shm_shm_name (type), size);
+#else
+	fd = -1;
+#endif
+
+	/* Fall back to files if POSIX shm fails (for example, because /dev/shm is not mounted */
+	if (fd == -1)
+		fd = _wapi_shm_file_open (filename, size);
 	if (fd == -1) {
 		g_critical ("%s: shared file [%s] open error", __func__,
 			    filename);
 		return(NULL);
 	}
-	
+
 	if (fstat (fd, &statbuf)==-1) {
 		g_critical ("%s: fstat error: %s", __func__,
 			    g_strerror (errno));
@@ -500,6 +552,10 @@ static void shm_semaphores_remove (void)
 #endif
 
 		semctl (_wapi_sem_id, 0, IPC_RMID);
+#ifdef USE_SHM
+		shm_unlink (_wapi_shm_shm_name (WAPI_SHM_DATA));
+		shm_unlink (_wapi_shm_shm_name (WAPI_SHM_FILESHARE));
+#endif
 		unlink (_wapi_shm_file (WAPI_SHM_DATA));
 		unlink (_wapi_shm_file (WAPI_SHM_FILESHARE));
 	} else {
diff --git a/mono/io-layer/sockets.c b/mono/io-layer/sockets.c
index 921fa09..c5c109a 100644
--- a/mono/io-layer/sockets.c
+++ b/mono/io-layer/sockets.c
@@ -39,6 +39,9 @@
 #include <netinet/tcp.h>
 #include <netdb.h>
 #include <arpa/inet.h>
+#ifdef HAVE_SYS_SENDFILE_H
+#include <sys/sendfile.h>
+#endif
 
 #undef DEBUG
 
@@ -334,7 +337,7 @@ int _wapi_connect(guint32 fd, const struct sockaddr *serv_addr,
 				if (ok == FALSE) {
 					/* ECONNRESET means the socket was closed by another thread */
 					if (errnum != WSAECONNRESET)
-						g_warning ("%s: error looking up socket handle %p", __func__, handle);
+						g_warning ("%s: error looking up socket handle %p (error %d)", __func__, handle, errnum);
 				} else {
 					socket_handle->saved_error = errnum;
 				}
@@ -1034,29 +1037,112 @@ static gboolean wapi_disconnectex (guint32 fd, WapiOverlapped *overlapped,
 	return(socket_disconnect (fd));
 }
 
-/* NB only supports NULL file handle, NULL buffers and
- * TF_DISCONNECT|TF_REUSE_SOCKET flags to disconnect the socket fd.
- * Shouldn't actually ever need to be called anyway though, because we
- * have DisconnectEx ().
- */
-static gboolean wapi_transmitfile (guint32 fd, gpointer file,
-				   guint32 num_write, guint32 num_per_send,
-				   WapiOverlapped *overlapped,
-				   WapiTransmitFileBuffers *buffers,
-				   WapiTransmitFileFlags flags)
+#define SF_BUFFER_SIZE	16384
+static gint
+wapi_sendfile (guint32 socket, gpointer fd, guint32 bytes_to_write, guint32 bytes_per_send, guint32 flags)
 {
-#ifdef DEBUG
-	g_message ("%s: called on socket %d!", __func__, fd);
+#if defined(HAVE_SENDFILE) && (defined(__linux__) || defined(DARWIN))
+	gint file = GPOINTER_TO_INT (fd);
+	gint n;
+	gint errnum;
+	gssize res;
+	struct stat statbuf;
+
+	n = fstat (file, &statbuf);
+	if (n == -1) {
+		errnum = errno;
+		errnum = errno_to_WSA (errnum, __func__);
+		WSASetLastError (errnum);
+		return SOCKET_ERROR;
+	}
+	do {
+#ifdef __linux__
+		res = sendfile (socket, file, NULL, statbuf.st_size);
+#elif defined(DARWIN)
+		/* TODO: header/tail could be sent in the 5th argument */
+		/* TODO: Might not send the entire file for non-blocking sockets */
+		res = sendfile (file, socket, 0, &statbuf.st_size, NULL, 0);
 #endif
+	} while (res != -1 && (errno == EINTR || errno == EAGAIN) && !_wapi_thread_cur_apc_pending ());
+	if (res == -1) {
+		errnum = errno;
+		errnum = errno_to_WSA (errnum, __func__);
+		WSASetLastError (errnum);
+		return SOCKET_ERROR;
+	}
+#else
+	/* Default implementation */
+	gint file = GPOINTER_TO_INT (fd);
+	gchar *buffer;
+	gint n;
+
+	buffer = g_malloc (SF_BUFFER_SIZE);
+	do {
+		do {
+			n = read (file, buffer, SF_BUFFER_SIZE);
+		} while (n == -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
+		if (n == -1)
+			break;
+		if (n == 0) {
+			g_free (buffer);
+			return 0; /* We're done reading */
+		}
+		do {
+			n = send (socket, buffer, n, 0); /* short sends? enclose this in a loop? */
+		} while (n == -1 && errno == EINTR && !_wapi_thread_cur_apc_pending ());
+	} while (n != -1);
+
+	if (n == -1) {
+		gint errnum = errno;
+		errnum = errno_to_WSA (errnum, __func__);
+		WSASetLastError (errnum);
+		g_free (buffer);
+		return SOCKET_ERROR;
+	}
+	g_free (buffer);
+#endif
+	return 0;
+}
+
+gboolean
+TransmitFile (guint32 socket, gpointer file, guint32 bytes_to_write, guint32 bytes_per_send, WapiOverlapped *ol,
+		WapiTransmitFileBuffers *buffers, guint32 flags)
+{
+	gpointer sock = GUINT_TO_POINTER (socket);
+	gint ret;
 	
-	g_assert (file == NULL);
-	g_assert (overlapped == NULL);
-	g_assert (buffers == NULL);
-	g_assert (num_write == 0);
-	g_assert (num_per_send == 0);
-	g_assert (flags == (TF_DISCONNECT | TF_REUSE_SOCKET));
+	if (startup_count == 0) {
+		WSASetLastError (WSANOTINITIALISED);
+		return FALSE;
+	}
+	
+	if (_wapi_handle_type (sock) != WAPI_HANDLE_SOCKET) {
+		WSASetLastError (WSAENOTSOCK);
+		return FALSE;
+	}
 
-	return(socket_disconnect (fd));
+	/* Write the header */
+	if (buffers != NULL && buffers->Head != NULL && buffers->HeadLength > 0) {
+		ret = _wapi_send (socket, buffers->Head, buffers->HeadLength, 0);
+		if (ret == SOCKET_ERROR)
+			return FALSE;
+	}
+
+	ret = wapi_sendfile (socket, file, bytes_to_write, bytes_per_send, flags);
+	if (ret == SOCKET_ERROR)
+		return FALSE;
+
+	/* Write the tail */
+	if (buffers != NULL && buffers->Tail != NULL && buffers->TailLength > 0) {
+		ret = _wapi_send (socket, buffers->Tail, buffers->TailLength, 0);
+		if (ret == SOCKET_ERROR)
+			return FALSE;
+	}
+
+	if ((flags & TF_DISCONNECT) == TF_DISCONNECT)
+		closesocket (socket);
+
+	return TRUE;
 }
 
 static struct 
@@ -1065,7 +1151,7 @@ static struct
 	gpointer func;
 } extension_functions[] = {
 	{WSAID_DISCONNECTEX, wapi_disconnectex},
-	{WSAID_TRANSMITFILE, wapi_transmitfile},
+	{WSAID_TRANSMITFILE, TransmitFile},
 	{{0}, NULL},
 };
 
diff --git a/mono/io-layer/sockets.h b/mono/io-layer/sockets.h
index e62add4..bae67c4 100644
--- a/mono/io-layer/sockets.h
+++ b/mono/io-layer/sockets.h
@@ -96,5 +96,7 @@ extern int WSASend (guint32 handle, WapiWSABuf *buffers, guint32 count,
 		    guint32 *sent, guint32 flags,
 		    WapiOverlapped *overlapped, WapiOverlappedCB *complete);
 
+gboolean TransmitFile (guint32 socket, gpointer file, guint32 bytes_to_write, guint32 bytes_per_send, WapiOverlapped *ol,
+			WapiTransmitFileBuffers *tb, guint32 flags);
 G_END_DECLS
 #endif /* _WAPI_SOCKETS_H_ */
diff --git a/mono/io-layer/wait.c b/mono/io-layer/wait.c
index f9e4ca0..aeaa667 100644
--- a/mono/io-layer/wait.c
+++ b/mono/io-layer/wait.c
@@ -627,6 +627,7 @@ guint32 WaitForMultipleObjectsEx(guint32 numobjects, gpointer *handles,
 #endif
 
 			bogustype = TRUE;
+			break;
 		}
 
 		g_hash_table_insert (dups, handles[i], handles[i]);
diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index 4f7a025..3e3ed44 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,8 +1,265 @@
+2009-12-01  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* metadata.c (inflated_method_in_image): Avoid calling
+	mono_method_signature () if the method does not already have a signature.
+
+	Backport of r125724.
+
+2009-11-15  Zoltan Varga  <vargaz at gmail.com>
+
+	* boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
+	koush at koushikdutta.com). Disable GC_no_dls on android.
+
+2009-11-04 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* debug-helpers.c: avoid g_strdup() in mono_type_full_name().
+
+2009-11-04  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* reflection.c (fieldref_encode_signature): If field_image is NULL then
+	the token is already properly encoded. Fixs 4.0 build.
+
+	Backport of r145396.
+
+2009-11-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* reflection.c (fieldref_encode_signature): Add new field_image parameter
+	to indicate which assembly to use when resolving a custom-mod.
+
+	Fixes handling of volatile fields used across assemblies as reported in #551513.
+
+	Backport of r145337.
+
+2009-10-31  Zoltan Varga  <vargaz at gmail.com>
+
+	* mono-perfcounters.c (predef_writable_update): Fix the 2.4 build.
+
+	* appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
+	Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
+
+2009-10-31 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* mono-perfcounters.c: add the "_Total" instance for CPU counters.
+	Until now, we only had the per-cpu(core) counters.
+
+2009-01-26  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
+	Fixes #469217.
+
+2009-10-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	marshal.c: BeginInvoke cannot be called on multicast delegates with
+	multiple targets. Fixes bug #574426.
+	Backported from trunk.
+
+2009-10-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* appdomain.c: do not test the st_mode field for shadow-copies.
+	Fixes bug #545276.
+
+2009-10-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* mono-config.c: ignore UTF-8 BOM and report parser errors.
+	Fixes bug #549108.
+
+2009-10-22 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* class.c: fix typo.
+
+2009-10-22  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (mono_string_builder_to_utf16): Applied patch from
+	Hib Eris  <hib at hiberis.nl>. Return empty string for empty string builders.
+	Fixes #549173.
+
+2009-10-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* socket-io.[ch]: fix VS build.
+
+2009-10-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* icall-def.h:
+	* socket-io.[ch]: implemented SendFile.
+
+2009-10-20  Zoltan Varga  <vargaz at gmail.com>
+
+	* class.c (mono_class_create_from_typedef): Initialize class->element_class
+	before the interfaces to avoid crashes later if class initialization fails.
+	Fixes #548417.
+
+2009-10-19  Sebastien Pouliot  <sebastien at ximian.com>
+
+	* assembly.c (mono_assembly_load_reference): Fix leak when 'status'
+	code is known. (parse_public_key) Remove duplicate (unneeded) NULL
+	check since 'pubkey' can't be NULL at this stage
+	* icall.c (ves_icall_System_Array_FastCopy): Add comment about
+	the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
+	initialization of 'iter'
+	[Backport r144403 + part of r141170 (assembly.c)]
+
+2009-09-22  Zoltan Varga  <vargaz at gmail.com>
+
+	* image.c (mono_image_close): Atomically decrement the reference count and
+	remove the image from the hash tables, to prevent another thread from seeing a
+	dying MonoImage. Fixes #541194.
+
+2009-10-13  Martin Baulig  <martin at ximian.com>
+
+	* mono-debug-debugger.h (MonoDebuggerEvent): Renamed
+	`MONO_DEBUGGER_EVENT_TRAMPOLINE' into
+	`MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
+	`MONO_DEBUGGER_EVENT_TRAMPOLINE'.
+
+	* mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
+
+2009-07-09  Mark Probst  <mark.probst at gmail.com>
+
+	* class-internals.h, generic-sharing.c: New RGCTX info type for
+	getting a remoting invoke with check wrapper.
+
+	Backport of r137640.
+
+2009-10-07  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
+	Fixes #322934.
+
+2009-10-06  Mark Probst  <mark.probst at gmail.com>
+
+	* object.c (mono_method_return_message_restore): Handle the case
+	where the argument is an instance of a generic type.  Fixes
+	#544446.
+
+	Backport of r143506.
+
+2009-09-30  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
+	Fixes #543133.
+
+2009-02-02  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
+	nullable arguments.
+
+	* object.c (mono_runtime_invoke_array): Ditto.
+
+2009-09-17 Rodrigo Kumpera  <rkumpera at novell.com>
+
+	Backport of r127430.
+
+	* appdomain.c:
+	* generic-sharing.c:
+	* object.c:
+	* reflection.c:  Adjust locking order to the new semantics where the loader lock
+	comes first.
+
+	Backport of r126758/126783.
+
+	* reflection.c (mono_reflection_lookup_dynamic_token): This function might be called without
+	the loader lock which is required to guard MonoImage:tokens.
+
+2009-09-12 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* domain.c:
+	* object.c:
+	* class-internals.h: renamed waithandle_class to
+	manualresetevent_class.
+	* marshal.c: propagate the exception if a remoting BeginInvoke call
+	fails.
+
+2009-09-04 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* threadpool.c: make the Sleep() alertable to prevent delays exiting
+	applications that take less than 2s to execute.
+	Bug #524984 fixed.
+
+2009-09-03  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
+	argument, since NEWARR expects a native int. Fixes #481559.
+
+2009-08-28  Zoltan Varga  <vargaz at gmail.com>
+
+	* marshal.c (cominterop_get_ccw): Applied patch from tom hindle
+	<tom_hindle at sil.org>. Add locking around hash table accesses.
+
+2009-08-19  Mark Probst  <mark.probst at gmail.com>
+
+	* generic-sharing.c: Replace the templates lock with the loader
+	lock because of very hard to resolve deadlock issues.
+
+	Backport of r139118.
+
+2009-08-12  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	Backport of r139815.
+
+	* class.c: Add mono_class_get_field_from_name_full which does
+	the same as mono_class_get_field_from_name but does check field
+	signature as well.
+
+	* class-internals.h: Export mono_class_get_field_from_name_full as
+	part of the internal API.
+
+	* loader.c (field_from_memberref): Search fields by name and signature
+	as it's valid to have two fields with same name but different types.
+
+	Fixes #528055.
+
+2009-08-04  Zoltan Varga  <vargaz at gmail.com>
+
+	* threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
+	#527902.
+
+2009-07-30  Zoltan Varga  <vargaz at gmail.com>
+
+	* icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*.
+
+2009-06-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* threads.c: Store the thread start argument in a hash table instead of
+	registering it as a root, as libgc doesn't support unregistering roots
+	under windows, leading to 'too many root sets' errors when many threads
+	are created.
+
+	* gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
+	shutdown, they can still be referenced by the other dying objects.
+	Fixes #514506.
+
+2009-06-27 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* socket-io.c: DontLinger does not allow LingerOptions.
+
+2009-06-26 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* socket-io.c: DontLinger can take an int or a boolean too.
+
+2009-06-25 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* threads.c: fix missing colon when DEBUG is defined.
+
 2009-06-09  Zoltan Varga  <vargaz at gmail.com>
 
 	* metadata.c (free_inflated_method): Call 
 	mono_marshal_free_inflated_wrappers (), which was missed earlier.
 
+2009-06-15 Rodrigo Kumpera  <rkumpera at novell.com>
+	Backport of r136134.
+
+	* class.c (mono_class_from_typeref): If the enclosing type is not
+	found return null instead of crashing. Fixes #508487.
+
+2009-06-14  Zoltan Varga  <vargaz at gmail.com>
+
+	* Makefile.am (libmonoruntimeinclude_HEADERS): Remove duplicate
+	appdomain.h file.
+
+2009-06-11  Zoltan Varga  <vargaz at gmail.com>
+
+	* reflection.c (add_custom_modifiers): Avoid reading invalid memory.
+
 2009-06-09 Rodrigo Kumpera  <rkumpera at novell.com>
 
 	Revert previous commit to threads.c until the race condition
diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am
index 83f8532..3fca7fc 100644
--- a/mono/metadata/Makefile.am
+++ b/mono/metadata/Makefile.am
@@ -171,7 +171,6 @@ libmonoruntimeinclude_HEADERS = \
 	object.h	\
 	exception.h	\
 	profiler.h	\
-	appdomain.h	\
 	mono-config.h	\
 	debug-helpers.h	\
 	mempool.h
diff --git a/mono/metadata/Makefile.in b/mono/metadata/Makefile.in
index c050f0b..37abe3d 100644
--- a/mono/metadata/Makefile.in
+++ b/mono/metadata/Makefile.in
@@ -40,7 +40,10 @@ subdir = mono/metadata
 DIST_COMMON = $(libmonoruntimeinclude_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in ChangeLog TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -141,10 +144,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -154,14 +153,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -179,6 +177,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -187,6 +186,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -198,11 +198,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -231,8 +234,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -272,6 +274,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -295,6 +298,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @CROSS_COMPILING_FALSE@@PLATFORM_WIN32_TRUE at assembliesdir = `cygpath -m "${libdir}"`
@@ -443,7 +447,6 @@ libmonoruntimeinclude_HEADERS = \
 	object.h	\
 	exception.h	\
 	profiler.h	\
-	appdomain.h	\
 	mono-config.h	\
 	debug-helpers.h	\
 	mempool.h
diff --git a/mono/metadata/appdomain.c b/mono/metadata/appdomain.c
index e3275e1..7efa971 100644
--- a/mono/metadata/appdomain.c
+++ b/mono/metadata/appdomain.c
@@ -1293,8 +1293,7 @@ private_file_needs_copying (const char *src, struct stat *sbuf_src, char *dest)
 	if (stat (src, sbuf_src) == -1 || stat (dest, &sbuf_dest) == -1)
 		return TRUE;
 
-	if (sbuf_src->st_mode == sbuf_dest.st_mode &&
-	    sbuf_src->st_size == sbuf_dest.st_size &&
+	if (sbuf_src->st_size == sbuf_dest.st_size &&
 	    sbuf_src->st_mtime == sbuf_dest.st_mtime)
 		return FALSE;
 
@@ -1972,11 +1971,12 @@ unload_thread_main (void *arg)
 	 * We also hold the loader lock because we're going to change
 	 * class->runtime_info.
 	 */
-	mono_domain_lock (domain);
+
 	mono_loader_lock ();
+	mono_domain_lock (domain);
 	g_hash_table_foreach (domain->class_vtable_hash, clear_cached_vtable, domain);
-	mono_loader_unlock ();
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 
 	mono_threads_clear_cached_culture (domain);
 
@@ -2080,11 +2080,12 @@ mono_domain_unload (MonoDomain *domain)
 
 	/* Wait for the thread */	
 	while ((res = WaitForSingleObjectEx (thread_handle, INFINITE, TRUE) == WAIT_IO_COMPLETION)) {
-		if (mono_thread_has_appdomain_ref (mono_thread_current (), domain) && (mono_thread_interruption_requested ()))
+		if (mono_thread_has_appdomain_ref (mono_thread_current (), domain) && (mono_thread_interruption_requested ())) {
 			/* The unload thread tries to abort us */
 			/* The icall wrapper will execute the abort */
 			CloseHandle (thread_handle);
 			return;
+		}
 	}
 	CloseHandle (thread_handle);
 
diff --git a/mono/metadata/assembly.c b/mono/metadata/assembly.c
index 961e90e..e371f1b 100644
--- a/mono/metadata/assembly.c
+++ b/mono/metadata/assembly.c
@@ -849,7 +849,7 @@ mono_assembly_load_reference (MonoImage *image, int index)
 		reference = mono_assembly_load (&aname, image->assembly? image->assembly->basedir: NULL, &status);
 
 	if (reference == NULL){
-		char *extra_msg = g_strdup ("");
+		char *extra_msg;
 
 		if (status == MONO_IMAGE_ERROR_ERRNO && errno == ENOENT) {
 			extra_msg = g_strdup_printf ("The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (%s).\n", image->assembly != NULL ? image->assembly->basedir : "" );
@@ -859,6 +859,8 @@ mono_assembly_load_reference (MonoImage *image, int index)
 			extra_msg = g_strdup ("Cannot find an assembly referenced from this one.\n");
 		} else if (status == MONO_IMAGE_IMAGE_INVALID) {
 			extra_msg = g_strdup ("The file exists but is not a valid assembly.\n");
+		} else {
+			extra_msg = g_strdup ("");
 		}
 		
 		g_warning ("The following assembly referenced from %s could not be loaded:\n"
@@ -1607,6 +1609,10 @@ parse_public_key (const gchar *key, gchar** pubkey)
 	bitlen = read32 (header + 12) >> 3;
 	if ((bitlen + 16 + 4) != pkeylen)
 		return FALSE;
+
+	/* parsing is OK and the public key itself is not requested back */
+	if (!pubkey)
+		return TRUE;
 		
 	/* Encode the size of the blob */
 	offset = 0;
@@ -1623,8 +1629,8 @@ parse_public_key (const gchar *key, gchar** pubkey)
 		arr [i] = g_ascii_xdigit_value (key [j++]) << 4;
 		arr [i] |= g_ascii_xdigit_value (key [j++]);
 	}
-	if (pubkey)
-		*pubkey = arr;
+
+	*pubkey = arr;
 
 	return TRUE;
 }
diff --git a/mono/metadata/boehm-gc.c b/mono/metadata/boehm-gc.c
index a34df3d..ac045a0 100644
--- a/mono/metadata/boehm-gc.c
+++ b/mono/metadata/boehm-gc.c
@@ -90,7 +90,10 @@ mono_gc_base_init (void)
 	}
 #endif
 
+#if !defined(PLATFORM_ANDROID)
+	/* If GC_no_dls is set to true, GC_find_limit is not called. This causes a seg fault on Android. */
 	GC_no_dls = TRUE;
+#endif
 	GC_init ();
 	GC_oom_fn = mono_gc_out_of_memory;
 	GC_set_warn_proc (mono_gc_warning);
diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h
index 1554b56..2705061 100644
--- a/mono/metadata/class-internals.h
+++ b/mono/metadata/class-internals.h
@@ -213,7 +213,8 @@ enum {
 	MONO_RGCTX_INFO_GENERIC_METHOD_CODE,
 	MONO_RGCTX_INFO_CLASS_FIELD,
 	MONO_RGCTX_INFO_METHOD_RGCTX,
-	MONO_RGCTX_INFO_METHOD_CONTEXT
+	MONO_RGCTX_INFO_METHOD_CONTEXT,
+	MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK
 };
 
 typedef struct _MonoRuntimeGenericContextOtherInfoTemplate {
@@ -910,7 +911,7 @@ typedef struct {
 	MonoClass *delegate_class;
 	MonoClass *multicastdelegate_class;
 	MonoClass *asyncresult_class;
-	MonoClass *waithandle_class;
+	MonoClass *manualresetevent_class;
 	MonoClass *typehandle_class;
 	MonoClass *fieldhandle_class;
 	MonoClass *methodhandle_class;
@@ -1150,4 +1151,7 @@ mono_method_get_vtable_index (MonoMethod *method) MONO_INTERNAL;
 void
 mono_class_setup_interface_id (MonoClass *class) MONO_INTERNAL;
 
+MonoClassField*
+mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoType *signature) MONO_INTERNAL;
+
 #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */
diff --git a/mono/metadata/class.c b/mono/metadata/class.c
index 47f5598..ca1dc51 100644
--- a/mono/metadata/class.c
+++ b/mono/metadata/class.c
@@ -115,6 +115,9 @@ mono_class_from_typeref (MonoImage *image, guint32 type_token)
 		MonoClass *enclosing = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | idx);
 		GList *tmp;
 
+		if (!enclosing)
+			return NULL;
+
 		if (enclosing->nested_classes_inited) {
 			/* Micro-optimization: don't scan the metadata tables if enclosing is already inited */
 			for (tmp = enclosing->nested_classes; tmp; tmp = tmp->next) {
@@ -4259,6 +4262,16 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
 	/* uses ->valuetype, which is initialized by mono_class_setup_parent above */
 	mono_class_setup_mono_type (class);
 
+	if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
+		class->unicode = 1;
+
+#ifdef PLATFORM_WIN32
+	if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
+		class->unicode = 1;
+#endif
+
+	class->cast_class = class->element_class = class;
+
 	if (!class->enumtype) {
 		if (!mono_metadata_interfaces_from_typedef_full (
 			    image, type_token, &interfaces, &icount, context)){
@@ -4271,16 +4284,6 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token)
 		class->interface_count = icount;
 	}
 
-	if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_UNICODE_CLASS)
-		class->unicode = 1;
-
-#if PLATFORM_WIN32
-	if ((class->flags & TYPE_ATTRIBUTE_STRING_FORMAT_MASK) == TYPE_ATTRIBUTE_AUTO_CLASS)
-		class->unicode = 1;
-#endif
-
-	class->cast_class = class->element_class = class;
-
 	/*g_print ("Load class %s\n", name);*/
 
 	/*
@@ -5103,13 +5106,28 @@ mono_class_get_field (MonoClass *class, guint32 field_token)
 MonoClassField *
 mono_class_get_field_from_name (MonoClass *klass, const char *name)
 {
+	return mono_class_get_field_from_name_full (klass, name, NULL);
+}
+
+MonoClassField *
+mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoType *signature)
+{
 	int i;
 
 	mono_class_setup_fields_locking (klass);
 	while (klass) {
 		for (i = 0; i < klass->field.count; ++i) {
-			if (strcmp (name, mono_field_get_name (&klass->fields [i])) == 0)
-				return &klass->fields [i];
+			MonoClassField *field = &klass->fields [i];
+
+			if (strcmp (name, mono_field_get_name (field)) != 0)
+				continue;
+
+			if (signature) {
+				MonoType *field_type = mono_metadata_get_corresponding_field_from_generic_type_definition (field)->type;
+				if (!mono_metadata_type_equal_full (signature, field_type, TRUE))
+					continue;
+			}
+			return field;
 		}
 		klass = klass->parent;
 	}
diff --git a/mono/metadata/debug-helpers.c b/mono/metadata/debug-helpers.c
index c8c7eca..763f6cd 100644
--- a/mono/metadata/debug-helpers.c
+++ b/mono/metadata/debug-helpers.c
@@ -175,14 +175,10 @@ char*
 mono_type_full_name (MonoType *type)
 {
 	GString *str;
-	char *res;
 
 	str = g_string_new ("");
 	mono_type_get_desc (str, type, TRUE);
-
-	res = g_strdup (str->str);
-	g_string_free (str, TRUE);
-	return res;
+	return g_string_free (str, FALSE);
 }
 
 char*
diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c
index a2c6235..e26a95f 100644
--- a/mono/metadata/domain.c
+++ b/mono/metadata/domain.c
@@ -1417,9 +1417,9 @@ mono_init_internal (const char *filename, const char *exe_filename, const char *
 		"AsyncResult");
 	g_assert (mono_defaults.asyncresult_class != 0 );
 
-	mono_defaults.waithandle_class = mono_class_from_name (
-		mono_defaults.corlib, "System.Threading", "WaitHandle");
-	g_assert (mono_defaults.waithandle_class != 0 );
+	mono_defaults.manualresetevent_class = mono_class_from_name (
+		mono_defaults.corlib, "System.Threading", "ManualResetEvent");
+	g_assert (mono_defaults.manualresetevent_class != 0 );
 
 	mono_defaults.typehandle_class = mono_class_from_name (
                 mono_defaults.corlib, "System", "RuntimeTypeHandle");
diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c
index 7ee79e0..c0bc34e 100644
--- a/mono/metadata/gc.c
+++ b/mono/metadata/gc.c
@@ -171,6 +171,17 @@ run_finalize (void *obj, void *data)
 		}
 	}
 
+	if (o->vtable->klass->image == mono_defaults.corlib && !strcmp (o->vtable->klass->name, "DynamicMethod") && finalizing_root_domain) {
+		/*
+		 * These can't be finalized during unloading/shutdown, since that would
+		 * free the native code which can still be referenced by other
+		 * finalizers.
+		 * FIXME: This is not perfect, objects dying at the same time as 
+		 * dynamic methods can still reference them even when !shutdown.
+		 */
+		return;
+	}
+
 	if (mono_runtime_get_no_exec ())
 		return;
 
diff --git a/mono/metadata/generic-sharing.c b/mono/metadata/generic-sharing.c
index f95225a..8741cbb 100644
--- a/mono/metadata/generic-sharing.c
+++ b/mono/metadata/generic-sharing.c
@@ -115,39 +115,7 @@ mono_class_check_context_used (MonoClass *class)
 }
 
 /*
- * Guards the two global rgctx (template) hash tables and all rgctx
- * templates.
- *
- * Ordering: Domain locks and the loader lock must not be taken while
- * the templates lock is held.
- */
-static CRITICAL_SECTION templates_mutex;
-
-static void
-templates_lock (void)
-{
-	static gboolean inited = FALSE;
-
-	if (!inited) {
-		mono_loader_lock ();
-		if (!inited) {
-			InitializeCriticalSection (&templates_mutex);
-			inited = TRUE;
-		}
-		mono_loader_unlock ();
-	}
-
-	EnterCriticalSection (&templates_mutex);
-}
-
-static void
-templates_unlock (void)
-{
-	LeaveCriticalSection (&templates_mutex);
-}
-
-/*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextOtherInfoTemplate*
 get_other_info_templates (MonoRuntimeGenericContextTemplate *template, int type_argc)
@@ -185,7 +153,7 @@ set_other_info_templates (MonoMemPool *mp, MonoRuntimeGenericContextTemplate *te
 }
 
 /*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static int
 template_get_max_argc (MonoRuntimeGenericContextTemplate *template)
@@ -194,7 +162,7 @@ template_get_max_argc (MonoRuntimeGenericContextTemplate *template)
 }
 
 /*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextOtherInfoTemplate*
 rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template, int type_argc, int slot)
@@ -213,7 +181,7 @@ rgctx_template_get_other_slot (MonoRuntimeGenericContextTemplate *template, int
 }
 
 /*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static int
 rgctx_template_num_other_infos (MonoRuntimeGenericContextTemplate *template, int type_argc)
@@ -231,7 +199,7 @@ rgctx_template_num_other_infos (MonoRuntimeGenericContextTemplate *template, int
  * uninstantiated generic classes whose parent is the key class or an
  * instance of the key class.
  *
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static GHashTable *generic_subclass_hash;
 
@@ -248,7 +216,7 @@ class_set_rgctx_template (MonoClass *class, MonoRuntimeGenericContextTemplate *r
 }
 
 /*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextTemplate*
 class_lookup_rgctx_template (MonoClass *class)
@@ -264,7 +232,7 @@ class_lookup_rgctx_template (MonoClass *class)
 }
 
 /*
- * LOCKING: templates lock
+ * LOCKING: loader lock
  */
 static void
 register_generic_subclass (MonoClass *class)
@@ -339,14 +307,14 @@ mono_class_unregister_image_generic_subclasses (MonoImage *image)
 	if (!generic_subclass_hash)
 		return;
 
-	templates_lock ();
+	mono_loader_lock ();
 
 	old_hash = generic_subclass_hash;
 	generic_subclass_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
 
 	g_hash_table_foreach (old_hash, (GHFunc)move_subclasses_not_in_image_foreach_func, image);
 
-	templates_unlock ();
+	mono_loader_unlock ();
 
 	g_hash_table_destroy (old_hash);
 }
@@ -402,7 +370,7 @@ alloc_oti (MonoImage *image)
 #define MONO_RGCTX_SLOT_USED_MARKER	((gpointer)&mono_defaults.object_class->byval_arg)
 
 /*
- * LOCKING: loader lock and templates lock
+ * LOCKING: loader lock
  */
 static void
 rgctx_template_set_other_slot (MonoImage *image, MonoRuntimeGenericContextTemplate *template, int type_argc,
@@ -539,7 +507,8 @@ inflate_other_data (gpointer data, int info_type, MonoGenericContext *context, M
 	case MONO_RGCTX_INFO_METHOD:
 	case MONO_RGCTX_INFO_GENERIC_METHOD_CODE:
 	case MONO_RGCTX_INFO_METHOD_RGCTX:
-	case MONO_RGCTX_INFO_METHOD_CONTEXT: {
+	case MONO_RGCTX_INFO_METHOD_CONTEXT:
+	case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK: {
 		MonoMethod *method = data;
 		MonoMethod *inflated_method;
 		MonoType *inflated_type = mono_class_inflate_generic_type (&method->klass->byval_arg, context);
@@ -624,29 +593,21 @@ static MonoRuntimeGenericContextTemplate*
 mono_class_get_runtime_generic_context_template (MonoClass *class)
 {
 	MonoRuntimeGenericContextTemplate *parent_template, *template;
-	MonoGenericInst *inst;
 	guint32 i;
 
 	g_assert (!class->generic_class);
 
-	templates_lock ();
+	mono_loader_lock ();
 	template = class_lookup_rgctx_template (class);
-	templates_unlock ();
+	mono_loader_unlock ();
 
 	if (template)
 		return template;
 
-	if (class->generic_container)
-		inst = class->generic_container->context.class_inst;
-	else
-		inst = NULL;
-
 	mono_loader_lock ();
 
 	template = alloc_template (class);
 
-	templates_lock ();
-
 	if (class->parent) {
 		if (class->parent->generic_class) {
 			guint32 num_entries;
@@ -701,8 +662,6 @@ mono_class_get_runtime_generic_context_template (MonoClass *class)
 			register_generic_subclass (class);
 	}
 
-	templates_unlock ();
-
 	mono_loader_unlock ();
 
 	return template;
@@ -714,6 +673,8 @@ mono_class_get_runtime_generic_context_template (MonoClass *class)
  * permanently, in which case it will be mempool-allocated.  If
  * temporary is set then *do_free will return whether the returned
  * data must be freed.
+ *
+ * LOCKING: loader lock
  */
 static MonoRuntimeGenericContextOtherInfoTemplate
 class_get_rgctx_template_oti (MonoClass *class, int type_argc, guint32 slot, gboolean temporary, gboolean *do_free)
@@ -816,6 +777,10 @@ instantiate_other_info (MonoDomain *domain, MonoRuntimeGenericContextOtherInfoTe
 	case MONO_RGCTX_INFO_GENERIC_METHOD_CODE:
 		return mono_create_ftnptr (mono_domain_get (),
 				mono_runtime_create_jump_trampoline (mono_domain_get (), data, TRUE));
+	case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK:
+		return mono_create_ftnptr (mono_domain_get (),
+				mono_runtime_create_jump_trampoline (mono_domain_get (),
+						mono_marshal_get_remoting_invoke_with_check (data), TRUE));
 	case MONO_RGCTX_INFO_CLASS_FIELD:
 		return data;
 	case MONO_RGCTX_INFO_METHOD_RGCTX: {
@@ -841,7 +806,7 @@ instantiate_other_info (MonoDomain *domain, MonoRuntimeGenericContextOtherInfoTe
 }
 
 /*
- * LOCKING: loader lock and templates lock
+ * LOCKING: loader lock
  */
 static void
 fill_in_rgctx_template_slot (MonoClass *class, int type_argc, int index, gpointer data, int info_type)
@@ -876,7 +841,7 @@ fill_in_rgctx_template_slot (MonoClass *class, int type_argc, int index, gpointe
 }
 
 /*
- * LOCKING: loader lock and templates lock
+ * LOCKING: loader lock
  */
 static int
 register_other_info (MonoClass *class, int type_argc, gpointer data, int info_type)
@@ -937,6 +902,7 @@ other_info_equal (gpointer data1, gpointer data2, int info_type)
 	case MONO_RGCTX_INFO_CLASS_FIELD:
 	case MONO_RGCTX_INFO_METHOD_RGCTX:
 	case MONO_RGCTX_INFO_METHOD_CONTEXT:
+	case MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK:
 		return data1 == data2;
 	default:
 		g_assert_not_reached ();
@@ -952,100 +918,35 @@ lookup_or_register_other_info (MonoClass *class, int type_argc, gpointer data, i
 
 	MonoRuntimeGenericContextTemplate *rgctx_template =
 		mono_class_get_runtime_generic_context_template (class);
-	MonoRuntimeGenericContextOtherInfoTemplate *oti_list, *oti, *copy;
-	int i, length;
+	MonoRuntimeGenericContextOtherInfoTemplate *oti_list, *oti;
+	int i;
 
 	g_assert (!class->generic_class);
 	g_assert (class->generic_container || type_argc);
 
-	/*
-	 * We must not call inflate_other_info() with the templates
-	 * lock held, because it calls metadata functions which might
-	 * cause the loader lock to be taken, which must not happen if
-	 * the templates lock is held.
-	 *
-	 * Only two things can happen to an oti list: An unused
-	 * (data==NULL) node can be filled in and nodes can be
-	 * appended at the end of the list.
-	 *
-	 * To solve the lock problem we first count the number of
-	 * nodes in the list, then copy all the data into a separate
-	 * array.  With the templates lock not held we then search for
-	 * our info in the array - this is where the calls to
-	 * inflate_other_info() happen.  If we don't find the info
-	 * we're looking for, we take the templates lock again and
-	 * check if the oti list has changed since we've copied it.
-	 * If it has, we start again.  If it hasn't, we register the
-	 * info.
-	 */
-
-	templates_lock ();
-
- restart:
-	oti_list = get_other_info_templates (rgctx_template, type_argc);
-
-	length = 0;
-	for (oti = oti_list; oti; oti = oti->next)
-		++length;
+	mono_loader_lock ();
 
-	copy = g_new (MonoRuntimeGenericContextOtherInfoTemplate, length);
+	oti_list = get_other_info_templates (rgctx_template, type_argc);
 
 	for (oti = oti_list, i = 0; oti; oti = oti->next, ++i) {
-		copy [i].info_type = oti->info_type;
-		copy [i].data = oti->data;
-	}
-	g_assert (i == length);
-
-	templates_unlock ();
-
-	/* We've copied the list.  Now look for the info. */
-
-	for (i = 0; i < length; ++i) {
 		gpointer inflated_data;
 
-		if (copy [i].info_type != info_type || !copy [i].data)
+		if (oti->info_type != info_type || !oti->data)
 			continue;
 
-		inflated_data = inflate_other_info (&copy [i], generic_context, class, TRUE);
+		inflated_data = inflate_other_info (oti, generic_context, class, TRUE);
 
 		if (other_info_equal (data, inflated_data, info_type)) {
 			free_inflated_info (info_type, inflated_data);
-			g_free (copy);
+			mono_loader_unlock ();
 			return i;
 		}
 		free_inflated_info (info_type, inflated_data);
 	}
 
-	/* We haven't found the info, so check if the list is still
-	   the same. */
-
-	mono_loader_lock ();
-	templates_lock ();
-
-	/* We need to fetch oti_list again here because the list could
-	   have been empty. */
-	oti_list = get_other_info_templates (rgctx_template, type_argc);
-
-	for (oti = oti_list, i = 0; i < length; oti = oti->next, ++i) {
-		g_assert (oti);
-
-		if (copy [i].info_type != oti->info_type || copy [i].data != oti->data) {
-			mono_loader_unlock ();
-			g_free (copy);
-			goto restart;
-		}
-	}
-	g_free (copy);
-	if (oti) {
-		mono_loader_unlock ();
-		goto restart;
-	}
-
-	/* The list is still the same - success. */
-
+	/* We haven't found the info */
 	i = register_other_info (class, type_argc, data, info_type);
 
-	templates_unlock ();
 	mono_loader_unlock ();
 
 	if (!inited) {
@@ -1214,6 +1115,7 @@ fill_runtime_generic_context (MonoVTable *class_vtable, MonoRuntimeGenericContex
 		g_print ("filling mrgctx slot %d table %d index %d\n", slot, i, rgctx_index);
 	*/
 
+	/*FIXME We should use CAS here, no need to take a lock.*/
 	mono_domain_lock (domain);
 
 	/* Check whether the slot hasn't been instantiated in the
@@ -1313,6 +1215,8 @@ mrgctx_equal_func (gconstpointer a, gconstpointer b)
  *
  * Returns the MRGCTX for the generic method(s) with the given
  * method_inst of the given class_vtable.
+ *
+ * LOCKING: Take the domain lock.
  */
 MonoMethodRuntimeGenericContext*
 mono_method_lookup_rgctx (MonoVTable *class_vtable, MonoGenericInst *method_inst)
diff --git a/mono/metadata/icall-def.h b/mono/metadata/icall-def.h
index c497862..d216ac0 100644
--- a/mono/metadata/icall-def.h
+++ b/mono/metadata/icall-def.h
@@ -423,6 +423,7 @@ ICALL(SOCK_12, "Receive_internal(intptr,byte[],int,int,System.Net.Sockets.Socket
 ICALL(SOCK_13, "RecvFrom_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&,int&)", ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
 ICALL(SOCK_14, "RemoteEndPoint_internal(intptr,int&)", ves_icall_System_Net_Sockets_Socket_RemoteEndPoint_internal)
 ICALL(SOCK_15, "Select_internal(System.Net.Sockets.Socket[]&,int,int&)", ves_icall_System_Net_Sockets_Socket_Select_internal)
+ICALL(SOCK_15a, "SendFile(intptr,string,byte[],byte[],System.Net.Sockets.TransmitFileOptions)", ves_icall_System_Net_Sockets_Socket_SendFile)
 ICALL(SOCK_16, "SendTo_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress,int&)", ves_icall_System_Net_Sockets_Socket_SendTo_internal)
 ICALL(SOCK_16a, "Send_internal(intptr,System.Net.Sockets.Socket/WSABUF[],System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_array_internal)
 ICALL(SOCK_17, "Send_internal(intptr,byte[],int,int,System.Net.Sockets.SocketFlags,int&)", ves_icall_System_Net_Sockets_Socket_Send_internal)
diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c
index 3298416..b6bc92f 100644
--- a/mono/metadata/icall.c
+++ b/mono/metadata/icall.c
@@ -672,6 +672,7 @@ ves_icall_System_Array_FastCopy (MonoArray *source, int source_idx, MonoArray* d
 	if (source->bounds || dest->bounds)
 		return FALSE;
 
+	/* there's no integer overflow since mono_array_length returns an unsigned integer */
 	if ((dest_idx + length > mono_array_length (dest)) ||
 		(source_idx + length > mono_array_length (source)))
 		return FALSE;
@@ -1532,12 +1533,17 @@ ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal (MonoReflectionField *
 }
 
 static MonoReflectionField*
-ves_icall_System_Reflection_FieldInfo_internal_from_handle_type (MonoClassField *handle, MonoClass *klass)
+ves_icall_System_Reflection_FieldInfo_internal_from_handle_type (MonoClassField *handle, MonoType *type)
 {
+	MonoClass *klass;
+
 	g_assert (handle);
 
-	if (!klass)
+	if (!type) {
 		klass = handle->parent;
+	} else {
+		klass = mono_class_from_mono_type (type);
+	}
 
 	/* FIXME: check that handle is a field of klass or of a parent: return null
 	 * and throw the exception in managed code.
@@ -2069,7 +2075,6 @@ ves_icall_Type_GetInterfaceMapData (MonoReflectionType *type, MonoReflectionType
 	*targets = mono_array_new (domain, mono_defaults.method_info_class, len);
 	*methods = mono_array_new (domain, mono_defaults.method_info_class, len);
 	iter = NULL;
-	iter = NULL;
 	while ((method = mono_class_get_methods (iclass, &iter))) {
 		member = mono_method_get_object (domain, method, iclass);
 		mono_array_setref (*methods, i, member);
diff --git a/mono/metadata/image.c b/mono/metadata/image.c
index 13d63a7..f3afb2f 100644
--- a/mono/metadata/image.c
+++ b/mono/metadata/image.c
@@ -49,8 +49,9 @@ static GHashTable *loaded_images_refonly_hash;
 
 static gboolean debug_assembly_unload = FALSE;
 
-#define mono_images_lock() EnterCriticalSection (&images_mutex)
-#define mono_images_unlock() LeaveCriticalSection (&images_mutex)
+#define mono_images_lock() if (mutex_inited) EnterCriticalSection (&images_mutex)
+#define mono_images_unlock() if (mutex_inited) LeaveCriticalSection (&images_mutex)
+static gboolean mutex_inited;
 static CRITICAL_SECTION images_mutex;
 
 /* returns offset relative to image->raw_data */
@@ -127,7 +128,9 @@ mono_images_init (void)
 	loaded_images_hash = g_hash_table_new (g_str_hash, g_str_equal);
 	loaded_images_refonly_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
-	debug_assembly_unload = getenv ("MONO_DEBUG_ASSEMBLY_UNLOAD") != NULL;
+	debug_assembly_unload = g_getenv ("MONO_DEBUG_ASSEMBLY_UNLOAD") != NULL;
+
+	mutex_inited = TRUE;
 }
 
 /**
@@ -142,6 +145,8 @@ mono_images_cleanup (void)
 
 	g_hash_table_destroy (loaded_images_hash);
 	g_hash_table_destroy (loaded_images_refonly_hash);
+
+	mutex_inited = FALSE;
 }
 
 /**
@@ -1342,8 +1347,27 @@ mono_image_close (MonoImage *image)
 
 	g_return_if_fail (image != NULL);
 
-	if (InterlockedDecrement (&image->ref_count) > 0)
+	/* 
+	 * Atomically decrement the refcount and remove ourselves from the hash tables, so
+	 * register_image () can't grab an image which is being closed.
+	 */
+	mono_images_lock ();
+
+	if (InterlockedDecrement (&image->ref_count) > 0) {
+		mono_images_unlock ();
 		return;
+	}
+
+	loaded_images = image->ref_only ? loaded_images_refonly_hash : loaded_images_hash;
+	image2 = g_hash_table_lookup (loaded_images, image->name);
+	if (image == image2) {
+		/* This is not true if we are called from mono_image_open () */
+		g_hash_table_remove (loaded_images, image->name);
+	}
+	if (image->assembly_name && (g_hash_table_lookup (loaded_images, image->assembly_name) == image))
+		g_hash_table_remove (loaded_images, (char *) image->assembly_name);	
+
+	mono_images_unlock ();
 
 #ifdef PLATFORM_WIN32
 	if (image->is_module_handle && image->has_entry_point) {
@@ -1382,22 +1406,12 @@ mono_image_close (MonoImage *image)
 		image->references = NULL;
 	}
 
-	mono_images_lock ();
-	loaded_images = image->ref_only ? loaded_images_refonly_hash : loaded_images_hash;
-	image2 = g_hash_table_lookup (loaded_images, image->name);
-	if (image == image2) {
-		/* This is not true if we are called from mono_image_open () */
-		g_hash_table_remove (loaded_images, image->name);
-	}
-	if (image->assembly_name && (g_hash_table_lookup (loaded_images, image->assembly_name) == image))
-		g_hash_table_remove (loaded_images, (char *) image->assembly_name);	
-
 #ifdef PLATFORM_WIN32
+	mono_images_lock ();
 	if (image->is_module_handle && !image->has_entry_point)
 		FreeLibrary ((HMODULE) image->raw_data);
-#endif
-
 	mono_images_unlock ();
+#endif
 
 	if (image->raw_buffer_used) {
 		if (image->raw_data != NULL)
diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c
index 20d3cae..b294fa2 100644
--- a/mono/metadata/loader.c
+++ b/mono/metadata/loader.c
@@ -348,7 +348,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
 		      MonoGenericContext *context)
 {
 	MonoClass *klass;
-	MonoClassField *field, *sig_field = NULL;
+	MonoClassField *field;
 	MonoTableInfo *tables = image->tables;
 	MonoType *sig_type;
 	guint32 cols[6];
@@ -386,7 +386,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
 		mono_class_init (klass);
 		if (retklass)
 			*retklass = klass;
-		sig_field = field = mono_class_get_field_from_name (klass, fname);
+		field = mono_class_get_field_from_name_full (klass, fname, sig_type);
 		break;
 	case MONO_MEMBERREF_PARENT_TYPEREF:
 		klass = mono_class_from_typeref (image, MONO_TOKEN_TYPE_REF | nindex);
@@ -400,7 +400,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
 		mono_class_init (klass);
 		if (retklass)
 			*retklass = klass;
-		sig_field = field = mono_class_get_field_from_name (klass, fname);
+		field = mono_class_get_field_from_name_full (klass, fname, sig_type);
 		break;
 	case MONO_MEMBERREF_PARENT_TYPESPEC: {
 		klass = mono_class_get_full (image, MONO_TOKEN_TYPE_SPEC | nindex, context);
@@ -408,9 +408,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
 		mono_class_init (klass);
 		if (retklass)
 			*retklass = klass;
-		field = mono_class_get_field_from_name (klass, fname);
-		if (field)
-			sig_field = mono_metadata_get_corresponding_field_from_generic_type_definition (field);
+		field = mono_class_get_field_from_name_full (klass, fname, sig_type);
 		break;
 	}
 	default:
@@ -420,10 +418,6 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass,
 
 	if (!field)
 		mono_loader_set_error_field_load (klass, fname);
-	else if (sig_field && !mono_metadata_type_equal_full (sig_type, sig_field->type, TRUE)) {
-		mono_loader_set_error_field_load (klass, fname);
-		return NULL;
-	}
 
 	return field;
 }
diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c
index 38edd2c..b4a9669 100644
--- a/mono/metadata/marshal.c
+++ b/mono/metadata/marshal.c
@@ -113,6 +113,9 @@ mono_free_bstr (gpointer bstr);
 static MonoStringBuilder *
 mono_string_utf8_to_builder2 (char *text);
 
+static MonoStringBuilder *
+mono_string_utf16_to_builder2 (gunichar2 *text);
+
 static void
 mono_byvalarray_to_array (MonoArray *arr, gpointer native_arr, MonoClass *eltype, guint32 elnum);
 
@@ -638,6 +641,7 @@ mono_marshal_init (void)
 		register_icall (mono_string_utf8_to_builder, "mono_string_utf8_to_builder", "void ptr ptr", FALSE);
 		register_icall (mono_string_utf8_to_builder2, "mono_string_utf8_to_builder2", "object ptr", FALSE);
 		register_icall (mono_string_utf16_to_builder, "mono_string_utf16_to_builder", "void ptr ptr", FALSE);
+		register_icall (mono_string_utf16_to_builder2, "mono_string_utf16_to_builder2", "object ptr", FALSE);
 		register_icall (mono_marshal_free_array, "mono_marshal_free_array", "void ptr int32", FALSE);
 		register_icall (mono_string_to_byvalstr, "mono_string_to_byvalstr", "void ptr ptr int32", FALSE);
 		register_icall (mono_string_to_byvalwstr, "mono_string_to_byvalwstr", "void ptr ptr int32", FALSE);
@@ -1071,6 +1075,45 @@ mono_string_utf16_to_builder (MonoStringBuilder *sb, gunichar2 *text)
 	sb->length = len;
 }
 
+MonoStringBuilder *
+mono_string_utf16_to_builder2 (gunichar2 *text)
+{
+	int len;
+	MonoStringBuilder *sb;
+	static MonoClass *string_builder_class;
+	static MonoMethod *sb_ctor;
+	void *args [1];
+	MonoObject *exc;
+
+	if (!text)
+		return NULL;
+
+	if (!string_builder_class) {
+		MonoMethodDesc *desc;
+
+		string_builder_class = mono_class_from_name (mono_defaults.corlib, "System.Text", "StringBuilder");
+		g_assert (string_builder_class);
+		desc = mono_method_desc_new (":.ctor(int)", FALSE);
+		sb_ctor = mono_method_desc_search_in_class (desc, string_builder_class);
+		g_assert (sb_ctor);
+		mono_method_desc_free (desc);
+	}
+
+	for (len = 0; text [len] != 0; ++len)
+		;
+
+	sb = (MonoStringBuilder*)mono_object_new (mono_domain_get (), string_builder_class);
+	g_assert (sb);
+	args [0] = &len;
+	mono_runtime_invoke (sb_ctor, sb, args, &exc);
+	g_assert (!exc);
+
+	sb->length = len;
+	memcpy (mono_string_chars (sb->str), text, len * 2);
+
+	return sb;
+}
+
 /**
  * mono_string_builder_to_utf8:
  * @sb: the string builder
@@ -1147,6 +1190,9 @@ mono_string_builder_to_utf16 (MonoStringBuilder *sb)
 		sb->cached_str = NULL;
 	}
 	
+	if (sb->length == 0)
+		*(mono_string_chars (sb->str)) = '\0';
+
 	return mono_string_chars (sb->str);
 }
 
@@ -2343,6 +2389,15 @@ emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object)
 		return;
 	}
 
+	if (klass != mono_defaults.safehandle_class) {
+		if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT) {
+			char *msg = g_strdup_printf ("Type %s which is passed to unmanaged code must have a StructLayout attribute.",
+										 mono_type_full_name (&klass->byval_arg));
+			mono_mb_emit_exception_marshal_directive (mb, msg);
+			return;
+		}
+	}
+
 	for (i = 0; i < info->num_fields; i++) {
 		MonoMarshalNative ntype;
 		MonoMarshalConv conv;
@@ -2377,11 +2432,6 @@ emit_struct_conv (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_object)
 						 "reference field at the same offset as another field.",
 						 mono_type_full_name (&klass->byval_arg));
 			}
-			
-			if ((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_AUTO_LAYOUT)
-				g_error ("Type %s which is passed to unmanaged code must have a StructLayout attribute",
-					 mono_type_full_name (&klass->byval_arg));
-			
 		}
 		
 		switch (conv) {
@@ -2569,12 +2619,16 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
 {
 	MonoMethodMessage *msg;
 	MonoDelegate *async_callback;
+	MonoMulticastDelegate *mcast_delegate;
 	MonoObject *state;
 	MonoMethod *im;
 	MonoClass *klass;
 	MonoMethod *method = NULL, *method2 = NULL;
 
 	g_assert (delegate);
+	mcast_delegate = (MonoMulticastDelegate *) delegate;
+	if (mcast_delegate->prev != NULL)
+		mono_raise_exception (mono_get_exception_argument (NULL, "The delegate must have only one target"));
 
 	if (delegate->target && mono_object_class (delegate->target) == mono_defaults.transparent_proxy_class) {
 
@@ -2599,7 +2653,10 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params)
 			MONO_OBJECT_SETREF (msg, async_result, ares);
 			msg->call_type = CallType_BeginInvoke;
 
+			exc = NULL;
 			mono_remoting_invoke ((MonoObject *)tp->rp, msg, &exc, &out_args);
+			if (exc)
+				mono_raise_exception ((MonoException *) exc);
 			return ares;
 		}
 	}
@@ -4886,6 +4943,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method)
 	int i, pos, posna;
 	char *name;
 	gboolean need_direct_wrapper = FALSE;
+	int *tmp_nullable_locals;
 
 	g_assert (method);
 
@@ -4907,7 +4965,7 @@ mono_marshal_get_runtime_invoke (MonoMethod *method)
 	res = mono_marshal_find_in_cache (cache, method);
 	if (res)
 		return res;
-
+		
 	if (method->klass->rank && (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
 		(method->iflags & METHOD_IMPL_ATTRIBUTE_NATIVE)) {
 		/* 
@@ -5045,6 +5103,8 @@ mono_marshal_get_runtime_invoke (MonoMethod *method)
 		}
 	}
 
+	tmp_nullable_locals = g_new0 (int, sig->param_count);
+
 	for (i = 0; i < sig->param_count; i++) {
 		MonoType *t = sig->params [i];
 		int type;
@@ -5061,11 +5121,11 @@ mono_marshal_get_runtime_invoke (MonoMethod *method)
 			 * So to make this work we unbox it to a local variablee and push a reference to that.
 			 */
 			if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) {
-				int tmp_nullable_local = mono_mb_add_local (mb, &mono_class_from_mono_type (t)->byval_arg);
+				tmp_nullable_locals [i] = mono_mb_add_local (mb, &mono_class_from_mono_type (t)->byval_arg);
 
 				mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (t));
-				mono_mb_emit_stloc (mb, tmp_nullable_local);
-				mono_mb_emit_ldloc_addr (mb, tmp_nullable_local);
+				mono_mb_emit_stloc (mb, tmp_nullable_locals [i]);
+				mono_mb_emit_ldloc_addr (mb, tmp_nullable_locals [i]);
 			}
 			continue;
 		}
@@ -5175,6 +5235,26 @@ handle_enum:
 	}
 
 	mono_mb_emit_stloc (mb, 0);
+
+	/* Convert back nullable-byref arguments */
+	for (i = 0; i < sig->param_count; i++) {
+		MonoType *t = sig->params [i];
+
+		/* 
+		 * Box the result and put it back into the array, the caller will have
+		 * to obtain it from there.
+		 */
+		if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) {
+			mono_mb_emit_ldarg (mb, 1);			
+			mono_mb_emit_icon (mb, sizeof (gpointer) * i);
+			mono_mb_emit_byte (mb, CEE_ADD);
+
+			mono_mb_emit_ldloc (mb, tmp_nullable_locals [i]);
+			mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (t));
+
+			mono_mb_emit_byte (mb, CEE_STIND_REF);
+		}
+	}
        		
 	pos = mono_mb_emit_branch (mb, CEE_LEAVE);
 
@@ -6313,16 +6393,40 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
 {
 	MonoMethodBuilder *mb = m->mb;
 	MonoClass *klass;
+	static MonoClass *date_time_class;
 	int pos = 0, pos2;
 
 	klass = mono_class_from_mono_type (t);
 
+	if (!date_time_class)
+		date_time_class = mono_class_from_name (mono_defaults.corlib, "System", "DateTime");
+	g_assert (date_time_class);
+
 	switch (action) {
 	case MARSHAL_ACTION_CONV_IN:
 		if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
 			klass->blittable || klass->enumtype)
 			break;
 
+		if (klass == date_time_class) {
+			/* Convert it to an OLE DATE type */
+			static MonoMethod *to_oadate;
+
+			if (!to_oadate)
+				to_oadate = mono_class_get_method_from_name (date_time_class, "ToOADate", 0);
+			g_assert (to_oadate);
+
+			if (t->byref)
+				g_assert_not_reached ();
+
+			conv_arg = mono_mb_add_local (mb, &mono_defaults.double_class->byval_arg);
+
+			mono_mb_emit_ldarg_addr (mb, argnum);
+			mono_mb_emit_managed_call (mb, to_oadate, NULL);
+			mono_mb_emit_stloc (mb, conv_arg);
+			break;
+		}
+
 		conv_arg = mono_mb_add_local (mb, &mono_defaults.int_class->byval_arg);
 			
 		/* store the address of the source into local variable 0 */
@@ -6374,6 +6478,11 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
 			break;
 		}
 
+		if (klass == date_time_class) {
+			mono_mb_emit_ldloc (mb, conv_arg);
+			break;
+		}
+
 		if (((klass->flags & TYPE_ATTRIBUTE_LAYOUT_MASK) == TYPE_ATTRIBUTE_EXPLICIT_LAYOUT) ||
 			klass->blittable || klass->enumtype) {
 			mono_mb_emit_ldarg (mb, argnum);
@@ -6421,6 +6530,7 @@ emit_marshal_vtype (EmitMarshalContext *m, int argnum, MonoType *t,
 			mono_mb_emit_stloc (mb, 3);
 			break;
 		}
+
 		/* load pointer to returned value type */
 		mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX);
 		mono_mb_emit_byte (mb, CEE_MONO_VTADDR);
@@ -6926,7 +7036,14 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
 			MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
 			MonoMarshalConv conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec);
 			
-			g_assert (!t->byref);
+			if (t->byref) {
+				if (!(t->attrs & PARAM_ATTRIBUTE_OUT)) {
+					char *msg = g_strdup_printf ("Byref marshalling of stringbuilders is not implemented.");
+					mono_mb_emit_exception_marshal_directive (mb, msg);
+				}
+				break;
+			}
+
 			mono_mb_emit_ldarg (mb, argnum);
 
 			if (conv != -1)
@@ -7014,13 +7131,34 @@ emit_marshal_object (EmitMarshalContext *m, int argnum, MonoType *t,
 			encoding = mono_marshal_get_string_encoding (m->piinfo, spec);
 			conv = mono_marshal_get_ptr_to_stringbuilder_conv (m->piinfo, spec, &need_free);
 
-			g_assert (!t->byref);
 			g_assert (encoding != -1);
 
-			mono_mb_emit_ldarg (mb, argnum);
-			mono_mb_emit_ldloc (mb, conv_arg);
+			if (t->byref) {
+				g_assert ((t->attrs & PARAM_ATTRIBUTE_OUT));
 
-			mono_mb_emit_icall (mb, conv_to_icall (conv));
+				need_free = TRUE;
+
+				mono_mb_emit_ldarg (mb, argnum);
+				mono_mb_emit_ldloc (mb, conv_arg);
+
+				switch (encoding) {
+				case MONO_NATIVE_LPWSTR:
+					mono_mb_emit_icall (mb, mono_string_utf16_to_builder2);
+					break;
+				case MONO_NATIVE_LPSTR:
+					mono_mb_emit_icall (mb, mono_string_utf8_to_builder2);
+					break;
+				default:
+					g_assert_not_reached ();
+				}
+
+				mono_mb_emit_byte (mb, CEE_STIND_REF);
+			} else {
+				mono_mb_emit_ldarg (mb, argnum);
+				mono_mb_emit_ldloc (mb, conv_arg);
+
+				mono_mb_emit_icall (mb, conv_to_icall (conv));
+			}
 
 			if (need_free) {
 				mono_mb_emit_ldloc (mb, conv_arg);
@@ -8153,15 +8291,15 @@ emit_marshal_array (EmitMarshalContext *m, int argnum, MonoType *t,
 		 * from 0.
 		 */
 
-		if (param_num == -1)
+		if (param_num == -1) {
 			mono_mb_emit_icon (mb, num_elem);
-		else {
-			/* FIXME: Add the two together */
+		} else {
 			mono_mb_emit_ldarg (mb, param_num);
 			if (num_elem > 0) {
 				mono_mb_emit_icon (mb, num_elem);
 				mono_mb_emit_byte (mb, CEE_ADD);
 			}
+			mono_mb_emit_byte (mb, CEE_CONV_OVF_I);
 		}
 
 		mono_mb_emit_op (mb, CEE_NEWARR, eklass);
@@ -8601,7 +8739,7 @@ emit_marshal_ptr (EmitMarshalContext *m, int argnum, MonoType *t,
 
 	switch (action) {
 	case MARSHAL_ACTION_CONV_IN:
-		if (MONO_TYPE_ISSTRUCT (t->data.type)) {
+		if (MONO_TYPE_ISSTRUCT (t->data.type) && !mono_class_from_mono_type (t->data.type)->blittable) {
 			char *msg = g_strdup_printf ("Can not marshal 'parameter #%d': Pointers can not reference marshaled structures. Use byref instead.", argnum + 1);
 			mono_mb_emit_exception_marshal_directive (m->mb, msg);
 		}
@@ -12163,12 +12301,14 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf)
 
 	klass = mono_object_get_class (object);
 
+	mono_cominterop_lock ();
 	if (!ccw_hash)
 		ccw_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
 	if (!ccw_interface_hash)
 		ccw_interface_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
 
 	ccw_list = g_hash_table_lookup (ccw_hash, GINT_TO_POINTER (mono_object_hash (object)));
+	mono_cominterop_unlock ();
 
 	ccw_list_item = ccw_list;
 	while (ccw_list_item) {
@@ -12209,7 +12349,9 @@ cominterop_get_ccw (MonoObject* object, MonoClass* itf)
 		}
 		else
 			ccw_list = g_list_append (ccw_list, ccw);
+		mono_cominterop_lock ();
 		g_hash_table_insert (ccw_hash, GINT_TO_POINTER (mono_object_hash (object)), ccw_list);
+		mono_cominterop_unlock ();
 		/* register for finalization to clean up ccw */
 		mono_object_register_finalizer (object);
 	}
diff --git a/mono/metadata/metadata.c b/mono/metadata/metadata.c
index 101d581..ccb698f 100644
--- a/mono/metadata/metadata.c
+++ b/mono/metadata/metadata.c
@@ -2197,7 +2197,7 @@ inflated_method_in_image (gpointer key, gpointer value, gpointer data)
 	// https://bugzilla.novell.com/show_bug.cgi?id=458168
 	return method->declaring->klass->image == image ||
 		(method->context.class_inst && ginst_in_image (method->context.class_inst, image)) ||
-		(method->context.method_inst && ginst_in_image (method->context.method_inst, image)) || signature_in_image (mono_method_signature ((MonoMethod*)method), image);
+		(method->context.method_inst && ginst_in_image (method->context.method_inst, image)) || (((MonoMethod*)method)->signature && signature_in_image (mono_method_signature ((MonoMethod*)method), image));
 }
 
 static gboolean
diff --git a/mono/metadata/mono-config.c b/mono/metadata/mono-config.c
index f6e5681..f69d889 100644
--- a/mono/metadata/mono-config.c
+++ b/mono/metadata/mono-config.c
@@ -201,6 +201,13 @@ static void parse_error   (GMarkupParseContext *context,
                            GError              *error,
 			   gpointer             user_data)
 {
+	ParseState *state = user_data;
+	const gchar *msg;
+	const gchar *filename;
+
+	filename = state && state->user_data ? (gchar *) state->user_data : "<unknown>";
+	msg = error && error->message ? error->message : "";
+	g_warning ("Error parsing %s: %s", filename, msg);
 }
 
 static int
@@ -365,15 +372,23 @@ mono_config_parse_xml_with_context (ParseState *state, const char *text, gsize l
 static int
 mono_config_parse_file_with_context (ParseState *state, const char *filename)
 {
-	char *text;
+	gchar *text;
 	gsize len;
+	gint offset;
 
 	mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_CONFIG,
 			"Config attempting to parse: '%s'.", filename);
 
 	if (!g_file_get_contents (filename, &text, &len, NULL))
 		return 0;
-	mono_config_parse_xml_with_context (state, text, len);
+
+
+	offset = 0;
+	if (len > 3 && text [0] == '\xef' && text [1] == (gchar) '\xbb' && text [2] == '\xbf')
+		offset = 3; /* Skip UTF-8 BOM */
+	if (state->user_data == NULL)
+		state->user_data = (gpointer) filename;
+	mono_config_parse_xml_with_context (state, text + offset, len - offset);
 	g_free (text);
 	return 1;
 }
@@ -388,7 +403,8 @@ void
 mono_config_parse_memory (const char *buffer)
 {
 	ParseState state = {NULL};
-	
+
+	state.user_data = (gpointer) "<buffer>";
 	mono_config_parse_xml_with_context (&state, buffer, strlen (buffer));
 }
 
@@ -396,6 +412,7 @@ static void
 mono_config_parse_file (const char *filename)
 {
 	ParseState state = {NULL};
+	state.user_data = (gpointer) filename;
 	mono_config_parse_file_with_context (&state, filename);
 }
 
@@ -465,8 +482,10 @@ mono_config_for_assembly (MonoImage *assembly)
 	state.assembly = assembly;
 
 	bundled_config = mono_config_string_for_assembly_file (assembly->module_name);
-	if (bundled_config)
+	if (bundled_config) {
+		state.user_data = (gpointer) "<bundled>";
 		mono_config_parse_xml_with_context (&state, bundled_config, strlen (bundled_config));
+	}
 
 	cfg_name = g_strdup_printf ("%s.config", mono_image_get_filename (assembly));
 	mono_config_parse_file_with_context (&state, cfg_name);
diff --git a/mono/metadata/mono-debug-debugger.h b/mono/metadata/mono-debug-debugger.h
index 6b7f7c8..ed6efa0 100644
--- a/mono/metadata/mono-debug-debugger.h
+++ b/mono/metadata/mono-debug-debugger.h
@@ -40,8 +40,10 @@ typedef enum {
 	MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN,
 	MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN,
 
-	/* Extended per-thread notifications */
-	MONO_DEBUGGER_EVENT_TRAMPOLINE			= 256,
+	/* Obsolete, only for backwards compatibility with older debugger versions */
+	MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE		= 256,
+
+	MONO_DEBUGGER_EVENT_TRAMPOLINE			= 512
 } MonoDebuggerEvent;
 
 extern volatile gint32 _mono_debugger_interruption_request;
diff --git a/mono/metadata/mono-debug.h b/mono/metadata/mono-debug.h
index ffdd9f9..63676bf 100644
--- a/mono/metadata/mono-debug.h
+++ b/mono/metadata/mono-debug.h
@@ -129,7 +129,7 @@ struct _MonoDebugVarInfo {
 };
 
 #define MONO_DEBUGGER_MAJOR_VERSION			80
-#define MONO_DEBUGGER_MINOR_VERSION			1
+#define MONO_DEBUGGER_MINOR_VERSION			2
 #define MONO_DEBUGGER_MAGIC				0x7aff65af4253d427ULL
 
 extern MonoSymbolTable *mono_symbol_table;
diff --git a/mono/metadata/mono-perfcounters.c b/mono/metadata/mono-perfcounters.c
index c963c20..7669b5d 100644
--- a/mono/metadata/mono-perfcounters.c
+++ b/mono/metadata/mono-perfcounters.c
@@ -1212,12 +1212,14 @@ get_cpu_instances (void)
 	void **buf = NULL;
 	int i, count;
 	MonoArray *array;
-	count = mono_cpu_count ();
+
+	count = mono_cpu_count () + 1; /* +1 for "_Total" */
 	buf = g_new (void*, count);
 	for (i = 0; i < count; ++i)
-		buf [i] = GINT_TO_POINTER (i);
+		buf [i] = GINT_TO_POINTER (i - 1); /* -1 => _Total */
 	array = get_string_array (buf, count, FALSE);
 	g_free (buf);
+	mono_array_setref (array, 0, mono_string_new (mono_domain_get (), "_Total"));
 	return array;
 }
 
diff --git a/mono/metadata/object.c b/mono/metadata/object.c
index ff53288..e9f6a3d 100644
--- a/mono/metadata/object.c
+++ b/mono/metadata/object.c
@@ -1176,6 +1176,10 @@ initialize_imt_slot (MonoVTable *vtable, MonoDomain *domain, MonoImtBuilderEntry
 	}
 }
 
+/*
+ * LOCKING: requires the loader and domain locks.
+ *
+*/
 static void
 build_imt_slots (MonoClass *klass, MonoVTable *vt, MonoDomain *domain, gpointer* imt, GSList *extra_interfaces, int slot_num) {
 	int i;
@@ -1276,6 +1280,8 @@ mono_install_vtable_trampoline (gpointer tramp_code)
  * Fill the given @imt_slot in the IMT table of @vtable with
  * a trampoline or a thunk for the case of collisions.
  * This is part of the internal mono API.
+ *
+ * LOCKING: Take the domain lock.
  */
 void
 mono_vtable_build_imt_slot (MonoVTable* vtable, int imt_slot)
@@ -1289,11 +1295,13 @@ mono_vtable_build_imt_slot (MonoVTable* vtable, int imt_slot)
 	 * Update and heck needs to ahppen inside the proper domain lock, as all
 	 * the changes made to a MonoVTable.
 	 */
+	mono_loader_lock (); /*FIXME build_imt_slots requires the loader lock.*/
 	mono_domain_lock (vtable->domain);
 	/* we change the slot only if it wasn't changed from the generic imt trampoline already */
 	if (imt [imt_slot] == imt_trampoline)
 		build_imt_slots (vtable->klass, vtable, vtable->domain, imt, NULL, imt_slot);
 	mono_domain_unlock (vtable->domain);
+	mono_loader_unlock ();
 }
 
 
@@ -1596,16 +1604,19 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
 	gpointer iter;
 	gpointer *interface_offsets;
 
+	mono_loader_lock (); /*FIXME mono_class_init acquires it*/
 	mono_domain_lock (domain);
 	runtime_info = class->runtime_info;
 	if (runtime_info && runtime_info->max_domain >= domain->domain_id && runtime_info->domain_vtables [domain->domain_id]) {
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return runtime_info->domain_vtables [domain->domain_id];
 	}
 	if (!class->inited || class->exception_type) {
 		if (!mono_class_init (class) || class->exception_type){
 			MonoException *exc;
 			mono_domain_unlock (domain);
+			mono_loader_unlock ();
 			exc = mono_class_get_exception_for_failure (class);
 			g_assert (exc);
 			mono_raise_exception (exc);
@@ -1754,7 +1765,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
 	/* class->runtime_info is protected by the loader lock, both when
 	 * it it enlarged and when it is stored info.
 	 */
-	mono_loader_lock ();
+
 	old_info = class->runtime_info;
 	if (old_info && old_info->max_domain >= domain->domain_id) {
 		/* someone already created a large enough runtime info */
@@ -1784,7 +1795,6 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
 		mono_memory_barrier ();
 		class->runtime_info = runtime_info;
 	}
-	mono_loader_unlock ();
 
 	/* Initialize vtable */
 	if (vtable_trampoline) {
@@ -1820,6 +1830,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class)
 	}
 
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 
 	/* Initialization is now complete, we can throw if the InheritanceDemand aren't satisfied */
 	if (mono_is_security_manager_active () && (class->exception_type == MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND)) {
@@ -2212,11 +2223,13 @@ clone_remote_class (MonoDomain *domain, MonoRemoteClass* remote_class, MonoClass
 gpointer
 mono_remote_class_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, MonoRealProxy *rp)
 {
+	mono_loader_lock (); /*FIXME mono_class_from_mono_type and mono_class_proxy_vtable take it*/
 	mono_domain_lock (domain);
 	if (rp->target_domain_id != -1) {
 		if (remote_class->xdomain_vtable == NULL)
 			remote_class->xdomain_vtable = mono_class_proxy_vtable (domain, remote_class, MONO_REMOTING_TARGET_APPDOMAIN);
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return remote_class->xdomain_vtable;
 	}
 	if (remote_class->default_vtable == NULL) {
@@ -2231,6 +2244,7 @@ mono_remote_class_vtable (MonoDomain *domain, MonoRemoteClass *remote_class, Mon
 	}
 	
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 	return remote_class->default_vtable;
 }
 
@@ -2251,6 +2265,7 @@ mono_upgrade_remote_class (MonoDomain *domain, MonoObject *proxy_object, MonoCla
 	MonoRemoteClass *remote_class;
 	gboolean redo_vtable;
 
+	mono_loader_lock (); /*FIXME mono_remote_class_vtable requires it.*/
 	mono_domain_lock (domain);
 
 	tproxy = (MonoTransparentProxy*) proxy_object;
@@ -2273,6 +2288,7 @@ mono_upgrade_remote_class (MonoDomain *domain, MonoObject *proxy_object, MonoCla
 	}
 	
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 }
 
 
@@ -3381,7 +3397,9 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
 {
 	MonoMethodSignature *sig = mono_method_signature (method);
 	gpointer *pa = NULL;
+	MonoObject *res;
 	int i;
+	gboolean has_byref_nullables = FALSE;
 
 	if (NULL != params) {
 		pa = alloca (sizeof (gpointer) * mono_array_length (params));
@@ -3408,6 +3426,8 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
 				if (t->type == MONO_TYPE_VALUETYPE && mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) {
 					/* The runtime invoke wrapper needs the original boxed vtype, it does handle byref values as well. */
 					pa [i] = mono_array_get (params, MonoObject*, i);
+					if (t->byref)
+						has_byref_nullables = TRUE;
 				} else {
 					/* MS seems to create the objects if a null is passed in */
 					if (!mono_array_get (params, MonoObject*, i))
@@ -3492,7 +3512,23 @@ mono_runtime_invoke_array (MonoMethod *method, void *obj, MonoArray *params,
 		}
 
 		/* obj must be already unboxed if needed */
-		return mono_runtime_invoke (method, obj, pa, exc);
+		res = mono_runtime_invoke (method, obj, pa, exc);
+
+		if (has_byref_nullables) {
+			/* 
+			 * The runtime invoke wrapper already converted byref nullables back,
+			 * and stored them in pa, we just need to copy them back to the
+			 * managed array.
+			 */
+			for (i = 0; i < mono_array_length (params); i++) {
+				MonoType *t = sig->params [i];
+
+				if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
+					mono_array_setref (params, i, pa [i]);
+			}
+		}
+
+		return res;
 	}
 }
 
@@ -4784,11 +4820,11 @@ mono_wait_handle_new (MonoDomain *domain, HANDLE handle)
 	gpointer params [1];
 	static MonoMethod *handle_set;
 
-	res = (MonoWaitHandle *)mono_object_new (domain, mono_defaults.waithandle_class);
+	res = (MonoWaitHandle *)mono_object_new (domain, mono_defaults.manualresetevent_class);
 
 	/* Even though this method is virtual, it's safe to invoke directly, since the object type matches.  */
 	if (!handle_set)
-		handle_set = mono_class_get_property_from_name (mono_defaults.waithandle_class, "Handle")->set;
+		handle_set = mono_class_get_property_from_name (mono_defaults.manualresetevent_class, "Handle")->set;
 
 	params [0] = &handle;
 	mono_runtime_invoke (handle_set, res, params, NULL);
@@ -4803,8 +4839,8 @@ mono_wait_handle_get_handle (MonoWaitHandle *handle)
 	static MonoClassField *f_safe_handle;
 
 	if (!f_os_handle && !f_safe_handle) {
-		f_os_handle = mono_class_get_field_from_name (mono_defaults.waithandle_class, "os_handle");
-		f_safe_handle = mono_class_get_field_from_name (mono_defaults.waithandle_class, "safe_wait_handle");
+		f_os_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "os_handle");
+		f_safe_handle = mono_class_get_field_from_name (mono_defaults.manualresetevent_class, "safe_wait_handle");
 	}
 
 	if (f_os_handle) {
@@ -5220,42 +5256,21 @@ mono_method_return_message_restore (MonoMethod *method, gpointer *params, MonoAr
 			arg = mono_array_get (out_args, gpointer, j);
 			type = pt->type;
 
-			switch (type) {
-			case MONO_TYPE_VOID:
-				g_assert_not_reached ();
-				break;
-			case MONO_TYPE_U1:
-			case MONO_TYPE_I1:
-			case MONO_TYPE_BOOLEAN:
-			case MONO_TYPE_U2:
-			case MONO_TYPE_I2:
-			case MONO_TYPE_CHAR:
-			case MONO_TYPE_U4:
-			case MONO_TYPE_I4:
-			case MONO_TYPE_I8:
-			case MONO_TYPE_U8:
-			case MONO_TYPE_R4:
-			case MONO_TYPE_R8:
-			case MONO_TYPE_VALUETYPE: {
+			g_assert (type != MONO_TYPE_VOID);
+
+			if (MONO_TYPE_IS_REFERENCE (pt)) {
+				mono_gc_wbarrier_generic_store (*((MonoObject ***)params [i]), (MonoObject *)arg);
+			} else {
 				if (arg) {
-					size = mono_class_value_size (((MonoObject*)arg)->vtable->klass, NULL);
+					MonoClass *class = ((MonoObject*)arg)->vtable->klass;
+					size = mono_class_value_size (class, NULL);
 					memcpy (*((gpointer *)params [i]), arg + sizeof (MonoObject), size); 
-				}
-				else {
+					if (class->has_references)
+						mono_gc_wbarrier_value_copy (*((gpointer *)params [i]), arg + sizeof (MonoObject), 1, class);
+				} else {
 					size = mono_class_value_size (mono_class_from_mono_type (pt), NULL);
 					memset (*((gpointer *)params [i]), 0, size);
 				}
-				break;
-			}
-			case MONO_TYPE_STRING:
-			case MONO_TYPE_CLASS: 
-			case MONO_TYPE_ARRAY:
-			case MONO_TYPE_SZARRAY:
-			case MONO_TYPE_OBJECT:
-				**((MonoObject ***)params [i]) = (MonoObject *)arg;
-				break;
-			default:
-				g_assert_not_reached ();
 			}
 
 			j++;
diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c
index 28cd90a..7b6eaea 100644
--- a/mono/metadata/reflection.c
+++ b/mono/metadata/reflection.c
@@ -1613,11 +1613,12 @@ type_get_qualified_name (MonoType *type, MonoAssembly *ass) {
 	return mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED);
 }
 
+/*field_image is the image to which the eventual custom mods have been encoded against*/
 static guint32
-fieldref_encode_signature (MonoDynamicImage *assembly, MonoType *type)
+fieldref_encode_signature (MonoDynamicImage *assembly, MonoImage *field_image, MonoType *type)
 {
 	SigBuffer buf;
-	guint32 idx, i;
+	guint32 idx, i, token;
 
 	if (!assembly->save)
 		return 0;
@@ -1626,14 +1627,22 @@ fieldref_encode_signature (MonoDynamicImage *assembly, MonoType *type)
 	
 	sigbuffer_add_value (&buf, 0x06);
 	/* encode custom attributes before the type */
-	/* FIXME: This should probably go in encode_type () */
 	if (type->num_mods) {
 		for (i = 0; i < type->num_mods; ++i) {
+			if (field_image) {
+				MonoClass *class = mono_class_get (field_image, type->modifiers [i].token);
+				g_assert (class);
+				token = mono_image_typedef_or_ref (assembly, &class->byval_arg);
+			} else {
+				token = type->modifiers [i].token;
+			}
+
 			if (type->modifiers [i].required)
 				sigbuffer_add_byte (&buf, MONO_TYPE_CMOD_REQD);
 			else
 				sigbuffer_add_byte (&buf, MONO_TYPE_CMOD_OPT);
-			sigbuffer_add_value (&buf, type->modifiers [i].token);
+
+			sigbuffer_add_value (&buf, token);
 		}
 	}
 	encode_type (assembly, type, &buf);
@@ -2612,7 +2621,7 @@ mono_image_get_fieldref_token (MonoDynamicImage *assembly, MonoReflectionField *
 	}
 	token = mono_image_get_memberref_token (assembly, &f->field->parent->byval_arg, 
 											mono_field_get_name (f->field),  
-											fieldref_encode_signature (assembly, type));
+											fieldref_encode_signature (assembly, field->parent->image, type));
 	g_hash_table_insert (assembly->handleref, f, GUINT_TO_POINTER(token));
 	return token;
 }
@@ -2902,7 +2911,7 @@ add_custom_modifiers (MonoDynamicImage *assembly, MonoType *type, MonoArray *mod
 
 	len = sizeof (MonoType) + ((gint32)count - MONO_ZERO_LEN_ARRAY) * sizeof (MonoCustomMod);
 	t = g_malloc (len);
-	memcpy (t, type, len);
+	memcpy (t, type, sizeof (MonoType));
 
 	t->num_mods = count;
 	pos = 0;
@@ -2947,10 +2956,10 @@ mono_image_get_generic_field_token (MonoDynamicImage *assembly, MonoReflectionFi
 	/* FIXME: We should do this in one place when a fieldbuilder is created */
 	if (fb->modreq || fb->modopt) {
 		custom = add_custom_modifiers (assembly, fb->type->type, fb->modreq, fb->modopt);
-		sig = fieldref_encode_signature (assembly, custom);
+		sig = fieldref_encode_signature (assembly, NULL, custom);
 		g_free (custom);
 	} else {
-		sig = fieldref_encode_signature (assembly, fb->type->type);
+		sig = fieldref_encode_signature (assembly, NULL, fb->type->type);
 	}
 
 	parent = create_generic_typespec (assembly, (MonoReflectionTypeBuilder *) fb->typeb);
@@ -6118,12 +6127,14 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
 			return vtable->type;
 	}
 
+	mono_loader_lock (); /*FIXME mono_class_init and mono_class_vtable acquire it*/
 	mono_domain_lock (domain);
 	if (!domain->type_hash)
 		domain->type_hash = mono_g_hash_table_new_type ((GHashFunc)mymono_metadata_type_hash, 
 				(GCompareFunc)mymono_metadata_type_equal, MONO_HASH_VALUE_GC);
 	if ((res = mono_g_hash_table_lookup (domain->type_hash, type))) {
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return res;
 	}
 	/* Create a MonoGenericClass object for instantiations of not finished TypeBuilders */
@@ -6131,11 +6142,13 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
 		res = (MonoReflectionType *)mono_generic_class_get_object (domain, type);
 		mono_g_hash_table_insert (domain->type_hash, type, res);
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return res;
 	}
 
 	if (!verify_safe_for_managed_space (type)) {
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		mono_raise_exception (mono_get_exception_invalid_operation ("This type cannot be propagated to managed space"));
 	}
 
@@ -6144,6 +6157,7 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
 		/* should this be considered an error condition? */
 		if (!type->byref) {
 			mono_domain_unlock (domain);
+			mono_loader_unlock ();
 			return klass->reflection_info;
 		}
 	}
@@ -6161,6 +6175,7 @@ mono_type_get_object (MonoDomain *domain, MonoType *type)
 		MONO_OBJECT_SETREF (domain, typeof_void, res);
 
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 	return res;
 }
 
@@ -10202,11 +10217,11 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
 	 * we need to lock the domain because the lock will be taken inside
 	 * So, we need to keep the locking order correct.
 	 */
-	mono_domain_lock (domain);
 	mono_loader_lock ();
+	mono_domain_lock (domain);
 	if (klass->wastypebuilder) {
-		mono_loader_unlock ();
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return mono_type_get_object (mono_object_domain (tb), &klass->byval_arg);
 	}
 	/*
@@ -10275,8 +10290,8 @@ mono_reflection_create_runtime_class (MonoReflectionTypeBuilder *tb)
 	if (domain->type_hash && klass->generic_container)
 		mono_g_hash_table_foreach_remove (domain->type_hash, remove_instantiations_of, klass);
 
-	mono_loader_unlock ();
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 
 	if (klass->enumtype && !mono_class_is_valid_enum (klass)) {
 		mono_class_set_failure (klass, MONO_EXCEPTION_TYPE_LOAD, NULL);
@@ -10496,6 +10511,8 @@ mono_reflection_is_valid_dynamic_token (MonoDynamicImage *image, guint32 token)
  * runtime structure. If HANDLE_CLASS is not NULL, it is set to the class required by 
  * mono_ldtoken. If valid_token is TRUE, assert if it is not found in the token->object
  * mapping table.
+ * 
+ * LOCKING: Take the loader lock
  */
 gpointer
 mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean valid_token, MonoClass **handle_class, MonoGenericContext *context)
@@ -10504,7 +10521,10 @@ mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean
 	MonoObject *obj;
 	MonoClass *klass;
 
+	mono_loader_lock ();
 	obj = mono_g_hash_table_lookup (assembly->tokens, GUINT_TO_POINTER (token));
+	mono_loader_unlock ();
+
 	if (!obj) {
 		if (valid_token)
 			g_assert_not_reached ();
diff --git a/mono/metadata/socket-io.c b/mono/metadata/socket-io.c
index a4dab61..01b1c04 100644
--- a/mono/metadata/socket-io.c
+++ b/mono/metadata/socket-io.c
@@ -35,6 +35,7 @@
 #include <mono/metadata/exception.h>
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/appdomain.h>
+#include <mono/metadata/file-io.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/threads-types.h>
 #include <mono/utils/mono-poll.h>
@@ -2002,6 +2003,7 @@ static struct in6_addr ipaddress_to_struct_in6_addr(MonoObject *ipaddr)
 
 void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, gint32 level, gint32 name, MonoObject *obj_val, MonoArray *byte_val, gint32 int_val, gint32 *error)
 {
+	struct linger linger;
 	int system_level;
 	int system_name;
 	int ret;
@@ -2047,18 +2049,9 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
 	/* Only one of obj_val, byte_val or int_val has data */
 	if(obj_val!=NULL) {
 		MonoClassField *field;
-		struct linger linger;
 		int valsize;
 		
 		switch(name) {
-		case SocketOptionName_DontLinger:
-			linger.l_onoff=0;
-			linger.l_linger=0;
-			valsize=sizeof(linger);
-			ret = _wapi_setsockopt (sock, system_level,
-						system_name, &linger, valsize);
-			break;
-			
 		case SocketOptionName_Linger:
 			/* Dig out "bool enabled" and "int seconds"
 			 * fields
@@ -2146,17 +2139,31 @@ void ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal(SOCKET sock, g
 			return;
 		}
 	} else if (byte_val!=NULL) {
-		int valsize=mono_array_length(byte_val);
-		guchar *buf=mono_array_addr(byte_val, guchar, 0);
-	
-		ret = _wapi_setsockopt (sock, system_level, system_name, buf, valsize);
-		if(ret==SOCKET_ERROR) {
-			*error = WSAGetLastError ();
-			return;
+		int valsize = mono_array_length (byte_val);
+		guchar *buf = mono_array_addr (byte_val, guchar, 0);
+		
+		switch(name) {
+		case SocketOptionName_DontLinger:
+			if (valsize == 1) {
+				linger.l_onoff = (*buf) ? 0 : 1;
+				linger.l_linger = 0;
+				ret = _wapi_setsockopt (sock, system_level, system_name, &linger, sizeof (linger));
+			} else {
+				*error = WSAEINVAL;
+			}
+			break;
+		default:
+			ret = _wapi_setsockopt (sock, system_level, system_name, buf, valsize);
+			break;
 		}
 	} else {
 		/* ReceiveTimeout/SendTimeout get here */
 		switch(name) {
+		case SocketOptionName_DontLinger:
+			linger.l_onoff = !int_val;
+			linger.l_linger = 0;
+			ret = _wapi_setsockopt (sock, system_level, system_name, &linger, sizeof (linger));
+			break;
 		case SocketOptionName_DontFragment:
 #ifdef HAVE_IP_MTU_DISCOVER
 			/* Fiddle with the value slightly if we're
@@ -3048,6 +3055,43 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_
 	return(TRUE);
 }
 
+gboolean
+ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags)
+{
+	HANDLE file;
+	gint32 error;
+	TRANSMIT_FILE_BUFFERS buffers;
+
+	MONO_ARCH_SAVE_REGS;
+
+	if (filename == NULL)
+		return FALSE;
+
+	file = ves_icall_System_IO_MonoIO_Open (filename, FileMode_Open, FileAccess_Read, FileShare_Read, 0, &error);
+	if (file == INVALID_HANDLE_VALUE) {
+		SetLastError (error);
+		return FALSE;
+	}
+
+	memset (&buffers, 0, sizeof (buffers));
+	if (pre_buffer != NULL) {
+		buffers.Head = mono_array_addr (pre_buffer, guchar, 0);
+		buffers.HeadLength = mono_array_length (pre_buffer);
+	}
+	if (post_buffer != NULL) {
+		buffers.Tail = mono_array_addr (post_buffer, guchar, 0);
+		buffers.TailLength = mono_array_length (post_buffer);
+	}
+
+	if (!TransmitFile (sock, file, 0, 0, NULL, &buffers, flags)) {
+		CloseHandle (file);
+		return FALSE;
+	}
+
+	CloseHandle (file);
+	return TRUE;
+}
+
 void mono_network_init(void)
 {
 	WSADATA wsadata;
diff --git a/mono/metadata/socket-io.h b/mono/metadata/socket-io.h
index 012f91c..3408c16 100644
--- a/mono/metadata/socket-io.h
+++ b/mono/metadata/socket-io.h
@@ -217,6 +217,7 @@ extern MonoBoolean ves_icall_System_Net_Dns_GetHostByAddr_internal(MonoString *a
 extern MonoBoolean ves_icall_System_Net_Dns_GetHostName_internal(MonoString **h_name) MONO_INTERNAL;
 extern MonoBoolean ves_icall_System_Net_Sockets_Socket_Poll_internal (SOCKET sock, gint mode, gint timeout, gint32 *error) MONO_INTERNAL;
 extern void ves_icall_System_Net_Sockets_Socket_Disconnect_internal(SOCKET sock, MonoBoolean reuse, gint32 *error) MONO_INTERNAL;
+extern gboolean ves_icall_System_Net_Sockets_Socket_SendFile (SOCKET sock, MonoString *filename, MonoArray *pre_buffer, MonoArray *post_buffer, gint flags) MONO_INTERNAL;
 
 extern void mono_network_init(void) MONO_INTERNAL;
 extern void mono_network_cleanup(void) MONO_INTERNAL;
diff --git a/mono/metadata/threadpool.c b/mono/metadata/threadpool.c
index 33506f5..1b68944 100644
--- a/mono/metadata/threadpool.c
+++ b/mono/metadata/threadpool.c
@@ -12,8 +12,8 @@
 #include <config.h>
 #include <glib.h>
 
-#define THREADS_PER_CPU	10 /* 20 + THREADS_PER_CPU * number of CPUs */
-#define THREAD_EXIT_TIMEOUT 1000
+#define THREADS_PER_CPU	15 /* 20 + THREADS_PER_CPU * number of CPUs */
+#define THREAD_EXIT_TIMEOUT 2000
 
 #include <mono/metadata/domain-internals.h>
 #include <mono/metadata/tabledefs.h>
@@ -1037,7 +1037,7 @@ start_idle_threads (MonoAsyncResult *data)
 			if (data) 
 				threadpool_jobs_dec ((MonoObject*)data);
 			data = NULL;
-			Sleep (500);
+			SleepEx (500, TRUE);
 		}
 	} while ((needed - existing) > 0);
 
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index 8de9c22..3057ceb 100644
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -125,6 +125,10 @@ static MonoGHashTable *threads=NULL;
  * Protected by mono_threads_lock ().
  */
 static MonoGHashTable *threads_starting_up = NULL;
+ 
+/* Maps a MonoThread to its start argument */
+/* Protected by mono_threads_lock () */
+static MonoGHashTable *thread_start_args = NULL;
 
 /* The TLS key that holds the MonoObject assigned to each thread */
 static guint32 current_object_key = -1;
@@ -140,8 +144,8 @@ static __thread MonoThread * tls_current_object MONO_TLS_FAST;
 } while (FALSE)
 #define GET_CURRENT_OBJECT() tls_current_object
 #else
-#define SET_CURRENT_OBJECT(x) TlsSetValue (current_object_key, x);
-#define GET_CURRENT_OBJECT() (MonoThread*) TlsGetValue (current_object_key);
+#define SET_CURRENT_OBJECT(x) TlsSetValue (current_object_key, x)
+#define GET_CURRENT_OBJECT() (MonoThread*) TlsGetValue (current_object_key)
 #endif
 
 /* function called at thread start */
@@ -530,6 +534,9 @@ static void thread_cleanup (MonoThread *thread)
 	if (thread->serialized_culture_info)
 		g_free (thread->serialized_culture_info);
 
+	if (thread->serialized_ui_culture_info)
+		g_free (thread->serialized_ui_culture_info);
+
 	g_free (thread->name);
 
 	thread->cached_culture_info = NULL;
@@ -609,7 +616,10 @@ static guint32 WINAPI start_wrapper(void *data)
 		ReleaseSemaphore (thread->start_notify, 1, NULL);
 	}
 
-	MONO_GC_UNREGISTER_ROOT (start_info->start_arg);
+	mono_threads_lock ();
+	mono_g_hash_table_remove (thread_start_args, thread);
+	mono_threads_unlock ();
+
 	g_free (start_info);
 
 	thread_adjust_static_data (thread);
@@ -691,12 +701,6 @@ void mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer ar
 	start_info->domain = domain;
 	start_info->start_arg = arg;
 
-	/* 
-	 * The argument may be an object reference, and there is no ref to keep it alive
-	 * when the new thread is started but not yet registered with the collector.
-	 */
-	MONO_GC_REGISTER_ROOT (start_info->start_arg);
-
 	mono_threads_lock ();
 	if (shutting_down) {
 		mono_threads_unlock ();
@@ -706,7 +710,17 @@ void mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer ar
 		MONO_GC_REGISTER_ROOT (threads_starting_up);
 		threads_starting_up = mono_g_hash_table_new (NULL, NULL);
 	}
-	mono_g_hash_table_insert (threads_starting_up, thread, thread);
+	if (thread_start_args == NULL) {
+		MONO_GC_REGISTER_ROOT (thread_start_args);
+		thread_start_args = mono_g_hash_table_new (NULL, NULL);
+	}
+ 	mono_g_hash_table_insert (threads_starting_up, thread, thread);
+	/* 
+	 * The argument may be an object reference, and there is no ref to keep it alive
+	 * when the new thread is started but not yet registered with the collector. So
+	 * we store it in a GC tracked hash table.
+	 */
+	mono_g_hash_table_insert (thread_start_args, thread, start_info->start_arg);
 	mono_threads_unlock ();	
 
 	/* Create suspended, so we can do some housekeeping before the thread
@@ -717,7 +731,6 @@ void mono_thread_create_internal (MonoDomain *domain, gpointer func, gpointer ar
 	THREAD_DEBUG (g_message ("%s: Started thread ID %"G_GSIZE_FORMAT" (handle %p)", __func__, tid, thread_handle));
 	if (thread_handle == NULL) {
 		/* The thread couldn't be created, so throw an exception */
-		MONO_GC_UNREGISTER_ROOT (start_info->start_arg);
 		mono_threads_lock ();
 		mono_g_hash_table_remove (threads_starting_up, thread);
 		mono_threads_unlock ();
@@ -1273,7 +1286,7 @@ ves_icall_System_Threading_Thread_SetSerializedCurrentUICulture (MonoThread *thi
 MonoThread *
 mono_thread_current (void)
 {
-	MonoThread *res = GET_CURRENT_OBJECT ()
+	MonoThread *res = GET_CURRENT_OBJECT ();
 	THREAD_DEBUG (g_message ("%s: returning %p", __func__, res));
 	return res;
 }
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index 7a918ea..76f1a09 100644
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,3 +1,165 @@
+2009-11-06  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-arm.c (handle_thunk): Add a domain argument to control the domain
+	where the thunk memory should be allocated from. Fixes appdomain unloading
+	on arm.
+
+2009-11-03  Rodrigo Kumpera  <rkumpera at novell.com>
+
+	* simd-intrinsics.c (load_simd_vreg): Add extra argument to signal if
+	the value was loaded from memory.
+
+	* simd-intrinsics.c (simd_intrinsic_emit_setter): Store back to memory if
+	the value was loader from there.
+
+	* simd-intrinsics.c (simd_intrinsic_emit_shuffle): Fail correctly for Shuffle
+	without constant swizzle.
+
+	Backport of r145283.
+
+2009-10-30  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini.c (mini_cleanup): Call profiler shutdown before shutting down the
+	runtime. Fixes #551228.
+
+2009-10-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-x86.c (mono_arch_output_basic_block): Fix % 1. Fixes #550970.
+
+	* basic.cs: Add a test.
+
+	* method-to-ir.c (mono_method_to_ir): Use EMIT_NEW_LOAD_MEMBASE_TYPE to
+	load vtypes instead if OP_LOADV_MEMBASE in the implementation of
+	CONSTRAINED. Fixes #550964.
+
+	* generics.cs: Add a test.
+
+2009-09-22  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-exceptions.c (mini_jit_info_table_find): New helper function which
+	searches all the domains of the current thread.
+
+	* exceptions-<ARCH>.c: Use it. Fixes #539394.
+
+2009-10-15  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini.c (mono_op_imm_to_op): Handle OP_AND/OR/XOR_IMM.
+
+2009-10-13  Martin Baulig  <martin at ximian.com>
+
+	* debug-mini.c (mono_debugger_trampoline_compiled): Add
+	`const guint8 *trampoline' argument; send both the old and the new
+	notification.
+
+2009-07-09  Mark Probst  <mark.probst at gmail.com>
+
+	* method-to-ir.c: When doing a call which might be remote from
+	shared generic code to other shared code with open type arguments,
+	get the remoting invoke wrapper from the RGCTX and do an indirect
+	call to it.
+
+	Backport of r137640.
+
+2009-10-02  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-sparc.c (mono_arch_emit_setret): Emit long return values using OP_LMOVE.
+	(mono_arch_create_vars): Instead of allocating a stack slot by hand, allocate
+	a variable to hold the stack slot used by the int<->float conversion opcodes.
+
+	* mini-sparc.c (mono_arch_build_imt_thunk): Implement support for fail_tramp.
+
+2009-09-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-sparc.c: Fix the handling of enums with base type long.
+
+	* mini-sparc.c (mono_arch_output_basic_block): Fix IREM_UN_IMM.
+
+	* mini-sparc.c (mono_arch_allocate_vars): Use mono_class_from_mono_type ()
+	instead of using type->data.klass as the later doesn't work with generics.
+
+2009-09-25  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-sparc.c (mono_arch_create_vars): Make the component vars of a long ret
+	variable volatile. Fixes #541577.
+
+	* basic-calls.cs: Add a new test.
+
+	* basic-long.cs: Remove tests which are now in basic-calls.cs.
+
+2009-09-24  Zoltan Varga  <vargaz at gmail.com>
+
+	* decompose.c (mono_decompose_vtype_opts): Avoid reading uninitialized memory
+	in the VCALL decomposition code.
+
+2009-09-19  Zoltan Varga  <vargaz at gmail.com>
+
+	* method-to-ir.c: Fix the previous change on 64 bit platforms.
+	
+	* method-to-ir.c: Applied patch from Rodrigo Kumpera. Allow an i8 argument
+	to NEWARR.
+
+	* iltests.il.in: Add a new test.
+
+2009-09-17 Rodrigo Kumpera  <rkumpera at novell.com>
+
+	Backport of r127430.
+
+	* mini.c: Adjust locking order to the new semantics where the loader lock
+	comes first.
+	
+2009-09-16  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-exceptions.c (mono_handle_exception_internal): Store the computed
+	lmf before calling filter clauses as well. Fixes #539550.
+
+	* exceptions.cs: Add a test.
+	
+2009-09-01  Zoltan Varga  <vargaz at gmail.com>
+
+	* exceptions-x86.c (throw_exception): Fix the previous change by substracting
+	the alignment for the value of sp.
+
+2009-08-31  Zoltan Varga  <vargaz at gmail.com>
+
+	* exceptions-x86.c (get_throw_exception): Align the stack on osx.
+
+2009-07-13  Zoltan Varga  <vargaz at gmail.com>
+
+	* method-to-ir.c (mono_method_to_ir): When calling a gshared method,
+	call a generic class init trampoline if needed. Fixes #519336.
+
+	* generics.cs: Add a test.
+
+2009-07-31  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-sparc.c (mono_arch_output_basic_block): Implement OP_IREM_UN_IMM.
+
+2009-07-09  Mark Probst  <mark.probst at gmail.com>
+
+	* method-to-ir.c: When doing a call which might be remote from
+	shared generic code to other shared code with open type arguments,
+	abort generic code sharing for that method.
+
+2009-06-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* mini-exceptions.c (get_generic_context_from_stack_frame): Fix the case
+	when the generic instance is an instantiation of a subclass of the
+	methods class. Fixes #517166.
+
+
+Fri Apr 24 16:44:08 CEST 2009 Paolo Molaro <lupus at ximian.com>
+
+	* Makefile.am, genmdesc.c, genmdesc.pl: tiny refactor to allow
+	multiple machine description files to be specified.
+	* mini-ops.h: fixes for cross-compilation.
+
+2009-06-17  Zoltan Varga  <vargaz at gmail.com>
+
+	* branch-opts.c (mono_merge_basic_blocks): Fix the case when bbn
+	falls through to its next bblock. Fixes #513931.
+
+	* iltests.il: Add a test.
+
 2009-06-08  Martin Baulig  <martin at ximian.com>
 
 	* debug-mini.c
diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am
index 0c24ed1..a2b7924 100644
--- a/mono/mini/Makefile.am
+++ b/mono/mini/Makefile.am
@@ -422,40 +422,40 @@ GENMDESC_PRG=./genmdesc
 endif !CROSS_COMPILING
 
 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
+	$(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
 
 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
+	$(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
 
 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ppc.md cpu-ppc.h ppcg4
+	$(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
 
 cpu-ppc64.h: cpu-ppc64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ppc64.md cpu-ppc64.h ppc64_cpu_desc
+	$(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
 
 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
+	$(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
 
 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
+	$(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
 
 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
+	$(GENMDESC_PRG) cpu-s390.h s390_cpu_desc $(srcdir)/cpu-s390.md
 
 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
+	$(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
 
 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
+	$(GENMDESC_PRG) cpu-ia64.h ia64_desc $(srcdir)/cpu-ia64.md
 
 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
+	$(GENMDESC_PRG) cpu-alpha.h alpha_desc $(srcdir)/cpu-alpha.md
 
 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-hppa.md cpu-hppa.h hppa_desc
+	$(GENMDESC_PRG) cpu-hppa.h hppa_desc $(srcdir)/cpu-hppa.md
 
 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
+	$(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
 
 testi: mono test.exe
 	$(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
diff --git a/mono/mini/Makefile.in b/mono/mini/Makefile.in
index f21e055..4feee30 100644
--- a/mono/mini/Makefile.in
+++ b/mono/mini/Makefile.in
@@ -44,7 +44,10 @@ subdir = mono/mini
 DIST_COMMON = README $(libmonoinclude_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in ChangeLog TODO
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -257,10 +260,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -270,14 +269,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -295,6 +293,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -303,6 +302,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -314,11 +314,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -347,8 +350,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -388,6 +390,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -411,6 +414,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 count = 100000
@@ -1224,40 +1228,40 @@ generics-variant-types.dll: generics-variant-types.il
 	$(ILASM) -dll -output=$@ $<
 
 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-x86.md cpu-x86.h x86_desc
+	$(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
 
 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
+	$(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
 
 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ppc.md cpu-ppc.h ppcg4
+	$(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
 
 cpu-ppc64.h: cpu-ppc64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ppc64.md cpu-ppc64.h ppc64_cpu_desc
+	$(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
 
 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-arm.md cpu-arm.h arm_cpu_desc
+	$(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
 
 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
+	$(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
 
 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-s390.md cpu-s390.h s390_cpu_desc
+	$(GENMDESC_PRG) cpu-s390.h s390_cpu_desc $(srcdir)/cpu-s390.md
 
 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-s390x.md cpu-s390x.h s390x_cpu_desc
+	$(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
 
 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-ia64.md cpu-ia64.h ia64_desc
+	$(GENMDESC_PRG) cpu-ia64.h ia64_desc $(srcdir)/cpu-ia64.md
 
 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-alpha.md cpu-alpha.h alpha_desc
+	$(GENMDESC_PRG) cpu-alpha.h alpha_desc $(srcdir)/cpu-alpha.md
 
 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-hppa.md cpu-hppa.h hppa_desc
+	$(GENMDESC_PRG) cpu-hppa.h hppa_desc $(srcdir)/cpu-hppa.md
 
 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
-	$(GENMDESC_PRG) $(srcdir)/cpu-mips.md cpu-mips.h mips_desc
+	$(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
 
 testi: mono test.exe
 	$(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
diff --git a/mono/mini/basic-calls.cs b/mono/mini/basic-calls.cs
index 08d43d5..387519b 100644
--- a/mono/mini/basic-calls.cs
+++ b/mono/mini/basic-calls.cs
@@ -288,6 +288,29 @@ class Tests {
 		return 0;
 	}
 
+	public static void use_long_arg (ulong l) {
+		for (int i = 0; i < 10; ++i)
+			l ++;
+	}
+
+	public static ulong return_long_arg (object o, ulong perm) {
+		use_long_arg (perm);
+
+        perm = 0x8000000000000FFF;
+
+		use_long_arg (perm);
+
+		return perm;
+	}
+
+    public static int test_0_sparc_long_ret_regress_541577 () {
+        ulong perm = 0x8000000000000FFF;
+
+        ulong work = return_long_arg (null, perm);
+
+		return work == perm ? 0 : 1;
+	}
+
 	static void doit (double value, out long m) {
 		m = (long) value;
 	}
diff --git a/mono/mini/basic-long.cs b/mono/mini/basic-long.cs
index dde9d3a..5373a5e 100644
--- a/mono/mini/basic-long.cs
+++ b/mono/mini/basic-long.cs
@@ -1014,26 +1014,6 @@ class Tests {
 		return 0;
 	}
 
-	static long return_5low () {
-		return 5;
-	}
-	
-	static long return_5high () {
-		return 0x500000000;
-	}
-
-	public static int test_3_long_ret () {
-		long val = return_5low ();
-		return (int) (val - 2);
-	}
-
-	public static int test_1_long_ret2 () {
-		long val = return_5high ();
-		if (val > 0xffffffff)
-			return 1;
-		return 0;
-	}
-
 	public static int test_3_byte_cast () {
 		ulong val = 0xff00ff00f0f0f0f0;
 		byte b;
diff --git a/mono/mini/basic.cs b/mono/mini/basic.cs
index 394110d..cc308fb 100644
--- a/mono/mini/basic.cs
+++ b/mono/mini/basic.cs
@@ -195,6 +195,11 @@ class Tests {
 		return b % 1;
 	}
 
+	public static int test_0_rem_imm_0_neg () {
+		int b = -2;
+		return b % 1;
+	}
+
 	public static int test_4_rem_big_imm () {
 		int b = 10004;
 		return b % 10000;
diff --git a/mono/mini/branch-opts.c b/mono/mini/branch-opts.c
index ff4de4e..18b3777 100644
--- a/mono/mini/branch-opts.c
+++ b/mono/mini/branch-opts.c
@@ -1004,6 +1004,16 @@ mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *b
 			bb->next_bb = bbn->next_bb;
 	}
 	mono_nullify_basic_block (bbn);
+
+	/* 
+	 * If bbn fell through to its next bblock, have to add a branch, since bb
+	 * will not fall though to the same bblock (#513931).
+	 */
+	if (bb->last_ins && bb->out_count == 1 && bb->out_bb [0] != bb->next_bb && !MONO_IS_BRANCH_OP (bb->last_ins)) {
+		MONO_INST_NEW (cfg, inst, OP_BR);
+		inst->inst_target_bb = bb->out_bb [0];
+		MONO_ADD_INS (bb, inst);
+	}
 }
 
 static void
diff --git a/mono/mini/debug-mini.c b/mono/mini/debug-mini.c
index 46fe06e..1ef19fd 100644
--- a/mono/mini/debug-mini.c
+++ b/mono/mini/debug-mini.c
@@ -858,10 +858,20 @@ mono_debugger_extended_notification (MonoDebuggerEvent event, guint64 data, guin
 }
 
 void
-mono_debugger_trampoline_compiled (MonoMethod *method, const guint8 *code)
+mono_debugger_trampoline_compiled (const guint8 *trampoline, MonoMethod *method, const guint8 *code)
 {
-	mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_TRAMPOLINE,
+#ifdef MONO_DEBUGGER_SUPPORTED
+	struct {
+		const guint8 * trampoline;
+		MonoMethod *method;
+		const guint8 *code;
+	} info = { trampoline, method, code };
+
+	mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE,
 					     (guint64) (gsize) method, (guint64) (gsize) code);
+	mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_TRAMPOLINE,
+					     (guint64) (gsize) &info, 0);
+#endif
 }
 
 #if MONO_DEBUGGER_SUPPORTED
diff --git a/mono/mini/debug-mini.h b/mono/mini/debug-mini.h
index 73f98c7..1df045d 100644
--- a/mono/mini/debug-mini.h
+++ b/mono/mini/debug-mini.h
@@ -19,7 +19,7 @@ void
 mono_debugger_extended_notification (MonoDebuggerEvent event, guint64 data, guint64 arg);
 
 void
-mono_debugger_trampoline_compiled (MonoMethod *method, const guint8 *code);
+mono_debugger_trampoline_compiled (const guint8 *trampoline, MonoMethod *method, const guint8 *code);
 
 void
 mono_debugger_call_exception_handler (gpointer addr, gpointer stack, MonoObject *exc);
diff --git a/mono/mini/decompose.c b/mono/mini/decompose.c
index 1a929ec..866bf54 100644
--- a/mono/mini/decompose.c
+++ b/mono/mini/decompose.c
@@ -1184,7 +1184,7 @@ mono_decompose_vtype_opts (MonoCompile *cfg)
 
 						/* Save the result */
 						if (dest_var->backend.is_pinvoke)
-							size = mono_class_native_size (dest->inst_vtype->data.klass, NULL);
+							size = mono_class_native_size (mono_class_from_mono_type (dest_var->inst_vtype), NULL);
 						else
 							size = mono_type_size (dest_var->inst_vtype, NULL);
 						switch (size) {
diff --git a/mono/mini/exceptions-alpha.c b/mono/mini/exceptions-alpha.c
index 5de412c..5d009ff 100644
--- a/mono/mini/exceptions-alpha.c
+++ b/mono/mini/exceptions-alpha.c
@@ -796,7 +796,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
        ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
     ji = prev_ji;
   else
-    ji = mono_jit_info_table_find (domain, ip);
+    ji = mini_jit_info_table_find (domain, ip);
 
   if (managed)
     *managed = FALSE;
@@ -975,7 +975,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
       if (!(*lmf)->method)
 	return (gpointer)-1;
 
-      if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+      if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
       } else {
 	memset (res, 0, sizeof (MonoJitInfo));
 	res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-amd64.c b/mono/mini/exceptions-amd64.c
index 2b9da1d..44edeb8 100644
--- a/mono/mini/exceptions-amd64.c
+++ b/mono/mini/exceptions-amd64.c
@@ -548,7 +548,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -685,7 +685,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 			rip = *(guint64*)((*lmf)->rsp - sizeof (gpointer));
 		}
 
-		ji = mono_jit_info_table_find (domain, (gpointer)rip);
+		ji = mini_jit_info_table_find (domain, (gpointer)rip);
 		if (!ji) {
 			// FIXME: This can happen with multiple appdomains (bug #444383)
 			return (gpointer)-1;
@@ -900,7 +900,7 @@ mono_arch_handle_altstack_exception (void *sigctx, gpointer fault_addr, gboolean
 	MonoException *exc = NULL;
 	ucontext_t *ctx = (ucontext_t*)sigctx;
 	guint64 *gregs = gregs_from_ucontext (ctx);
-	MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)gregs [REG_RIP]);
+	MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)gregs [REG_RIP]);
 	gpointer *sp;
 	int frame_size;
 
@@ -1271,7 +1271,7 @@ MONO_GET_RUNTIME_FUNCTION_CALLBACK ( DWORD64 ControlPc, IN PVOID Context )
 	PMonoUnwindInfo targetinfo;
 	MonoDomain *domain = mono_domain_get ();
 
-	ji = mono_jit_info_table_find (domain, (char*)ControlPc);
+	ji = mini_jit_info_table_find (domain, (char*)ControlPc);
 	if (!ji)
 		return 0;
 
diff --git a/mono/mini/exceptions-arm.c b/mono/mini/exceptions-arm.c
index 682f745..96f7a22 100644
--- a/mono/mini/exceptions-arm.c
+++ b/mono/mini/exceptions-arm.c
@@ -376,7 +376,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -448,7 +448,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		
 		*new_ctx = *ctx;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			if (!(*lmf)->method)
 				return (gpointer)-1;
diff --git a/mono/mini/exceptions-hppa.c b/mono/mini/exceptions-hppa.c
index afbe1b6..241b413 100644
--- a/mono/mini/exceptions-hppa.c
+++ b/mono/mini/exceptions-hppa.c
@@ -545,7 +545,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -577,7 +577,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		if (!(*lmf)->method)
 			return (gpointer)-1;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			memset (res, 0, sizeof (MonoJitInfo));
 			res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-ia64.c b/mono/mini/exceptions-ia64.c
index 87372e0..d60c01a 100644
--- a/mono/mini/exceptions-ia64.c
+++ b/mono/mini/exceptions-ia64.c
@@ -256,7 +256,7 @@ throw_exception (MonoObject *exc, guint64 rethrow)
 		res = unw_get_reg (&ctx.cursor, UNW_IA64_SP, &sp);
 		g_assert (res == 0);
 
-		ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)ip);
+		ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)ip);
 
 		//printf ("UN: %s %lx %lx\n", ji ? ji->method->name : "", ip, sp);
 
@@ -535,7 +535,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		if (prev_ji && ((guint8*)ip > (guint8*)prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 			ji = prev_ji;
 		else
-			ji = mono_jit_info_table_find (domain, (gpointer)ip);
+			ji = mini_jit_info_table_find (domain, (gpointer)ip);
 
 		if (managed)
 			*managed = FALSE;
@@ -611,7 +611,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
 		res = unw_get_reg (&ctx.cursor, UNW_IA64_IP, &ip);
 		g_assert (res == 0);
 
-		ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)ip);
+		ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)ip);
 
 		if (ji)
 			break;
diff --git a/mono/mini/exceptions-mips.c b/mono/mini/exceptions-mips.c
index c99243f..76d0b67 100644
--- a/mono/mini/exceptions-mips.c
+++ b/mono/mini/exceptions-mips.c
@@ -413,7 +413,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -500,7 +500,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 		}
 		g_assert (((*lmf)->magic == MIPS_LMF_MAGIC1) || ((*lmf)->magic == MIPS_LMF_MAGIC2));
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			memset (res, 0, sizeof (MonoJitInfo));
 			res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-ppc.c b/mono/mini/exceptions-ppc.c
index 3183cba..77c3637 100644
--- a/mono/mini/exceptions-ppc.c
+++ b/mono/mini/exceptions-ppc.c
@@ -507,7 +507,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -563,7 +563,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		*new_ctx = *ctx;
 		setup_context (new_ctx);
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			if (!(*lmf)->method)
 				return (gpointer)-1;
@@ -640,7 +640,7 @@ mono_arch_handle_altstack_exception (void *sigctx, gpointer fault_addr, gboolean
 #ifdef MONO_ARCH_USE_SIGACTION
 	os_ucontext *uc = (ucontext_t*)sigctx;
 	os_ucontext *uc_copy;
-	MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context (sigctx));
+	MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), mono_arch_ip_from_context (sigctx));
 	gpointer *sp;
 	int frame_size;
 
diff --git a/mono/mini/exceptions-s390.c b/mono/mini/exceptions-s390.c
index e87d5f7..9d7b500 100644
--- a/mono/mini/exceptions-s390.c
+++ b/mono/mini/exceptions-s390.c
@@ -447,7 +447,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 	    ((guint8 *) ip <= ((guint8 *) prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -481,7 +481,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 		if (!(*lmf)->method)
 			return (gpointer)-1;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			memset (res, 0, sizeof (MonoJitInfo));
 			res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-s390x.c b/mono/mini/exceptions-s390x.c
index 4699b36..8c7f942 100644
--- a/mono/mini/exceptions-s390x.c
+++ b/mono/mini/exceptions-s390x.c
@@ -452,7 +452,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 	    ((guint8 *) ip <= ((guint8 *) prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -487,7 +487,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 		if (!(*lmf)->method)
 			return (gpointer)-1;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			memset (res, 0, sizeof (MonoJitInfo));
 			res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-sparc.c b/mono/mini/exceptions-sparc.c
index e721463..e39a245 100644
--- a/mono/mini/exceptions-sparc.c
+++ b/mono/mini/exceptions-sparc.c
@@ -378,7 +378,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -412,7 +412,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		if (!(*lmf)->method)
 			return (gpointer)-1;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->ip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->ip))) {
 		} else {
 			memset (res, 0, sizeof (MonoJitInfo));
 			res->method = (*lmf)->method;
diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c
index ed4605b..464ae25 100644
--- a/mono/mini/exceptions-x86.c
+++ b/mono/mini/exceptions-x86.c
@@ -374,7 +374,7 @@ throw_exception (unsigned long eax, unsigned long ecx, unsigned long edx, unsign
 		restore_context = mono_arch_get_restore_context ();
 
 	/* Pop argument and return address */
-	ctx.esp = esp + (2 * sizeof (gpointer));
+	ctx.esp = esp + (3 * sizeof (gpointer));
 	ctx.eip = eip;
 	ctx.ebp = ebp;
 	ctx.edi = edi;
@@ -423,9 +423,14 @@ get_throw_exception (gboolean rethrow)
 
 	start = code = mono_global_codeman_reserve (64);
 
+	/* 
+	 * Align the stack on apple, since we push 10 args + the return address, and the
+	 * caller pushed 8 bytes.
+	 */
+	x86_alu_reg_imm (code, X86_SUB, X86_ESP, 4);
 	x86_push_reg (code, X86_ESP);
-	x86_push_membase (code, X86_ESP, 4); /* IP */
-	x86_push_membase (code, X86_ESP, 12); /* exception */
+	x86_push_membase (code, X86_ESP, 8); /* IP */
+	x86_push_membase (code, X86_ESP, 16); /* exception */
 	x86_push_reg (code, X86_EBP);
 	x86_push_reg (code, X86_EDI);
 	x86_push_reg (code, X86_ESI);
@@ -592,7 +597,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 	if (prev_ji && (ip > prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
 		ji = prev_ji;
 	else
-		ji = mono_jit_info_table_find (domain, ip);
+		ji = mini_jit_info_table_find (domain, ip);
 
 	if (managed)
 		*managed = FALSE;
@@ -662,7 +667,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf
 		
 		*new_ctx = *ctx;
 
-		if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
+		if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
 		} else {
 			if (!((guint32)((*lmf)->previous_lmf) & 1))
 				/* Top LMF entry */
@@ -861,7 +866,7 @@ mono_arch_handle_altstack_exception (void *sigctx, gpointer fault_addr, gboolean
 #ifdef MONO_ARCH_USE_SIGACTION
 	MonoException *exc = NULL;
 	ucontext_t *ctx = (ucontext_t*)sigctx;
-	MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)UCONTEXT_REG_EIP (ctx));
+	MonoJitInfo *ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)UCONTEXT_REG_EIP (ctx));
 	gpointer *sp;
 	int frame_size;
 
@@ -871,7 +876,7 @@ mono_arch_handle_altstack_exception (void *sigctx, gpointer fault_addr, gboolean
 	 */
 	if (!ji && fault_addr == (gpointer)UCONTEXT_REG_EIP (ctx)) {
 		glong *sp = (gpointer)UCONTEXT_REG_ESP (ctx);
-		ji = mono_jit_info_table_find (mono_domain_get (), (gpointer)sp [0]);
+		ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)sp [0]);
 		if (ji)
 			UCONTEXT_REG_EIP (ctx) = sp [0];
 	}
diff --git a/mono/mini/exceptions.cs b/mono/mini/exceptions.cs
index f6270f6..62bc232 100644
--- a/mono/mini/exceptions.cs
+++ b/mono/mini/exceptions.cs
@@ -2427,5 +2427,58 @@ class Tests {
 
 		return (i == 1) ? 0 : 1;
 	}		
+
+	public static int test_0_inline_throw () {
+		try {
+			inline_throw1 (5);
+			return 1;
+		} catch {
+			return 0;
+		}
+	}
+
+	// for llvm, the end bblock is unreachable
+	public static int inline_throw1 (int i) {
+		if (i == 0)
+			throw new Exception ();
+		else
+			return inline_throw2 (i);
+	}
+
+	public static int inline_throw2 (int i) {
+		throw new Exception ();
+	}
+
+	// bug #539550
+	public static int test_0_lmf_filter () {
+		try {
+			// The invoke calls a runtime-invoke wrapper which has a filter clause
+			typeof (Tests).GetMethod ("lmf_filter").Invoke (null, new object [] { });
+		} catch (TargetInvocationException) {
+		}
+		return 0;
+	}
+
+    public static void lmf_filter () {
+        try {
+            Connect ();
+        }
+        catch {
+            throw new NotImplementedException ();
+        }
+    }
+
+    public static void Connect () {
+        Stop ();
+        throw new Exception();
+    }
+
+    public static void Stop () {
+        try {
+            lock (null) {}
+        }
+        catch {
+        }
+    }
 }
 
diff --git a/mono/mini/generics.cs b/mono/mini/generics.cs
index 13e3510..6d7140b 100644
--- a/mono/mini/generics.cs
+++ b/mono/mini/generics.cs
@@ -401,6 +401,47 @@ class Tests {
 		return 0;
 	}
 
+	enum MyEnumUlong : ulong {
+		Value_2 = 2
+	}
+
+	public static int test_0_regress_550964_constrained_enum_long () {
+        MyEnumUlong a = MyEnumUlong.Value_2;
+        MyEnumUlong b = MyEnumUlong.Value_2;
+
+        return Pan (a, b) ? 0 : 1;
+	}
+
+    static bool Pan<T> (T a, T b)
+    {
+        return a.Equals (b);
+    }
+
+	static int cctor_count = 0;
+
+    public abstract class Beta<TChanged> 
+    {		
+        static Beta()
+        {
+			cctor_count ++;
+        }
+    }   
+    
+    public class Gamma<T> : Beta<T> 
+    {   
+        static Gamma()
+        {
+        }
+    }
+
+	// #519336    
+	public static int test_2_generic_class_init_gshared_ctor () {
+		new Gamma<object>();
+		new Gamma<string>();
+
+		return cctor_count;
+	}
+
 	public static Type the_type;
 
 	public void ldvirtftn<T> () {
diff --git a/mono/mini/genmdesc.c b/mono/mini/genmdesc.c
index 7b28861..144c174 100644
--- a/mono/mini/genmdesc.c
+++ b/mono/mini/genmdesc.c
@@ -211,21 +211,20 @@ int
 main (int argc, char* argv [])
 {
 	init_table ();
-	switch (argc) {
-	case 2:
+	if (argc == 2) {
 		/* useful to get a new file when some opcodes are added: looses the comments, though */
 		load_file (argv [1]);
 		dump ();
-		break;
-	case 4:
-		load_file (argv [1]);
-		build_table (argv [2], argv [3]);
-		break;
-	default:
+	} else if (argc < 4) {
 		g_print ("Usage: genmdesc arguments\n");
-		g_print ("\tgenmdesc desc             Output to stdout the description file.\n");
-		g_print ("\tgenmdesc desc output name Write to output the description in a table named 'name'.\n");
+		g_print ("\tgenmdesc desc                        Output to stdout the description file.\n");
+		g_print ("\tgenmdesc output name desc [desc1...] Write to output the description in a table named 'name'.\n");
 		return 1;
+	} else {
+		int i;
+		for (i = 3; i < argc; ++i)
+			load_file (argv [i]);
+		build_table (argv [1], argv [2]);
 	}
 	return 0;
 }
diff --git a/mono/mini/genmdesc.pl b/mono/mini/genmdesc.pl
index 7febf81..46f3f44 100644
--- a/mono/mini/genmdesc.pl
+++ b/mono/mini/genmdesc.pl
@@ -51,7 +51,7 @@ sub load_opcodes
 	#print "Running: $cpp\n";
 	open (OPS, $cpp) || die "Cannot execute cpp: $!";
 	while (<OPS>) {
-		next unless /MINI_OP\s*\(\s*(\S+?)\s*,\s*"(.*?)"/;
+		next unless /MINI_OP3?\s*\(\s*(\S+?)\s*,\s*"(.*?)"/;
 		my ($sym, $name) = ($1, $2);
 		push @opcodes, [$sym, $name];
 		$table{$name} = {num => $i, name => $name};
@@ -159,16 +159,19 @@ sub build_table {
 }
 
 sub usage {
-	die "genmdesc.pl arch srcdir desc output name\n";
+	die "genmdesc.pl arch srcdir output name desc [desc2 ...]\n";
 }
 
 my $arch = shift || usage ();
 my $srcdir = shift || usage ();
-my $file = shift || usage ();
 my $output = shift || usage ();
 my $name = shift || usage ();
+usage () unless @ARGV;
+my @files = @ARGV;
 
 load_opcodes ($srcdir, $arch);
-load_file ($file);
+foreach my $file (@files) {
+	load_file ($file);
+}
 build_table ($output, $name);
 
diff --git a/mono/mini/iltests.il.in b/mono/mini/iltests.il.in
index ec00b6d..6a6c69f 100644
--- a/mono/mini/iltests.il.in
+++ b/mono/mini/iltests.il.in
@@ -2198,4 +2198,76 @@ HAS_VALUE:	ldc.i4.1
 		conv.i4
 		ret
 	}
+
+   .field  private static  int32 Value
+
+  .method public static hidebysig  specialname 
+          default int32 regress_513931_inner ()  cil managed 
+    {                                                                 
+        // Method begins at RVA 0x225c                                
+        // Code size 52 (0x34)                                        
+        .maxstack 2                                                   
+        .locals init (                                                
+                int32   V_0,                                          
+                int32   V_1,                                          
+                bool    V_2)
+                       
+				ldc.i4 999
+				stsfld int32 Tests::Value
+
+        IL_0000:  nop                                                 
+        IL_0001:  ldsfld int32 Tests::Value      
+        IL_0006:  stloc.0                                             
+        IL_0007:  ldloc.0                                             
+        IL_0008:  ldc.i4.0                                            
+        IL_0009:  cgt                                                 
+        IL_000b:  ldc.i4.0                                            
+        IL_000c:  ceq                                                 
+        IL_000e:  stloc.2                                             
+        IL_000f:  ldloc.2                                             
+        IL_0010:  brtrue.s IL_0027                                    
+
+        IL_0012:  nop 
+        IL_0013:  ldloc.0 
+        IL_0014:  ldc.i4.s 0x7b
+        IL_0016:  ceq          
+        IL_0018:  ldc.i4.0     
+        IL_0019:  ceq          
+        IL_001b:  stloc.2      
+        IL_001c:  ldloc.2      
+        IL_001d:  brtrue.s IL_0023
+
+        IL_001f:  ldc.i4.m1 
+        IL_0020:  stloc.1   
+        IL_0021:  br.s IL_0032
+
+        IL_0023:  ldc.i4.1 
+        IL_0024:  stloc.1  
+        IL_0025:  br.s IL_0032
+
+        IL_0027:  
+        IL_002c:  newobj instance void class [mscorlib]System.Exception::'.ctor'()
+        IL_0031:  throw                                                                            
+        IL_0032:  ldloc.1                                                                          
+        IL_0033:  ret                                                                              
+    }
+
+	.method public static hidebysig  specialname 
+         default int32 test_0_regress_513931 ()  cil managed 
+	{
+		call int32 Tests::regress_513931_inner ()
+		pop
+		ldc.i4.0
+		ret
+	}
+
+	.method public static default int32 test_0_newarr_i8 () cil managed
+	{
+		ldc.i4 1000
+		conv.i8
+		newarr [mscorlib]System.Boolean
+		pop
+		ldc.i4 0
+		ret
+	}
 }
diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c
index d3e604d..f3303d2 100644
--- a/mono/mini/method-to-ir.c
+++ b/mono/mini/method-to-ir.c
@@ -2195,11 +2195,16 @@ mono_emit_rgctx_calli (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **ar
 }
 
 static MonoInst*
+emit_get_rgctx_method (MonoCompile *cfg, int context_used, MonoMethod *cmethod, int rgctx_type);
+
+static MonoInst*
 mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSignature *sig,
 							MonoInst **args, MonoInst *this, MonoInst *imt_arg)
 {
+	gboolean might_be_remote;
 	gboolean virtual = this != NULL;
 	gboolean enable_for_aot = TRUE;
+	int context_used;
 	MonoCallInst *call;
 
 	if (method->string_ctor) {
@@ -2211,11 +2216,28 @@ mono_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign
 		sig = ctor_sig;
 	}
 
+	might_be_remote = this && sig->hasthis &&
+		(method->klass->marshalbyref || method->klass == mono_defaults.object_class) &&
+		!(method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !MONO_CHECK_THIS (this);
+
+	context_used = mono_method_check_context_used (method);
+	if (might_be_remote && context_used) {
+		MonoInst *addr;
+
+		g_assert (cfg->generic_sharing_context);
+
+		addr = emit_get_rgctx_method (cfg, context_used, method, MONO_RGCTX_INFO_REMOTING_INVOKE_WITH_CHECK);
+
+		return mono_emit_calli (cfg, sig, args, addr);
+	}
+
 	call = mono_emit_call_args (cfg, sig, args, FALSE, virtual);
 
-	if (this && sig->hasthis && 
-	    (method->klass->marshalbyref || method->klass == mono_defaults.object_class) && 
-	    !(method->flags & METHOD_ATTRIBUTE_VIRTUAL) && !MONO_CHECK_THIS (this)) {
+	if (might_be_remote) {
+		if (mono_method_check_context_used (method)) {
+			g_assert (cfg->generic_sharing_context);
+			return NULL;
+		}
 		call->method = mono_marshal_get_remoting_invoke_with_check (method);
 	} else {
 		call->method = method;
@@ -2338,6 +2360,8 @@ mono_emit_rgctx_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMeth
 #endif
 	}
 	ins = mono_emit_method_call_full (cfg, method, sig, args, this, imt_arg);
+	if (!ins)
+		return NULL;
 
 	call = (MonoCallInst*)ins;
 	if (vtable_arg) {
@@ -2610,6 +2634,36 @@ emit_get_rgctx_field (MonoCompile *cfg, int context_used,
 }
 
 static void
+emit_generic_class_init (MonoCompile *cfg, MonoClass *klass)
+{
+	MonoInst *vtable_arg;
+	MonoCallInst *call;
+	int context_used = 0;
+
+	if (cfg->generic_sharing_context)
+		context_used = mono_class_check_context_used (klass);
+
+	if (context_used) {
+		vtable_arg = emit_get_rgctx_klass (cfg, context_used,
+										   klass, MONO_RGCTX_INFO_VTABLE);
+	} else {
+		MonoVTable *vtable = mono_class_vtable (cfg->domain, klass);
+
+		if (!vtable)
+			return;
+		EMIT_NEW_VTABLECONST (cfg, vtable_arg, vtable);
+	}
+
+	call = (MonoCallInst*)mono_emit_abs_call (cfg, MONO_PATCH_INFO_GENERIC_CLASS_INIT, NULL, helper_sig_generic_class_init_trampoline, &vtable_arg);
+#ifdef MONO_ARCH_VTABLE_REG
+	mono_call_inst_add_outarg_reg (cfg, call, vtable_arg->dreg, MONO_ARCH_VTABLE_REG, FALSE);
+	cfg->uses_vtable_reg = TRUE;
+#else
+	NOT_IMPLEMENTED;
+#endif
+}
+
+static void
 mini_emit_check_array_type (MonoCompile *cfg, MonoInst *obj, MonoClass *array_class)
 {
 	int vtable_reg = alloc_preg (cfg);
@@ -5966,15 +6020,12 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 				 * We have the `constrained.' prefix opcode.
 				 */
 				if (constrained_call->valuetype && !cmethod->klass->valuetype) {
-					int dreg;
-
 					/*
 					 * The type parameter is instantiated as a valuetype,
 					 * but that type doesn't override the method we're
 					 * calling, so we need to box `this'.
 					 */
-					dreg = alloc_dreg (cfg, STACK_VTYPE);
-					EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADV_MEMBASE, dreg, sp [0]->dreg, 0);
+					EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, &constrained_call->byval_arg, sp [0]->dreg, 0);
 					ins->klass = constrained_call;
 					sp [0] = handle_box (cfg, ins, constrained_call);
 				} else if (!constrained_call->valuetype) {
@@ -5996,6 +6047,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 			if (*ip != CEE_CALLI && check_call_signature (cfg, fsig, sp))
 				UNVERIFIED;
 
+			/* 
+			 * If the callee is a shared method, then its static cctor
+			 * might not get called after the call was patched.
+			 */
+			if (cfg->generic_sharing_context && cmethod && cmethod->klass != method->klass && cmethod->klass->generic_class && mono_method_is_generic_sharable_impl (cmethod, TRUE) && mono_class_needs_cctor_run (cmethod->klass, method)) {
+				emit_generic_class_init (cfg, cmethod->klass);
+			}
 
 			if (cmethod && ((cmethod->flags & METHOD_ATTRIBUTE_STATIC) || cmethod->klass->valuetype) &&
 					(cmethod->klass->generic_class || cmethod->klass->generic_container)) {
@@ -6131,6 +6189,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 							((MonoMethodInflated*)cmethod)->context.method_inst);
 					}
 					ins = mono_emit_method_call_full (cfg, cmethod, fsig, sp, sp [0], imt_arg);
+					if (!ins)
+						GENERIC_SHARING_FAILURE (*ip);
 				} else
 #endif
 				{
@@ -6457,6 +6517,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 			} else {
 				ins = (MonoInst*)mono_emit_method_call_full (cfg, cmethod, fsig, sp, virtual ? sp [0] : NULL, NULL);
 			}
+			if (!ins)
+				GENERIC_SHARING_FAILURE (*ip);
 
 			if (!MONO_TYPE_IS_VOID (fsig->ret))
 				*sp++ = ins;
@@ -7363,7 +7425,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 						inline_costs += costs - 5;
 					} else {
 						INLINE_FAILURE;
-						mono_emit_method_call_full (cfg, cmethod, fsig, sp, callvirt_this_arg, NULL);
+						if (!mono_emit_method_call_full (cfg, cmethod, fsig, sp, callvirt_this_arg, NULL))
+							GENERIC_SHARING_FAILURE (*ip);
 					}
 				} else if (context_used &&
 						(!mono_method_is_generic_sharable_impl (cmethod, TRUE) ||
@@ -8131,6 +8194,16 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 			if (cfg->generic_sharing_context)
 				context_used = mono_class_check_context_used (klass);
 
+			if (sp [0]->type == STACK_I8 || (SIZEOF_VOID_P == 8 && sp [0]->type == STACK_PTR)) {
+				MONO_INST_NEW (cfg, ins, OP_LCONV_TO_I4);
+				ins->sreg1 = sp [0]->dreg;
+				ins->type = STACK_I4;
+				ins->dreg = alloc_ireg (cfg);
+				MONO_ADD_INS (cfg->cbb, ins);
+				mono_decompose_opcode (cfg, ins);
+				*sp = ins;
+			}
+
 			if (context_used) {
 				MonoInst *args [2];
 
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
index f5083d1..8f7d805 100644
--- a/mono/mini/mini-amd64.c
+++ b/mono/mini/mini-amd64.c
@@ -2011,6 +2011,10 @@ emit_call_body (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointe
 		near_call = FALSE;
 #endif
 
+		/* The 64bit XEN kernel does not honour the MAP_32BIT flag. (#522894) */
+		if (optimize_for_xen)
+			near_call = FALSE;
+
 		if (near_call) {
 			/* 
 			 * Align the call displacement to an address divisible by 4 so it does
diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c
index eed4e27..b02c262 100644
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@ -2017,10 +2017,13 @@ search_thunk_slot (void *data, int csize, int bsize, void *user_data) {
 }
 
 static void
-handle_thunk (int absolute, guchar *code, const guchar *target) {
-	MonoDomain *domain = mono_domain_get ();
+handle_thunk (MonoDomain *domain, int absolute, guchar *code, const guchar *target)
+{
 	PatchData pdata;
 
+	if (!domain)
+		domain = mono_domain_get ();
+
 	pdata.code = code;
 	pdata.target = target;
 	pdata.absolute = absolute;
@@ -2041,8 +2044,8 @@ handle_thunk (int absolute, guchar *code, const guchar *target) {
 	g_assert (pdata.found == 1);
 }
 
-void
-arm_patch (guchar *code, const guchar *target)
+static void
+arm_patch_general (MonoDomain *domain, guchar *code, const guchar *target)
 {
 	guint32 *code32 = (void*)code;
 	guint32 ins = *code32;
@@ -2088,7 +2091,7 @@ arm_patch (guchar *code, const guchar *target)
 			}
 		}
 		
-		handle_thunk (TRUE, code, target);
+		handle_thunk (domain, TRUE, code, target);
 		return;
 	}
 
@@ -2188,6 +2191,12 @@ arm_patch (guchar *code, const guchar *target)
 //	g_print ("patched with 0x%08x\n", ins);
 }
 
+void
+arm_patch (guchar *code, const guchar *target)
+{
+	arm_patch_general (NULL, code, target);
+}
+
 /* 
  * Return the >= 0 uimm8 value if val can be represented with a byte + rotation
  * (with the rotation amount in *rot_amount. rot_amount is already adjusted
@@ -3562,7 +3571,7 @@ mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, Mono
 		default:
 			break;
 		}
-		arm_patch (ip, target);
+		arm_patch_general (domain, ip, target);
 	}
 }
 
diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c
index dee9316..a7b2b65 100644
--- a/mono/mini/mini-exceptions.c
+++ b/mono/mini/mini-exceptions.c
@@ -303,15 +303,21 @@ get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
 		class = generic_info;
 	}
 
-	if (class->generic_class || class->generic_container)
-		context.class_inst = mini_class_get_context (class)->class_inst;
-
 	g_assert (!ji->method->klass->generic_container);
 	if (ji->method->klass->generic_class)
 		method_container_class = ji->method->klass->generic_class->container_class;
 	else
 		method_container_class = ji->method->klass;
 
+	/* class might refer to a subclass of ji->method's class */
+	while (class->generic_class && class->generic_class->container_class != method_container_class) {
+		class = class->parent;
+		g_assert (class);
+	}
+
+	if (class->generic_class || class->generic_container)
+		context.class_inst = mini_class_get_context (class)->class_inst;
+
 	if (class->generic_class)
 		g_assert (mono_class_has_parent_and_ignore_generics (class->generic_class->container_class, method_container_class));
 	else
@@ -325,7 +331,7 @@ get_method_from_stack_frame (MonoJitInfo *ji, gpointer generic_info)
 {
 	MonoGenericContext context;
 	MonoMethod *method;
-
+	
 	if (!ji->has_generic_jit_info || !mono_jit_info_get_generic_jit_info (ji)->has_this)
 		return ji->method;
 	context = get_generic_context_from_stack_frame (ji, generic_info);
@@ -841,6 +847,34 @@ get_exception_catch_class (MonoJitExceptionInfo *ei, MonoJitInfo *ji, MonoContex
 	return catch_class;
 }
 
+/*
+ * mini_jit_info_table_find:
+ *
+ *   Same as mono_jit_info_table_find, but search all the domains of the current thread
+ * if ADDR is not found in DOMAIN.
+ */
+MonoJitInfo*
+mini_jit_info_table_find (MonoDomain *domain, char *addr)
+{
+	MonoJitInfo *ji;
+	MonoThread *t = mono_thread_current ();
+	GSList *l;
+
+	ji = mono_jit_info_table_find (domain, addr);
+	if (ji)
+		return ji;
+
+	for (l = t->appdomain_refs; l; l = l->next) {
+		if (l->data != domain) {
+			ji = mono_jit_info_table_find ((MonoDomain*)l->data, addr);
+			if (ji)
+				return ji;
+		}
+	}
+
+	return NULL;
+}
+
 /**
  * mono_handle_exception_internal:
  * @ctx: saved processor state
@@ -1078,6 +1112,7 @@ mono_handle_exception_internal (MonoContext *ctx, gpointer obj, gpointer origina
 							mono_profiler_exception_clause_handler (ji->method, ei->flags, i);
 							mono_debugger_call_exception_handler (ei->handler_start, MONO_CONTEXT_GET_SP (ctx), obj);
 							mono_perfcounters->exceptions_finallys++;
+							*(mono_get_lmf_addr ()) = lmf;
 							call_filter (ctx, ei->handler_start);
 						}
 						
diff --git a/mono/mini/mini-ops.h b/mono/mini/mini-ops.h
index 5db58fb..93c97c7 100644
--- a/mono/mini/mini-ops.h
+++ b/mono/mini/mini-ops.h
@@ -72,7 +72,7 @@ MINI_OP(OP_STOREI8_MEMBASE_REG, "storei8_membase_reg", IREG, IREG, NONE)
 MINI_OP(OP_STORER4_MEMBASE_REG, "storer4_membase_reg", IREG, FREG, NONE)
 MINI_OP(OP_STORER8_MEMBASE_REG, "storer8_membase_reg", IREG, FREG, NONE)
 
-#ifdef MONO_ARCH_SUPPORT_SIMD_INTRINSICS
+#if defined(TARGET_X86) || defined(TARGET_AMD64)
 MINI_OP(OP_STOREX_MEMBASE_REG, "storex_membase_reg", IREG, XREG, NONE)
 MINI_OP(OP_STOREX_ALIGNED_MEMBASE_REG,     "storex_aligned_membase_reg", IREG, XREG, NONE)
 MINI_OP(OP_STOREX_NTA_MEMBASE_REG,     "storex_nta_membase_reg", IREG, XREG, NONE)
@@ -100,7 +100,7 @@ MINI_OP(OP_LOADR8_MEMBASE,"loadr8_membase", FREG, IREG, NONE)
 
 MINI_OP(OP_LOADX_MEMBASE, 			"loadx_membase", XREG, IREG, NONE)
 
-#ifdef MONO_ARCH_SUPPORT_SIMD_INTRINSICS
+#if defined(TARGET_X86) || defined(TARGET_AMD64)
 MINI_OP(OP_LOADX_ALIGNED_MEMBASE,  "loadx_aligned_membase", XREG, IREG, NONE)
 #endif
 
@@ -578,7 +578,7 @@ MINI_OP(OP_NOT_NULL, "not_null", NONE, IREG, NONE)
 
 /* SIMD opcodes. */
 
-#ifdef MONO_ARCH_SUPPORT_SIMD_INTRINSICS
+#if defined(TARGET_X86) || defined(TARGET_AMD64)
 
 MINI_OP(OP_ADDPS, "addps", XREG, XREG, XREG)
 MINI_OP(OP_DIVPS, "divps", XREG, XREG, XREG)
diff --git a/mono/mini/mini-sparc.c b/mono/mini/mini-sparc.c
index 7ed3251..402d174 100644
--- a/mono/mini/mini-sparc.c
+++ b/mono/mini/mini-sparc.c
@@ -811,8 +811,9 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 			cfg->ret->opcode = OP_REGVAR;
 			cfg->ret->inst_c0 = cinfo->ret.reg;
 			break;
-		case ArgInIRegPair:
-			if (((sig->ret->type == MONO_TYPE_I8) || (sig->ret->type == MONO_TYPE_U8))) {
+		case ArgInIRegPair: {
+			MonoType *t = mono_type_get_underlying_type (sig->ret);
+			if (((t->type == MONO_TYPE_I8) || (t->type == MONO_TYPE_U8))) {
 				MonoInst *low = get_vreg_to_inst (cfg, cfg->ret->dreg + 1);
 				MonoInst *high = get_vreg_to_inst (cfg, cfg->ret->dreg + 2);
 
@@ -824,6 +825,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 			cfg->ret->opcode = OP_REGVAR;
 			cfg->ret->inst_c0 = cinfo->ret.reg;
 			break;
+		}
 		case ArgOnStack:
 #ifdef SPARCV9
 			g_assert_not_reached ();
@@ -877,7 +879,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 		/* inst->backend.is_pinvoke indicates native sized value types, this is used by the
 		* pinvoke wrappers when they call functions returning structure */
 		if (inst->backend.is_pinvoke && MONO_TYPE_ISSTRUCT (inst->inst_vtype) && inst->inst_vtype->type != MONO_TYPE_TYPEDBYREF)
-			size = mono_class_native_size (inst->inst_vtype->data.klass, &align);
+			size = mono_class_native_size (mono_class_from_mono_type (inst->inst_vtype), &align);
 		else
 			size = mini_type_stack_size (cfg->generic_sharing_context, inst->inst_vtype, &align);
 
@@ -963,7 +965,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 					high->dreg = sparc_i0 + ainfo->reg;
 				}
 				inst->opcode = OP_REGVAR;
-				inst->dreg = sparc_i0 + ainfo->reg;					
+				inst->dreg = sparc_i0 + ainfo->reg;
 				break;
 			case ArgInFloatReg:
 			case ArgInDoubleReg:
@@ -1017,11 +1019,6 @@ mono_arch_allocate_vars (MonoCompile *cfg)
 		}
 	}
 
-	/* Add a properly aligned dword for use by int<->float conversion opcodes */
-	offset += 8;
-	offset = ALIGN_TO (offset, 8);
-	cfg->arch.float_spill_slot_offset = offset;
-
 	/* 
 	 * spillvars are stored between the normal locals and the storage reserved
 	 * by the ABI.
@@ -1046,6 +1043,18 @@ mono_arch_create_vars (MonoCompile *cfg)
 			mono_print_ins (cfg->vret_addr);
 		}
 	}
+
+	if (!sig->ret->byref && (sig->ret->type == MONO_TYPE_I8 || sig->ret->type == MONO_TYPE_U8)) {
+		MonoInst *low = get_vreg_to_inst (cfg, cfg->ret->dreg + 1);
+		MonoInst *high = get_vreg_to_inst (cfg, cfg->ret->dreg + 2);
+
+		low->flags |= MONO_INST_VOLATILE;
+		high->flags |= MONO_INST_VOLATILE;
+	}
+
+	/* Add a properly aligned dword for use by int<->float conversion opcodes */
+	cfg->arch.float_spill_slot = mono_compile_create_var (cfg, &mono_defaults.double_class->byval_arg, OP_ARG);
+	((MonoInst*)cfg->arch.float_spill_slot)->flags |= MONO_INST_VOLATILE;
 }
 
 static void
@@ -1305,6 +1314,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
 		else
 			arg_type = sig->params [i - sig->hasthis];
 
+		arg_type = mono_type_get_underlying_type (arg_type);
 		if ((i >= sig->hasthis) && (MONO_TYPE_ISSTRUCT(sig->params [i - sig->hasthis])))
 			emit_pass_vtype (cfg, call, cinfo, ainfo, arg_type, in, sig->pinvoke);
 		else if (!arg_type->byref && ((arg_type->type == MONO_TYPE_I8) || (arg_type->type == MONO_TYPE_U8)))
@@ -1340,17 +1350,22 @@ void
 mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val)
 {
 	CallInfo *cinfo = get_call_info (cfg, mono_method_signature (method), FALSE);
+	MonoType *ret = mini_type_get_underlying_type (cfg->generic_sharing_context, mono_method_signature (method)->ret);
 
 	switch (cinfo->ret.storage) {
 	case ArgInIReg:
 		MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg);
 		break;
 	case ArgInIRegPair:
-		MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg + 2);
-		MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg + 1, val->dreg + 1);
+		if (ret->type == MONO_TYPE_I8 || ret->type == MONO_TYPE_U8) {
+			MONO_EMIT_NEW_UNALU (cfg, OP_LMOVE, cfg->ret->dreg, val->dreg);
+		} else {
+			MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg + 2, val->dreg + 2);
+			MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg + 1, val->dreg + 1);
+		}
 		break;
 	case ArgInFReg:
-		if (mono_method_signature (method)->ret->type == MONO_TYPE_R4)
+		if (ret->type == MONO_TYPE_R4)
 			MONO_EMIT_NEW_UNALU (cfg, OP_SETFRET, cfg->ret->dreg, val->dreg);
 		else
 			MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, cfg->ret->dreg, val->dreg);
@@ -2343,8 +2358,6 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI
 	int size = 0;
 	guint32 *code, *start;
 
-	g_assert (!fail_tramp);
-
 	for (i = 0; i < count; ++i) {
 		MonoIMTCheckItem *item = imt_entries [i];
 		if (item->is_equals) {
@@ -2353,6 +2366,8 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI
 					item->chunk_size += CMP_SIZE;
 				item->chunk_size += BR_SMALL_SIZE + JUMP_IMM_SIZE;
 			} else {
+				if (fail_tramp)
+					item->chunk_size += 16;
 				item->chunk_size += JUMP_IMM_SIZE;
 #if ENABLE_WRONG_METHOD_CHECK
 				item->chunk_size += CMP_SIZE + BR_SMALL_SIZE + 1;
@@ -2364,15 +2379,19 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI
 		}
 		size += item->chunk_size;
 	}
-	code = mono_code_manager_reserve (domain->code_mp, size * 4);
+	if (fail_tramp)
+		code = mono_method_alloc_generic_virtual_thunk (domain, size * 4);
+	else
+		code = mono_code_manager_reserve (domain->code_mp, size * 4);
 	start = code;
-
 	for (i = 0; i < count; ++i) {
 		MonoIMTCheckItem *item = imt_entries [i];
 		item->code_target = (guint8*)code;
 		if (item->is_equals) {
-			if (item->check_target_idx) {
-				if (!item->compare_done) {
+			gboolean fail_case = !item->check_target_idx && fail_tramp;
+
+			if (item->check_target_idx || fail_case) {
+				if (!item->compare_done || fail_case) {
 					sparc_set (code, (guint32)item->key, sparc_g5);
 					sparc_cmp (code, MONO_ARCH_IMT_REG, sparc_g5);
 				}
@@ -2383,6 +2402,14 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI
 				sparc_ld (code, sparc_g5, 0, sparc_g5);
 				sparc_jmpl (code, sparc_g5, sparc_g0, sparc_g0);
 				sparc_nop (code);
+
+				if (fail_case) {
+					sparc_patch (item->jmp_code, code);
+					sparc_set (code, fail_tramp, sparc_g5);
+					sparc_jmpl (code, sparc_g5, sparc_g0, sparc_g0);
+					sparc_nop (code);
+					item->jmp_code = NULL;
+				}
 			} else {
 				/* enable the commented code to assert on wrong method */
 #if ENABLE_WRONG_METHOD_CHECK
@@ -2759,6 +2786,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 			}
 			sparc_sub (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
 			break;
+		case OP_IREM_UN_IMM:
+			sparc_set (code, ins->inst_imm, GP_SCRATCH_REG);
+			sparc_wry (code, sparc_g0, sparc_g0);
+			sparc_udiv (code, FALSE, ins->sreg1, GP_SCRATCH_REG, sparc_o7);
+			sparc_umul (code, FALSE, GP_SCRATCH_REG, sparc_o7, sparc_o7);
+			sparc_sub (code, FALSE, ins->sreg1, sparc_o7, ins->dreg);
+			break;
 		case OP_IOR:
 			sparc_or (code, FALSE, ins->sreg1, ins->sreg2, ins->dreg);
 			break;
@@ -3418,25 +3452,29 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 			break;
 		}
 		case OP_ICONV_TO_R4: {
-			gint32 offset = cfg->arch.float_spill_slot_offset;
+			MonoInst *spill = cfg->arch.float_spill_slot;
+			gint32 reg = spill->inst_basereg;
+			gint32 offset = spill->inst_offset;
+
+			g_assert (spill->opcode == OP_REGOFFSET);
 #ifdef SPARCV9
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_stx (code, ins->sreg1, sparc_sp, offset);
-				sparc_lddf (code, sparc_sp, offset, FP_SCRATCH_REG);
+				sparc_stx (code, ins->sreg1, reg, offset);
+				sparc_lddf (code, reg, offset, FP_SCRATCH_REG);
 			} else {
-				sparc_stx_imm (code, ins->sreg1, sparc_sp, offset);
-				sparc_lddf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+				sparc_stx_imm (code, ins->sreg1, reg, offset);
+				sparc_lddf_imm (code, reg, offset, FP_SCRATCH_REG);
 			}
 			sparc_fxtos (code, FP_SCRATCH_REG, FP_SCRATCH_REG);
 #else
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_st (code, ins->sreg1, sparc_sp, sparc_o7);
-				sparc_ldf (code, sparc_sp, sparc_o7, FP_SCRATCH_REG);
+				sparc_st (code, ins->sreg1, reg, sparc_o7);
+				sparc_ldf (code, reg, sparc_o7, FP_SCRATCH_REG);
 			} else {
-				sparc_st_imm (code, ins->sreg1, sparc_sp, offset);
-				sparc_ldf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+				sparc_st_imm (code, ins->sreg1, reg, offset);
+				sparc_ldf_imm (code, reg, offset, FP_SCRATCH_REG);
 			}
 			sparc_fitos (code, FP_SCRATCH_REG, FP_SCRATCH_REG);
 #endif
@@ -3444,25 +3482,30 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 			break;
 		}
 		case OP_ICONV_TO_R8: {
-			gint32 offset = cfg->arch.float_spill_slot_offset;
+			MonoInst *spill = cfg->arch.float_spill_slot;
+			gint32 reg = spill->inst_basereg;
+			gint32 offset = spill->inst_offset;
+
+			g_assert (spill->opcode == OP_REGOFFSET);
+
 #ifdef SPARCV9
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_stx (code, ins->sreg1, sparc_sp, sparc_o7);
-				sparc_lddf (code, sparc_sp, sparc_o7, FP_SCRATCH_REG);
+				sparc_stx (code, ins->sreg1, reg, sparc_o7);
+				sparc_lddf (code, reg, sparc_o7, FP_SCRATCH_REG);
 			} else {
-				sparc_stx_imm (code, ins->sreg1, sparc_sp, offset);
-				sparc_lddf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+				sparc_stx_imm (code, ins->sreg1, reg, offset);
+				sparc_lddf_imm (code, reg, offset, FP_SCRATCH_REG);
 			}
 			sparc_fxtod (code, FP_SCRATCH_REG, ins->dreg);
 #else
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_st (code, ins->sreg1, sparc_sp, sparc_o7);
-				sparc_ldf (code, sparc_sp, sparc_o7, FP_SCRATCH_REG);
+				sparc_st (code, ins->sreg1, reg, sparc_o7);
+				sparc_ldf (code, reg, sparc_o7, FP_SCRATCH_REG);
 			} else {
-				sparc_st_imm (code, ins->sreg1, sparc_sp, offset);
-				sparc_ldf_imm (code, sparc_sp, offset, FP_SCRATCH_REG);
+				sparc_st_imm (code, ins->sreg1, reg, offset);
+				sparc_ldf_imm (code, reg, offset, FP_SCRATCH_REG);
 			}
 			sparc_fitod (code, FP_SCRATCH_REG, ins->dreg);
 #endif
@@ -3478,15 +3521,20 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 #endif
 		case OP_FCONV_TO_I4:
 		case OP_FCONV_TO_U4: {
-			gint32 offset = cfg->arch.float_spill_slot_offset;
+			MonoInst *spill = cfg->arch.float_spill_slot;
+			gint32 reg = spill->inst_basereg;
+			gint32 offset = spill->inst_offset;
+
+			g_assert (spill->opcode == OP_REGOFFSET);
+
 			sparc_fdtoi (code, ins->sreg1, FP_SCRATCH_REG);
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_stdf (code, FP_SCRATCH_REG, sparc_sp, sparc_o7);
-				sparc_ld (code, sparc_sp, sparc_o7, ins->dreg);
+				sparc_stdf (code, FP_SCRATCH_REG, reg, sparc_o7);
+				sparc_ld (code, reg, sparc_o7, ins->dreg);
 			} else {
-				sparc_stdf_imm (code, FP_SCRATCH_REG, sparc_sp, offset);
-				sparc_ld_imm (code, sparc_sp, offset, ins->dreg);
+				sparc_stdf_imm (code, FP_SCRATCH_REG, reg, offset);
+				sparc_ld_imm (code, reg, offset, ins->dreg);
 			}
 
 			switch (ins->opcode) {
@@ -3659,14 +3707,19 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 			EMIT_FLOAT_COND_BRANCH (ins, sparc_fbu, 1, 1);
 			break;
 		case OP_CKFINITE: {
-			gint32 offset = cfg->arch.float_spill_slot_offset;
+			MonoInst *spill = cfg->arch.float_spill_slot;
+			gint32 reg = spill->inst_basereg;
+			gint32 offset = spill->inst_offset;
+
+			g_assert (spill->opcode == OP_REGOFFSET);
+
 			if (!sparc_is_imm13 (offset)) {
 				sparc_set (code, offset, sparc_o7);
-				sparc_stdf (code, ins->sreg1, sparc_sp, sparc_o7);
-				sparc_lduh (code, sparc_sp, sparc_o7, sparc_o7);
+				sparc_stdf (code, ins->sreg1, reg, sparc_o7);
+				sparc_lduh (code, reg, sparc_o7, sparc_o7);
 			} else {
-				sparc_stdf_imm (code, ins->sreg1, sparc_sp, offset);
-				sparc_lduh_imm (code, sparc_sp, offset, sparc_o7);
+				sparc_stdf_imm (code, ins->sreg1, reg, offset);
+				sparc_lduh_imm (code, reg, offset, sparc_o7);
 			}
 			sparc_srl_imm (code, sparc_o7, 4, sparc_o7);
 			sparc_and_imm (code, FALSE, sparc_o7, 2047, sparc_o7);
diff --git a/mono/mini/mini-sparc.h b/mono/mini/mini-sparc.h
index 5720b95..f7bdb7f 100644
--- a/mono/mini/mini-sparc.h
+++ b/mono/mini/mini-sparc.h
@@ -82,7 +82,7 @@ typedef struct MonoContext {
 typedef struct MonoCompileArch {
 	gint32 lmf_offset;
 	gint32 localloc_offset;
-	gint32 float_spill_slot_offset;
+	void *float_spill_slot;
 } MonoCompileArch;
 
 #define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0); 
diff --git a/mono/mini/mini-trampolines.c b/mono/mini/mini-trampolines.c
index 337662d..b051454 100644
--- a/mono/mini/mini-trampolines.c
+++ b/mono/mini/mini-trampolines.c
@@ -292,7 +292,7 @@ mono_magic_trampoline (gssize *regs, guint8 *code, MonoMethod *m, guint8* tramp)
 	addr = mono_compile_method (m);
 	g_assert (addr);
 
-	mono_debugger_trampoline_compiled (m, addr);
+	mono_debugger_trampoline_compiled (code, m, addr);
 
 	if (generic_virtual_method_inst) {
 		vtable_slot = mono_arch_get_vcall_slot_addr (code, (gpointer*)regs);
@@ -406,7 +406,7 @@ mono_generic_virtual_remoting_trampoline (gssize *regs, guint8 *code, MonoMethod
 	addr = mono_compile_method (m);
 	g_assert (addr);
 
-	mono_debugger_trampoline_compiled (m, addr);
+	mono_debugger_trampoline_compiled (NULL, m, addr);
 
 	return addr;
 }
@@ -623,7 +623,7 @@ mono_delegate_trampoline (gssize *regs, guint8 *code, gpointer *tramp_data, guin
 			delegate->method_ptr = mono_compile_method (method);
 			if (delegate->method_code)
 				*delegate->method_code = delegate->method_ptr;
-			mono_debugger_trampoline_compiled (method, delegate->method_ptr);
+			mono_debugger_trampoline_compiled (NULL, method, delegate->method_ptr);
 		}
 	}
 
@@ -641,7 +641,7 @@ mono_delegate_trampoline (gssize *regs, guint8 *code, gpointer *tramp_data, guin
 	m = mono_marshal_get_delegate_invoke (invoke, delegate);
 	code = mono_compile_method (m);
 	delegate->invoke_impl = mono_get_addr_from_ftnptr (code);
-	mono_debugger_trampoline_compiled (m, delegate->invoke_impl);
+	mono_debugger_trampoline_compiled (NULL, m, delegate->invoke_impl);
 
 #ifdef __mono_ppc64__
 	// FIXME:
diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c
index 3507dde..25349bd 100644
--- a/mono/mini/mini-x86.c
+++ b/mono/mini/mini-x86.c
@@ -2253,6 +2253,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb)
 				 */
 				x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EDX);
 				x86_alu_reg_reg (code, X86_SUB, X86_EAX, X86_EDX);
+			} else if (power == 0) {
+				x86_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg);
 			} else {
 				/* Based on gcc code */
 
diff --git a/mono/mini/mini.c b/mono/mini/mini.c
index e5f9262..e5fad81 100644
--- a/mono/mini/mini.c
+++ b/mono/mini/mini.c
@@ -703,6 +703,18 @@ mono_op_imm_to_op (int opcode)
 #else
 		return OP_LAND;
 #endif
+	case OP_OR_IMM:
+#if SIZEOF_REGISTER == 4
+		return OP_IOR;
+#else
+		return OP_LOR;
+#endif
+	case OP_XOR_IMM:
+#if SIZEOF_REGISTER == 4
+		return OP_IXOR;
+#else
+		return OP_LXOR;
+#endif
 	case OP_IAND_IMM:
 		return OP_IAND;
 	case OP_LAND_IMM:
@@ -1242,10 +1254,12 @@ mono_icall_get_wrapper_full (MonoJitICallInfo* callinfo, gboolean do_compile)
 	 * We use the lock on the root domain instead of the JIT lock to protect 
 	 * callinfo->trampoline, since we do a lot of stuff inside the critical section.
 	 */
+	mono_loader_lock (); /*FIXME mono_compile_method requires the loader lock, by large.*/
 	mono_domain_lock (domain);
 
 	if (callinfo->trampoline) {
 		mono_domain_unlock (domain);
+		mono_loader_unlock ();
 		return callinfo->trampoline;
 	}
 
@@ -1262,6 +1276,7 @@ mono_icall_get_wrapper_full (MonoJitICallInfo* callinfo, gboolean do_compile)
 	callinfo->trampoline = trampoline;
 
 	mono_domain_unlock (domain);
+	mono_loader_unlock ();
 	
 	return callinfo->trampoline;
 }
@@ -3735,9 +3750,11 @@ lookup_method (MonoDomain *domain, MonoMethod *method)
 {
 	MonoJitInfo *info;
 
+	mono_loader_lock (); /*FIXME lookup_method_inner acquired it*/
 	mono_domain_jit_code_hash_lock (domain);
 	info = lookup_method_inner (domain, method);
 	mono_domain_jit_code_hash_unlock (domain);
+	mono_loader_unlock ();
 
 	return info;
 }
@@ -3915,6 +3932,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
 		g_assert_not_reached ();
 	}
 
+	mono_loader_lock (); /*FIXME lookup_method_inner requires the loader lock*/
 	mono_domain_lock (target_domain);
 
 	/* Check if some other thread already did the job. In this case, we can
@@ -3961,6 +3979,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
 	}
 
 	mono_domain_unlock (target_domain);
+	mono_loader_unlock ();
 
 	vtable = mono_class_vtable (target_domain, method->klass);
 	if (!vtable) {
@@ -5411,10 +5430,10 @@ mini_cleanup (MonoDomain *domain)
 	/* This accesses metadata so needs to be called before runtime shutdown */
 	print_jit_stats ();
 
-	mono_runtime_cleanup (domain);
-
 	mono_profiler_shutdown ();
 
+	mono_runtime_cleanup (domain);
+
 	mono_icall_cleanup ();
 
 	mono_runtime_cleanup_handlers ();
diff --git a/mono/mini/mini.h b/mono/mini/mini.h
index 50ce6b7..5923954 100644
--- a/mono/mini/mini.h
+++ b/mono/mini/mini.h
@@ -1485,6 +1485,7 @@ void     mono_jit_walk_stack_from_ctx           (MonoStackWalk func, MonoContext
 void     mono_setup_altstack                    (MonoJitTlsData *tls) MONO_INTERNAL;
 void     mono_free_altstack                     (MonoJitTlsData *tls) MONO_INTERNAL;
 gpointer mono_altstack_restore_prot             (gssize *regs, guint8 *code, gpointer *tramp_data, guint8* tramp) MONO_INTERNAL;
+MonoJitInfo* mini_jit_info_table_find           (MonoDomain *domain, char *addr) MONO_INTERNAL;
 
 MonoJitInfo * mono_find_jit_info                (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx, MonoContext *new_ctx, char **trace, MonoLMF **lmf, int *native_offset, gboolean *managed) MONO_INTERNAL;
 
diff --git a/mono/mini/simd-intrinsics.c b/mono/mini/simd-intrinsics.c
index 010d8dd..e7cb2eb 100644
--- a/mono/mini/simd-intrinsics.c
+++ b/mono/mini/simd-intrinsics.c
@@ -789,8 +789,10 @@ get_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src)
  * This function will load the value if needed. 
  */
 static int
-load_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src)
+load_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src, gboolean *indirect)
 {
+	if (indirect)
+		*indirect = FALSE;
 	if (src->opcode == OP_XMOVE) {
 		return src->sreg1;
 	} else if (src->opcode == OP_LDADDR) {
@@ -801,6 +803,8 @@ load_simd_vreg (MonoCompile *cfg, MonoMethod *cmethod, MonoInst *src)
 		return src->dreg;
 	} else if (src->type == STACK_PTR || src->type == STACK_MP) {
 		MonoInst *ins;
+		if (indirect)
+			*indirect = TRUE;
 
 		MONO_INST_NEW (cfg, ins, OP_LOADX_MEMBASE);
 		ins->klass = cmethod->klass;
@@ -953,13 +957,16 @@ simd_intrinsic_emit_setter (const SimdIntrinsc *intrinsic, MonoCompile *cfg, Mon
 	MonoInst *ins;
 	MonoMethodSignature *sig = mono_method_signature (cmethod);
 	int size, align;
+	gboolean indirect;
+	int dreg;
+
 	size = mono_type_size (sig->params [0], &align); 
 
 	if (size == 2 || size == 4 || size == 8) {
 		MONO_INST_NEW (cfg, ins, mono_type_to_slow_insert_op (sig->params [0]));
 		ins->klass = cmethod->klass;
 		/*This is a partial load so we encode the dependency on the previous value by setting dreg and sreg1 to the same value.*/
-		ins->dreg = ins->sreg1 = load_simd_vreg (cfg, cmethod, args [0]);
+		ins->dreg = ins->sreg1 = dreg = load_simd_vreg (cfg, cmethod, args [0], &indirect);
 		ins->sreg2 = args [1]->dreg;
 		ins->inst_c0 = intrinsic->opcode;
 		if (sig->params [0]->type == MONO_TYPE_R4)
@@ -972,7 +979,7 @@ simd_intrinsic_emit_setter (const SimdIntrinsc *intrinsic, MonoCompile *cfg, Mon
 
 		MONO_INST_NEW (cfg, ins, OP_EXTRACTX_U2);
 		ins->klass = cmethod->klass;
-		ins->sreg1 = sreg = load_simd_vreg (cfg, cmethod, args [0]);
+		ins->sreg1 = sreg = dreg = load_simd_vreg (cfg, cmethod, args [0], &indirect);
 		ins->type = STACK_I4;
 		ins->dreg = vreg = alloc_ireg (cfg);
 		ins->inst_c0 = intrinsic->opcode / 2;
@@ -985,7 +992,14 @@ simd_intrinsic_emit_setter (const SimdIntrinsc *intrinsic, MonoCompile *cfg, Mon
 		ins->dreg = sreg;
 		ins->inst_c0 = intrinsic->opcode;
 		MONO_ADD_INS (cfg->cbb, ins);
+	}
 
+	if (indirect) {
+		MONO_INST_NEW (cfg, ins, OP_STOREX_MEMBASE);
+		ins->klass = cmethod->klass;
+		ins->dreg = args [0]->dreg;
+		ins->sreg1 = dreg;
+		MONO_ADD_INS (cfg->cbb, ins);
 	}
 	return ins;
 }
@@ -997,7 +1011,7 @@ simd_intrinsic_emit_getter (const SimdIntrinsc *intrinsic, MonoCompile *cfg, Mon
 	MonoMethodSignature *sig = mono_method_signature (cmethod);
 	int vreg, shift_bits = mono_type_elements_shift_bits (sig->ret);
 
-	vreg = load_simd_vreg (cfg, cmethod, args [0]);
+	vreg = load_simd_vreg (cfg, cmethod, args [0], NULL);
 
 	if (intrinsic->opcode >> shift_bits) {
 		MONO_INST_NEW (cfg, ins, OP_PSHUFLED);
@@ -1036,7 +1050,7 @@ simd_intrinsic_emit_long_getter (const SimdIntrinsc *intrinsic, MonoCompile *cfg
 	int vreg;
 	gboolean is_r8 = mono_method_signature (cmethod)->ret->type == MONO_TYPE_R8;
 
-	vreg = load_simd_vreg (cfg, cmethod, args [0]);
+	vreg = load_simd_vreg (cfg, cmethod, args [0], NULL);
 
 	MONO_INST_NEW (cfg, ins, is_r8 ? OP_EXTRACT_R8 : OP_EXTRACT_I8);
 	ins->klass = cmethod->klass;
@@ -1233,8 +1247,8 @@ simd_intrinsic_emit_shuffle (const SimdIntrinsc *intrinsic, MonoCompile *cfg, Mo
 	/*TODO Exposing shuffle is not a good thing as it's non obvious. We should come up with better abstractions*/
 
 	if (args [1]->opcode != OP_ICONST) {
-		g_warning ("Shuffle with non literals is not yet supported");
-		g_assert_not_reached ();
+		/*TODO Shuffle with non literals is not yet supported */
+		return NULL;
 	}
 	vreg = get_simd_vreg (cfg, cmethod, args [0]);
 	NULLIFY_INS (args [1]);
diff --git a/mono/monograph/Makefile.in b/mono/monograph/Makefile.in
index 9073624..29589f8 100644
--- a/mono/monograph/Makefile.in
+++ b/mono/monograph/Makefile.in
@@ -37,7 +37,10 @@ bin_PROGRAMS = monograph$(EXEEXT)
 subdir = mono/monograph
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -89,10 +92,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -102,14 +101,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -127,6 +125,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -135,6 +134,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -146,11 +146,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -179,8 +182,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -220,6 +222,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -243,6 +246,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @JIT_SUPPORTED_FALSE at runtime_lib = ../interpreter/libmint.la
diff --git a/mono/os/Makefile.in b/mono/os/Makefile.in
index ddf9a06..d190be7 100644
--- a/mono/os/Makefile.in
+++ b/mono/os/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono/os
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = gc_wrapper.h
diff --git a/mono/profiler/Makefile.in b/mono/profiler/Makefile.in
index bc34d8d..a5fec73 100644
--- a/mono/profiler/Makefile.in
+++ b/mono/profiler/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = mono/profiler
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -119,10 +122,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -132,14 +131,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -157,6 +155,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -165,6 +164,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -176,11 +176,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -209,8 +212,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -250,6 +252,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -273,6 +276,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 INCLUDES = \
diff --git a/mono/tests/ChangeLog b/mono/tests/ChangeLog
index 64dde1b..92cbdb2 100644
--- a/mono/tests/ChangeLog
+++ b/mono/tests/ChangeLog
@@ -1,3 +1,46 @@
+2009-10-07  Zoltan Varga  <vargaz at gmail.com>
+
+	* pinvoke2.cs libtest.c: Add a test for marshalling DateTime to unmanaged code.
+
+2009-10-06  Mark Probst  <mark.probst at gmail.com>
+
+	* bug-544445.cs: New test.
+
+	* Makefile.am: Test added.
+
+	Backport of r143506.
+
+2009-09-30  Zoltan Varga  <vargaz at gmail.com>
+
+	* pinvoke2.cs libtest.c: Add a test for #543133.
+
+2009-09-03  Zoltan Varga  <vargaz at gmail.com>
+
+	* pinvoke3.cs libtest.c: Add a test for #481559.
+
+2009-07-09  Mark Probst  <mark.probst at gmail.com>
+
+	Backport of r137640.
+
+	* generic-xdomain.2.cs: Test case for generic marshal-by-ref
+	objects.
+
+	* Makefile.am: Test added.
+
+2009-06-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* generic-stack-traces.2.cs: Add a test for #509406.
+
+	* dynamic-method-finalize.2.cs: New test.
+
+2009-06-15 Rodrigo Kumpera  <rkumpera at novell.com>
+
+	Backport of r136135.
+
+	* load-exceptions.cs: Add regression test for #508487.
+
+	* t-missing.cs: Add nested type.
+
 2009-06-01 Rodrigo Kumpera  <rkumpera at novell.com>
 
 	* bug-508538.cs: New regression test.
diff --git a/mono/tests/Makefile.am b/mono/tests/Makefile.am
index a7f40c1..32a08eb 100644
--- a/mono/tests/Makefile.am
+++ b/mono/tests/Makefile.am
@@ -289,6 +289,7 @@ BASE_TEST_CS_SRC=		\
 	generic-array-iface-set.2.cs	\
 	generic-typedef.2.cs	\
 	generic-marshalbyref.2.cs	\
+	generic-xdomain.2.cs	\
 	bug-431413.2.cs	\
 	bug-459285.2.cs	\
 	generic-virtual-invoke.2.cs	\
@@ -303,6 +304,7 @@ BASE_TEST_CS_SRC=		\
 	bug-479763.2.cs	\
 	bug-80392.2.cs		\
 	dynamic-method-access.2.cs	\
+	dynamic-method-finalize.2.cs	\
 	bug-82194.2.cs	\
 	anonarray.2.cs	\
 	ienumerator-interfaces.2.cs	\
@@ -346,7 +348,8 @@ BASE_TEST_CS_SRC=		\
 	bug-467456.cs	\
 	appdomain-unload-callback.cs	\
 	bug-508538.cs	\
-	bug-472692.2.cs
+	bug-472692.2.cs	\
+	bug-544446.cs
 
 if AMD64
 TEST_CS_SRC = $(BASE_TEST_CS_SRC) async-exc-compilation.cs
@@ -750,7 +753,7 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe	\
 		generic-marshalbyref.2.exe bug-459285.2.exe bug-461198.2.exe	\
 		generic-sealed-virtual.2.exe generic-stack-traces.2.exe		\
 		generic-stack-traces2.2.exe bug-472600.2.exe bug-473482.2.exe	\
-		bug-473999.2.exe bug-479763.2.exe
+		bug-473999.2.exe bug-479763.2.exe generic-xdomain.2.exe
 	@for fn in $+ ; do	\
 		echo "Testing $$fn ...";	\
 		MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;	\
diff --git a/mono/tests/Makefile.in b/mono/tests/Makefile.in
index 0c8d79b..7960928 100644
--- a/mono/tests/Makefile.in
+++ b/mono/tests/Makefile.in
@@ -38,7 +38,10 @@ subdir = mono/tests
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/tests-config.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -104,10 +107,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -117,14 +116,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -142,6 +140,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -150,6 +149,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -161,11 +161,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -194,8 +197,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -235,6 +237,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -258,6 +261,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = cas assemblyresolve
@@ -536,6 +540,7 @@ BASE_TEST_CS_SRC = \
 	generic-array-iface-set.2.cs	\
 	generic-typedef.2.cs	\
 	generic-marshalbyref.2.cs	\
+	generic-xdomain.2.cs	\
 	bug-431413.2.cs	\
 	bug-459285.2.cs	\
 	generic-virtual-invoke.2.cs	\
@@ -550,6 +555,7 @@ BASE_TEST_CS_SRC = \
 	bug-479763.2.cs	\
 	bug-80392.2.cs		\
 	dynamic-method-access.2.cs	\
+	dynamic-method-finalize.2.cs	\
 	bug-82194.2.cs	\
 	anonarray.2.cs	\
 	ienumerator-interfaces.2.cs	\
@@ -593,7 +599,8 @@ BASE_TEST_CS_SRC = \
 	bug-467456.cs	\
 	appdomain-unload-callback.cs	\
 	bug-508538.cs	\
-	bug-472692.2.cs
+	bug-472692.2.cs	\
+	bug-544446.cs
 
 @AMD64_FALSE@@X86_FALSE at TEST_CS_SRC = $(BASE_TEST_CS_SRC) \
 @AMD64_FALSE@@X86_FALSE@	$(am__append_1)
@@ -1335,7 +1342,7 @@ test-generic-sharing : generics-sharing.2.exe shared-generic-methods.2.exe	\
 		generic-marshalbyref.2.exe bug-459285.2.exe bug-461198.2.exe	\
 		generic-sealed-virtual.2.exe generic-stack-traces.2.exe		\
 		generic-stack-traces2.2.exe bug-472600.2.exe bug-473482.2.exe	\
-		bug-473999.2.exe bug-479763.2.exe
+		bug-473999.2.exe bug-479763.2.exe generic-xdomain.2.exe
 	@for fn in $+ ; do	\
 		echo "Testing $$fn ...";	\
 		MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared                $$fn > $$fn.stdout || exit 1;	\
diff --git a/mono/tests/assemblyresolve/Makefile.in b/mono/tests/assemblyresolve/Makefile.in
index 0419049..54c389a 100644
--- a/mono/tests/assemblyresolve/Makefile.in
+++ b/mono/tests/assemblyresolve/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono/tests/assemblyresolve
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
diff --git a/mono/tests/bug-544446.cs b/mono/tests/bug-544446.cs
new file mode 100644
index 0000000..80b8fe4
--- /dev/null
+++ b/mono/tests/bug-544446.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Proxies;
+using System.Collections.Generic;
+
+class MyProxy : RealProxy {
+	readonly MarshalByRefObject target;
+
+	public MyProxy (MarshalByRefObject target) : base (target.GetType())
+	{
+		this.target = target;
+	}
+
+	public override IMessage Invoke (IMessage request) {
+		IMethodCallMessage call = (IMethodCallMessage)request;
+		return RemotingServices.ExecuteMessage (target, call);
+	}
+}
+
+class R1 : MarshalByRefObject {
+
+	public void foo (out  Dictionary<string, int> paramAssignmentStatus) {
+
+		paramAssignmentStatus = new Dictionary<string, int> ();
+		paramAssignmentStatus.Add ("One", 1);
+	}
+}
+
+class Test {
+	static int Main () {
+		MyProxy real_proxy = new MyProxy (new R1 ());
+		R1 o = (R1)real_proxy.GetTransparentProxy ();
+
+		Dictionary<string, int> i;
+		o.foo (out i);
+		if (1 == i["One"])
+			return 0;
+		return 1;
+	}
+}
diff --git a/mono/tests/cas/Makefile.in b/mono/tests/cas/Makefile.in
index 2247747..1e41108 100644
--- a/mono/tests/cas/Makefile.in
+++ b/mono/tests/cas/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = mono/tests/cas
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,10 +84,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -94,14 +93,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -119,6 +117,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -127,6 +126,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -138,11 +138,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -171,8 +174,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,6 +214,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -235,6 +238,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/cas/assembly/Makefile.in b/mono/tests/cas/assembly/Makefile.in
index d9dd05f..dcf7c4e 100644
--- a/mono/tests/cas/assembly/Makefile.in
+++ b/mono/tests/cas/assembly/Makefile.in
@@ -36,7 +36,10 @@ subdir = mono/tests/cas/assembly
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/cas/demand/Makefile.in b/mono/tests/cas/demand/Makefile.in
index 9ad1840..e3d6c67 100644
--- a/mono/tests/cas/demand/Makefile.in
+++ b/mono/tests/cas/demand/Makefile.in
@@ -36,7 +36,10 @@ subdir = mono/tests/cas/demand
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/cas/inheritance/Makefile.in b/mono/tests/cas/inheritance/Makefile.in
index f72f72e..08160ae 100644
--- a/mono/tests/cas/inheritance/Makefile.in
+++ b/mono/tests/cas/inheritance/Makefile.in
@@ -36,7 +36,10 @@ subdir = mono/tests/cas/inheritance
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/cas/linkdemand/Makefile.in b/mono/tests/cas/linkdemand/Makefile.in
index df38166..2d1aaaa 100644
--- a/mono/tests/cas/linkdemand/Makefile.in
+++ b/mono/tests/cas/linkdemand/Makefile.in
@@ -36,7 +36,10 @@ subdir = mono/tests/cas/linkdemand
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/cas/threads/Makefile.in b/mono/tests/cas/threads/Makefile.in
index 22922f8..2461c68 100644
--- a/mono/tests/cas/threads/Makefile.in
+++ b/mono/tests/cas/threads/Makefile.in
@@ -36,7 +36,10 @@ subdir = mono/tests/cas/threads
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_1_1
diff --git a/mono/tests/dynamic-method-finalize.2.cs b/mono/tests/dynamic-method-finalize.2.cs
new file mode 100644
index 0000000..bcc74dd
--- /dev/null
+++ b/mono/tests/dynamic-method-finalize.2.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+delegate int Getter ();
+
+class Host {
+
+	static int Field = 42;
+
+	Getter g;
+
+	public Host (Getter g) {
+		this.g = g;
+	}
+
+	~Host () {
+		int d = g ();
+		Console.WriteLine (d);
+	}
+}
+
+class Program {
+
+	static Host h;
+
+        public static int Main ()
+        {
+			DynamicMethod method = new DynamicMethod ("GetField",
+                        typeof (int), new Type [0], Type.GetType ("Host"));
+
+			ILGenerator il = method.GetILGenerator ();
+			il.Emit (OpCodes.Ldsfld, typeof (Host).GetField (
+                        "Field", BindingFlags.Static |
+BindingFlags.NonPublic));
+			il.Emit (OpCodes.Ret);
+
+			Getter g = (Getter) method.CreateDelegate (typeof (Getter));
+
+			/* 
+			 * Create an object whose finalizer calls a dynamic method which
+			 * dies at the same time.
+			 * Storing into a static guarantees that this is only finalized during
+			 * shutdown. This is needed since the !shutdown case still doesn't
+			 * work.
+			 */
+			h = new Host (g);
+
+			return 0;
+        }
+}
diff --git a/mono/tests/generic-stack-traces.2.cs b/mono/tests/generic-stack-traces.2.cs
index c8ae9bf..340b28f 100644
--- a/mono/tests/generic-stack-traces.2.cs
+++ b/mono/tests/generic-stack-traces.2.cs
@@ -13,6 +13,20 @@ public class Gen<T> {
     }
 }
 
+class Foo<T1, T2> {
+
+	public void Throw () {
+		throw new Exception ();
+	}
+
+	public void Throw<T3> () {
+		throw new Exception ();
+	}
+}
+
+class Bar<T> : Foo<object, T> {
+}
+
 public class main {
     public static void callCallStaticCrash<T> () {
 	Gen<T> gt = new Gen<T> ();
@@ -70,6 +84,21 @@ public class main {
 	    if (!test (exc, typeof (Gen<string>)))
 		return 1;
 	}
+
+	// Exception thrown in inherited method with different generic context
+	// (#509406)
+	try {
+		new Bar <string> ().Throw ();
+	} catch (Exception ex) {
+		Console.WriteLine (new StackTrace (ex));
+	}
+
+	try {
+		new Bar <string> ().Throw<Bar<string>> ();
+	} catch (Exception ex) {
+		Console.WriteLine (new StackTrace (ex));
+	}
+
 	return 0;
     }
 }
diff --git a/mono/tests/generic-xdomain.2.cs b/mono/tests/generic-xdomain.2.cs
new file mode 100644
index 0000000..7a08380
--- /dev/null
+++ b/mono/tests/generic-xdomain.2.cs
@@ -0,0 +1,54 @@
+using System;
+using System.ComponentModel;
+using System.Runtime.Remoting;
+
+namespace Test {
+	public class Test {
+		static void Main ()
+		{
+			AppDomain domain = AppDomain.CreateDomain ("new-domain");
+			domain.DoCallBack (Run);
+			Type stType = typeof (Something<string, string>);
+			Other<string, string> st = (Other<string, string>) domain.CreateInstanceAndUnwrap (stType.Assembly.FullName, stType.FullName);
+			Console.WriteLine ("in main int: {0}", st.getInt ());
+			Console.WriteLine ("in main types: {0}", st.getTypeNames<Test> ());
+		}
+
+	    	public static void Run ()
+		{
+		    DoRun<string, string>(new Something<string, string> ());
+		}
+
+	    	public static void DoRun<T1, T2> (Other<T1, T2> some)
+	    	{
+			Console.WriteLine ("domain: {0}", AppDomain.CurrentDomain.FriendlyName);
+			Console.WriteLine ("This is null: {0}", some.Mappings == null);
+			Console.WriteLine ("int: {0}", some.getInt ());
+		}
+	}
+
+	public class Other<T1, T2> : MarshalByRefObject {
+		public T2 Mappings {
+			get { return default(T2); }
+		}
+
+		public virtual int getInt () {
+			return 123;
+		}
+
+		public virtual string getTypeNames<T3> () {
+			return "error";
+		}
+	}
+
+	public class Something<T1, T2> : Other<T1,T2> {
+		public override int getInt () {
+			return 456;
+		}
+
+		public override string getTypeNames<T3> () {
+			Console.WriteLine ("getTypeNames in {0}", AppDomain.CurrentDomain.FriendlyName);
+			return typeof(T1).ToString () + " " + typeof(T2).ToString () + " " + typeof (T3).ToString ();
+		}
+	}
+}
diff --git a/mono/tests/libtest.c b/mono/tests/libtest.c
index d481d55..0cd0c3f 100644
--- a/mono/tests/libtest.c
+++ b/mono/tests/libtest.c
@@ -957,6 +957,36 @@ mono_test_marshal_stringbuilder_unicode (gunichar2 *s, int n)
 	return 0;
 }
 
+LIBTEST_API void STDCALL
+mono_test_marshal_stringbuilder_out (char **s)
+{
+	const char m[] = "This is my message.  Isn't it nice?";
+	char *str;
+
+	str = g_malloc (strlen (m) + 1);
+	memcpy (str, m, strlen (m) + 1);
+	
+	*s = str;
+}
+
+LIBTEST_API int STDCALL  
+mono_test_marshal_stringbuilder_out_unicode (gunichar2 **s)
+{
+	const char m[] = "This is my message.  Isn't it nice?";
+	gunichar2 *s2;
+	glong len;
+
+	s2 = g_utf8_to_utf16 (m, -1, NULL, &len, NULL);
+	
+	len = (len * 2) + 2;
+	*s = g_malloc (len);
+	memcpy (*s, s2, len);
+
+	g_free (s2);
+
+	return 0;
+}
+
 typedef struct {
 #ifndef __GNUC__
     char a;
@@ -2004,6 +2034,14 @@ mono_test_marshal_array_delegate (void *arr, int len, ArrayDelegate del)
 	return del (len, NULL, arr);
 }
 
+typedef int (STDCALL *ArrayDelegateLong) (gint64 i, char *j, void *arr);
+
+LIBTEST_API int STDCALL 
+mono_test_marshal_array_delegate_long (void *arr, gint64 len, ArrayDelegateLong del)
+{
+	return del (len, NULL, arr);
+}
+
 LIBTEST_API int STDCALL 
 mono_test_marshal_out_array_delegate (int *arr, int len, ArrayDelegate del)
 {
@@ -2205,6 +2243,13 @@ mono_safe_handle_ref (void **handle)
 
 	*handle = (void *) 0x800d;
 }
+
+LIBTEST_API double STDCALL
+mono_test_marshal_date_time (double d)
+{
+	return d;
+}
+
 /*
  * COM INTEROP TESTS
  */
diff --git a/mono/tests/load-exceptions.cs b/mono/tests/load-exceptions.cs
index 53480c6..f356043 100644
--- a/mono/tests/load-exceptions.cs
+++ b/mono/tests/load-exceptions.cs
@@ -216,6 +216,15 @@ public class Tests : LoadMissing {
 	public static int test_0_missing_assembly_in_newobj () {
 		return check_type_load (new TestDel (missing_assembly_in_newobj));
 	}
+
+	public static void missing_outer () {
+		new Missing.Foo1.InnerFoo ();
+	}
+
+	//Regression test for #508487
+	public static int test_0_missing_outer_type_in_typeref () {
+		return check_type_load (new TestDel (missing_outer));
+	}
 	
 	//
 	// Missing classes referenced from metadata
diff --git a/mono/tests/pinvoke2.cs b/mono/tests/pinvoke2.cs
index f4f33c2..a4b1d7e 100644
--- a/mono/tests/pinvoke2.cs
+++ b/mono/tests/pinvoke2.cs
@@ -278,6 +278,12 @@ public class Tests {
 	[DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_unicode", CharSet=CharSet.Unicode)]
 	public static extern void mono_test_marshal_stringbuilder_unicode (StringBuilder sb, int len);
 
+	[DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_out")]
+	public static extern void mono_test_marshal_stringbuilder_out (out StringBuilder sb);
+
+	[DllImport ("libtest", EntryPoint="mono_test_marshal_stringbuilder_out_unicode", CharSet=CharSet.Unicode)]
+	public static extern void mono_test_marshal_stringbuilder_out_unicode (out StringBuilder sb);
+
 	[DllImport ("libtest", EntryPoint="mono_test_last_error", SetLastError=true)]
 	public static extern void mono_test_last_error (int err);
 
@@ -769,6 +775,24 @@ public class Tests {
 		return 0;
 	}
 
+	public static int test_0_marshal_stringbuilder_out () {
+		StringBuilder sb;
+		mono_test_marshal_stringbuilder_out (out sb);
+		
+		if (sb.ToString () != "This is my message.  Isn't it nice?")
+			return 1;  
+		return 0;
+	}
+
+	public static int test_0_marshal_stringbuilder_out_unicode () {
+		StringBuilder sb;
+		mono_test_marshal_stringbuilder_out_unicode (out sb);
+
+		if (sb.ToString () != "This is my message.  Isn't it nice?")
+			return 1;  
+		return 0;
+	}
+
 	public static int test_0_marshal_empty_string_array () {
 		return mono_test_marshal_empty_string_array (null);
 	}
@@ -1470,5 +1494,17 @@ public class Tests {
 			return 0;
 		}
 	}
+
+	/*
+	 * Marshalling of DateTime to OLE DATE (double)
+	 */
+	[DllImport ("libtest", EntryPoint="mono_test_marshal_date_time")]
+	public static extern double mono_test_marshal_date_time (DateTime d);
+
+	public static int test_0_marshal_date_time () {
+		DateTime d = new DateTime (2009, 12, 6);
+		double d2 = mono_test_marshal_date_time (new DateTime (2009, 12, 6));
+		return  (d2 == 40153.0) ? 0 : 1;
+	}
 }
 
diff --git a/mono/tests/pinvoke3.cs b/mono/tests/pinvoke3.cs
index 5660be0..ec22508 100644
--- a/mono/tests/pinvoke3.cs
+++ b/mono/tests/pinvoke3.cs
@@ -861,6 +861,30 @@ public class Tests {
 		return mono_test_marshal_array_delegate8 (arr, 2, new ArrayDelegate8 (array_delegate8));
 	}
 
+	/* Array with size param of type long */
+
+	public delegate int ArrayDelegate8_2 (long i, 
+										string j, 
+										[In, MarshalAs(UnmanagedType.LPArray, 
+													   ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] string[] arr);
+
+	[DllImport ("libtest", EntryPoint="mono_test_marshal_array_delegate_long")]
+	public static extern int mono_test_marshal_array_delegate8_2 (string[] arr, long len, ArrayDelegate8_2 d);
+
+	public static int array_delegate8_2 (long i, string j, string[] arr) {
+		if (arr.Length != 2)
+			return 1;
+		if ((arr [0] != "ABC") || (arr [1] != "DEF"))
+			return 2;
+		return 0;
+	}
+
+	public static int test_0_marshal_array_delegate_long_param () {	
+		string[] arr = new string [] { "ABC", "DEF" };
+		return mono_test_marshal_array_delegate8_2 (arr, arr.Length, new ArrayDelegate8_2 (array_delegate8_2));
+	}
+
+
 	/*
 	 * [Out] blittable arrays
 	 */
diff --git a/mono/tests/t-missing.cs b/mono/tests/t-missing.cs
index bbb25bf..e594b3e 100644
--- a/mono/tests/t-missing.cs
+++ b/mono/tests/t-missing.cs
@@ -4,6 +4,7 @@ namespace Missing {
 
 #if FOUND
 public class Foo1 {
+	public class InnerFoo {}
 }
 #endif
 
diff --git a/mono/utils/ChangeLog b/mono/utils/ChangeLog
index 8f524d2..2175b0b 100644
--- a/mono/utils/ChangeLog
+++ b/mono/utils/ChangeLog
@@ -1,3 +1,23 @@
+2009-10-30 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* mono-proclib.c: hz is only multiplied by the number of cpus when
+	requesting "_Total".
+
+2009-09-29  Zoltan Varga  <vargaz at gmail.com>
+
+	* mono-compiler.h (MONO_INTERNAL): Disable this on solaris as it produces a
+	millions of warnings during compilation.
+
+2009-07-17 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* mono-proclib.c: fix reading processor usage for a process. Patch
+	from Jacob Gladish that fixes bug #523052.
+
+2009-07-15 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* mono-proclib.c: fixed setting the NUL terminator.
+	Thanks to Jacob Gladish.
+
 2009-03-05  Mark Probst  <mark.probst at gmail.com>
 
 	Contributed under the terms of the MIT/X11 license by Steven
diff --git a/mono/utils/Makefile.in b/mono/utils/Makefile.in
index e62a030..70d5a73 100644
--- a/mono/utils/Makefile.in
+++ b/mono/utils/Makefile.in
@@ -38,7 +38,10 @@ subdir = mono/utils
 DIST_COMMON = $(libmonoutilsinclude_HEADERS) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -115,10 +118,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -128,14 +127,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -153,6 +151,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -161,6 +160,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -172,11 +172,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -205,8 +208,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -246,6 +248,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -269,6 +272,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 noinst_LTLIBRARIES = libmonoutils.la
diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h
index fcc2440..438da52 100644
--- a/mono/utils/mono-compiler.h
+++ b/mono/utils/mono-compiler.h
@@ -151,7 +151,7 @@
 
 #endif /* _MSC_VER */
 
-#if !defined(PLATFORM_WIN32) && HAVE_VISIBILITY_HIDDEN
+#if !defined(PLATFORM_WIN32) && !defined(PLATFORM_SOLARIS) && HAVE_VISIBILITY_HIDDEN
 #define MONO_INTERNAL __attribute__ ((visibility ("hidden")))
 #else
 #define MONO_INTERNAL 
diff --git a/mono/utils/mono-proclib.c b/mono/utils/mono-proclib.c
index c3fd545..af26adc 100644
--- a/mono/utils/mono-proclib.c
+++ b/mono/utils/mono-proclib.c
@@ -131,7 +131,7 @@ get_pid_status_item_buf (int pid, const char *item, char *rbuf, int blen, MonoPr
 		fclose (f);
 		len = strlen (s);
 		strncpy (rbuf, s, MIN (len, blen));
-		rbuf [blen - 1] = 0;
+		rbuf [MIN (len, blen) - 1] = 0;
 		if (error)
 			*error = MONO_PROCESS_ERROR_NONE;
 		return rbuf;
@@ -279,8 +279,8 @@ static gint64
 get_process_stat_time (int pid, int pos, int sum, MonoProcessError *error)
 {
 	gint64 val = get_process_stat_item (pid, pos, sum, error);
-	/* return milliseconds */
-	return (val * 1000) / get_user_hz ();
+	/* return 100ns ticks */
+	return (val * 10000000) / get_user_hz ();
 }
 
 static gint64
@@ -316,11 +316,11 @@ mono_process_get_data_with_error (gpointer pid, MonoProcessData data, MonoProces
 	case MONO_PROCESS_NUM_THREADS:
 		return get_pid_status_item (rpid, "Threads", error);
 	case MONO_PROCESS_USER_TIME:
-		return get_process_stat_time (rpid, 12, FALSE, error);
+		return get_process_stat_time (rpid, 10, FALSE, error);
 	case MONO_PROCESS_SYSTEM_TIME:
-		return get_process_stat_time (rpid, 13, FALSE, error);
+		return get_process_stat_time (rpid, 11, FALSE, error);
 	case MONO_PROCESS_TOTAL_TIME:
-		return get_process_stat_time (rpid, 12, TRUE, error);
+		return get_process_stat_time (rpid, 10, TRUE, error);
 	case MONO_PROCESS_WORKING_SET:
 		return get_pid_status_item (rpid, "VmRSS", error) * 1024;
 	case MONO_PROCESS_WORKING_SET_PEAK:
@@ -399,7 +399,8 @@ get_cpu_times (int cpu_id, gint64 *user, gint64 *systemt, gint64 *irq, gint64 *s
 	FILE *f = fopen ("/proc/stat", "r");
 	if (!f)
 		return;
-	hz *= mono_cpu_count ();
+	if (cpu_id < 0)
+		hz *= mono_cpu_count ();
 	while ((s = fgets (buf, sizeof (buf), f))) {
 		char *data = NULL;
 		if (cpu_id < 0 && strncmp (s, "cpu", 3) == 0 && g_ascii_isspace (s [3])) {
diff --git a/msvc/Makefile.in b/msvc/Makefile.in
index 233c726..3c121d4 100644
--- a/msvc/Makefile.in
+++ b/msvc/Makefile.in
@@ -36,7 +36,10 @@ subdir = msvc
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 VCPROJS = \
diff --git a/msvc/libmono.vcproj b/msvc/libmono.vcproj
index c34b23b..6708016 100644
--- a/msvc/libmono.vcproj
+++ b/msvc/libmono.vcproj
@@ -71,7 +71,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;;&quot;$(MONO_DEPENDENCIES_PREFIX)\lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -157,7 +157,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;;&quot;$(MONO_DEPENDENCIES_PREFIX)\lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -246,7 +246,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;;&quot;$(MONO_DEPENDENCIES_PREFIX)\lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -336,7 +336,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib glib-2.0.lib ws2_32.lib gthread-2.0.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;;&quot;$(MONO_DEPENDENCIES_PREFIX)\lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -426,7 +426,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -516,7 +516,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -604,7 +604,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;"
 				ModuleDefinitionFile="mono.def"
@@ -690,7 +690,7 @@
 			<Tool
 				Name="VCLinkerTool"
 				LinkLibraryDependencies="false"
-				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib"
+				AdditionalDependencies="version.lib libgc.lib eglib.lib ws2_32.lib Psapi.lib winmm.lib mswsock.lib"
 				OutputFile="$(OutDir)\mono.dll"
 				AdditionalLibraryDirectories="&quot;$(PlatformName)_$(ConfigurationName)/lib&quot;"
 				ModuleDefinitionFile="mono.def"
diff --git a/po/Makefile.in b/po/Makefile.in
index c3a0d1a..b965c59 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = po
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,10 +84,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -94,14 +93,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -119,6 +117,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -127,6 +126,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -138,11 +138,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -171,8 +174,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,6 +214,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -235,6 +238,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = mcs
diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo
index 1bf85cd..4c6f01a 100644
Binary files a/po/mcs/de.gmo and b/po/mcs/de.gmo differ
diff --git a/po/mcs/de.po b/po/mcs/de.po
index 82257a6..fadff93 100644
--- a/po/mcs/de.po
+++ b/po/mcs/de.po
@@ -2,7 +2,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
-"POT-Creation-Date: 2009-07-27 16:32+0000\n"
+"POT-Creation-Date: 2009-11-30 19:29-0700\n"
 "PO-Revision-Date: 2008-09-26 15:14+0100\n"
 "Last-Translator: Daniel Nauck <dna at mono-project.de>\n"
 "Language-Team: http://www.mono-project.de\n"
@@ -908,149 +908,149 @@ msgid ""
 "Fixed size buffer `{0}' of length `{1}' and type `{2}' exceeded 2^31 limit"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5868
+#: ../mcs/mcs/class.cs:5869
 #, csharp-format
 msgid "Struct member `{0}' of type `{1}' causes a cycle in the struct layout"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5921
+#: ../mcs/mcs/class.cs:5922
 #, csharp-format
 msgid "`{0}': A volatile field cannot be of the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5926
+#: ../mcs/mcs/class.cs:5927
 #, csharp-format
 msgid "`{0}': A field cannot be both volatile and readonly"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6079
+#: ../mcs/mcs/class.cs:6080
 #, csharp-format
 msgid ""
 "Attribute `{0}' is not valid on property or event accessors. It is valid on `"
 "{1}' declarations only"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6179 ../mcs/mcs/decl.cs:2800
+#: ../mcs/mcs/class.cs:6180 ../mcs/mcs/decl.cs:2800
 #, csharp-format
 msgid "A member `{0}' is already reserved"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6382
+#: ../mcs/mcs/class.cs:6383
 #, csharp-format
 msgid "Explicit interface implementation `{0}' is missing accessor `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6399
+#: ../mcs/mcs/class.cs:6400
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers may not be used on accessors in an interface"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6403
+#: ../mcs/mcs/class.cs:6404
 #, csharp-format
 msgid "`{0}': abstract properties cannot have private accessors"
 msgstr "`{0}': Abstrakte Eigenschaften können keine privaten-Accessoren haben"
 
-#: ../mcs/mcs/class.cs:6470
+#: ../mcs/mcs/class.cs:6471
 #, csharp-format
 msgid ""
 "The accessibility modifier of the `{0}' accessor must be more restrictive "
 "than the modifier of the property or indexer `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6538
+#: ../mcs/mcs/class.cs:6539
 #, csharp-format
 msgid ""
 "`{0}': Cannot specify accessibility modifiers for both accessors of the "
 "property or indexer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6546
+#: ../mcs/mcs/class.cs:6547
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers on accessors may only be used if the property "
 "or indexer has both a get and a set accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6595
+#: ../mcs/mcs/class.cs:6596
 #, csharp-format
 msgid ""
 "`{0}.get': cannot override because `{1}' does not have an overridable get "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6610
+#: ../mcs/mcs/class.cs:6611
 #, csharp-format
 msgid ""
 "`{0}.set': cannot override because `{1}' does not have an overridable set "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6809
+#: ../mcs/mcs/class.cs:6810
 #, csharp-format
 msgid ""
 "Automatically implemented property `{0}' cannot be used inside a type with "
 "an explicit StructLayout attribute"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7163
+#: ../mcs/mcs/class.cs:7164
 #, csharp-format
 msgid "`{0}': abstract event cannot have an initializer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7369
+#: ../mcs/mcs/class.cs:7370
 #, csharp-format
 msgid "`{0}': event must be of a delegate type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7577
+#: ../mcs/mcs/class.cs:7578
 msgid ""
 "The `IndexerName' attribute is valid only on an indexer that is not an "
 "explicit interface member declaration"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7584
+#: ../mcs/mcs/class.cs:7585
 msgid "Cannot set the `IndexerName' attribute on an indexer marked override"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7781
+#: ../mcs/mcs/class.cs:7782
 #, csharp-format
 msgid "User-defined operator `{0}' must be declared static and public"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7811
+#: ../mcs/mcs/class.cs:7812
 msgid ""
 "User-defined operator cannot take an object of the enclosing type and "
 "convert to an object of the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7822
+#: ../mcs/mcs/class.cs:7823
 msgid "User-defined conversion must convert to or from the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7831
+#: ../mcs/mcs/class.cs:7832
 #, csharp-format
 msgid ""
 "User-defined conversion `{0}' cannot convert to or from an interface type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7838
+#: ../mcs/mcs/class.cs:7839
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a base class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7844
+#: ../mcs/mcs/class.cs:7845
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a derived class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7852
+#: ../mcs/mcs/class.cs:7853
 msgid ""
 "Overloaded shift operator must have the type of the first operand be the "
 "containing type, and the type of the second operand must be int"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7861
+#: ../mcs/mcs/class.cs:7862
 msgid ""
 "The return type for ++ or -- operator must be the containing type or derived "
 "from the containing type"
@@ -1058,19 +1058,19 @@ msgstr ""
 "Der Rückgabetyp für die Operatoren ++ und -- muss der enthaltene Typ sein "
 "oder vom enthaltenen Typ abgeleitet sein"
 
-#: ../mcs/mcs/class.cs:7866
+#: ../mcs/mcs/class.cs:7867
 msgid "The parameter type for ++ or -- operator must be the containing type"
 msgstr "Der Parameter für den ++ oder -- Operator muss der enthaltene Typ sein"
 
-#: ../mcs/mcs/class.cs:7873
+#: ../mcs/mcs/class.cs:7874
 msgid "The parameter type of a unary operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7881
+#: ../mcs/mcs/class.cs:7882
 msgid "The return type of operator True or False must be bool"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7894
+#: ../mcs/mcs/class.cs:7895
 msgid "One of the parameters of a binary operator must be the containing type"
 msgstr ""
 
@@ -1351,27 +1351,27 @@ msgid ""
 "Cannot create delegate with `{0}' because it has a Conditional attribute"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:833
+#: ../mcs/mcs/delegate.cs:838
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' parameters and return type must be same as "
 "delegate `{2} {3}' parameters and return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:839
+#: ../mcs/mcs/delegate.cs:844
 #, csharp-format
 msgid ""
 "A method or delegate `{0}' parameters do not match delegate `{1}' parameters"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:844
+#: ../mcs/mcs/delegate.cs:849
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' "
 "return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:969
+#: ../mcs/mcs/delegate.cs:974
 msgid "Method name expected"
 msgstr "Methodennamen erwartet"
 
@@ -2184,87 +2184,87 @@ msgstr ""
 msgid "`{0}': cannot explicitly call operator or accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5382
+#: ../mcs/mcs/expression.cs:5383
 #, csharp-format
 msgid "Unsafe type `{0}' cannot be used in an object creation expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5434
+#: ../mcs/mcs/expression.cs:5435
 #, csharp-format
 msgid "Cannot create an instance of the static class `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5446
+#: ../mcs/mcs/expression.cs:5447
 #, csharp-format
 msgid "Cannot create an instance of the abstract class or interface `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5771
+#: ../mcs/mcs/expression.cs:5772
 msgid "Invalid rank specifier: expected `,' or `]'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5776
+#: ../mcs/mcs/expression.cs:5777
 msgid "Cannot create an array with a negative size"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5793 ../mcs/mcs/statement.cs:3049
+#: ../mcs/mcs/expression.cs:5794 ../mcs/mcs/statement.cs:3049
 msgid "A constant value is expected"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5880
+#: ../mcs/mcs/expression.cs:5881
 msgid "An expression tree cannot contain a multidimensional array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5974
+#: ../mcs/mcs/expression.cs:5975
 msgid ""
 "Can only use array initializer expressions to assign to array types. Try "
 "using a new expression instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5979
+#: ../mcs/mcs/expression.cs:5980
 msgid ""
 "An implicitly typed local variable declarator cannot use an array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6054
+#: ../mcs/mcs/expression.cs:6055
 msgid "New invocation: Can not find a constructor for this argument list"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6493
+#: ../mcs/mcs/expression.cs:6494
 msgid ""
 "The type of an implicitly typed array cannot be inferred from the "
 "initializer. Try specifying array type explicitly"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6671
+#: ../mcs/mcs/expression.cs:6672
 msgid ""
 "Anonymous methods inside structs cannot access instance members of `this'. "
 "Consider copying `this' to a local variable outside the anonymous method and "
 "using the local instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6738
+#: ../mcs/mcs/expression.cs:6739
 msgid "Cannot take the address of `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6740
+#: ../mcs/mcs/expression.cs:6741
 msgid "Cannot pass `this' as a ref or out argument because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6742
+#: ../mcs/mcs/expression.cs:6743
 msgid "Cannot assign to `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6849
+#: ../mcs/mcs/expression.cs:6850
 msgid "An expression tree cannot contain a method with variable arguments"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6959
+#: ../mcs/mcs/expression.cs:6960
 #, csharp-format
 msgid "`{0}': an attribute argument cannot use type parameters"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7192
+#: ../mcs/mcs/expression.cs:7193
 #, csharp-format
 msgid ""
 "`{0}' does not have a predefined size, therefore sizeof can only be used in "
@@ -2272,12 +2272,12 @@ msgid ""
 "SizeOf)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7247
+#: ../mcs/mcs/expression.cs:7248
 #, csharp-format
 msgid "Alias `{0}' not found"
 msgstr "Alias `{0}' wurde nicht gefunden"
 
-#: ../mcs/mcs/expression.cs:7258
+#: ../mcs/mcs/expression.cs:7259
 #, csharp-format
 msgid ""
 "Alias `{0}' cannot be used with '::' since it denotes a type. Consider "
@@ -2286,28 +2286,28 @@ msgstr ""
 "Der Alias `{0}' kann nicht mit '::' verwendet werden, da der Alias auf einen "
 "Typ verweist. Verwenden Sie '.' stattdessen."
 
-#: ../mcs/mcs/expression.cs:7274
+#: ../mcs/mcs/expression.cs:7275
 #, csharp-format
 msgid ""
 "A namespace alias qualifier `{0}' did not resolve to a namespace or a type"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7413
+#: ../mcs/mcs/expression.cs:7414
 #, csharp-format
 msgid "`{0}': cannot reference a type through an expression; try `{1}' instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7510
+#: ../mcs/mcs/expression.cs:7511
 #, csharp-format
 msgid "A nested type cannot be specified through a type parameter `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7578
+#: ../mcs/mcs/expression.cs:7579
 #, csharp-format
 msgid "The nested type `{0}' does not exist in the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7590
+#: ../mcs/mcs/expression.cs:7591
 #, csharp-format
 msgid ""
 "Type `{0}' does not contain a definition for `{1}' and no extension method `"
@@ -2315,100 +2315,100 @@ msgid ""
 "assembly reference?)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7808
+#: ../mcs/mcs/expression.cs:7809
 msgid "Cannot apply indexing with [] to an expression of type `System.Array'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7914
+#: ../mcs/mcs/expression.cs:7915
 #, csharp-format
 msgid "Wrong number of indexes `{0}' inside [], expected `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8418
+#: ../mcs/mcs/expression.cs:8419
 #, csharp-format
 msgid ""
 "A property or indexer `{0}' may not be passed as an out or ref parameter"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8443
+#: ../mcs/mcs/expression.cs:8444
 #, csharp-format
 msgid "Cannot apply indexing with [] to an expression of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8473
+#: ../mcs/mcs/expression.cs:8474
 #, csharp-format
 msgid "The read only property or indexer `{0}' cannot be assigned to"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8481
+#: ../mcs/mcs/expression.cs:8482
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because it "
 "lacks a `{1}' accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8503
+#: ../mcs/mcs/expression.cs:8504
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because a `{1}' "
 "accessor is inaccessible"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8966
+#: ../mcs/mcs/expression.cs:8967
 #, csharp-format
 msgid "Array elements cannot be of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8972
+#: ../mcs/mcs/expression.cs:8973
 #, csharp-format
 msgid "Array elements cannot be of static type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9131
+#: ../mcs/mcs/expression.cs:9132
 msgid "Cannot use a negative size with stackalloc"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9258
+#: ../mcs/mcs/expression.cs:9259
 #, csharp-format
 msgid ""
 "Member `{0}' cannot be initialized. An object initializer may only be used "
 "for fields, or properties"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9261
+#: ../mcs/mcs/expression.cs:9262
 #, csharp-format
 msgid ""
 " Static field or property `{0}' cannot be assigned in an object initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9434
+#: ../mcs/mcs/expression.cs:9435
 #, csharp-format
 msgid ""
 "A field or property `{0}' cannot be initialized with a collection object "
 "initializer because type `{1}' does not implement `{2}' interface"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9445
+#: ../mcs/mcs/expression.cs:9446
 #, csharp-format
 msgid "Inconsistent `{0}' member declaration"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9453
+#: ../mcs/mcs/expression.cs:9454
 #, csharp-format
 msgid ""
 "An object initializer includes more than one member `{0}' initialization"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9470
+#: ../mcs/mcs/expression.cs:9471
 #, csharp-format
 msgid "Cannot initialize object of type `{0}' with a collection initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9731
+#: ../mcs/mcs/expression.cs:9732
 msgid "Anonymous types cannot be used in this expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9838
+#: ../mcs/mcs/expression.cs:9839
 #, csharp-format
 msgid "An anonymous type property `{0}' cannot be initialized with `{1}'"
 msgstr ""
@@ -3084,39 +3084,39 @@ msgstr ""
 msgid "Try statement already has an empty catch block"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4805
+#: ../mcs/mcs/statement.cs:4807
 #, csharp-format
 msgid ""
 "A previous catch clause already catches all exceptions of this or a super "
 "type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4980 ../mcs/mcs/statement.cs:5095
+#: ../mcs/mcs/statement.cs:4982 ../mcs/mcs/statement.cs:5097
 msgid "Internal error: No Dispose method which takes 0 parameters."
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5052
+#: ../mcs/mcs/statement.cs:5054
 #, csharp-format
 msgid ""
 "`{0}': type used in a using statement must be implicitly convertible to "
 "`System.IDisposable'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5492
+#: ../mcs/mcs/statement.cs:5494
 #, csharp-format
 msgid ""
 "foreach statement requires that the return type `{0}' of `{1}' must have a "
 "suitable public MoveNext method and public Current property"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5577
+#: ../mcs/mcs/statement.cs:5580
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it does "
 "not contain a definition for `GetEnumerator' or is not accessible"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5629
+#: ../mcs/mcs/statement.cs:5632
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it "
@@ -3124,11 +3124,11 @@ msgid ""
 "implementation"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5924
+#: ../mcs/mcs/statement.cs:5927
 msgid "Use of null is not valid in this context"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5934
+#: ../mcs/mcs/statement.cs:5937
 #, csharp-format
 msgid "Foreach statement cannot operate on a `{0}'"
 msgstr ""
diff --git a/po/mcs/es.gmo b/po/mcs/es.gmo
index b2b6be2..7cde038 100644
Binary files a/po/mcs/es.gmo and b/po/mcs/es.gmo differ
diff --git a/po/mcs/es.po b/po/mcs/es.po
index 0a3582b..ed8d854 100644
--- a/po/mcs/es.po
+++ b/po/mcs/es.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: mono 2.1\n"
 "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
-"POT-Creation-Date: 2009-07-27 16:32+0000\n"
+"POT-Creation-Date: 2009-11-30 19:29-0700\n"
 "PO-Revision-Date: 2008-09-19 13:28-0400\n"
 "Last-Translator: Miguel de Icaza <miguel at novell.com>\n"
 "Language-Team: es <mono-list at lists.ximian.com>\n"
@@ -1001,167 +1001,167 @@ msgid ""
 "Fixed size buffer `{0}' of length `{1}' and type `{2}' exceeded 2^31 limit"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5868
+#: ../mcs/mcs/class.cs:5869
 #, csharp-format
 msgid "Struct member `{0}' of type `{1}' causes a cycle in the struct layout"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5921
+#: ../mcs/mcs/class.cs:5922
 #, csharp-format
 msgid "`{0}': A volatile field cannot be of the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5926
+#: ../mcs/mcs/class.cs:5927
 #, csharp-format
 msgid "`{0}': A field cannot be both volatile and readonly"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6079
+#: ../mcs/mcs/class.cs:6080
 #, csharp-format
 msgid ""
 "Attribute `{0}' is not valid on property or event accessors. It is valid on `"
 "{1}' declarations only"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6179 ../mcs/mcs/decl.cs:2800
+#: ../mcs/mcs/class.cs:6180 ../mcs/mcs/decl.cs:2800
 #, csharp-format
 msgid "A member `{0}' is already reserved"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6382
+#: ../mcs/mcs/class.cs:6383
 #, csharp-format
 msgid "Explicit interface implementation `{0}' is missing accessor `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6399
+#: ../mcs/mcs/class.cs:6400
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers may not be used on accessors in an interface"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6403
+#: ../mcs/mcs/class.cs:6404
 #, csharp-format
 msgid "`{0}': abstract properties cannot have private accessors"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6470
+#: ../mcs/mcs/class.cs:6471
 #, csharp-format
 msgid ""
 "The accessibility modifier of the `{0}' accessor must be more restrictive "
 "than the modifier of the property or indexer `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6538
+#: ../mcs/mcs/class.cs:6539
 #, csharp-format
 msgid ""
 "`{0}': Cannot specify accessibility modifiers for both accessors of the "
 "property or indexer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6546
+#: ../mcs/mcs/class.cs:6547
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers on accessors may only be used if the property "
 "or indexer has both a get and a set accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6595
+#: ../mcs/mcs/class.cs:6596
 #, csharp-format
 msgid ""
 "`{0}.get': cannot override because `{1}' does not have an overridable get "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6610
+#: ../mcs/mcs/class.cs:6611
 #, csharp-format
 msgid ""
 "`{0}.set': cannot override because `{1}' does not have an overridable set "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6809
+#: ../mcs/mcs/class.cs:6810
 #, csharp-format
 msgid ""
 "Automatically implemented property `{0}' cannot be used inside a type with "
 "an explicit StructLayout attribute"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7163
+#: ../mcs/mcs/class.cs:7164
 #, csharp-format
 msgid "`{0}': abstract event cannot have an initializer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7369
+#: ../mcs/mcs/class.cs:7370
 #, csharp-format
 msgid "`{0}': event must be of a delegate type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7577
+#: ../mcs/mcs/class.cs:7578
 msgid ""
 "The `IndexerName' attribute is valid only on an indexer that is not an "
 "explicit interface member declaration"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7584
+#: ../mcs/mcs/class.cs:7585
 msgid "Cannot set the `IndexerName' attribute on an indexer marked override"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7781
+#: ../mcs/mcs/class.cs:7782
 #, csharp-format
 msgid "User-defined operator `{0}' must be declared static and public"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7811
+#: ../mcs/mcs/class.cs:7812
 msgid ""
 "User-defined operator cannot take an object of the enclosing type and "
 "convert to an object of the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7822
+#: ../mcs/mcs/class.cs:7823
 msgid "User-defined conversion must convert to or from the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7831
+#: ../mcs/mcs/class.cs:7832
 #, csharp-format
 msgid ""
 "User-defined conversion `{0}' cannot convert to or from an interface type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7838
+#: ../mcs/mcs/class.cs:7839
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a base class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7844
+#: ../mcs/mcs/class.cs:7845
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a derived class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7852
+#: ../mcs/mcs/class.cs:7853
 msgid ""
 "Overloaded shift operator must have the type of the first operand be the "
 "containing type, and the type of the second operand must be int"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7861
+#: ../mcs/mcs/class.cs:7862
 msgid ""
 "The return type for ++ or -- operator must be the containing type or derived "
 "from the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7866
+#: ../mcs/mcs/class.cs:7867
 msgid "The parameter type for ++ or -- operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7873
+#: ../mcs/mcs/class.cs:7874
 msgid "The parameter type of a unary operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7881
+#: ../mcs/mcs/class.cs:7882
 msgid "The return type of operator True or False must be bool"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7894
+#: ../mcs/mcs/class.cs:7895
 msgid "One of the parameters of a binary operator must be the containing type"
 msgstr ""
 
@@ -1444,27 +1444,27 @@ msgid ""
 "Cannot create delegate with `{0}' because it has a Conditional attribute"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:833
+#: ../mcs/mcs/delegate.cs:838
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' parameters and return type must be same as "
 "delegate `{2} {3}' parameters and return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:839
+#: ../mcs/mcs/delegate.cs:844
 #, csharp-format
 msgid ""
 "A method or delegate `{0}' parameters do not match delegate `{1}' parameters"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:844
+#: ../mcs/mcs/delegate.cs:849
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' "
 "return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:969
+#: ../mcs/mcs/delegate.cs:974
 msgid "Method name expected"
 msgstr ""
 
@@ -2272,87 +2272,87 @@ msgstr ""
 msgid "`{0}': cannot explicitly call operator or accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5382
+#: ../mcs/mcs/expression.cs:5383
 #, csharp-format
 msgid "Unsafe type `{0}' cannot be used in an object creation expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5434
+#: ../mcs/mcs/expression.cs:5435
 #, csharp-format
 msgid "Cannot create an instance of the static class `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5446
+#: ../mcs/mcs/expression.cs:5447
 #, csharp-format
 msgid "Cannot create an instance of the abstract class or interface `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5771
+#: ../mcs/mcs/expression.cs:5772
 msgid "Invalid rank specifier: expected `,' or `]'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5776
+#: ../mcs/mcs/expression.cs:5777
 msgid "Cannot create an array with a negative size"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5793 ../mcs/mcs/statement.cs:3049
+#: ../mcs/mcs/expression.cs:5794 ../mcs/mcs/statement.cs:3049
 msgid "A constant value is expected"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5880
+#: ../mcs/mcs/expression.cs:5881
 msgid "An expression tree cannot contain a multidimensional array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5974
+#: ../mcs/mcs/expression.cs:5975
 msgid ""
 "Can only use array initializer expressions to assign to array types. Try "
 "using a new expression instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5979
+#: ../mcs/mcs/expression.cs:5980
 msgid ""
 "An implicitly typed local variable declarator cannot use an array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6054
+#: ../mcs/mcs/expression.cs:6055
 msgid "New invocation: Can not find a constructor for this argument list"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6493
+#: ../mcs/mcs/expression.cs:6494
 msgid ""
 "The type of an implicitly typed array cannot be inferred from the "
 "initializer. Try specifying array type explicitly"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6671
+#: ../mcs/mcs/expression.cs:6672
 msgid ""
 "Anonymous methods inside structs cannot access instance members of `this'. "
 "Consider copying `this' to a local variable outside the anonymous method and "
 "using the local instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6738
+#: ../mcs/mcs/expression.cs:6739
 msgid "Cannot take the address of `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6740
+#: ../mcs/mcs/expression.cs:6741
 msgid "Cannot pass `this' as a ref or out argument because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6742
+#: ../mcs/mcs/expression.cs:6743
 msgid "Cannot assign to `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6849
+#: ../mcs/mcs/expression.cs:6850
 msgid "An expression tree cannot contain a method with variable arguments"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6959
+#: ../mcs/mcs/expression.cs:6960
 #, csharp-format
 msgid "`{0}': an attribute argument cannot use type parameters"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7192
+#: ../mcs/mcs/expression.cs:7193
 #, csharp-format
 msgid ""
 "`{0}' does not have a predefined size, therefore sizeof can only be used in "
@@ -2360,40 +2360,40 @@ msgid ""
 "SizeOf)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7247
+#: ../mcs/mcs/expression.cs:7248
 #, csharp-format
 msgid "Alias `{0}' not found"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7258
+#: ../mcs/mcs/expression.cs:7259
 #, csharp-format
 msgid ""
 "Alias `{0}' cannot be used with '::' since it denotes a type. Consider "
 "replacing '::' with '.'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7274
+#: ../mcs/mcs/expression.cs:7275
 #, csharp-format
 msgid ""
 "A namespace alias qualifier `{0}' did not resolve to a namespace or a type"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7413
+#: ../mcs/mcs/expression.cs:7414
 #, csharp-format
 msgid "`{0}': cannot reference a type through an expression; try `{1}' instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7510
+#: ../mcs/mcs/expression.cs:7511
 #, csharp-format
 msgid "A nested type cannot be specified through a type parameter `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7578
+#: ../mcs/mcs/expression.cs:7579
 #, csharp-format
 msgid "The nested type `{0}' does not exist in the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7590
+#: ../mcs/mcs/expression.cs:7591
 #, csharp-format
 msgid ""
 "Type `{0}' does not contain a definition for `{1}' and no extension method `"
@@ -2401,102 +2401,102 @@ msgid ""
 "assembly reference?)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7808
+#: ../mcs/mcs/expression.cs:7809
 msgid "Cannot apply indexing with [] to an expression of type `System.Array'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7914
+#: ../mcs/mcs/expression.cs:7915
 #, csharp-format
 msgid "Wrong number of indexes `{0}' inside [], expected `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8418
+#: ../mcs/mcs/expression.cs:8419
 #, csharp-format
 msgid ""
 "A property or indexer `{0}' may not be passed as an out or ref parameter"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8443
+#: ../mcs/mcs/expression.cs:8444
 #, csharp-format
 msgid "Cannot apply indexing with [] to an expression of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8473
+#: ../mcs/mcs/expression.cs:8474
 #, csharp-format
 msgid "The read only property or indexer `{0}' cannot be assigned to"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8481
+#: ../mcs/mcs/expression.cs:8482
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because it "
 "lacks a `{1}' accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8503
+#: ../mcs/mcs/expression.cs:8504
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because a `{1}' "
 "accessor is inaccessible"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8966
+#: ../mcs/mcs/expression.cs:8967
 #, csharp-format
 msgid "Array elements cannot be of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8972
+#: ../mcs/mcs/expression.cs:8973
 #, csharp-format
 msgid "Array elements cannot be of static type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9131
+#: ../mcs/mcs/expression.cs:9132
 msgid "Cannot use a negative size with stackalloc"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9258
+#: ../mcs/mcs/expression.cs:9259
 #, csharp-format
 msgid ""
 "Member `{0}' cannot be initialized. An object initializer may only be used "
 "for fields, or properties"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9261
+#: ../mcs/mcs/expression.cs:9262
 #, csharp-format
 msgid ""
 " Static field or property `{0}' cannot be assigned in an object initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9434
+#: ../mcs/mcs/expression.cs:9435
 #, csharp-format
 msgid ""
 "A field or property `{0}' cannot be initialized with a collection object "
 "initializer because type `{1}' does not implement `{2}' interface"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9445
+#: ../mcs/mcs/expression.cs:9446
 #, csharp-format
 msgid "Inconsistent `{0}' member declaration"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9453
+#: ../mcs/mcs/expression.cs:9454
 #, csharp-format
 msgid ""
 "An object initializer includes more than one member `{0}' initialization"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9470
+#: ../mcs/mcs/expression.cs:9471
 #, csharp-format
 msgid "Cannot initialize object of type `{0}' with a collection initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9731
+#: ../mcs/mcs/expression.cs:9732
 #, fuzzy
 msgid "Anonymous types cannot be used in this expression"
 msgstr ""
 "Los métodos anónimos no pueden ser convertidos a árboles de expresiones"
 
-#: ../mcs/mcs/expression.cs:9838
+#: ../mcs/mcs/expression.cs:9839
 #, csharp-format
 msgid "An anonymous type property `{0}' cannot be initialized with `{1}'"
 msgstr ""
@@ -3146,39 +3146,39 @@ msgstr ""
 msgid "Try statement already has an empty catch block"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4805
+#: ../mcs/mcs/statement.cs:4807
 #, csharp-format
 msgid ""
 "A previous catch clause already catches all exceptions of this or a super "
 "type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4980 ../mcs/mcs/statement.cs:5095
+#: ../mcs/mcs/statement.cs:4982 ../mcs/mcs/statement.cs:5097
 msgid "Internal error: No Dispose method which takes 0 parameters."
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5052
+#: ../mcs/mcs/statement.cs:5054
 #, csharp-format
 msgid ""
 "`{0}': type used in a using statement must be implicitly convertible to "
 "`System.IDisposable'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5492
+#: ../mcs/mcs/statement.cs:5494
 #, csharp-format
 msgid ""
 "foreach statement requires that the return type `{0}' of `{1}' must have a "
 "suitable public MoveNext method and public Current property"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5577
+#: ../mcs/mcs/statement.cs:5580
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it does "
 "not contain a definition for `GetEnumerator' or is not accessible"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5629
+#: ../mcs/mcs/statement.cs:5632
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it "
@@ -3186,11 +3186,11 @@ msgid ""
 "implementation"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5924
+#: ../mcs/mcs/statement.cs:5927
 msgid "Use of null is not valid in this context"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5934
+#: ../mcs/mcs/statement.cs:5937
 #, csharp-format
 msgid "Foreach statement cannot operate on a `{0}'"
 msgstr "El mandato `foreach' no puede operar en un `{0}'"
diff --git a/po/mcs/ja.gmo b/po/mcs/ja.gmo
index 1fd617f..3c52cd9 100644
Binary files a/po/mcs/ja.gmo and b/po/mcs/ja.gmo differ
diff --git a/po/mcs/ja.po b/po/mcs/ja.po
index ffcc5e5..5d81c99 100644
--- a/po/mcs/ja.po
+++ b/po/mcs/ja.po
@@ -2,7 +2,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
-"POT-Creation-Date: 2009-07-27 16:32+0000\n"
+"POT-Creation-Date: 2009-11-30 19:29-0700\n"
 "PO-Revision-Date: \n"
 "Last-Translator: Atsushi Eno <atsushi at ximian.com>\n"
 "Language-Team: \n"
@@ -986,167 +986,167 @@ msgid ""
 "Fixed size buffer `{0}' of length `{1}' and type `{2}' exceeded 2^31 limit"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5868
+#: ../mcs/mcs/class.cs:5869
 #, csharp-format
 msgid "Struct member `{0}' of type `{1}' causes a cycle in the struct layout"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5921
+#: ../mcs/mcs/class.cs:5922
 #, csharp-format
 msgid "`{0}': A volatile field cannot be of the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5926
+#: ../mcs/mcs/class.cs:5927
 #, csharp-format
 msgid "`{0}': A field cannot be both volatile and readonly"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6079
+#: ../mcs/mcs/class.cs:6080
 #, csharp-format
 msgid ""
 "Attribute `{0}' is not valid on property or event accessors. It is valid on `"
 "{1}' declarations only"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6179 ../mcs/mcs/decl.cs:2800
+#: ../mcs/mcs/class.cs:6180 ../mcs/mcs/decl.cs:2800
 #, csharp-format
 msgid "A member `{0}' is already reserved"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6382
+#: ../mcs/mcs/class.cs:6383
 #, csharp-format
 msgid "Explicit interface implementation `{0}' is missing accessor `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6399
+#: ../mcs/mcs/class.cs:6400
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers may not be used on accessors in an interface"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6403
+#: ../mcs/mcs/class.cs:6404
 #, csharp-format
 msgid "`{0}': abstract properties cannot have private accessors"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6470
+#: ../mcs/mcs/class.cs:6471
 #, csharp-format
 msgid ""
 "The accessibility modifier of the `{0}' accessor must be more restrictive "
 "than the modifier of the property or indexer `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6538
+#: ../mcs/mcs/class.cs:6539
 #, csharp-format
 msgid ""
 "`{0}': Cannot specify accessibility modifiers for both accessors of the "
 "property or indexer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6546
+#: ../mcs/mcs/class.cs:6547
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers on accessors may only be used if the property "
 "or indexer has both a get and a set accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6595
+#: ../mcs/mcs/class.cs:6596
 #, csharp-format
 msgid ""
 "`{0}.get': cannot override because `{1}' does not have an overridable get "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6610
+#: ../mcs/mcs/class.cs:6611
 #, csharp-format
 msgid ""
 "`{0}.set': cannot override because `{1}' does not have an overridable set "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6809
+#: ../mcs/mcs/class.cs:6810
 #, csharp-format
 msgid ""
 "Automatically implemented property `{0}' cannot be used inside a type with "
 "an explicit StructLayout attribute"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7163
+#: ../mcs/mcs/class.cs:7164
 #, csharp-format
 msgid "`{0}': abstract event cannot have an initializer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7369
+#: ../mcs/mcs/class.cs:7370
 #, csharp-format
 msgid "`{0}': event must be of a delegate type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7577
+#: ../mcs/mcs/class.cs:7578
 msgid ""
 "The `IndexerName' attribute is valid only on an indexer that is not an "
 "explicit interface member declaration"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7584
+#: ../mcs/mcs/class.cs:7585
 msgid "Cannot set the `IndexerName' attribute on an indexer marked override"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7781
+#: ../mcs/mcs/class.cs:7782
 #, csharp-format
 msgid "User-defined operator `{0}' must be declared static and public"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7811
+#: ../mcs/mcs/class.cs:7812
 msgid ""
 "User-defined operator cannot take an object of the enclosing type and "
 "convert to an object of the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7822
+#: ../mcs/mcs/class.cs:7823
 msgid "User-defined conversion must convert to or from the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7831
+#: ../mcs/mcs/class.cs:7832
 #, csharp-format
 msgid ""
 "User-defined conversion `{0}' cannot convert to or from an interface type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7838
+#: ../mcs/mcs/class.cs:7839
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a base class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7844
+#: ../mcs/mcs/class.cs:7845
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a derived class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7852
+#: ../mcs/mcs/class.cs:7853
 msgid ""
 "Overloaded shift operator must have the type of the first operand be the "
 "containing type, and the type of the second operand must be int"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7861
+#: ../mcs/mcs/class.cs:7862
 msgid ""
 "The return type for ++ or -- operator must be the containing type or derived "
 "from the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7866
+#: ../mcs/mcs/class.cs:7867
 msgid "The parameter type for ++ or -- operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7873
+#: ../mcs/mcs/class.cs:7874
 msgid "The parameter type of a unary operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7881
+#: ../mcs/mcs/class.cs:7882
 msgid "The return type of operator True or False must be bool"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7894
+#: ../mcs/mcs/class.cs:7895
 msgid "One of the parameters of a binary operator must be the containing type"
 msgstr ""
 
@@ -1427,27 +1427,27 @@ msgid ""
 "Cannot create delegate with `{0}' because it has a Conditional attribute"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:833
+#: ../mcs/mcs/delegate.cs:838
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' parameters and return type must be same as "
 "delegate `{2} {3}' parameters and return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:839
+#: ../mcs/mcs/delegate.cs:844
 #, csharp-format
 msgid ""
 "A method or delegate `{0}' parameters do not match delegate `{1}' parameters"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:844
+#: ../mcs/mcs/delegate.cs:849
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' "
 "return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:969
+#: ../mcs/mcs/delegate.cs:974
 msgid "Method name expected"
 msgstr ""
 
@@ -2257,87 +2257,87 @@ msgstr ""
 msgid "`{0}': cannot explicitly call operator or accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5382
+#: ../mcs/mcs/expression.cs:5383
 #, csharp-format
 msgid "Unsafe type `{0}' cannot be used in an object creation expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5434
+#: ../mcs/mcs/expression.cs:5435
 #, csharp-format
 msgid "Cannot create an instance of the static class `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5446
+#: ../mcs/mcs/expression.cs:5447
 #, csharp-format
 msgid "Cannot create an instance of the abstract class or interface `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5771
+#: ../mcs/mcs/expression.cs:5772
 msgid "Invalid rank specifier: expected `,' or `]'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5776
+#: ../mcs/mcs/expression.cs:5777
 msgid "Cannot create an array with a negative size"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5793 ../mcs/mcs/statement.cs:3049
+#: ../mcs/mcs/expression.cs:5794 ../mcs/mcs/statement.cs:3049
 msgid "A constant value is expected"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5880
+#: ../mcs/mcs/expression.cs:5881
 msgid "An expression tree cannot contain a multidimensional array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5974
+#: ../mcs/mcs/expression.cs:5975
 msgid ""
 "Can only use array initializer expressions to assign to array types. Try "
 "using a new expression instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5979
+#: ../mcs/mcs/expression.cs:5980
 msgid ""
 "An implicitly typed local variable declarator cannot use an array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6054
+#: ../mcs/mcs/expression.cs:6055
 msgid "New invocation: Can not find a constructor for this argument list"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6493
+#: ../mcs/mcs/expression.cs:6494
 msgid ""
 "The type of an implicitly typed array cannot be inferred from the "
 "initializer. Try specifying array type explicitly"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6671
+#: ../mcs/mcs/expression.cs:6672
 msgid ""
 "Anonymous methods inside structs cannot access instance members of `this'. "
 "Consider copying `this' to a local variable outside the anonymous method and "
 "using the local instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6738
+#: ../mcs/mcs/expression.cs:6739
 msgid "Cannot take the address of `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6740
+#: ../mcs/mcs/expression.cs:6741
 msgid "Cannot pass `this' as a ref or out argument because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6742
+#: ../mcs/mcs/expression.cs:6743
 msgid "Cannot assign to `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6849
+#: ../mcs/mcs/expression.cs:6850
 msgid "An expression tree cannot contain a method with variable arguments"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6959
+#: ../mcs/mcs/expression.cs:6960
 #, csharp-format
 msgid "`{0}': an attribute argument cannot use type parameters"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7192
+#: ../mcs/mcs/expression.cs:7193
 #, csharp-format
 msgid ""
 "`{0}' does not have a predefined size, therefore sizeof can only be used in "
@@ -2345,40 +2345,40 @@ msgid ""
 "SizeOf)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7247
+#: ../mcs/mcs/expression.cs:7248
 #, csharp-format
 msgid "Alias `{0}' not found"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7258
+#: ../mcs/mcs/expression.cs:7259
 #, csharp-format
 msgid ""
 "Alias `{0}' cannot be used with '::' since it denotes a type. Consider "
 "replacing '::' with '.'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7274
+#: ../mcs/mcs/expression.cs:7275
 #, csharp-format
 msgid ""
 "A namespace alias qualifier `{0}' did not resolve to a namespace or a type"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7413
+#: ../mcs/mcs/expression.cs:7414
 #, csharp-format
 msgid "`{0}': cannot reference a type through an expression; try `{1}' instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7510
+#: ../mcs/mcs/expression.cs:7511
 #, csharp-format
 msgid "A nested type cannot be specified through a type parameter `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7578
+#: ../mcs/mcs/expression.cs:7579
 #, csharp-format
 msgid "The nested type `{0}' does not exist in the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7590
+#: ../mcs/mcs/expression.cs:7591
 #, csharp-format
 msgid ""
 "Type `{0}' does not contain a definition for `{1}' and no extension method `"
@@ -2386,101 +2386,101 @@ msgid ""
 "assembly reference?)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7808
+#: ../mcs/mcs/expression.cs:7809
 msgid "Cannot apply indexing with [] to an expression of type `System.Array'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7914
+#: ../mcs/mcs/expression.cs:7915
 #, csharp-format
 msgid "Wrong number of indexes `{0}' inside [], expected `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8418
+#: ../mcs/mcs/expression.cs:8419
 #, csharp-format
 msgid ""
 "A property or indexer `{0}' may not be passed as an out or ref parameter"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8443
+#: ../mcs/mcs/expression.cs:8444
 #, csharp-format
 msgid "Cannot apply indexing with [] to an expression of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8473
+#: ../mcs/mcs/expression.cs:8474
 #, csharp-format
 msgid "The read only property or indexer `{0}' cannot be assigned to"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8481
+#: ../mcs/mcs/expression.cs:8482
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because it "
 "lacks a `{1}' accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8503
+#: ../mcs/mcs/expression.cs:8504
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because a `{1}' "
 "accessor is inaccessible"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8966
+#: ../mcs/mcs/expression.cs:8967
 #, csharp-format
 msgid "Array elements cannot be of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8972
+#: ../mcs/mcs/expression.cs:8973
 #, csharp-format
 msgid "Array elements cannot be of static type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9131
+#: ../mcs/mcs/expression.cs:9132
 msgid "Cannot use a negative size with stackalloc"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9258
+#: ../mcs/mcs/expression.cs:9259
 #, csharp-format
 msgid ""
 "Member `{0}' cannot be initialized. An object initializer may only be used "
 "for fields, or properties"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9261
+#: ../mcs/mcs/expression.cs:9262
 #, csharp-format
 msgid ""
 " Static field or property `{0}' cannot be assigned in an object initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9434
+#: ../mcs/mcs/expression.cs:9435
 #, csharp-format
 msgid ""
 "A field or property `{0}' cannot be initialized with a collection object "
 "initializer because type `{1}' does not implement `{2}' interface"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9445
+#: ../mcs/mcs/expression.cs:9446
 #, csharp-format
 msgid "Inconsistent `{0}' member declaration"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9453
+#: ../mcs/mcs/expression.cs:9454
 #, csharp-format
 msgid ""
 "An object initializer includes more than one member `{0}' initialization"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9470
+#: ../mcs/mcs/expression.cs:9471
 #, csharp-format
 msgid "Cannot initialize object of type `{0}' with a collection initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9731
+#: ../mcs/mcs/expression.cs:9732
 #, fuzzy
 msgid "Anonymous types cannot be used in this expression"
 msgstr "匿名メソッドを式ツリーに変換することはできません"
 
-#: ../mcs/mcs/expression.cs:9838
+#: ../mcs/mcs/expression.cs:9839
 #, csharp-format
 msgid "An anonymous type property `{0}' cannot be initialized with `{1}'"
 msgstr ""
@@ -3130,39 +3130,39 @@ msgstr ""
 msgid "Try statement already has an empty catch block"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4805
+#: ../mcs/mcs/statement.cs:4807
 #, csharp-format
 msgid ""
 "A previous catch clause already catches all exceptions of this or a super "
 "type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4980 ../mcs/mcs/statement.cs:5095
+#: ../mcs/mcs/statement.cs:4982 ../mcs/mcs/statement.cs:5097
 msgid "Internal error: No Dispose method which takes 0 parameters."
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5052
+#: ../mcs/mcs/statement.cs:5054
 #, csharp-format
 msgid ""
 "`{0}': type used in a using statement must be implicitly convertible to "
 "`System.IDisposable'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5492
+#: ../mcs/mcs/statement.cs:5494
 #, csharp-format
 msgid ""
 "foreach statement requires that the return type `{0}' of `{1}' must have a "
 "suitable public MoveNext method and public Current property"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5577
+#: ../mcs/mcs/statement.cs:5580
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it does "
 "not contain a definition for `GetEnumerator' or is not accessible"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5629
+#: ../mcs/mcs/statement.cs:5632
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it "
@@ -3170,11 +3170,11 @@ msgid ""
 "implementation"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5924
+#: ../mcs/mcs/statement.cs:5927
 msgid "Use of null is not valid in this context"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5934
+#: ../mcs/mcs/statement.cs:5937
 #, csharp-format
 msgid "Foreach statement cannot operate on a `{0}'"
 msgstr ""
diff --git a/po/mcs/mcs.pot b/po/mcs/mcs.pot
index ef64e69..a82dada 100644
--- a/po/mcs/mcs.pot
+++ b/po/mcs/mcs.pot
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: mono 2.4.2.3\n"
+"Project-Id-Version: mono 2.4.3\n"
 "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
-"POT-Creation-Date: 2009-07-27 16:32+0000\n"
+"POT-Creation-Date: 2009-11-30 19:29-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
 "Language-Team: LANGUAGE <LL at li.org>\n"
@@ -901,167 +901,167 @@ msgid ""
 "Fixed size buffer `{0}' of length `{1}' and type `{2}' exceeded 2^31 limit"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5868
+#: ../mcs/mcs/class.cs:5869
 #, csharp-format
 msgid "Struct member `{0}' of type `{1}' causes a cycle in the struct layout"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5921
+#: ../mcs/mcs/class.cs:5922
 #, csharp-format
 msgid "`{0}': A volatile field cannot be of the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:5926
+#: ../mcs/mcs/class.cs:5927
 #, csharp-format
 msgid "`{0}': A field cannot be both volatile and readonly"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6079
+#: ../mcs/mcs/class.cs:6080
 #, csharp-format
 msgid ""
 "Attribute `{0}' is not valid on property or event accessors. It is valid on `"
 "{1}' declarations only"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6179 ../mcs/mcs/decl.cs:2800
+#: ../mcs/mcs/class.cs:6180 ../mcs/mcs/decl.cs:2800
 #, csharp-format
 msgid "A member `{0}' is already reserved"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6382
+#: ../mcs/mcs/class.cs:6383
 #, csharp-format
 msgid "Explicit interface implementation `{0}' is missing accessor `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6399
+#: ../mcs/mcs/class.cs:6400
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers may not be used on accessors in an interface"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6403
+#: ../mcs/mcs/class.cs:6404
 #, csharp-format
 msgid "`{0}': abstract properties cannot have private accessors"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6470
+#: ../mcs/mcs/class.cs:6471
 #, csharp-format
 msgid ""
 "The accessibility modifier of the `{0}' accessor must be more restrictive "
 "than the modifier of the property or indexer `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6538
+#: ../mcs/mcs/class.cs:6539
 #, csharp-format
 msgid ""
 "`{0}': Cannot specify accessibility modifiers for both accessors of the "
 "property or indexer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6546
+#: ../mcs/mcs/class.cs:6547
 #, csharp-format
 msgid ""
 "`{0}': accessibility modifiers on accessors may only be used if the property "
 "or indexer has both a get and a set accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6595
+#: ../mcs/mcs/class.cs:6596
 #, csharp-format
 msgid ""
 "`{0}.get': cannot override because `{1}' does not have an overridable get "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6610
+#: ../mcs/mcs/class.cs:6611
 #, csharp-format
 msgid ""
 "`{0}.set': cannot override because `{1}' does not have an overridable set "
 "accessor"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:6809
+#: ../mcs/mcs/class.cs:6810
 #, csharp-format
 msgid ""
 "Automatically implemented property `{0}' cannot be used inside a type with "
 "an explicit StructLayout attribute"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7163
+#: ../mcs/mcs/class.cs:7164
 #, csharp-format
 msgid "`{0}': abstract event cannot have an initializer"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7369
+#: ../mcs/mcs/class.cs:7370
 #, csharp-format
 msgid "`{0}': event must be of a delegate type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7577
+#: ../mcs/mcs/class.cs:7578
 msgid ""
 "The `IndexerName' attribute is valid only on an indexer that is not an "
 "explicit interface member declaration"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7584
+#: ../mcs/mcs/class.cs:7585
 msgid "Cannot set the `IndexerName' attribute on an indexer marked override"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7781
+#: ../mcs/mcs/class.cs:7782
 #, csharp-format
 msgid "User-defined operator `{0}' must be declared static and public"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7811
+#: ../mcs/mcs/class.cs:7812
 msgid ""
 "User-defined operator cannot take an object of the enclosing type and "
 "convert to an object of the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7822
+#: ../mcs/mcs/class.cs:7823
 msgid "User-defined conversion must convert to or from the enclosing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7831
+#: ../mcs/mcs/class.cs:7832
 #, csharp-format
 msgid ""
 "User-defined conversion `{0}' cannot convert to or from an interface type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7838
+#: ../mcs/mcs/class.cs:7839
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a base class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7844
+#: ../mcs/mcs/class.cs:7845
 #, csharp-format
 msgid "User-defined conversion `{0}' cannot convert to or from a derived class"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7852
+#: ../mcs/mcs/class.cs:7853
 msgid ""
 "Overloaded shift operator must have the type of the first operand be the "
 "containing type, and the type of the second operand must be int"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7861
+#: ../mcs/mcs/class.cs:7862
 msgid ""
 "The return type for ++ or -- operator must be the containing type or derived "
 "from the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7866
+#: ../mcs/mcs/class.cs:7867
 msgid "The parameter type for ++ or -- operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7873
+#: ../mcs/mcs/class.cs:7874
 msgid "The parameter type of a unary operator must be the containing type"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7881
+#: ../mcs/mcs/class.cs:7882
 msgid "The return type of operator True or False must be bool"
 msgstr ""
 
-#: ../mcs/mcs/class.cs:7894
+#: ../mcs/mcs/class.cs:7895
 msgid "One of the parameters of a binary operator must be the containing type"
 msgstr ""
 
@@ -1342,27 +1342,27 @@ msgid ""
 "Cannot create delegate with `{0}' because it has a Conditional attribute"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:833
+#: ../mcs/mcs/delegate.cs:838
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' parameters and return type must be same as "
 "delegate `{2} {3}' parameters and return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:839
+#: ../mcs/mcs/delegate.cs:844
 #, csharp-format
 msgid ""
 "A method or delegate `{0}' parameters do not match delegate `{1}' parameters"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:844
+#: ../mcs/mcs/delegate.cs:849
 #, csharp-format
 msgid ""
 "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' "
 "return type"
 msgstr ""
 
-#: ../mcs/mcs/delegate.cs:969
+#: ../mcs/mcs/delegate.cs:974
 msgid "Method name expected"
 msgstr ""
 
@@ -2170,87 +2170,87 @@ msgstr ""
 msgid "`{0}': cannot explicitly call operator or accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5382
+#: ../mcs/mcs/expression.cs:5383
 #, csharp-format
 msgid "Unsafe type `{0}' cannot be used in an object creation expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5434
+#: ../mcs/mcs/expression.cs:5435
 #, csharp-format
 msgid "Cannot create an instance of the static class `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5446
+#: ../mcs/mcs/expression.cs:5447
 #, csharp-format
 msgid "Cannot create an instance of the abstract class or interface `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5771
+#: ../mcs/mcs/expression.cs:5772
 msgid "Invalid rank specifier: expected `,' or `]'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5776
+#: ../mcs/mcs/expression.cs:5777
 msgid "Cannot create an array with a negative size"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5793 ../mcs/mcs/statement.cs:3049
+#: ../mcs/mcs/expression.cs:5794 ../mcs/mcs/statement.cs:3049
 msgid "A constant value is expected"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5880
+#: ../mcs/mcs/expression.cs:5881
 msgid "An expression tree cannot contain a multidimensional array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5974
+#: ../mcs/mcs/expression.cs:5975
 msgid ""
 "Can only use array initializer expressions to assign to array types. Try "
 "using a new expression instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:5979
+#: ../mcs/mcs/expression.cs:5980
 msgid ""
 "An implicitly typed local variable declarator cannot use an array initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6054
+#: ../mcs/mcs/expression.cs:6055
 msgid "New invocation: Can not find a constructor for this argument list"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6493
+#: ../mcs/mcs/expression.cs:6494
 msgid ""
 "The type of an implicitly typed array cannot be inferred from the "
 "initializer. Try specifying array type explicitly"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6671
+#: ../mcs/mcs/expression.cs:6672
 msgid ""
 "Anonymous methods inside structs cannot access instance members of `this'. "
 "Consider copying `this' to a local variable outside the anonymous method and "
 "using the local instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6738
+#: ../mcs/mcs/expression.cs:6739
 msgid "Cannot take the address of `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6740
+#: ../mcs/mcs/expression.cs:6741
 msgid "Cannot pass `this' as a ref or out argument because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6742
+#: ../mcs/mcs/expression.cs:6743
 msgid "Cannot assign to `this' because it is read-only"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6849
+#: ../mcs/mcs/expression.cs:6850
 msgid "An expression tree cannot contain a method with variable arguments"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:6959
+#: ../mcs/mcs/expression.cs:6960
 #, csharp-format
 msgid "`{0}': an attribute argument cannot use type parameters"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7192
+#: ../mcs/mcs/expression.cs:7193
 #, csharp-format
 msgid ""
 "`{0}' does not have a predefined size, therefore sizeof can only be used in "
@@ -2258,40 +2258,40 @@ msgid ""
 "SizeOf)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7247
+#: ../mcs/mcs/expression.cs:7248
 #, csharp-format
 msgid "Alias `{0}' not found"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7258
+#: ../mcs/mcs/expression.cs:7259
 #, csharp-format
 msgid ""
 "Alias `{0}' cannot be used with '::' since it denotes a type. Consider "
 "replacing '::' with '.'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7274
+#: ../mcs/mcs/expression.cs:7275
 #, csharp-format
 msgid ""
 "A namespace alias qualifier `{0}' did not resolve to a namespace or a type"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7413
+#: ../mcs/mcs/expression.cs:7414
 #, csharp-format
 msgid "`{0}': cannot reference a type through an expression; try `{1}' instead"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7510
+#: ../mcs/mcs/expression.cs:7511
 #, csharp-format
 msgid "A nested type cannot be specified through a type parameter `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7578
+#: ../mcs/mcs/expression.cs:7579
 #, csharp-format
 msgid "The nested type `{0}' does not exist in the type `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7590
+#: ../mcs/mcs/expression.cs:7591
 #, csharp-format
 msgid ""
 "Type `{0}' does not contain a definition for `{1}' and no extension method `"
@@ -2299,100 +2299,100 @@ msgid ""
 "assembly reference?)"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7808
+#: ../mcs/mcs/expression.cs:7809
 msgid "Cannot apply indexing with [] to an expression of type `System.Array'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:7914
+#: ../mcs/mcs/expression.cs:7915
 #, csharp-format
 msgid "Wrong number of indexes `{0}' inside [], expected `{1}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8418
+#: ../mcs/mcs/expression.cs:8419
 #, csharp-format
 msgid ""
 "A property or indexer `{0}' may not be passed as an out or ref parameter"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8443
+#: ../mcs/mcs/expression.cs:8444
 #, csharp-format
 msgid "Cannot apply indexing with [] to an expression of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8473
+#: ../mcs/mcs/expression.cs:8474
 #, csharp-format
 msgid "The read only property or indexer `{0}' cannot be assigned to"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8481
+#: ../mcs/mcs/expression.cs:8482
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because it "
 "lacks a `{1}' accessor"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8503
+#: ../mcs/mcs/expression.cs:8504
 #, csharp-format
 msgid ""
 "The property or indexer `{0}' cannot be used in this context because a `{1}' "
 "accessor is inaccessible"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8966
+#: ../mcs/mcs/expression.cs:8967
 #, csharp-format
 msgid "Array elements cannot be of type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:8972
+#: ../mcs/mcs/expression.cs:8973
 #, csharp-format
 msgid "Array elements cannot be of static type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9131
+#: ../mcs/mcs/expression.cs:9132
 msgid "Cannot use a negative size with stackalloc"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9258
+#: ../mcs/mcs/expression.cs:9259
 #, csharp-format
 msgid ""
 "Member `{0}' cannot be initialized. An object initializer may only be used "
 "for fields, or properties"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9261
+#: ../mcs/mcs/expression.cs:9262
 #, csharp-format
 msgid ""
 " Static field or property `{0}' cannot be assigned in an object initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9434
+#: ../mcs/mcs/expression.cs:9435
 #, csharp-format
 msgid ""
 "A field or property `{0}' cannot be initialized with a collection object "
 "initializer because type `{1}' does not implement `{2}' interface"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9445
+#: ../mcs/mcs/expression.cs:9446
 #, csharp-format
 msgid "Inconsistent `{0}' member declaration"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9453
+#: ../mcs/mcs/expression.cs:9454
 #, csharp-format
 msgid ""
 "An object initializer includes more than one member `{0}' initialization"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9470
+#: ../mcs/mcs/expression.cs:9471
 #, csharp-format
 msgid "Cannot initialize object of type `{0}' with a collection initializer"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9731
+#: ../mcs/mcs/expression.cs:9732
 msgid "Anonymous types cannot be used in this expression"
 msgstr ""
 
-#: ../mcs/mcs/expression.cs:9838
+#: ../mcs/mcs/expression.cs:9839
 #, csharp-format
 msgid "An anonymous type property `{0}' cannot be initialized with `{1}'"
 msgstr ""
@@ -3042,39 +3042,39 @@ msgstr ""
 msgid "Try statement already has an empty catch block"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4805
+#: ../mcs/mcs/statement.cs:4807
 #, csharp-format
 msgid ""
 "A previous catch clause already catches all exceptions of this or a super "
 "type `{0}'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:4980 ../mcs/mcs/statement.cs:5095
+#: ../mcs/mcs/statement.cs:4982 ../mcs/mcs/statement.cs:5097
 msgid "Internal error: No Dispose method which takes 0 parameters."
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5052
+#: ../mcs/mcs/statement.cs:5054
 #, csharp-format
 msgid ""
 "`{0}': type used in a using statement must be implicitly convertible to "
 "`System.IDisposable'"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5492
+#: ../mcs/mcs/statement.cs:5494
 #, csharp-format
 msgid ""
 "foreach statement requires that the return type `{0}' of `{1}' must have a "
 "suitable public MoveNext method and public Current property"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5577
+#: ../mcs/mcs/statement.cs:5580
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it does "
 "not contain a definition for `GetEnumerator' or is not accessible"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5629
+#: ../mcs/mcs/statement.cs:5632
 #, csharp-format
 msgid ""
 "foreach statement cannot operate on variables of type `{0}' because it "
@@ -3082,11 +3082,11 @@ msgid ""
 "implementation"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5924
+#: ../mcs/mcs/statement.cs:5927
 msgid "Use of null is not valid in this context"
 msgstr ""
 
-#: ../mcs/mcs/statement.cs:5934
+#: ../mcs/mcs/statement.cs:5937
 #, csharp-format
 msgid "Foreach statement cannot operate on a `{0}'"
 msgstr ""
diff --git a/runtime/Makefile.in b/runtime/Makefile.in
index a4df955..0032c26 100644
--- a/runtime/Makefile.in
+++ b/runtime/Makefile.in
@@ -37,7 +37,10 @@ subdir = runtime
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(srcdir)/mono-wrapper.in $(srcdir)/monodis-wrapper.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -72,10 +75,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -85,14 +84,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -110,6 +108,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -118,6 +117,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -129,11 +129,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -162,8 +165,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -203,6 +205,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -226,6 +229,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 
diff --git a/samples/Makefile.in b/samples/Makefile.in
index b6f9374..ddd25e8 100644
--- a/samples/Makefile.in
+++ b/samples/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = samples
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 all: all-am
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 28c036b..61fbec7 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -38,7 +38,10 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/mono-find-provides.in \
 	$(srcdir)/mono-find-requires.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -75,10 +78,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -88,14 +87,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -113,6 +111,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -121,6 +120,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -132,11 +132,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -165,8 +168,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -206,6 +208,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -229,6 +232,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @USE_BATCH_FILES_FALSE at SCRIPT_IN = script.in
diff --git a/support/ChangeLog b/support/ChangeLog
index 26ec8fc..df1423e 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,46 @@
+2009-10-24 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* zlib-helper.c: stop trying to decompress when we get Z_STREAM_END.
+	Patch by Ives Bastide. Fixes bug #549942.
+
+2009-09-14  Jonathan Pryor  <jpryor at novell.com>
+
+	* zlib-helper.c: support reverse callbacks within MonoTouch.
+
+2009-08-23 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* deflate.c:
+	* gzio.c:
+	* deflate.h:
+	* zutil.h:
+	* crc32.c:
+	* trees.c:
+	* zconf.h:
+	* inffast.c:
+	* compress.c:
+	* zlib.h:
+	* inftrees.c:
+	* inflate.c:
+	* inflate.h:
+	* adler32.c:
+	* infback.c: updated to 1.2.3.3
+
+2009-07-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* zlib-helper.c: use glib for malloc/free.
+
+2009-07-21 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* zlib-helper.c: don't try to finish the z_stream if it has not been
+	used. This fixes all the tests after the latest change.
+
+2009-07-20 Gonzalo Paniagua Javier <gonzalo at novell.com>
+
+	* Makefile.am: replaced zlib_macros.c with zlib-helper.c
+	* zlib_macros.c: Removed file.
+	* zlib-helper.c: new interface for DeflateStream. Flush() actually
+	does something.
+
 2009-03-20  Jonathan Pryor  <jpryor at novell.com>
 
 	* x-struct-str.c: It's possible for struct members to be NULL, so make 
diff --git a/support/Makefile.am b/support/Makefile.am
index f53fe0b..1eb3479 100644
--- a/support/Makefile.am
+++ b/support/Makefile.am
@@ -51,7 +51,7 @@ MPH_UNIX_SOURCE =				\
 
 if PLATFORM_WIN32
 MPH_SOURCE = $(MPH_C_SOURCE)
-MPH_LIBS   =
+MPH_LIBS   = $(GLIB_LIBS)
 else
 MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE)
 MPH_LIBS   = $(GLIB_LIBS)
@@ -91,10 +91,10 @@ ZLIB_SOURCES = \
 	zutil.h
 
 if HAVE_ZLIB
-Z_SOURCE = zlib_macros.c 
+Z_SOURCE = zlib-helper.c
 Z_LIBS= -lz
 else
-Z_SOURCE = zlib_macros.c $(ZLIB_SOURCES)
+Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES)
 Z_LIBS=
 endif
 
diff --git a/support/Makefile.in b/support/Makefile.in
index 8afd34b..326ca50 100644
--- a/support/Makefile.in
+++ b/support/Makefile.in
@@ -36,7 +36,10 @@ target_triplet = @target@
 subdir = support
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -55,6 +58,7 @@ libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 @PLATFORM_WIN32_FALSE at am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+ at PLATFORM_WIN32_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
 libMonoPosixHelper_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
 	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 am__libMonoPosixHelper_la_SOURCES_DIST = errno.c map.c map.h mph.h \
@@ -62,7 +66,7 @@ am__libMonoPosixHelper_la_SOURCES_DIST = errno.c map.c map.h mph.h \
 	grp.c macros.c old-map.c old-map.h pwd.c serial.c sys-mman.c \
 	sys-sendfile.c sys-stat.c sys-statvfs.c sys-time.c \
 	sys-utsname.c sys-wait.c sys-xattr.c syslog.c time.c unistd.c \
-	utime.c x-struct-str.c zlib_macros.c adler32.c compress.c \
+	utime.c x-struct-str.c zlib-helper.c adler32.c compress.c \
 	crc32.c gzio.c uncompr.c deflate.c trees.c zutil.c inflate.c \
 	infback.c inftrees.c inffast.c crc32.h deflate.h inffast.h \
 	inffixed.h inflate.h inftrees.h trees.h zconf.h zlib.h zutil.h \
@@ -80,8 +84,8 @@ am__objects_2 = dirent.lo fcntl.lo fstab.lo grp.lo macros.lo \
 am__objects_4 = adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo \
 	deflate.lo trees.lo zutil.lo inflate.lo infback.lo inftrees.lo \
 	inffast.lo
- at HAVE_ZLIB_FALSE@am__objects_5 = zlib_macros.lo $(am__objects_4)
- at HAVE_ZLIB_TRUE@am__objects_5 = zlib_macros.lo
+ at HAVE_ZLIB_FALSE@am__objects_5 = zlib-helper.lo $(am__objects_4)
+ at HAVE_ZLIB_TRUE@am__objects_5 = zlib-helper.lo
 am__objects_6 = ioapi.lo unzip.lo zip.lo
 am_libMonoPosixHelper_la_OBJECTS = $(am__objects_3) $(am__objects_5) \
 	$(am__objects_6)
@@ -135,10 +139,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -148,14 +148,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -173,6 +172,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -181,6 +181,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -192,11 +193,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -225,8 +229,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -266,6 +269,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -289,6 +293,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @PLATFORM_WIN32_FALSE at SUPPORT = libMonoSupportW.la
@@ -344,7 +349,7 @@ MPH_UNIX_SOURCE = \
 @PLATFORM_WIN32_FALSE at MPH_SOURCE = $(MPH_C_SOURCE) $(MPH_UNIX_SOURCE)
 @PLATFORM_WIN32_TRUE at MPH_SOURCE = $(MPH_C_SOURCE)
 @PLATFORM_WIN32_FALSE at MPH_LIBS = $(GLIB_LIBS)
- at PLATFORM_WIN32_TRUE@MPH_LIBS = 
+ at PLATFORM_WIN32_TRUE@MPH_LIBS = $(GLIB_LIBS)
 MINIZIP_SOURCE = \
 	minizip/crypt.h \
 	minizip/ioapi.c	\
@@ -378,8 +383,8 @@ ZLIB_SOURCES = \
 	zlib.h  	\
 	zutil.h
 
- at HAVE_ZLIB_FALSE@Z_SOURCE = zlib_macros.c $(ZLIB_SOURCES)
- at HAVE_ZLIB_TRUE@Z_SOURCE = zlib_macros.c 
+ at HAVE_ZLIB_FALSE@Z_SOURCE = zlib-helper.c $(ZLIB_SOURCES)
+ at HAVE_ZLIB_TRUE@Z_SOURCE = zlib-helper.c
 @HAVE_ZLIB_FALSE at Z_LIBS = 
 @HAVE_ZLIB_TRUE at Z_LIBS = -lz
 libMonoPosixHelper_la_SOURCES = \
@@ -518,7 +523,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/utime.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/x-struct-str.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zip.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zlib_macros.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zlib-helper.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zutil.Plo at am__quote@
 
 .c.o:
diff --git a/support/adler32.c b/support/adler32.c
index 007ba26..8bf7dc4 100644
--- a/support/adler32.c
+++ b/support/adler32.c
@@ -1,5 +1,5 @@
 /* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -8,6 +8,15 @@
 #define ZLIB_INTERNAL
 #include "zlib.h"
 
+#define local static
+
+#ifdef _LARGEFILE64_SOURCE
+   local uLong adler32_combine_(uLong adler1, uLong adler2, off64_t len2);
+#else
+   local uLong adler32_combine_(uLong adler1, uLong adler2, z_off_t len2);
+#endif
+
+
 #define BASE 65521UL    /* largest prime smaller than 65536 */
 #define NMAX 5552
 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -125,10 +134,14 @@ uLong ZEXPORT adler32(adler, buf, len)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+local uLong adler32_combine_(adler1, adler2, len2)
     uLong adler1;
     uLong adler2;
+#ifdef _LARGEFILE64_SOURCE
+    off64_t len2;
+#else
     z_off_t len2;
+#endif
 {
     unsigned long sum1;
     unsigned long sum2;
@@ -147,3 +160,30 @@ uLong ZEXPORT adler32_combine(adler1, adler2, len2)
     if (sum2 > BASE) sum2 -= BASE;
     return sum1 | (sum2 << 16);
 }
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
+
+#ifdef _LARGEFILE64_SOURCE
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    off64_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
+#else
+uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
+    uLong adler1;
+    uLong adler2;
+    z_off_t len2;
+{
+    return adler32_combine_(adler1, adler2, len2);
+}
+#endif
diff --git a/support/compress.c b/support/compress.c
index df04f01..ea4dfbe 100644
--- a/support/compress.c
+++ b/support/compress.c
@@ -1,5 +1,5 @@
 /* compress.c -- compress a memory buffer
- * Copyright (C) 1995-2003 Jean-loup Gailly.
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -75,5 +75,6 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
 uLong ZEXPORT compressBound (sourceLen)
     uLong sourceLen;
 {
-    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 11;
+    return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
+           (sourceLen >> 25) + 13;
 }
diff --git a/support/crc32.c b/support/crc32.c
index f658a9e..b34a510 100644
--- a/support/crc32.c
+++ b/support/crc32.c
@@ -1,5 +1,5 @@
 /* crc32.c -- compute the CRC-32 of a data stream
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * Thanks to Rodney Brown <rbrown64 at csc.com.au> for his contribution of faster
@@ -68,6 +68,12 @@
 local unsigned long gf2_matrix_times OF((unsigned long *mat,
                                          unsigned long vec));
 local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
+#ifdef _LARGEFILE64_SOURCE
+   local uLong crc32_combine_(uLong crc1, uLong crc2, off64_t len2);
+#else
+   local uLong crc32_combine_(uLong crc1, uLong crc2, z_off_t len2);
+#endif
+
 
 #ifdef DYNAMIC_CRC_TABLE
 
@@ -367,10 +373,14 @@ local void gf2_matrix_square(square, mat)
 }
 
 /* ========================================================================= */
-uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+local uLong crc32_combine_(crc1, crc2, len2)
     uLong crc1;
     uLong crc2;
+#ifdef _LARGEFILE64_SOURCE
+    off64_t len2;
+#else
     z_off_t len2;
+#endif
 {
     int n;
     unsigned long row;
@@ -421,3 +431,30 @@ uLong ZEXPORT crc32_combine(crc1, crc2, len2)
     crc1 ^= crc2;
     return crc1;
 }
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
+
+#ifdef _LARGEFILE64_SOURCE
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    off64_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
+#else
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
+    uLong crc1;
+    uLong crc2;
+    z_off_t len2;
+{
+    return crc32_combine_(crc1, crc2, len2);
+}
+#endif
diff --git a/support/deflate.c b/support/deflate.c
index 29ce1f6..fc41b80 100644
--- a/support/deflate.c
+++ b/support/deflate.c
@@ -1,5 +1,5 @@
 /* deflate.c -- compress data using the deflation algorithm
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly ";
+   " deflate 1.2.3.3 Copyright 1995-2006 Jean-loup Gailly ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -481,33 +481,65 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain)
  * resulting from using fixed blocks instead of stored blocks, which deflate
  * can emit on compressed data for some combinations of the parameters.
  *
- * This function could be more sophisticated to provide closer upper bounds
- * for every combination of windowBits and memLevel, as well as wrap.
- * But even the conservative upper bound of about 14% expansion does not
- * seem onerous for output buffer allocation.
+ * This function could be more sophisticated to provide closer upper bounds for
+ * every combination of windowBits and memLevel.  But even the conservative
+ * upper bound of about 14% expansion does not seem onerous for output buffer
+ * allocation.
  */
 uLong ZEXPORT deflateBound(strm, sourceLen)
     z_streamp strm;
     uLong sourceLen;
 {
     deflate_state *s;
-    uLong destLen;
+    uLong complen, wraplen;
+    Bytef *str;
 
-    /* conservative upper bound */
-    destLen = sourceLen +
-              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 11;
+    /* conservative upper bound for compressed data */
+    complen = sourceLen +
+              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
 
-    /* if can't get parameters, return conservative bound */
+    /* if can't get parameters, return conservative bound plus zlib wrapper */
     if (strm == Z_NULL || strm->state == Z_NULL)
-        return destLen;
+        return complen + 6;
 
-    /* if not default parameters, return conservative bound */
+    /* compute wrapper length */
     s = strm->state;
+    switch (s->wrap) {
+    case 0:                                 /* raw deflate */
+        wraplen = 0;
+        break;
+    case 1:                                 /* zlib wrapper */
+        wraplen = 6 + (s->strstart ? 4 : 0);
+        break;
+    case 2:                                 /* gzip wrapper */
+        wraplen = 18;
+        if (s->gzhead != NULL) {            /* user-supplied gzip header */
+            if (s->gzhead->extra != NULL)
+                wraplen += 2 + s->gzhead->extra_len;
+            str = s->gzhead->name;
+            if (str != NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            str = s->gzhead->comment;
+            if (str != NULL)
+                do {
+                    wraplen++;
+                } while (*str++);
+            if (s->gzhead->hcrc)
+                wraplen += 2;
+        }
+        break;
+    default:                                /* for compiler happiness */
+        wraplen = 6;
+    }
+
+    /* if not default parameters, return conservative bound */
     if (s->w_bits != 15 || s->hash_bits != 8 + 7)
-        return destLen;
+        return complen + wraplen;
 
     /* default settings: return tight bound for that case */
-    return compressBound(sourceLen);
+    return compressBound(sourceLen) - 6 + wraplen;
 }
 
 /* =========================================================================
diff --git a/support/deflate.h b/support/deflate.h
index 05a5ab3..90077d8 100644
--- a/support/deflate.h
+++ b/support/deflate.h
@@ -1,5 +1,5 @@
 /* deflate.h -- internal compression state
- * Copyright (C) 1995-2004 Jean-loup Gailly
+ * Copyright (C) 1995-2005 Jean-loup Gailly
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
diff --git a/support/gzio.c b/support/gzio.c
index 7e90f49..044d38a 100644
--- a/support/gzio.c
+++ b/support/gzio.c
@@ -1,5 +1,6 @@
+#ifdef MONO_DOES_NOT_NEED_THIS
 /* gzio.c -- IO on .gz files
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  *
  * Compile this file with -DNO_GZCOMPRESS to avoid the compression code.
@@ -7,9 +8,17 @@
 
 /* @(#) $Id$ */
 
-#include <stdio.h>
+#ifdef _LARGEFILE64_SOURCE
+#  ifndef _LARGEFILE_SOURCE
+#    define _LARGEFILE_SOURCE
+#  endif
+#  ifdef _FILE_OFFSET_BITS
+#    undef _FILE_OFFSET_BITS
+#  endif
+#endif
 
 #include "zutil.h"
+#include <stdio.h>
 
 #ifdef NO_DEFLATE       /* for compatibility with old definition */
 #  define NO_GZCOMPRESS
@@ -40,6 +49,14 @@ extern voidp  malloc OF((uInt size));
 extern void   free   OF((voidpf ptr));
 #endif
 
+#ifdef NO_FSEEKO
+#  define FSEEK fseek
+#  define FTELL ftell
+#else
+#  define FSEEK fseeko
+#  define FTELL ftello
+#endif
+
 #define ALLOC(size) malloc(size)
 #define TRYFREE(p) {if (p) free(p);}
 
@@ -65,15 +82,27 @@ typedef struct gz_stream {
     char     *path;   /* path name for debugging only */
     int      transparent; /* 1 if input file is not a .gz file */
     char     mode;    /* 'w' or 'r' */
+#ifdef _LARGEFILE64_SOURCE
+    off64_t  start;   /* start of compressed data in file (header skipped) */
+    off64_t  in;      /* bytes into deflate or inflate */
+    off64_t  out;     /* bytes out of deflate or inflate */
+#else
     z_off_t  start;   /* start of compressed data in file (header skipped) */
     z_off_t  in;      /* bytes into deflate or inflate */
     z_off_t  out;     /* bytes out of deflate or inflate */
+#endif
     int      back;    /* one character push-back */
     int      last;    /* true if push-back is last character */
 } gz_stream;
 
 
-local gzFile gz_open      OF((const char *path, const char *mode, int  fd));
+local gzFile gz_open      OF((const char *path, const char *mode, int fd,
+                              int use64));
+#ifdef _LARGEFILE64_SOURCE
+local off64_t gz_seek OF((gzFile file, off64_t offset, int whence, int use64));
+#else
+local z_off_t gz_seek OF((gzFile file, z_off_t offset, int whence, int use64));
+#endif
 local int do_flush        OF((gzFile file, int flush));
 local int    get_byte     OF((gz_stream *s));
 local void   check_header OF((gz_stream *s));
@@ -90,10 +119,11 @@ local uLong  getLong      OF((gz_stream *s));
    can be checked to distinguish the two cases (if errno is zero, the
    zlib error is Z_MEM_ERROR).
 */
-local gzFile gz_open (path, mode, fd)
+local gzFile gz_open (path, mode, fd, use64)
     const char *path;
     const char *mode;
     int  fd;
+    int use64;
 {
     int err;
     int level = Z_DEFAULT_COMPRESSION; /* compression level */
@@ -165,12 +195,7 @@ local gzFile gz_open (path, mode, fd)
         s->stream.next_in  = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE);
 
         err = inflateInit2(&(s->stream), -MAX_WBITS);
-        /* windowBits is passed < 0 to tell that there is no zlib header.
-         * Note that in this case inflate *requires* an extra "dummy" byte
-         * after the compressed stream in order to complete decompression and
-         * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are
-         * present after the compressed stream.
-         */
+        /* windowBits is passed < 0 to tell that there is no zlib header */
         if (err != Z_OK || s->inbuf == Z_NULL) {
             return destroy(s), (gzFile)Z_NULL;
         }
@@ -178,7 +203,8 @@ local gzFile gz_open (path, mode, fd)
     s->stream.avail_out = Z_BUFSIZE;
 
     errno = 0;
-    s->file = fd < 0 ? F_OPEN(path, fmode) : (FILE*)fdopen(fd, fmode);
+    s->file = fd < 0 ? (use64 ? F_OPEN64(path, fmode) : F_OPEN(path, fmode)) :
+              (FILE*)fdopen(fd, fmode);
 
     if (s->file == NULL) {
         return destroy(s), (gzFile)Z_NULL;
@@ -187,7 +213,10 @@ local gzFile gz_open (path, mode, fd)
         /* Write a very simple .gz header:
          */
         fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
-             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE);
+             Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, level == 9 ? 2 :
+                            (strategy >= Z_HUFFMAN_ONLY ||
+                             (level != Z_DEFAULT_COMPRESSION && level < 2) ?
+                             4 : 0) /*xflags*/, OS_CODE);
         s->start = 10L;
         /* We use 10L instead of ftell(s->file) to because ftell causes an
          * fflush on some systems. This version of the library doesn't use
@@ -196,7 +225,7 @@ local gzFile gz_open (path, mode, fd)
          */
     } else {
         check_header(s); /* skip the .gz header */
-        s->start = ftell(s->file) - s->stream.avail_in;
+        s->start = FTELL(s->file) - s->stream.avail_in;
     }
 
     return (gzFile)s;
@@ -209,7 +238,17 @@ gzFile ZEXPORT gzopen (path, mode)
     const char *path;
     const char *mode;
 {
-    return gz_open (path, mode, -1);
+    return gz_open (path, mode, -1, 0);
+}
+
+/* ===========================================================================
+     Opens a gzip (.gz) file for reading or writing for 64-bit offsets
+*/
+gzFile ZEXPORT gzopen64 (path, mode)
+    const char *path;
+    const char *mode;
+{
+    return gz_open (path, mode, -1, 1);
 }
 
 /* ===========================================================================
@@ -225,7 +264,7 @@ gzFile ZEXPORT gzdopen (fd, mode)
     if (fd < 0) return (gzFile)Z_NULL;
     sprintf(name, "<fd:%d>", fd); /* for debugging */
 
-    return gz_open (name, mode, fd);
+    return gz_open (name, mode, fd, 0);
 }
 
 /* ===========================================================================
@@ -256,7 +295,7 @@ int ZEXPORT gzsetparams (file, level, strategy)
 /* ===========================================================================
      Read a byte from a gz_stream; update next_in and avail_in. Return EOF
    for end of file.
-   IN assertion: the stream s has been sucessfully opened for reading.
+   IN assertion: the stream s has been successfully opened for reading.
 */
 local int get_byte(s)
     gz_stream *s;
@@ -281,7 +320,7 @@ local int get_byte(s)
     mode to transparent if the gzip magic header is not present; set s->err
     to Z_DATA_ERROR if the magic header is present but the rest of the header
     is incorrect.
-    IN assertion: the stream s has already been created sucessfully;
+    IN assertion: the stream s has already been created successfully;
        s->stream.avail_in is zero for the first time, but may be non-zero
        for concatenated .gz files.
 */
@@ -301,6 +340,7 @@ local void check_header(s)
         if (len) s->inbuf[0] = s->stream.next_in[0];
         errno = 0;
         len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file);
+        if (len == 0) s->z_eof = 1;
         if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO;
         s->stream.avail_in += len;
         s->stream.next_in = s->inbuf;
@@ -436,7 +476,7 @@ int ZEXPORT gzread (file, buf, len)
                 s->stream.avail_out -= n;
                 s->stream.avail_in  -= n;
             }
-            if (s->stream.avail_out > 0) {
+            if (s->stream.avail_out > 0 && !feof(s->file)) {
                 s->stream.avail_out -=
                     (uInt)fread(next_out, 1, s->stream.avail_out, s->file);
             }
@@ -764,10 +804,17 @@ int ZEXPORT gzflush (file, flush)
       SEEK_END is not implemented, returns error.
       In this version of the library, gzseek can be extremely slow.
 */
-z_off_t ZEXPORT gzseek (file, offset, whence)
+#ifdef _LARGEFILE64_SOURCE
+local off64_t gz_seek (file, offset, whence, use64)
+    gzFile file;
+    off64_t offset;
+#else
+local z_off_t gz_seek (file, offset, whence, use64)
     gzFile file;
     z_off_t offset;
+#endif
     int whence;
+    int use64;
 {
     gz_stream *s = (gz_stream*)file;
 
@@ -816,7 +863,13 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
         s->back = EOF;
         s->stream.avail_in = 0;
         s->stream.next_in = s->inbuf;
-        if (fseek(s->file, offset, SEEK_SET) < 0) return -1L;
+#ifdef _LARGEFILE64_SOURCE
+        if ((use64 ? fseeko64(s->file, offset, SEEK_SET) :
+                     FSEEK(s->file, offset, SEEK_SET)) < 0)
+            return -1L;
+#else
+        if (FSEEK(s->file, offset, SEEK_SET) < 0) return -1L;
+#endif
 
         s->in = s->out = offset;
         return offset;
@@ -852,6 +905,35 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
 }
 
 /* ===========================================================================
+    Define external functions gzseek() and gzseek64() using local gz_seek().
+*/
+z_off_t ZEXPORT gzseek (file, offset, whence)
+    gzFile file;
+    z_off_t offset;
+    int whence;
+{
+    return (z_off_t)gz_seek(file, offset, whence, 0);
+}
+
+#ifdef _LARGEFILE64_SOURCE
+off64_t ZEXPORT gzseek64 (file, offset, whence)
+    gzFile file;
+    off64_t offset;
+    int whence;
+{
+    return gz_seek(file, offset, whence, 1);
+}
+#else
+z_off_t ZEXPORT gzseek64 (file, offset, whence)
+    gzFile file;
+    z_off_t offset;
+    int whence;
+{
+    return gz_seek(file, offset, whence, 0);
+}
+#endif
+
+/* ===========================================================================
      Rewinds input file.
 */
 int ZEXPORT gzrewind (file)
@@ -870,7 +952,7 @@ int ZEXPORT gzrewind (file)
     if (!s->transparent) (void)inflateReset(&s->stream);
     s->in = 0;
     s->out = 0;
-    return fseek(s->file, s->start, SEEK_SET);
+    return FSEEK(s->file, s->start, SEEK_SET);
 }
 
 /* ===========================================================================
@@ -885,6 +967,19 @@ z_off_t ZEXPORT gztell (file)
 }
 
 /* ===========================================================================
+     64-bit version
+*/
+#ifdef _LARGEFILE64_SOURCE
+off64_t ZEXPORT gztell64 (file)
+#else
+z_off_t ZEXPORT gztell64 (file)
+#endif
+    gzFile file;
+{
+    return gzseek64(file, 0L, SEEK_CUR);
+}
+
+/* ===========================================================================
      Returns 1 when EOF has previously been detected reading the given
    input stream, otherwise zero.
 */
@@ -971,7 +1066,7 @@ int ZEXPORT gzclose (file)
     return destroy((gz_stream*)file);
 }
 
-#ifdef STDC
+#if defined(STDC) && !defined(_WIN32_WCE)
 #  define zstrerror(errnum) strerror(errnum)
 #else
 #  define zstrerror(errnum) ""
@@ -1024,3 +1119,4 @@ void ZEXPORT gzclearerr (file)
     s->z_eof = 0;
     clearerr(s->file);
 }
+#endif
diff --git a/support/infback.c b/support/infback.c
index 455dbc9..be0b3dc 100644
--- a/support/infback.c
+++ b/support/infback.c
@@ -1,5 +1,5 @@
 /* infback.c -- inflate using a call-back interface
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -253,7 +253,7 @@ void FAR *out_desc;
     unsigned bits;              /* bits in bit buffer */
     unsigned copy;              /* number of stored or match bytes to copy */
     unsigned char FAR *from;    /* where to copy match bytes from */
-    code this;                  /* current decoding table entry */
+    code here;                  /* current decoding table entry */
     code last;                  /* parent table entry */
     unsigned len;               /* length to copy for repeats, bits to drop */
     int ret;                    /* return code */
@@ -389,19 +389,19 @@ void FAR *out_desc;
             state->have = 0;
             while (state->have < state->nlen + state->ndist) {
                 for (;;) {
-                    this = state->lencode[BITS(state->lenbits)];
-                    if ((unsigned)(this.bits) <= bits) break;
+                    here = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(here.bits) <= bits) break;
                     PULLBYTE();
                 }
-                if (this.val < 16) {
-                    NEEDBITS(this.bits);
-                    DROPBITS(this.bits);
-                    state->lens[state->have++] = this.val;
+                if (here.val < 16) {
+                    NEEDBITS(here.bits);
+                    DROPBITS(here.bits);
+                    state->lens[state->have++] = here.val;
                 }
                 else {
-                    if (this.val == 16) {
-                        NEEDBITS(this.bits + 2);
-                        DROPBITS(this.bits);
+                    if (here.val == 16) {
+                        NEEDBITS(here.bits + 2);
+                        DROPBITS(here.bits);
                         if (state->have == 0) {
                             strm->msg = (char *)"invalid bit length repeat";
                             state->mode = BAD;
@@ -411,16 +411,16 @@ void FAR *out_desc;
                         copy = 3 + BITS(2);
                         DROPBITS(2);
                     }
-                    else if (this.val == 17) {
-                        NEEDBITS(this.bits + 3);
-                        DROPBITS(this.bits);
+                    else if (here.val == 17) {
+                        NEEDBITS(here.bits + 3);
+                        DROPBITS(here.bits);
                         len = 0;
                         copy = 3 + BITS(3);
                         DROPBITS(3);
                     }
                     else {
-                        NEEDBITS(this.bits + 7);
-                        DROPBITS(this.bits);
+                        NEEDBITS(here.bits + 7);
+                        DROPBITS(here.bits);
                         len = 0;
                         copy = 11 + BITS(7);
                         DROPBITS(7);
@@ -474,28 +474,28 @@ void FAR *out_desc;
 
             /* get a literal, length, or end-of-block code */
             for (;;) {
-                this = state->lencode[BITS(state->lenbits)];
-                if ((unsigned)(this.bits) <= bits) break;
+                here = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(here.bits) <= bits) break;
                 PULLBYTE();
             }
-            if (this.op && (this.op & 0xf0) == 0) {
-                last = this;
+            if (here.op && (here.op & 0xf0) == 0) {
+                last = here;
                 for (;;) {
-                    this = state->lencode[last.val +
+                    here = state->lencode[last.val +
                             (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
                     PULLBYTE();
                 }
                 DROPBITS(last.bits);
             }
-            DROPBITS(this.bits);
-            state->length = (unsigned)this.val;
+            DROPBITS(here.bits);
+            state->length = (unsigned)here.val;
 
             /* process literal */
-            if (this.op == 0) {
-                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+            if (here.op == 0) {
+                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
                         "inflate:         literal '%c'\n" :
-                        "inflate:         literal 0x%02x\n", this.val));
+                        "inflate:         literal 0x%02x\n", here.val));
                 ROOM();
                 *put++ = (unsigned char)(state->length);
                 left--;
@@ -504,21 +504,21 @@ void FAR *out_desc;
             }
 
             /* process end of block */
-            if (this.op & 32) {
+            if (here.op & 32) {
                 Tracevv((stderr, "inflate:         end of block\n"));
                 state->mode = TYPE;
                 break;
             }
 
             /* invalid code */
-            if (this.op & 64) {
+            if (here.op & 64) {
                 strm->msg = (char *)"invalid literal/length code";
                 state->mode = BAD;
                 break;
             }
 
             /* length code -- get extra bits, if any */
-            state->extra = (unsigned)(this.op) & 15;
+            state->extra = (unsigned)(here.op) & 15;
             if (state->extra != 0) {
                 NEEDBITS(state->extra);
                 state->length += BITS(state->extra);
@@ -528,30 +528,30 @@ void FAR *out_desc;
 
             /* get distance code */
             for (;;) {
-                this = state->distcode[BITS(state->distbits)];
-                if ((unsigned)(this.bits) <= bits) break;
+                here = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(here.bits) <= bits) break;
                 PULLBYTE();
             }
-            if ((this.op & 0xf0) == 0) {
-                last = this;
+            if ((here.op & 0xf0) == 0) {
+                last = here;
                 for (;;) {
-                    this = state->distcode[last.val +
+                    here = state->distcode[last.val +
                             (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
                     PULLBYTE();
                 }
                 DROPBITS(last.bits);
             }
-            DROPBITS(this.bits);
-            if (this.op & 64) {
+            DROPBITS(here.bits);
+            if (here.op & 64) {
                 strm->msg = (char *)"invalid distance code";
                 state->mode = BAD;
                 break;
             }
-            state->offset = (unsigned)this.val;
+            state->offset = (unsigned)here.val;
 
             /* get distance extra bits, if any */
-            state->extra = (unsigned)(this.op) & 15;
+            state->extra = (unsigned)(here.op) & 15;
             if (state->extra != 0) {
                 NEEDBITS(state->extra);
                 state->offset += BITS(state->extra);
diff --git a/support/inffast.c b/support/inffast.c
index bbee92e..0b919bb 100644
--- a/support/inffast.c
+++ b/support/inffast.c
@@ -1,5 +1,5 @@
 /* inffast.c -- fast decoding
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -87,7 +87,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
     code const FAR *dcode;      /* local strm->distcode */
     unsigned lmask;             /* mask for first level of length codes */
     unsigned dmask;             /* mask for first level of distance codes */
-    code this;                  /* retrieved table entry */
+    code here;                  /* retrieved table entry */
     unsigned op;                /* code bits, operation, extra bits, or */
                                 /*  window position, window bytes to copy */
     unsigned len;               /* match length, unused bytes */
@@ -124,20 +124,20 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
             hold += (unsigned long)(PUP(in)) << bits;
             bits += 8;
         }
-        this = lcode[hold & lmask];
+        here = lcode[hold & lmask];
       dolen:
-        op = (unsigned)(this.bits);
+        op = (unsigned)(here.bits);
         hold >>= op;
         bits -= op;
-        op = (unsigned)(this.op);
+        op = (unsigned)(here.op);
         if (op == 0) {                          /* literal */
-            Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+            Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
                     "inflate:         literal '%c'\n" :
-                    "inflate:         literal 0x%02x\n", this.val));
-            PUP(out) = (unsigned char)(this.val);
+                    "inflate:         literal 0x%02x\n", here.val));
+            PUP(out) = (unsigned char)(here.val);
         }
         else if (op & 16) {                     /* length base */
-            len = (unsigned)(this.val);
+            len = (unsigned)(here.val);
             op &= 15;                           /* number of extra bits */
             if (op) {
                 if (bits < op) {
@@ -155,14 +155,14 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
                 hold += (unsigned long)(PUP(in)) << bits;
                 bits += 8;
             }
-            this = dcode[hold & dmask];
+            here = dcode[hold & dmask];
           dodist:
-            op = (unsigned)(this.bits);
+            op = (unsigned)(here.bits);
             hold >>= op;
             bits -= op;
-            op = (unsigned)(this.op);
+            op = (unsigned)(here.op);
             if (op & 16) {                      /* distance base */
-                dist = (unsigned)(this.val);
+                dist = (unsigned)(here.val);
                 op &= 15;                       /* number of extra bits */
                 if (bits < op) {
                     hold += (unsigned long)(PUP(in)) << bits;
@@ -187,9 +187,30 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
                 if (dist > op) {                /* see if copy from window */
                     op = dist - op;             /* distance back in window */
                     if (op > whave) {
-                        strm->msg = (char *)"invalid distance too far back";
-                        state->mode = BAD;
-                        break;
+                        if (state->sane) {
+                            strm->msg = (char *)"invalid distance too far back";
+                            state->mode = BAD;
+                            break;
+                        }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                        if (len <= op - whave) {
+                            do {
+                                PUP(out) = 0;
+                            } while (--len);
+                            continue;
+                        }
+                        len -= op - whave;
+                        do {
+                            PUP(out) = 0;
+                        } while (--op > whave);
+                        if (op == 0) {
+                            from = out - dist;
+                            do {
+                                PUP(out) = PUP(from);
+                            } while (--len);
+                            continue;
+                        }
+#endif
                     }
                     from = window - OFF;
                     if (write == 0) {           /* very common case */
@@ -259,7 +280,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
                 }
             }
             else if ((op & 64) == 0) {          /* 2nd level distance code */
-                this = dcode[this.val + (hold & ((1U << op) - 1))];
+                here = dcode[here.val + (hold & ((1U << op) - 1))];
                 goto dodist;
             }
             else {
@@ -269,7 +290,7 @@ unsigned start;         /* inflate()'s starting value for strm->avail_out */
             }
         }
         else if ((op & 64) == 0) {              /* 2nd level length code */
-            this = lcode[this.val + (hold & ((1U << op) - 1))];
+            here = lcode[here.val + (hold & ((1U << op) - 1))];
             goto dolen;
         }
         else if (op & 32) {                     /* end-of-block */
diff --git a/support/inflate.c b/support/inflate.c
index 792fdee..d3c718c 100644
--- a/support/inflate.c
+++ b/support/inflate.c
@@ -1,5 +1,5 @@
 /* inflate.c -- zlib decompression
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -121,6 +121,7 @@ z_streamp strm;
     state->hold = 0;
     state->bits = 0;
     state->lencode = state->distcode = state->next = state->codes;
+    state->sane = 1;
     Tracev((stderr, "inflate: reset\n"));
     return Z_OK;
 }
@@ -564,7 +565,7 @@ int flush;
     unsigned in, out;           /* save starting available input and output */
     unsigned copy;              /* number of stored or match bytes to copy */
     unsigned char FAR *from;    /* where to copy match bytes from */
-    code this;                  /* current decoding table entry */
+    code here;                  /* current decoding table entry */
     code last;                  /* parent table entry */
     unsigned len;               /* length to copy for repeats, bits to drop */
     int ret;                    /* return code */
@@ -876,19 +877,19 @@ int flush;
         case CODELENS:
             while (state->have < state->nlen + state->ndist) {
                 for (;;) {
-                    this = state->lencode[BITS(state->lenbits)];
-                    if ((unsigned)(this.bits) <= bits) break;
+                    here = state->lencode[BITS(state->lenbits)];
+                    if ((unsigned)(here.bits) <= bits) break;
                     PULLBYTE();
                 }
-                if (this.val < 16) {
-                    NEEDBITS(this.bits);
-                    DROPBITS(this.bits);
-                    state->lens[state->have++] = this.val;
+                if (here.val < 16) {
+                    NEEDBITS(here.bits);
+                    DROPBITS(here.bits);
+                    state->lens[state->have++] = here.val;
                 }
                 else {
-                    if (this.val == 16) {
-                        NEEDBITS(this.bits + 2);
-                        DROPBITS(this.bits);
+                    if (here.val == 16) {
+                        NEEDBITS(here.bits + 2);
+                        DROPBITS(here.bits);
                         if (state->have == 0) {
                             strm->msg = (char *)"invalid bit length repeat";
                             state->mode = BAD;
@@ -898,16 +899,16 @@ int flush;
                         copy = 3 + BITS(2);
                         DROPBITS(2);
                     }
-                    else if (this.val == 17) {
-                        NEEDBITS(this.bits + 3);
-                        DROPBITS(this.bits);
+                    else if (here.val == 17) {
+                        NEEDBITS(here.bits + 3);
+                        DROPBITS(here.bits);
                         len = 0;
                         copy = 3 + BITS(3);
                         DROPBITS(3);
                     }
                     else {
-                        NEEDBITS(this.bits + 7);
-                        DROPBITS(this.bits);
+                        NEEDBITS(here.bits + 7);
+                        DROPBITS(here.bits);
                         len = 0;
                         copy = 11 + BITS(7);
                         DROPBITS(7);
@@ -955,40 +956,40 @@ int flush;
                 break;
             }
             for (;;) {
-                this = state->lencode[BITS(state->lenbits)];
-                if ((unsigned)(this.bits) <= bits) break;
+                here = state->lencode[BITS(state->lenbits)];
+                if ((unsigned)(here.bits) <= bits) break;
                 PULLBYTE();
             }
-            if (this.op && (this.op & 0xf0) == 0) {
-                last = this;
+            if (here.op && (here.op & 0xf0) == 0) {
+                last = here;
                 for (;;) {
-                    this = state->lencode[last.val +
+                    here = state->lencode[last.val +
                             (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
                     PULLBYTE();
                 }
                 DROPBITS(last.bits);
             }
-            DROPBITS(this.bits);
-            state->length = (unsigned)this.val;
-            if ((int)(this.op) == 0) {
-                Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ?
+            DROPBITS(here.bits);
+            state->length = (unsigned)here.val;
+            if ((int)(here.op) == 0) {
+                Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
                         "inflate:         literal '%c'\n" :
-                        "inflate:         literal 0x%02x\n", this.val));
+                        "inflate:         literal 0x%02x\n", here.val));
                 state->mode = LIT;
                 break;
             }
-            if (this.op & 32) {
+            if (here.op & 32) {
                 Tracevv((stderr, "inflate:         end of block\n"));
                 state->mode = TYPE;
                 break;
             }
-            if (this.op & 64) {
+            if (here.op & 64) {
                 strm->msg = (char *)"invalid literal/length code";
                 state->mode = BAD;
                 break;
             }
-            state->extra = (unsigned)(this.op) & 15;
+            state->extra = (unsigned)(here.op) & 15;
             state->mode = LENEXT;
         case LENEXT:
             if (state->extra) {
@@ -1000,28 +1001,28 @@ int flush;
             state->mode = DIST;
         case DIST:
             for (;;) {
-                this = state->distcode[BITS(state->distbits)];
-                if ((unsigned)(this.bits) <= bits) break;
+                here = state->distcode[BITS(state->distbits)];
+                if ((unsigned)(here.bits) <= bits) break;
                 PULLBYTE();
             }
-            if ((this.op & 0xf0) == 0) {
-                last = this;
+            if ((here.op & 0xf0) == 0) {
+                last = here;
                 for (;;) {
-                    this = state->distcode[last.val +
+                    here = state->distcode[last.val +
                             (BITS(last.bits + last.op) >> last.bits)];
-                    if ((unsigned)(last.bits + this.bits) <= bits) break;
+                    if ((unsigned)(last.bits + here.bits) <= bits) break;
                     PULLBYTE();
                 }
                 DROPBITS(last.bits);
             }
-            DROPBITS(this.bits);
-            if (this.op & 64) {
+            DROPBITS(here.bits);
+            if (here.op & 64) {
                 strm->msg = (char *)"invalid distance code";
                 state->mode = BAD;
                 break;
             }
-            state->offset = (unsigned)this.val;
-            state->extra = (unsigned)(this.op) & 15;
+            state->offset = (unsigned)here.val;
+            state->extra = (unsigned)(here.op) & 15;
             state->mode = DISTEXT;
         case DISTEXT:
             if (state->extra) {
@@ -1036,11 +1037,6 @@ int flush;
                 break;
             }
 #endif
-            if (state->offset > state->whave + out - left) {
-                strm->msg = (char *)"invalid distance too far back";
-                state->mode = BAD;
-                break;
-            }
             Tracevv((stderr, "inflate:         distance %u\n", state->offset));
             state->mode = MATCH;
         case MATCH:
@@ -1048,6 +1044,26 @@ int flush;
             copy = out - left;
             if (state->offset > copy) {         /* copy from window */
                 copy = state->offset - copy;
+                if (copy > state->whave) {
+                    if (state->sane) {
+                        strm->msg = (char *)"invalid distance too far back";
+                        state->mode = BAD;
+                        break;
+                    }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+                    Trace((stderr, "inflate.c too far\n"));
+                    copy -= state->whave;
+                    if (copy > state->length) copy = state->length;
+                    if (copy > left) copy = left;
+                    left -= copy;
+                    state->length -= copy;
+                    do {
+                        *put++ = 0;
+                    } while (--copy);
+                    if (state->length == 0) state->mode = LEN;
+                    break;
+#endif
+                }
                 if (copy > state->write) {
                     copy -= state->write;
                     from = state->window + (state->wsize - copy);
@@ -1366,3 +1382,20 @@ z_streamp source;
     dest->state = (struct internal_state FAR *)copy;
     return Z_OK;
 }
+
+int ZEXPORT inflateUndermine(strm, subvert)
+z_streamp strm;
+int subvert;
+{
+    struct inflate_state FAR *state;
+
+    if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR;
+    state = (struct inflate_state FAR *)strm->state;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+    state->sane = !subvert;
+    return Z_OK;
+#else
+    state->sane = 1;
+    return Z_DATA_ERROR;
+#endif
+}
diff --git a/support/inflate.h b/support/inflate.h
index 07bd3e7..d54a868 100644
--- a/support/inflate.h
+++ b/support/inflate.h
@@ -1,5 +1,5 @@
 /* inflate.h -- internal inflate state definition
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -73,7 +73,7 @@ typedef enum {
         CHECK -> LENGTH -> DONE
  */
 
-/* state maintained between inflate() calls.  Approximately 7K bytes. */
+/* state maintained between inflate() calls.  Approximately 10K bytes. */
 struct inflate_state {
     inflate_mode mode;          /* current inflate mode */
     int last;                   /* true if processing last block */
@@ -112,4 +112,5 @@ struct inflate_state {
     unsigned short lens[320];   /* temporary storage for code lengths */
     unsigned short work[288];   /* work area for code table building */
     code codes[ENOUGH];         /* space for code tables */
+    int sane;                   /* if false, allow invalid distance too far */
 };
diff --git a/support/inftrees.c b/support/inftrees.c
index 8a9c13f..fb8d843 100644
--- a/support/inftrees.c
+++ b/support/inftrees.c
@@ -1,5 +1,5 @@
 /* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2005 Mark Adler
+ * Copyright (C) 1995-2006 Mark Adler
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
+   " inflate 1.2.3.3 Copyright 1995-2006 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -50,7 +50,7 @@ unsigned short FAR *work;
     unsigned fill;              /* index for replicating entries */
     unsigned low;               /* low bits for current root entry */
     unsigned mask;              /* mask for low root bits */
-    code this;                  /* table entry for duplication */
+    code here;                  /* table entry for duplication */
     code FAR *next;             /* next available space in table */
     const unsigned short FAR *base;     /* base value table to use */
     const unsigned short FAR *extra;    /* extra bits table to use */
@@ -62,7 +62,7 @@ unsigned short FAR *work;
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 203};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -115,11 +115,11 @@ unsigned short FAR *work;
         if (count[max] != 0) break;
     if (root > max) root = max;
     if (max == 0) {                     /* no symbols to code at all */
-        this.op = (unsigned char)64;    /* invalid code marker */
-        this.bits = (unsigned char)1;
-        this.val = (unsigned short)0;
-        *(*table)++ = this;             /* make a table to force an error */
-        *(*table)++ = this;
+        here.op = (unsigned char)64;    /* invalid code marker */
+        here.bits = (unsigned char)1;
+        here.val = (unsigned short)0;
+        *(*table)++ = here;             /* make a table to force an error */
+        *(*table)++ = here;
         *bits = 1;
         return 0;     /* no symbols, but wait for decoding to report error */
     }
@@ -215,18 +215,18 @@ unsigned short FAR *work;
     /* process all codes and make table entries */
     for (;;) {
         /* create table entry */
-        this.bits = (unsigned char)(len - drop);
+        here.bits = (unsigned char)(len - drop);
         if ((int)(work[sym]) < end) {
-            this.op = (unsigned char)0;
-            this.val = work[sym];
+            here.op = (unsigned char)0;
+            here.val = work[sym];
         }
         else if ((int)(work[sym]) > end) {
-            this.op = (unsigned char)(extra[work[sym]]);
-            this.val = base[work[sym]];
+            here.op = (unsigned char)(extra[work[sym]]);
+            here.val = base[work[sym]];
         }
         else {
-            this.op = (unsigned char)(32 + 64);         /* end of block */
-            this.val = 0;
+            here.op = (unsigned char)(32 + 64);         /* end of block */
+            here.val = 0;
         }
 
         /* replicate for those indices with low len bits equal to huff */
@@ -235,7 +235,7 @@ unsigned short FAR *work;
         min = fill;                 /* save offset to next table */
         do {
             fill -= incr;
-            next[(huff >> drop) + fill] = this;
+            next[(huff >> drop) + fill] = here;
         } while (fill != 0);
 
         /* backwards increment the len-bit code huff */
@@ -295,20 +295,20 @@ unsigned short FAR *work;
        through high index bits.  When the current sub-table is filled, the loop
        drops back to the root table to fill in any remaining entries there.
      */
-    this.op = (unsigned char)64;                /* invalid code marker */
-    this.bits = (unsigned char)(len - drop);
-    this.val = (unsigned short)0;
+    here.op = (unsigned char)64;                /* invalid code marker */
+    here.bits = (unsigned char)(len - drop);
+    here.val = (unsigned short)0;
     while (huff != 0) {
         /* when done with sub-table, drop back to root table */
         if (drop != 0 && (huff & mask) != low) {
             drop = 0;
             len = root;
             next = *table;
-            this.bits = (unsigned char)len;
+            here.bits = (unsigned char)len;
         }
 
         /* put invalid code marker in table */
-        next[huff >> drop] = this;
+        next[huff >> drop] = here;
 
         /* backwards increment the len-bit code huff */
         incr = 1U << (len - 1);
diff --git a/support/trees.c b/support/trees.c
index 395e4e1..94f28bb 100644
--- a/support/trees.c
+++ b/support/trees.c
@@ -1,5 +1,6 @@
 /* trees.c -- output deflated data using Huffman coding
- * Copyright (C) 1995-2005 Jean-loup Gailly
+ * Copyright (C) 1995-2006 Jean-loup Gailly
+ * detect_data_type() function provided freely by Cosmin Truta, 2006
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -152,7 +153,7 @@ local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
                               int blcodes));
 local void compress_block OF((deflate_state *s, ct_data *ltree,
                               ct_data *dtree));
-local void set_data_type  OF((deflate_state *s));
+local int  detect_data_type OF((deflate_state *s));
 local unsigned bi_reverse OF((unsigned value, int length));
 local void bi_windup      OF((deflate_state *s));
 local void bi_flush       OF((deflate_state *s));
@@ -250,11 +251,13 @@ local void tr_static_init()
     if (static_init_done) return;
 
     /* For some embedded targets, global variables are not initialized: */
+#ifdef NO_INIT_GLOBAL_POINTERS
     static_l_desc.static_tree = static_ltree;
     static_l_desc.extra_bits = extra_lbits;
     static_d_desc.static_tree = static_dtree;
     static_d_desc.extra_bits = extra_dbits;
     static_bl_desc.extra_bits = extra_blbits;
+#endif
 
     /* Initialize the mapping length (0..255) -> length code (0..28) */
     length = 0;
@@ -931,8 +934,8 @@ void _tr_flush_block(s, buf, stored_len, eof)
     if (s->level > 0) {
 
         /* Check if the file is binary or text */
-        if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN)
-            set_data_type(s);
+        if (s->strm->data_type == Z_UNKNOWN)
+            s->strm->data_type = detect_data_type(s);
 
         /* Construct the literal and distance trees */
         build_tree(s, (tree_desc *)(&(s->l_desc)));
@@ -1118,24 +1121,45 @@ local void compress_block(s, ltree, dtree)
 }
 
 /* ===========================================================================
- * Set the data type to BINARY or TEXT, using a crude approximation:
- * set it to Z_TEXT if all symbols are either printable characters (33 to 255)
- * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise.
+ * Check if the data type is TEXT or BINARY, using the following algorithm:
+ * - TEXT if the two conditions below are satisfied:
+ *    a) There are no non-portable control characters belonging to the
+ *       "black list" (0..6, 14..25, 28..31).
+ *    b) There is at least one printable character belonging to the
+ *       "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
+ * - BINARY otherwise.
+ * - The following partially-portable control characters form a
+ *   "gray list" that is ignored in this detection algorithm:
+ *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
  * IN assertion: the fields Freq of dyn_ltree are set.
  */
-local void set_data_type(s)
+local int detect_data_type(s)
     deflate_state *s;
 {
+    /* black_mask is the bit mask of black-listed bytes
+     * set bits 0..6, 14..25, and 28..31
+     * 0xf3ffc07f = binary 11110011111111111100000001111111
+     */
+    unsigned long black_mask = 0xf3ffc07fUL;
     int n;
 
-    for (n = 0; n < 9; n++)
+    /* Check for non-textual ("black-listed") bytes. */
+    for (n = 0; n <= 31; n++, black_mask >>= 1)
+        if ((black_mask & 1) && (s->dyn_ltree[n].Freq != 0))
+            return Z_BINARY;
+
+    /* Check for textual ("white-listed") bytes. */
+    if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
+            || s->dyn_ltree[13].Freq != 0)
+        return Z_TEXT;
+    for (n = 32; n < LITERALS; n++)
         if (s->dyn_ltree[n].Freq != 0)
-            break;
-    if (n == 9)
-        for (n = 14; n < 32; n++)
-            if (s->dyn_ltree[n].Freq != 0)
-                break;
-    s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY;
+            return Z_TEXT;
+
+    /* There are no "black-listed" or "white-listed" bytes:
+     * this stream either is empty or has tolerated ("gray-listed") bytes only.
+     */
+    return Z_BINARY;
 }
 
 /* ===========================================================================
diff --git a/support/zconf.h b/support/zconf.h
index 03a9431..bfb62c1 100644
--- a/support/zconf.h
+++ b/support/zconf.h
@@ -1,5 +1,5 @@
 /* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -11,52 +11,115 @@
 /*
  * If you *really* need a unique prefix for all types and library functions,
  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
  */
-#ifdef Z_PREFIX
-#  define deflateInit_          z_deflateInit_
+#ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
+
+/* all linked symbols */
+#  define _dist_code            z__dist_code
+#  define _length_code          z__length_code
+#  define _tr_align             z__tr_align
+#  define _tr_flush_block       z__tr_flush_block
+#  define _tr_init              z__tr_init
+#  define _tr_stored_block      z__tr_stored_block
+#  define _tr_tally             z__tr_tally
+#  define adler32               z_adler32
+#  define adler32_combine       z_adler32_combine
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define crc32                 z_crc32
+#  define crc32_combine         z_crc32_combine
 #  define deflate               z_deflate
+#  define deflateBound          z_deflateBound
+#  define deflateCopy           z_deflateCopy
 #  define deflateEnd            z_deflateEnd
-#  define inflateInit_          z_inflateInit_
-#  define inflate               z_inflate
-#  define inflateEnd            z_inflateEnd
 #  define deflateInit2_         z_deflateInit2_
-#  define deflateSetDictionary  z_deflateSetDictionary
-#  define deflateCopy           z_deflateCopy
-#  define deflateReset          z_deflateReset
+#  define deflateInit_          z_deflateInit_
 #  define deflateParams         z_deflateParams
-#  define deflateBound          z_deflateBound
 #  define deflatePrime          z_deflatePrime
+#  define deflateReset          z_deflateReset
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateSetHeader      z_deflateSetHeader
+#  define deflateTune           z_deflateTune
+#  define deflate_copyright     z_deflate_copyright
+#  define get_crc_table         z_get_crc_table
+#  define gzclearerr            z_gzclearerr
+#  define gzclose               z_gzclose
+#  define gzdirect              z_gzdirect
+#  define gzdopen               z_gzdopen
+#  define gzeof                 z_gzeof
+#  define gzerror               z_gzerror
+#  define gzflush               z_gzflush
+#  define gzgetc                z_gzgetc
+#  define gzgets                z_gzgets
+#  define gzopen                z_gzopen
+#  define gzprintf              z_gzprintf
+#  define gzputc                z_gzputc
+#  define gzputs                z_gzputs
+#  define gzread                z_gzread
+#  define gzrewind              z_gzrewind
+#  define gzseek                z_gzseek
+#  define gzsetparams           z_gzsetparams
+#  define gztell                z_gztell
+#  define gzungetc              z_gzungetc
+#  define gzwrite               z_gzwrite
+#  define inflate               z_inflate
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define inflateBackInit_      z_inflateBackInit_
+#  define inflateCopy           z_inflateCopy
+#  define inflateEnd            z_inflateEnd
+#  define inflateGetHeader      z_inflateGetHeader
 #  define inflateInit2_         z_inflateInit2_
+#  define inflateInit_          z_inflateInit_
+#  define inflatePrime          z_inflatePrime
+#  define inflateReset          z_inflateReset
 #  define inflateSetDictionary  z_inflateSetDictionary
 #  define inflateSync           z_inflateSync
 #  define inflateSyncPoint      z_inflateSyncPoint
-#  define inflateCopy           z_inflateCopy
-#  define inflateReset          z_inflateReset
-#  define inflateBack           z_inflateBack
-#  define inflateBackEnd        z_inflateBackEnd
-#  define compress              z_compress
-#  define compress2             z_compress2
-#  define compressBound         z_compressBound
+#  define inflate_copyright     z_inflate_copyright
+#  define inflate_fast          z_inflate_fast
+#  define inflate_table         z_inflate_table
 #  define uncompress            z_uncompress
-#  define adler32               z_adler32
-#  define crc32                 z_crc32
-#  define get_crc_table         z_get_crc_table
 #  define zError                z_zError
+#  define z_errmsg              z_z_errmsg
+#  define zcalloc               z_zcalloc
+#  define zcfree                z_zcfree
+#  define zlibCompileFlags      z_zlibCompileFlags
+#  define zlibVersion           z_zlibVersion
 
+/* all zlib typedefs in zlib.h and zconf.h */
+#  define Byte                  z_Byte
+#  define Bytef                 z_Bytef
 #  define alloc_func            z_alloc_func
+#  define charf                 z_charf
 #  define free_func             z_free_func
+#  define gzFile                z_gzFile
+#  define gz_header             z_gz_header
+#  define gz_headerp            z_gz_headerp
 #  define in_func               z_in_func
+#  define intf                  z_intf
 #  define out_func              z_out_func
-#  define Byte                  z_Byte
 #  define uInt                  z_uInt
-#  define uLong                 z_uLong
-#  define Bytef                 z_Bytef
-#  define charf                 z_charf
-#  define intf                  z_intf
 #  define uIntf                 z_uIntf
+#  define uLong                 z_uLong
 #  define uLongf                z_uLongf
-#  define voidpf                z_voidpf
 #  define voidp                 z_voidp
+#  define voidp                 z_voidp
+#  define voidpc                z_voidpc
+#  define voidpc                z_voidpc
+#  define voidpf                z_voidpf
+#  define voidpf                z_voidpf
+#  define z_stream              z_z_stream
+#  define z_streamp             z_z_streamp
+
+/* all zlib structs in zlib.h and zconf.h */
+#  define gz_header_s           z_gz_header_s
+#  define internal_state        z_internal_state
+#  define z_stream_s            z_z_stream_s
+
 #endif
 
 #if defined(__MSDOS__) && !defined(MSDOS)
@@ -243,6 +306,10 @@
 #  endif
 #endif
 
+#ifdef HAVE_VISIBILITY_PRAGMA
+#  define ZEXTERN __attribute__((visibility ("default"))) extern
+#endif
+
 #ifndef ZEXTERN
 #  define ZEXTERN extern
 #endif
@@ -284,14 +351,11 @@ typedef uLong FAR uLongf;
    typedef Byte       *voidp;
 #endif
 
-#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
-#  include <sys/types.h> /* for off_t */
-#  include <unistd.h>    /* for SEEK_* and off_t */
-#  ifdef VMS
-#    include <unixio.h>   /* for off_t */
-#  endif
-#  define z_off_t off_t
-#endif
+/* not needed
+ * This is created by zlib's configure script to define off_t
+#include "zlibdefs.h"
+*/
+
 #ifndef SEEK_SET
 #  define SEEK_SET        0       /* Seek from beginning of file.  */
 #  define SEEK_CUR        1       /* Seek from current position.  */
@@ -307,9 +371,6 @@ typedef uLong FAR uLongf;
 
 #if defined(__MVS__)
 #  define NO_vsnprintf
-#  ifdef FAR
-#    undef FAR
-#  endif
 #endif
 
 /* MVS linker does not support external names larger than 8 bytes */
@@ -329,4 +390,9 @@ typedef uLong FAR uLongf;
 #   pragma map(inflate_copyright,"INCOPY")
 #endif
 
+#ifdef WINDOWS
+#define NO_FSEEKO 1
+#define NO_vsnprintf 1
+#endif
 #endif /* ZCONF_H */
+
diff --git a/support/zlib-helper.c b/support/zlib-helper.c
new file mode 100644
index 0000000..5e11cb3
--- /dev/null
+++ b/support/zlib-helper.c
@@ -0,0 +1,220 @@
+/*
+ * Used by System.IO.Compression.DeflateStream
+ *
+ * Author:
+ *   Gonzalo Paniagua Javier (gonzalo at novell.com)
+ *
+ * (c) Copyright 2009 Novell, Inc.
+ */
+#include <config.h>
+#if defined (HAVE_ZLIB)
+#include <zlib.h>
+#else
+#include "zlib.h"
+#endif
+
+#include <glib.h>
+#include <string.h>
+#include <stdlib.h>
+
+#ifndef TRUE
+#define FALSE 0
+#define TRUE 1
+#endif
+
+#define BUFFER_SIZE 4096
+#define ARGUMENT_ERROR -10
+#define IO_ERROR -11
+
+typedef gint (*read_write_func) (guchar *buffer, gint length, void *gchandle);
+struct _ZStream {
+	z_stream *stream;
+	guchar *buffer;
+	read_write_func func;
+	void *gchandle;
+	guchar compress;
+	guchar eof;
+};
+typedef struct _ZStream ZStream;
+
+ZStream *CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle);
+gint CloseZStream (ZStream *zstream);
+gint Flush (ZStream *stream);
+gint ReadZStream (ZStream *stream, guchar *buffer, gint length);
+gint WriteZStream (ZStream *stream, guchar *buffer, gint length);
+
+static void *
+z_alloc (void *opaque, gsize nitems, gsize item_size)
+{
+	return g_malloc0 (nitems * item_size);
+}
+
+static void
+z_free (void *opaque, void *ptr)
+{
+	g_free (ptr);
+}
+
+ZStream *
+CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle)
+{
+	z_stream *z;
+	gint retval;
+	ZStream *result;
+
+	if (func == NULL)
+		return NULL;
+
+#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204)
+	/* Older versions of zlib do not support raw deflate or gzip */
+	return NULL;
+#endif
+
+	z = g_new0 (z_stream, 1);
+	if (compress) {
+		retval = deflateInit2 (z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gzip ? 31 : -15, 8, Z_DEFAULT_STRATEGY);
+	} else {
+		retval = inflateInit2 (z, gzip ? 31 : -15);
+	}
+
+	if (retval != Z_OK) {
+		g_free (z);
+		return NULL;
+	}
+	z->zalloc = z_alloc;
+	z->zfree = z_free;
+	result = g_new0 (ZStream, 1);
+	result->stream = z;
+	result->func = func;
+	result->gchandle = gchandle;
+	result->compress = compress;
+	result->buffer = g_new (guchar, BUFFER_SIZE);
+	return result;
+}
+
+gint
+CloseZStream (ZStream *zstream)
+{
+	gint status;
+	gint flush_status;
+
+	if (zstream == NULL)
+		return ARGUMENT_ERROR;
+
+	status = 0;
+	if (zstream->compress) {
+		if (zstream->stream->total_out) {
+			status = deflate (zstream->stream, Z_FINISH);
+			flush_status = Flush (zstream);
+			if (status == Z_OK || status == Z_STREAM_END)
+				status = flush_status;
+		}
+		deflateEnd (zstream->stream);
+	} else {
+		inflateEnd (zstream->stream);
+	}
+	g_free (zstream->buffer);
+	g_free (zstream->stream);
+	memset (zstream, 0, sizeof (ZStream));
+	g_free (zstream);
+	return status;
+}
+
+static gint
+write_to_managed (ZStream *stream)
+{
+	gint n;
+	z_stream *zs;
+
+	zs = stream->stream;
+	if (zs->avail_out != BUFFER_SIZE) {
+		n = stream->func (stream->buffer, BUFFER_SIZE - zs->avail_out, stream->gchandle);
+		zs->next_out = stream->buffer;
+		zs->avail_out =  BUFFER_SIZE;
+		if (n < 0)
+			return IO_ERROR;
+	}
+	return 0;
+}
+
+gint
+Flush (ZStream *stream)
+{
+	if (!stream->compress)
+		return 0;
+
+	return write_to_managed (stream);
+}
+
+gint
+ReadZStream (ZStream *stream, guchar *buffer, gint length)
+{
+	gint n;
+	gint status;
+	z_stream *zs;
+
+	if (stream == NULL || buffer == NULL || length < 0)
+		return ARGUMENT_ERROR;
+
+	if (stream->eof)
+		return 0;
+
+	zs = stream->stream;
+	zs->next_out = buffer;
+	zs->avail_out = length;
+	while (zs->avail_out > 0) {
+		if (zs->avail_in == 0) {
+			n = stream->func (stream->buffer, BUFFER_SIZE, stream->gchandle);
+			if (n <= 0) {
+				stream->eof = TRUE;
+				break;
+			}
+			zs->next_in = stream->buffer;
+			zs->avail_in = n;
+		}
+
+		status = inflate (stream->stream, Z_SYNC_FLUSH);
+		if (status == Z_STREAM_END) {
+			stream->eof = TRUE;
+			break;
+		} else if (status != Z_OK) {
+			return status;
+		}
+	}
+	return length - zs->avail_out;
+}
+
+gint
+WriteZStream (ZStream *stream, guchar *buffer, gint length)
+{
+	gint n;
+	gint status;
+	z_stream *zs;
+
+	if (stream == NULL || buffer == NULL || length < 0)
+		return ARGUMENT_ERROR;
+
+	if (stream->eof)
+		return IO_ERROR;
+
+	zs = stream->stream;
+	zs->next_in = buffer;
+	zs->avail_in = length;
+	while (zs->avail_in > 0) {
+		if (zs->avail_out == 0) {
+			zs->next_out = stream->buffer;
+			zs->avail_out = BUFFER_SIZE;
+		}
+		status = deflate (stream->stream, Z_SYNC_FLUSH);
+		if (status != Z_OK && status != Z_STREAM_END)
+			return status;
+
+		if (zs->avail_out == 0) {
+			n = write_to_managed (stream);
+			if (n < 0)
+				return n;
+		}
+	}
+	return length;
+}
+
diff --git a/support/zlib.h b/support/zlib.h
index 0228179..ab2f11b 100644
--- a/support/zlib.h
+++ b/support/zlib.h
@@ -1,7 +1,7 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.3, July 18th, 2005
+  version 1.2.3.3, October 2nd, 2006
 
-  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+  Copyright (C) 1995-2006 Jean-loup Gailly and Mark Adler
 
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
@@ -37,8 +37,11 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.2.3"
-#define ZLIB_VERNUM 0x1230
+#define ZLIB_VERSION "1.2.3.3"
+#define ZLIB_VERNUM 0x1233
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 3
 
 /*
      The 'zlib' compression library provides in-memory compression and
@@ -353,10 +356,14 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
 
      inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
    memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
-   version assumed by the caller.  msg is set to null if there is no error
-   message. inflateInit does not perform any decompression apart from reading
-   the zlib header if present: this will be done by inflate().  (So next_in and
-   avail_in may be modified, but next_out and avail_out are unchanged.)
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message. inflateInit does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.)  The current
+   implementation of inflateInit() does not process any header information --
+   that is deferred until inflate() is called.
 */
 
 
@@ -645,9 +652,10 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
                                        uLong sourceLen));
 /*
      deflateBound() returns an upper bound on the compressed size after
-   deflation of sourceLen bytes.  It must be called after deflateInit()
-   or deflateInit2().  This would be used to allocate an output buffer
-   for deflation in a single pass, and so would be called before deflate().
+   deflation of sourceLen bytes.  It must be called after deflateInit() or
+   deflateInit2(), and after deflateSetHeader(), if used.  This would be used
+   to allocate an output buffer for deflation in a single pass, and so would be
+   called before deflate().
 */
 
 ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
@@ -726,11 +734,15 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
    a crc32 instead of an adler32.
 
      inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
-   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
-   is set to null if there is no error message.  inflateInit2 does not perform
-   any decompression apart from reading the zlib header if present: this will
-   be done by inflate(). (So next_in and avail_in may be modified, but next_out
-   and avail_out are unchanged.)
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+   invalid, such as a null pointer to the structure.  msg is set to null if
+   there is no error message. inflateInit2 does not perform any decompression
+   apart from possibly reading the zlib header if present: actual decompression
+   will be done by inflate().  (So next_in and avail_in may be modified, but
+   next_out and avail_out are unused and unchanged.)  The current
+   implementation of inflateInit2() does not process any header information --
+   that is deferred until inflate() is called.
 */
 
 ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
@@ -1065,8 +1077,9 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
 
 typedef voidp gzFile;
 
-ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
 /*
+ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
+
      Opens a gzip (.gz) file for reading or writing. The mode parameter
    is as in fopen ("rb" or "wb") but can also include a compression level
    ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
@@ -1180,9 +1193,10 @@ ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
    degrade compression.
 */
 
+/*
 ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
                                       z_off_t offset, int whence));
-/*
+
       Sets the starting position for the next gzread or gzwrite on the
    given compressed file. The offset represents a number of bytes in the
    uncompressed data stream. The whence parameter is defined as in lseek(2);
@@ -1205,8 +1219,9 @@ ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
    gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
 */
 
-ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
 /*
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+
      Returns the starting position for the next gzread or gzwrite on the
    given compressed file. This position represents a number of bytes in the
    uncompressed data stream.
@@ -1230,7 +1245,8 @@ ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
 /*
      Flushes all pending output if necessary, closes the compressed file
    and deallocates all the (de)compression state. The return value is the zlib
-   error number (see function gzerror below).
+   error number.  Note that once file is close, you cannot call gzerror with
+   file, since its structures have been deallocated.
 */
 
 ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
@@ -1240,6 +1256,9 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
    error occurred in the file system and not in the compression library,
    errnum is set to Z_ERRNO and the application may consult errno
    to get the exact error code.
+
+   The application must not modify the returned string and future calls to
+   this function may invalidate the returned string.
 */
 
 ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
@@ -1273,9 +1292,10 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
      if (adler != original_adler) error();
 */
 
+/*
 ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
                                           z_off_t len2));
-/*
+
      Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
    and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
    each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
@@ -1298,9 +1318,9 @@ ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
      if (crc != original_crc) error();
 */
 
+/*
 ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
 
-/*
      Combine two CRC-32 check values into one.  For two sequences of bytes,
    seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
    calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
@@ -1339,16 +1359,40 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
         inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
 #define inflateBackInit(strm, windowBits, window) \
         inflateBackInit_((strm), (windowBits), (window), \
-        ZLIB_VERSION, sizeof(z_stream))
+                                            ZLIB_VERSION, sizeof(z_stream))
+
+#ifdef _LARGEFILE64_SOURCE
+   ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+   ZEXTERN off64_t ZEXPORT gzseek64 OF((gzFile, off64_t, int));
+   ZEXTERN off64_t ZEXPORT gztell64 OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, off64_t));
+   ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, off64_t));
+#endif
 
+/* Mono: disable this. We don't use it and makes compilation fail
+#if _FILE_OFFSET_BITS == 64
+#  define gzopen gzopen64
+#  define gzseek gzseek64
+#  define gztell gztell64
+#  define adler32_combine adler32_combine64
+#  define crc32_combine crc32_combine64
+#else
+*/
+   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+/*#endif*/
 
 #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
     struct internal_state {int dummy;}; /* hack for buggy compilers */
 #endif
 
 ZEXTERN const char   * ZEXPORT zError           OF((int));
-ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
 ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
 
 #ifdef __cplusplus
 }
diff --git a/support/zlib_macros.c b/support/zlib_macros.c
deleted file mode 100644
index d022e04..0000000
--- a/support/zlib_macros.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Helper routines to use Zlib
- *
- * Author:
- *   Christopher Lahey (clahey at ximian.co)
- *
- * (C) 2004 Novell, Inc.
- */
-#include <config.h>
-#if defined (HAVE_ZLIB)
-#include <zlib.h>
-#else
-#include "zlib.h"
-#endif
-
-#include <stdlib.h>
-
-z_stream *
-create_z_stream(int compress, unsigned char gzip)
-{
-	z_stream *z;
-	int retval;
-
-#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204)
-	/* Older versions of zlib do not support raw deflate or gzip */
-	return NULL;
-#endif
-
-	z = malloc (sizeof (z_stream));
-	z->next_in = Z_NULL;
-	z->avail_in = 0;
-	z->next_out = Z_NULL;
-	z->avail_out = 0;
-	z->zalloc = Z_NULL;
-	z->zfree = Z_NULL;
-	z->opaque = NULL;
-	if (compress) {
-		retval = deflateInit2 (z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gzip ? 31 : -15, 8, Z_DEFAULT_STRATEGY);
-	} else {
-		retval = inflateInit2 (z, gzip ? 31 : -15);
-	}
-
-	if (retval == Z_OK)
-		return z;
-
-	free (z);
-	return NULL;
-}
-
-void
-free_z_stream(z_stream *z, int compress)
-{
-	if (compress) {
-		deflateEnd (z);
-	} else {
-		inflateEnd (z);
-	}
-	free (z);
-}
-
-void
-z_stream_set_next_in(z_stream *z, unsigned char *next_in)
-{
-	z->next_in = next_in;
-}
-
-void
-z_stream_set_avail_in(z_stream *z, int avail_in)
-{
-	z->avail_in = avail_in;
-}
-
-int
-z_stream_get_avail_in(z_stream *z)
-{
-	return z->avail_in;
-}
-
-void
-z_stream_set_next_out(z_stream *z, unsigned char *next_out)
-{
-	z->next_out = next_out;
-}
-
-void
-z_stream_set_avail_out(z_stream *z, int avail_out)
-{
-	z->avail_out = avail_out;
-}
-
-int
-z_stream_deflate (z_stream *z, int flush, unsigned char *next_out, int *avail_out)
-{
-	int ret_val;
-
-	z->next_out = next_out;
-	z->avail_out = *avail_out;
-
-	ret_val = deflate (z, flush);
-
-	*avail_out = z->avail_out;
-
-	return ret_val;
-}
-
-int
-z_stream_inflate (z_stream *z, int *avail_out)
-{
-	int ret_val;
-
-	z->avail_out = *avail_out;
-
-	ret_val = inflate (z, Z_NO_FLUSH);
-
-	*avail_out = z->avail_out;
-
-	return ret_val;
-}
diff --git a/support/zutil.h b/support/zutil.h
index b7d5eff..32e9c89 100644
--- a/support/zutil.h
+++ b/support/zutil.h
@@ -1,5 +1,5 @@
 /* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * Copyright (C) 1995-2006 Jean-loup Gailly.
  * For conditions of distribution and use, see copyright notice in zlib.h
  */
 
@@ -23,7 +23,7 @@
 #  include <string.h>
 #  include <stdlib.h>
 #endif
-#ifdef NO_ERRNO_H
+#if defined(NO_ERRNO_H) || defined(_WIN32_WCE)
 #   ifdef _WIN32_WCE
       /* The Microsoft C Run-Time Library for Windows CE doesn't have
        * errno.  We define it as a global variable to simplify porting.
@@ -34,9 +34,7 @@
 #   endif
     extern int errno;
 #else
-#  ifndef _WIN32_WCE
-#    include <errno.h>
-#  endif
+#   include <errno.h>
 #endif
 
 #ifndef local
@@ -151,7 +149,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #  define fdopen(fd,mode) NULL /* No fdopen() */
 #endif
 
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
 #  if defined(_WIN32_WCE)
 #    define fdopen(fd,mode) NULL /* No fdopen() */
 #    ifndef _PTRDIFF_T_DEFINED
@@ -163,6 +161,12 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #  endif
 #endif
 
+#if defined(__BORLANDC__)
+#pragma warn -8004
+#pragma warn -8008
+#pragma warn -8066
+#endif
+
         /* common defaults */
 
 #ifndef OS_CODE
@@ -173,6 +177,12 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
 #  define F_OPEN(name, mode) fopen((name), (mode))
 #endif
 
+#ifdef _LARGEFILE64_SOURCE
+#  define F_OPEN64(name, mode) fopen64((name), (mode))
+#else
+#  define F_OPEN64(name, mode) fopen((name), (mode))
+#endif
+
          /* functions */
 
 #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 8964105..3ee7e51 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = tools
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -81,10 +84,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -94,14 +93,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -119,6 +117,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -127,6 +126,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -138,11 +138,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -171,8 +174,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -212,6 +214,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -235,6 +238,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = locale-builder
diff --git a/tools/locale-builder/Makefile.in b/tools/locale-builder/Makefile.in
index e588b1a..e125964 100644
--- a/tools/locale-builder/Makefile.in
+++ b/tools/locale-builder/Makefile.in
@@ -35,7 +35,10 @@ target_triplet = @target@
 subdir = tools/locale-builder
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,10 +72,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -82,14 +81,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -107,6 +105,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -115,6 +114,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -126,11 +126,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -159,8 +162,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -200,6 +202,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -223,6 +226,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 MCS = mcs
diff --git a/web/Makefile.in b/web/Makefile.in
index 6130a4e..c656524 100644
--- a/web/Makefile.in
+++ b/web/Makefile.in
@@ -36,7 +36,10 @@ subdir = web
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/libtool.m4 \
+	$(top_srcdir)/ltoptions.m4 $(top_srcdir)/ltsugar.m4 \
+	$(top_srcdir)/ltversion.m4 $(top_srcdir)/lt~obsolete.m4 \
+	$(top_srcdir)/nls.m4 $(top_srcdir)/po.m4 \
 	$(top_srcdir)/progtest.m4 $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -70,10 +73,6 @@ CFLAGS = @CFLAGS@
 CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
@@ -83,14 +82,13 @@ DOLT_BASH = @DOLT_BASH@
 DSYMUTIL = @DSYMUTIL@
 DTRACE = @DTRACE@
 DTRACEFLAGS = @DTRACEFLAGS@
-ECHO = @ECHO@
+DUMPBIN = @DUMPBIN@
 ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
+FGREP = @FGREP@
 GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
 GLIB_CFLAGS = @GLIB_CFLAGS@
 GLIB_LIBS = @GLIB_LIBS@
@@ -108,6 +106,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INTL = @INTL@
+LD = @LD@
 LDFLAGS = @LDFLAGS@
 LIBC = @LIBC@
 LIBGC_CFLAGS = @LIBGC_CFLAGS@
@@ -116,6 +115,7 @@ LIBGC_STATIC_LIBS = @LIBGC_STATIC_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
 LN_S = @LN_S@
 LTCOMPILE = @LTCOMPILE@
 LTCXXCOMPILE = @LTCXXCOMPILE@
@@ -127,11 +127,14 @@ MONO_DL_NEED_USCORE = @MONO_DL_NEED_USCORE@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
+NM = @NM@
 NMEDIT = @NMEDIT@
 OBJDUMP = @OBJDUMP@
 OBJEXT = @OBJEXT@
 OPROFILE_CFLAGS = @OPROFILE_CFLAGS@
 OPROFILE_LIBS = @OPROFILE_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
 PACKAGE_NAME = @PACKAGE_NAME@
@@ -160,8 +163,7 @@ abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
 ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
 am__include = @am__include@
 am__leading_dot = @am__leading_dot@
 am__quote = @am__quote@
@@ -201,6 +203,7 @@ libmono_ldflags = @libmono_ldflags@
 libsuffix = @libsuffix@
 localedir = @localedir@
 localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
 mandir = @mandir@
 mcs_topdir = @mcs_topdir@
 mcs_topdir_from_srcdir = @mcs_topdir_from_srcdir@
@@ -224,6 +227,7 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 WEB_FILES = \
diff --git a/web/devel-faq b/web/devel-faq
index c5b7a75..2bc1abd 100644
--- a/web/devel-faq
+++ b/web/devel-faq
@@ -179,7 +179,7 @@ benefits:
 This mechanism works very well for GNOME and other projects.
 
 Q: Should I use any of the special RCS keywords like $Id: devel-faq 36980 2004-12-03 01:08:33Z benm $, $Author: benm $,
-   $Date: 2004-12-03 01:08:33 +0000 (Fri, 03 Dec 2004) $, or $Revision: 1.1 $?
+   $Date: 2004-12-02 18:08:33 -0700 (Thu, 02 Dec 2004) $, or $Revision: 1.1 $?
 
 A: Please avoid using those in the source code in the CVS.  They
    are not really useful, and they cause a lot of conflicts when

-- 
mono



More information about the Pkg-mono-svn-commits mailing list