gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19189 - in monkey/branches/MonkeyBacktracking: . monkey mo


From: gnunet
Subject: [GNUnet-SVN] r19189 - in monkey/branches/MonkeyBacktracking: . monkey monkey/m4 monkey/src monkey/src/include monkey/src/monkey
Date: Tue, 17 Jan 2012 14:42:55 +0100

Author: safey
Date: 2012-01-17 14:42:55 +0100 (Tue, 17 Jan 2012)
New Revision: 19189

Added:
   monkey/branches/MonkeyBacktracking/monkey/
   monkey/branches/MonkeyBacktracking/monkey/bin/
   monkey/branches/MonkeyBacktracking/monkey/bug_assertion_failure.db
   monkey/branches/MonkeyBacktracking/monkey/configure.ac
   monkey/branches/MonkeyBacktracking/monkey/contrib/
   monkey/branches/MonkeyBacktracking/monkey/src/include/gettext.h
   monkey/branches/MonkeyBacktracking/monkey/src/include/plibc.h
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_bug_assertion_failure.db
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.db
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_xml_writer.h
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c
Removed:
   monkey/branches/MonkeyBacktracking/monkey/configure.ac
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
   
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.db
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h
   monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h
Modified:
   monkey/branches/MonkeyBacktracking/monkey/m4/libtool.m4
   monkey/branches/MonkeyBacktracking/monkey/m4/ltoptions.m4
   monkey/branches/MonkeyBacktracking/monkey/m4/ltversion.m4
   monkey/branches/MonkeyBacktracking/monkey/m4/lt~obsolete.m4
Log:
Major changes in the data structure of Monkey's Action API.

Copied: monkey/branches/MonkeyBacktracking/monkey/bug_assertion_failure.db 
(from rev 18263, monkey/bug_assertion_failure.db)
===================================================================
Deleted: monkey/branches/MonkeyBacktracking/monkey/configure.ac
===================================================================
--- monkey/configure.ac 2011-10-05 10:26:47 UTC (rev 17195)
+++ monkey/branches/MonkeyBacktracking/monkey/configure.ac      2012-01-17 
13:42:55 UTC (rev 19189)
@@ -1,284 +0,0 @@
-# This file is part of GNUnet.
-# (C) 2001-2011 Christian Grothoff (and other contributing authors)
-#
-# GNUnet 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, or (at your
-# option) any later version.
-#
-# GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-#
-#
-# Process this file with autoconf to produce a configure script.
-#
-AC_PREREQ(2.61)
-AC_INIT([monkey],[0.0.0],address@hidden)
-AM_INIT_AUTOMAKE([monkey], [0.0.0])
-AM_CONFIG_HEADER(monkey_config.h)
-
-AH_TOP([#define _GNU_SOURCE  1])
-
-AC_ISC_POSIX
-AC_PROG_AWK
-AC_PROG_CC
-
-AC_PROG_MKDIR_P
-AC_PROG_CPP
-AC_PROG_INSTALL
-AC_PROG_LN_S
-AC_PROG_MAKE_SET
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_HEADER_STDC
-AC_CANONICAL_HOST
-
-# dynamic libraries/plugins
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-
-AC_SYS_LARGEFILE
-AC_FUNC_FSEEKO
-
-CFLAGS="-Wall $CFLAGS"
-# use '-fno-strict-aliasing', but only if the compiler can take it
-if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
-then
- CFLAGS="-fno-strict-aliasing $CFLAGS"
-fi
-
-
-# Check system type
-case "$host_os" in
-*darwin* | *rhapsody* | *macosx*)
-     AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
-     CFLAGS="-no-cpp-precomp $CFLAGS"
-     LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS"
-     ;;
-linux*)
-     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
-     ;;
-freebsd*)
-     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
-     ;;
-openbsd*)
-     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
-     ;;
-netbsd*)
-     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
-     AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
-     ;;
-*solaris*)
-     AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
-     AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
-     build_target="solaris"
-     ;;
-*arm-linux*)
-     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
-     ;;
-*cygwin*)
-     AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
-     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
-     AC_CHECK_LIB(intl, gettext)
-     LDFLAGS="$LDFLAGS -no-undefined"
-     build_target="cygwin"
-     ;;
-*mingw*)
-     AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
-     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
-     AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
-     AC_CHECK_LIB(intl, gettext)
-     LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32"
-     CFLAGS="-mms-bitfields $CFLAGS"
-     build_target="mingw"
-     ;;
-*)
-     AC_MSG_RESULT(Unrecognised OS $host_os)
-     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
-;;
-esac
-
-AM_CONDITIONAL(MINGW,   test "$build_target" = "mingw")
-
-# check for gettext
-AM_GNU_GETTEXT_VERSION([0.17])
-AM_GNU_GETTEXT([external])
-
-AC_CHECK_HEADERS([errno.h stdio.h unistd.h locale.h sys/stat.h sys/types.h 
langinfo.h libintl.h unistd.h stddef.h argz.h sys/socket.h netinet/in.h 
stdarg.h])
-
-# test for GNUnet core
-gnunet=0
-AC_MSG_CHECKING(for GNUnet core)
-AC_ARG_WITH(gnunet,
-   [  --with-gnunet=PFX       Base of GNUnet installation],
-   [AC_MSG_RESULT([$with_gnunet])
-    case $with_gnunet in
-      no)
-        ;;
-      yes)
-        LDFLAGS="-L/usr/lib $LDFLAGS"
-        CPPFLAGS="-I/usr/include $CPPFLAGS"
-        AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
-          AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
-            gnunet=1))
-        ;;
-      *)
-        LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
-        CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"
-        AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
-          AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
-            EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH"
-            gnunet=1))
-        ;;
-    esac
-   ],
-   [AC_MSG_RESULT([--with-gnunet not specified])
-    LDFLAGS="-L/usr/lib $LDFLAGS"
-    CPPFLAGS="-I/usr/include $CPPFLAGS"
-    AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
-     AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
-      gnunet=1))])
-
-# if GNUnet was not found, try in /usr/local
-if test "$gnunet" != 1
-then
-AC_MSG_CHECKING(for GNUnet core in /usr/local)
-with_gnunet=/usr/local
-  LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
-  CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"
-  AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
-  AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
-  EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH"
-  gnunet=1))
-fi
-
-if test "$gnunet" != 1
-then
- AC_MSG_ERROR([monkey requires GNUnet])
-fi
-AC_CHECK_HEADERS([gnunet/gnunet_core_service.h],,
-                 AC_MSG_ERROR([compiling monkey requires GNUnet core headers]))
-
-SAVELIBS=$LIBS
-AC_CHECK_LIB(gnunetutil,GNUNET_log,,
-             AC_MSG_ERROR([monkey requires libgnunetutil]))
-AC_CHECK_LIB(gnunetcore,GNUNET_CORE_connect,,
-             AC_MSG_ERROR([monkey requires libgnunetcore]))
-LIBS=$SAVELIBS
-
-# openssl
-openssl=0
-AC_MSG_CHECKING([for openssl])
-AC_ARG_WITH(openssl,
-   [  --with-openssl=PFX   base of openssl installation],
-   [AC_MSG_RESULT([$with_openssl])
-    case $with_openssl in
-      no)
-        ;;
-      yes)
-        AC_CHECK_HEADERS([openssl/ssl.h],
-            AC_CHECK_LIB([ssl], [SSL_new],
-            openssl=1))
-        ;;
-      *)
-        LDFLAGS="-L$with_openssl/lib $LDFLAGS"
-        CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
-        AC_CHECK_HEADERS([openssl/ssl.h],
-            AC_CHECK_LIB([ssl], [SSL_new],
-              EXT_LIB_PATH="-L$with_openssl/lib $EXT_LIB_PATH"
-              openssl=1))
-        ;;
-    esac
-   ],
-   [AC_MSG_RESULT([--with-openssl not specified])
-    AC_CHECK_HEADERS([openssl/ssl.h],
-        AC_CHECK_LIB([ssl], [SSL_new],
-          openssl=1))])
-AM_CONDITIONAL(HAVE_OPENSSL, test x$openssl = x1)
-AC_DEFINE_UNQUOTED([HAVE_OPENSSL], $openssl, [We have openssl])
-
-
-
-# libesmtp
-esmtp=0
-AC_MSG_CHECKING([for libesmtp])
-AC_ARG_WITH(esmtp,
-   [  --with-esmtp=PFX        base of libesmtp installation],
-   [AC_MSG_RESULT([$with_esmtp])
-    case $with_esmtp in
-      no)
-        ;;
-      yes)
-        AC_CHECK_HEADERS(libesmtp.h,
-          AC_CHECK_LIB([esmtp], [smtp_start_session],
-            esmtp=1))
-        ;;
-      *)
-        LDFLAGS="-L$with_esmtp/lib $LDFLAGS"
-        CPPFLAGS="-I$with_esmtp/include $CPPFLAGS"
-        AC_CHECK_HEADERS(libesmtp.h,
-          AC_CHECK_LIB([esmtp], [smtp_start_session],
-            EXT_LIB_PATH="-L$with_esmtp/lib $EXT_LIB_PATH"
-              esmtp=1))
-        ;;
-    esac
-   ],
-   [AC_MSG_RESULT([--with-esmtp not specified])
-    AC_CHECK_HEADERS(libesmtp.h,
-      AC_CHECK_LIB([esmtp], [smtp_start_session],
-          esmtp=1))])
-AM_CONDITIONAL(HAVE_ESMTP, test x$esmtp = x1)
-AC_DEFINE_UNQUOTED([HAVE_ESMTP], $esmtp, [We have libesmtp])
-# restore LIBS
-LIBS=$SAVE_LIBS
-
-
-# gcov compilation
-AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
-AC_ARG_ENABLE([coverage], 
-              AS_HELP_STRING([--enable-coverage],
-                             [compile the library with code coverage support]),
-              [use_gcov=${enableval}], 
-              [use_gcov=no])
-AC_MSG_RESULT($use_gcov)
-AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
-
-
-
-
-
-# should 'make check' run tests?
-AC_MSG_CHECKING(whether to run tests)
-AC_ARG_ENABLE([testruns],
-   [AS_HELP_STRING([--disable-testruns], [disable running tests on make check 
(default is YES)])],
-   [enable_tests_run=${enableval}],
-   [enable_tests_run=yes])
-AC_MSG_RESULT($enable_test_run)
-AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
-
-
-
-AC_SUBST(GNUNETEXT_CFLAGS)
-AC_SUBST(GNUNETEXT_LIBS)
-AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing 
read-only architecture-independent data])
-
-# Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h.
-packagesrcdir=`cd $srcdir && pwd`
-AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
-
-AC_OUTPUT([
-Makefile
-src/Makefile
-src/include/Makefile
-src/monkey/Makefile
-])

Copied: monkey/branches/MonkeyBacktracking/monkey/configure.ac (from rev 18263, 
monkey/configure.ac)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/configure.ac                      
        (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/configure.ac      2012-01-17 
13:42:55 UTC (rev 19189)
@@ -0,0 +1,358 @@
+# This file is part of GNUnet.
+# (C) 2001-2011 Christian Grothoff (and other contributing authors)
+#
+# GNUnet 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, or (at your
+# option) any later version.
+#
+# GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+#
+# Process this file with autoconf to produce a configure script.
+#
+AC_PREREQ(2.61)
+AC_INIT([monkey],[0.0.0],address@hidden)
+AM_INIT_AUTOMAKE([monkey], [0.0.0])
+AM_CONFIG_HEADER(monkey_config.h)
+
+AH_TOP([#define _GNU_SOURCE  1])
+
+AC_ISC_POSIX
+AC_PROG_AWK
+AC_PROG_CC
+
+AC_PROG_MKDIR_P
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_CANONICAL_HOST
+
+# dynamic libraries/plugins
+AC_DISABLE_STATIC
+AC_PROG_LIBTOOL
+
+AC_SYS_LARGEFILE
+AC_FUNC_FSEEKO
+
+CFLAGS="-Wall $CFLAGS"
+# use '-fno-strict-aliasing', but only if the compiler can take it
+if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
+then
+ CFLAGS="-fno-strict-aliasing $CFLAGS"
+fi
+
+
+# Check system type
+case "$host_os" in
+*darwin* | *rhapsody* | *macosx*)
+     AC_DEFINE_UNQUOTED(OSX,1,[This is an OS X system])
+     CFLAGS="-no-cpp-precomp $CFLAGS"
+     LDFLAGS="-flat_namespace -undefined suppress $LDFLAGS"
+     ;;
+linux*)
+     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
+     ;;
+freebsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
+     ;;
+openbsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
+     ;;
+netbsd*)
+     AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
+     AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
+     ;;
+*solaris*)
+     AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
+     AC_DEFINE_UNQUOTED(_REENTRANT,1,[Need with solaris or errno doesnt work])
+     build_target="solaris"
+     ;;
+*arm-linux*)
+     AC_DEFINE_UNQUOTED(LINUX,1,[This is a Linux system])
+     ;;
+*cygwin*)
+     AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a Cygwin system])
+     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
+     AC_CHECK_LIB(intl, gettext)
+     LDFLAGS="$LDFLAGS -no-undefined"
+     build_target="cygwin"
+     ;;
+*mingw*)
+     AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
+     AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
+     AC_DEFINE_UNQUOTED(_WIN32,1,[This is a Windows system])
+     AC_CHECK_LIB(intl, gettext)
+     LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols -lws2_32"
+     CFLAGS="-mms-bitfields $CFLAGS"
+     build_target="mingw"
+     ;;
+*)
+     AC_MSG_RESULT(Unrecognised OS $host_os)
+     AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
+;;
+esac
+
+AM_CONDITIONAL(MINGW,   test "$build_target" = "mingw")
+
+# check for gettext
+AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT([external])
+
+AC_CHECK_HEADERS([errno.h stdio.h unistd.h locale.h sys/stat.h sys/types.h 
langinfo.h libintl.h unistd.h stddef.h argz.h sys/socket.h netinet/in.h 
stdarg.h])
+
+# test for GNUnet core
+gnunet=0
+AC_MSG_CHECKING(for GNUnet core)
+AC_ARG_WITH(gnunet,
+   [  --with-gnunet=PFX       Base of GNUnet installation],
+   [AC_MSG_RESULT([$with_gnunet])
+    case $with_gnunet in
+      no)
+        ;;
+      yes)
+        LDFLAGS="-L/usr/lib $LDFLAGS"
+        CPPFLAGS="-I/usr/include $CPPFLAGS"
+        AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+          AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
+            gnunet=1))
+        ;;
+      *)
+        LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
+        CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"
+        AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+          AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
+            EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH"
+            gnunet=1))
+        ;;
+    esac
+   ],
+   [AC_MSG_RESULT([--with-gnunet not specified])
+    LDFLAGS="-L/usr/lib $LDFLAGS"
+    CPPFLAGS="-I/usr/include $CPPFLAGS"
+    AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+     AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
+      gnunet=1))])
+
+# if GNUnet was not found, try in /usr/local
+if test "$gnunet" != 1
+then
+AC_MSG_CHECKING(for GNUnet core in /usr/local)
+with_gnunet=/usr/local
+  LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
+  CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"
+  AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_lib.h],
+  AC_CHECK_LIB([gnunetutil], [GNUNET_xfree_],
+  EXT_LIB_PATH="-L$with_gnunet/lib $EXT_LIB_PATH"
+  gnunet=1))
+fi
+
+if test "$gnunet" != 1
+then
+ AC_MSG_ERROR([monkey requires GNUnet])
+fi
+AC_CHECK_HEADERS([gnunet/gnunet_core_service.h],,
+                 AC_MSG_ERROR([compiling monkey requires GNUnet core headers]))
+
+SAVELIBS=$LIBS
+       AC_CHECK_LIB(gnunetutil,GNUNET_log_setup,,
+             AC_MSG_ERROR([monkey requires libgnunetutil]))
+AC_CHECK_LIB(gnunetcore,GNUNET_CORE_connect,,
+             AC_MSG_ERROR([monkey requires libgnunetcore]))
+LIBS=$SAVELIBS
+
+# libgcrypt
+gcrypt=0
+AM_PATH_LIBGCRYPT(1.2.0, gcrypt=1)
+AC_CHECK_DECLS([gcry_mpi_lshift], [], [], [[#include <gcrypt.h>]])
+
+if test $gcrypt = 0
+then
+  AC_MSG_ERROR([GNUnet needs libgcrypt])
+fi
+
+extra_logging=GNUNET_NO
+AC_ARG_ENABLE([logging],
+   AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. 
Possible values: yes,no,verbose,veryverbose ('yes' is the default)]),
+   [AS_IF([test "x$enableval" = "xyes"], [],
+          [test "x$enableval" = "xno"], 
[AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])],
+          [test "x$enableval" = "xverbose"], [extra_logging=GNUNET_YES]
+          [test "x$enableval" = "xveryverbose"], 
[extra_logging=\(GNUNET_YES+1\)])
+   ], [])
+AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging 
is enabled, 2 for very verbose extra logging, 0 otherwise])
+
+if test $build = $target
+then
+AC_MSG_CHECKING([for working HMAC])
+AC_LANG_PUSH(C)
+LIBS="$LIBS $LIBGCRYPT_LIBS"
+CFLAGS="$CFLAGS $LIBGCRYPT_CFLAGS"
+AC_RUN_IFELSE(
+  [AC_LANG_PROGRAM([#include <gcrypt.h>], [[
+        gcry_md_hd_t mac;
+      
+        unsigned char data[] = { 0xbf, 0x16, 0x6e, 0x46, 0x3a, 0x6c, 0xf3, 
0x93, 0xa7, 0x72,
+            0x11, 0xa1, 0xdc, 0x0b, 0x07, 0xdb, 0x1a, 0x5e, 0xd9, 0xb9, 0x81, 
0xbe,
+            0xea, 0xe4, 0x31, 0x5f, 0x24, 0xff, 0xfe, 0x50, 0x8a, 0xde };
+        unsigned char key[] = { 0xfc, 0x62, 0x76, 0x35 };
+        unsigned char result[] = {0xa2, 0xb, 0x1, 0xd9, 0xc0, 0x8b, 0x5a, 
0x12, 0x80,
+            0xd5, 0x50, 0x12, 0x8e, 0xd0, 0x5b, 0xb6, 0x5c, 0x87, 0x24, 0xe2, 
0xd0,
+            0xd2, 0xaf, 0x63, 0xae, 0xd1, 0xd6, 0x64, 0x14, 0xe3, 0x6e, 0x61, 
0x5b,
+            0xd, 0xba, 0x17, 0x7d, 0xd3, 0x10, 0xb1, 0x37, 0x41, 0x91, 0x7d, 
0xeb,
+            0x1, 0x4d, 0x71, 0xe8, 0x59, 0x71, 0x42, 0x8e, 0xd6, 0xf3, 0x29, 
0x3b,
+            0x90, 0xf2, 0xd1, 0xaf, 0x65, 0x1e, 0xb3};
+      
+        if (!gcry_check_version (GCRYPT_VERSION))
+          return 1;
+  
+        gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
+        gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
+  
+        if (gcry_md_open(&mac, GCRY_MD_SHA512, GCRY_MD_FLAG_HMAC) != 
GPG_ERR_NO_ERROR)
+          return 2;
+  
+        gcry_md_setkey (mac, key, sizeof (key));
+        gcry_md_write (mac, data, sizeof (data));
+  
+        if (memcmp(gcry_md_read (mac, 0), result, gcry_md_get_algo_dlen 
(gcry_md_get_algo (mac))) != 0)
+          return 3;
+  
+        gcry_md_close (mac);
+  
+        return 0;
+    ]])],
+  [AC_MSG_RESULT([yes])],
+  [
+   if test $? = 3
+   then
+     AC_MSG_FAILURE([HMAC test vector does not match. This is a known problem 
with libgcrypt 1.2.2 on Windows and fixed in 1.4.6.])
+   else
+     AC_MSG_FAILURE([HMAC test failed])
+   fi
+  ])
+AC_LANG_POP(C)
+fi     # $build = $target
+
+
+
+# openssl
+openssl=0
+AC_MSG_CHECKING([for openssl])
+AC_ARG_WITH(openssl,
+   [  --with-openssl=PFX   base of openssl installation],
+   [AC_MSG_RESULT([$with_openssl])
+    case $with_openssl in
+      no)
+        ;;
+      yes)
+        AC_CHECK_HEADERS([openssl/ssl.h],
+            AC_CHECK_LIB([ssl], [SSL_new],
+            openssl=1))
+        ;;
+      *)
+        LDFLAGS="-L$with_openssl/lib $LDFLAGS"
+        CPPFLAGS="-I$with_openssl/include $CPPFLAGS"
+        AC_CHECK_HEADERS([openssl/ssl.h],
+            AC_CHECK_LIB([ssl], [SSL_new],
+              EXT_LIB_PATH="-L$with_openssl/lib $EXT_LIB_PATH"
+              openssl=1))
+        ;;
+    esac
+   ],
+   [AC_MSG_RESULT([--with-openssl not specified])
+    AC_CHECK_HEADERS([openssl/ssl.h],
+        AC_CHECK_LIB([ssl], [SSL_new],
+          openssl=1))])
+AM_CONDITIONAL(HAVE_OPENSSL, test x$openssl = x1)
+AC_DEFINE_UNQUOTED([HAVE_OPENSSL], $openssl, [We have openssl])
+
+
+
+# libesmtp
+esmtp=0
+AC_MSG_CHECKING([for libesmtp])
+AC_ARG_WITH(esmtp,
+   [  --with-esmtp=PFX        base of libesmtp installation],
+   [AC_MSG_RESULT([$with_esmtp])
+    case $with_esmtp in
+      no)
+        ;;
+      yes)
+        AC_CHECK_HEADERS(libesmtp.h,
+          AC_CHECK_LIB([esmtp], [smtp_start_session],
+            esmtp=1))
+        ;;
+      *)
+        LDFLAGS="-L$with_esmtp/lib $LDFLAGS"
+        CPPFLAGS="-I$with_esmtp/include $CPPFLAGS"
+        AC_CHECK_HEADERS(libesmtp.h,
+          AC_CHECK_LIB([esmtp], [smtp_start_session],
+            EXT_LIB_PATH="-L$with_esmtp/lib $EXT_LIB_PATH"
+              esmtp=1))
+        ;;
+    esac
+   ],
+   [AC_MSG_RESULT([--with-esmtp not specified])
+    AC_CHECK_HEADERS(libesmtp.h,
+      AC_CHECK_LIB([esmtp], [smtp_start_session],
+          esmtp=1))])
+AM_CONDITIONAL(HAVE_ESMTP, test x$esmtp = x1)
+AC_DEFINE_UNQUOTED([HAVE_ESMTP], $esmtp, [We have libesmtp])
+# restore LIBS
+LIBS=$SAVE_LIBS
+
+
+# gcov compilation
+AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
+AC_ARG_ENABLE([coverage], 
+              AS_HELP_STRING([--enable-coverage],
+                             [compile the library with code coverage support]),
+              [use_gcov=${enableval}], 
+              [use_gcov=no])
+AC_MSG_RESULT($use_gcov)
+AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
+
+
+
+
+
+# should 'make check' run tests?
+AC_MSG_CHECKING(whether to run tests)
+AC_ARG_ENABLE([testruns],
+   [AS_HELP_STRING([--disable-testruns], [disable running tests on make check 
(default is YES)])],
+   [enable_tests_run=${enableval}],
+   [enable_tests_run=yes])
+AC_MSG_RESULT($enable_test_run)
+AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
+
+
+
+AC_SUBST(GNUNETEXT_CFLAGS)
+AC_SUBST(GNUNETEXT_LIBS)
+AC_DEFINE_DIR([PACKAGE_DATA], [datarootdir], [The directory for installing 
read-only architecture-independent data])
+
+# Set PACKAGE_SOURCE_DIR in gnunet_gtk_config.h.
+packagesrcdir=`cd $srcdir && pwd`
+AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}", [source dir])
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+src/include/Makefile
+src/monkey/Makefile
+])

Modified: monkey/branches/MonkeyBacktracking/monkey/m4/libtool.m4
===================================================================
--- monkey/m4/libtool.m4        2011-10-05 10:26:47 UTC (rev 17195)
+++ monkey/branches/MonkeyBacktracking/monkey/m4/libtool.m4     2012-01-17 
13:42:55 UTC (rev 19189)
@@ -1,8 +1,7 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,8 +10,7 @@
 
 m4_define([_LT_COPYING], [dnl
 #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-#                 Inc.
+#                 2006, 2007, 2008 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 #   This file is part of GNU Libtool.
@@ -39,7 +37,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ])
 
-# serial 57 LT_INIT
+# serial 56 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -68,7 +66,6 @@
 # ------------------
 AC_DEFUN([LT_INIT],
 [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
 AC_BEFORE([$0], [LTDL_INIT])dnl
@@ -85,8 +82,6 @@
 AC_REQUIRE([LTOBSOLETE_VERSION])dnl
 m4_require([_LT_PROG_LTMAIN])dnl
 
-_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
-
 dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
@@ -123,7 +118,7 @@
     *) break;;
   esac
 done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
 ])
 
 
@@ -143,9 +138,6 @@
 m4_defun([_LT_SETUP],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
-
 _LT_DECL([], [host_alias], [0], [The host system])dnl
 _LT_DECL([], [host], [0])dnl
 _LT_DECL([], [host_os], [0])dnl
@@ -168,13 +160,10 @@
 dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
 m4_require([_LT_CMD_RELOAD])dnl
 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_WITH_SYSROOT])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
 # See if we are running on zsh, and set the options which allow our
@@ -190,6 +179,7 @@
 _LT_CHECK_OBJDIR
 
 m4_require([_LT_TAG_COMPILER])dnl
+_LT_PROG_ECHO_BACKSLASH
 
 case $host_os in
 aix3*)
@@ -203,6 +193,23 @@
   ;;
 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
@@ -243,28 +250,6 @@
 ])# _LT_SETUP
 
 
-# _LT_PREPARE_SED_QUOTE_VARS
-# --------------------------
-# Define a few sed substitution that help us do robust quoting.
-m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
-[# Backslashify 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'
-])
-
 # _LT_PROG_LTMAIN
 # ---------------
 # Note that this code is called both from `configure', and `config.status'
@@ -423,7 +408,7 @@
 # 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 "$][$1" | $SED "$delay_single_quote_subst"`'])
+[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
 
 
 # _LT_CONFIG_STATUS_DECLARATIONS
@@ -433,7 +418,7 @@
 # embedded single quotes properly.  In configure, this macro expands
 # each variable declared with _LT_DECL (and _LT_TAGDECL) into:
 #
-#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+#    <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)])])])
@@ -532,20 +517,12 @@
 LTCFLAGS='$LTCFLAGS'
 compiler='$compiler_DEFAULT'
 
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-\$[]1
-_LTECHO_EOF'
-}
-
 # Quote evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED 
\\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e 
\\"\\\$sed_quote_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -556,9 +533,9 @@
 # Double-quote double-evaled strings.
 for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
-    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e 
\\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e 
\\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e 
\\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e 
\\"\\\$delay_variable_subst\\"\\\`\\\\\\""
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -566,38 +543,16 @@
     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_GENERATED_FILE_INIT(FILE, [COMMENT])
-# ------------------------------------
-# Generate a child script FILE with all initialization necessary to
-# reuse the environment learned by the parent script, and make the
-# file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
-# macro, additional text can be appended to FILE to form the body of
-# the child script.  The macro ends with non-zero status if the
-# file could not be fully written (such as if the disk is full).
-m4_ifdef([AS_INIT_GENERATED],
-[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
-[m4_defun([_LT_GENERATED_FILE_INIT],
-[m4_require([AS_PREPARE])]dnl
-[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
-[lt_write_fail=0
-cat >$1 <<_ASEOF || lt_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-$2
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$1 <<\_ASEOF || lt_write_fail=1
-AS_SHELL_SANITIZE
-_AS_PREPARE
-exec AS_MESSAGE_FD>&1
-_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
-m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
 # ---------
@@ -607,11 +562,20 @@
 AC_DEFUN([LT_OUTPUT],
 [: ${CONFIG_LT=./config.lt}
 AC_MSG_NOTICE([creating $CONFIG_LT])
-_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
-[# Run this file to recreate a libtool stub with the current configuration.])
+cat >"$CONFIG_LT" <<_LTEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate a libtool stub with the current configuration.
 
-cat >>"$CONFIG_LT" <<\_LTEOF
 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
@@ -637,7 +601,7 @@
 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
 configured by $[0], generated by m4_PACKAGE_STRING.
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+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."
 
@@ -682,13 +646,15 @@
 # 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.
-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)
+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
 
 
@@ -751,12 +717,15 @@
   # 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)
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
 
-  _LT_PROG_REPLACE_SHELLFNS
+  _LT_PROG_XSI_SHELLFNS
 
-   mv -f "$cfgfile" "$ofile" ||
+  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"
 ],
@@ -862,13 +831,11 @@
 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)])
-AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
 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], [])
-dnl AC_DEFUN([AC_LIBTOOL_RC], [])
 
 
 # _LT_TAG_COMPILER
@@ -973,31 +940,6 @@
        [lt_cv_ld_exported_symbols_list=no])
        LDFLAGS="$save_LDFLAGS"
     ])
-    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
-      [lt_cv_ld_force_load=no
-      cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
-      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
-      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
-      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
-      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
-      cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
-      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c 
-Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
-      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c 
-Wl,-force_load,./libconftest.a 2>conftest.err
-      _lt_result=$?
-      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && 
$GREP forced_load conftest 2>&1 >/dev/null; then
-       lt_cv_ld_force_load=yes
-      else
-       cat conftest.err >&AS_MESSAGE_LOG_FD
-      fi
-        rm -f conftest.err libconftest.a conftest conftest.c
-        rm -rf conftest.dSYM
-    ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
       _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
@@ -1025,7 +967,7 @@
     else
       _lt_dar_export_syms='~$NMEDIT -s 
$output_objdir/${libname}-symbols.expsym ${lib}'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test "$DSYMUTIL" != ":"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1045,11 +987,7 @@
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do 
test  -n \"$conv\" && new_convenience=\"$new_convenience 
${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-  else
-    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
-  fi
+  _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
@@ -1057,7 +995,7 @@
      *) _lt_dar_can_shared=$GCC ;;
   esac
   if test "$_lt_dar_can_shared" = "yes"; then
-    output_verbose_link_cmd=func_echo_all
+    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}"
@@ -1073,142 +1011,203 @@
   fi
 ])
 
-# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
-# ----------------------------------
+# _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.
-# Store the results from the different compilers for each TAGNAME.
-# Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
-  aix_libpath=$lt_cv_aix_libpath
-else
-  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
-  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
-  lt_aix_libpath_sed='[
-      /Import File Strings/,/^$/ {
-         /^0/ {
-             s/^0  *\([^ ]*\) *$/\1/
-             p
-         }
-      }]'
-  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`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 "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 
2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-  fi],[])
-  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
-  fi
-  ])
-  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
-fi
+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],
-[m4_divert_text([M4SH-INIT], [$1
-])])# _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
 # -----------------------
-# Find how we can fake an echo command that does not interpret backslash.
-# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# 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],
-[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+[_LT_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
 
-AC_MSG_CHECKING([how to print strings])
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
-   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
-  ECHO='printf %s\n'
+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
-  # Use this function as a fallback that always works.
-  func_fallback_echo ()
-  {
-    eval 'cat <<_LTECHO_EOF
-$[]1
-_LTECHO_EOF'
-  }
-  ECHO='func_fallback_echo'
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
 fi
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*" 
-}
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<_LT_EOF
+[$]*
+_LT_EOF
+  exit 0
+fi
 
-case "$ECHO" in
-  printf*) AC_MSG_RESULT([printf]) ;;
-  print*) AC_MSG_RESULT([print -r]) ;;
-  *) AC_MSG_RESULT([cat]) ;;
-esac
+# 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
 
-m4_ifdef([_AS_DETECT_SUGGESTED],
-[_AS_DETECT_SUGGESTED([
-  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
-    
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-    PATH=/empty FPATH=/empty; export PATH FPATH
-    test "X`printf %s $ECHO`" = "X$ECHO" \
-      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+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
 
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
+  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"
 
-# _LT_WITH_SYSROOT
-# ----------------
-AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
-AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
-[], [with_sysroot=no])
+    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=:
 
-dnl lt_sysroot will always be passed unquoted.  We quote it here
-dnl in case the user passed a directory name.
-lt_sysroot=
-case ${with_sysroot} in #(
- yes)
-   if test "$GCC" = yes; then
-     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
-   fi
-   ;; #(
- /*)
-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
-   ;; #(
- no|'')
-   ;; #(
- *)
-   AC_MSG_RESULT([${with_sysroot}])
-   AC_MSG_ERROR([The sysroot must be an absolute path.])
-   ;;
-esac
+         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
 
- AC_MSG_RESULT([${lt_sysroot:-no}])
-_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+         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],
@@ -1237,7 +1236,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  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
@@ -1355,47 +1354,14 @@
 ])# _LT_ENABLE_LOCK
 
 
-# _LT_PROG_AR
-# -----------
-m4_defun([_LT_PROG_AR],
-[AC_CHECK_TOOLS(AR, [ar], false)
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
-
-AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
-  [lt_cv_ar_at_file=no
-   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
-     [echo conftest.$ac_objext > conftest.lst
-      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
-       # Ensure the archiver fails upon bogus file names.
-       rm -f conftest.$ac_objext libconftest.a
-       AC_TRY_EVAL([lt_ar_try])
-       if test "$ac_status" -ne 0; then
-          lt_cv_ar_at_file=@
-        fi
-      fi
-      rm -f conftest.* libconftest.a
-     ])
-  ])
-
-if test "x$lt_cv_ar_at_file" = xno; then
-  archiver_list_spec=
-else
-  archiver_list_spec=$lt_cv_ar_at_file
-fi
-_LT_DECL([], [archiver_list_spec], [1],
-  [How to feed a file listing to the archiver])
-])# _LT_PROG_AR
-
-
 # _LT_CMD_OLD_ARCHIVE
 # -------------------
 m4_defun([_LT_CMD_OLD_ARCHIVE],
-[_LT_PROG_AR
+[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=:
@@ -1422,19 +1388,10 @@
   esac
   old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
-
-case $host_os in
-  darwin*)
-    lock_old_archive_extraction=yes ;;
-  *)
-    lock_old_archive_extraction=no ;;
-esac
 _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_DECL([], [lock_old_archive_extraction], [0],
-    [Whether to use a lock for old archive extraction])
 ])# _LT_CMD_OLD_ARCHIVE
 
 
@@ -1459,15 +1416,15 @@
    -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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (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:$LINENO: \$? = $ac_status" >&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 "$_lt_compiler_boilerplate" | $SED '/^$/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
@@ -1507,7 +1464,7 @@
      if test -s conftest.err; then
        # Append any errors to the config.log.
        cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/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
@@ -1570,11 +1527,6 @@
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  mint*)
-    # On MiNT this can take a long time and run out of memory.
-    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.
@@ -1639,8 +1591,8 @@
       # 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"`func_fallback_echo "$teststring$teststring" 
2>/dev/null` \
-                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+      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`
@@ -1691,7 +1643,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-[#line $LINENO "configure"
+[#line __oline__ "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -1732,13 +1684,7 @@
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
-   correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || 
(__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
+void fnord() { int i=42;}
 int main ()
 {
   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -1747,11 +1693,7 @@
   if (self)
     {
       if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else
-        {
-         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
-          else puts (dlerror ());
-       }
+      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
       /* dlclose (self); */
     }
   else
@@ -1927,16 +1869,16 @@
    -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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (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:$LINENO: \$? = $ac_status" >&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 "$_lt_compiler_boilerplate" | $SED '/^$/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_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
@@ -2095,7 +2037,6 @@
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
        [], [
@@ -2104,23 +2045,16 @@
     darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
     *) lt_awk_arg="/^libraries:/" ;;
   esac
-  case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
-  esac
-  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e 
"s/^libraries://" -e $lt_sed_strip_eq`
-  case $lt_search_path_spec in
-  *\;*)
+  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 's/;/ /g'`
-    ;;
-  *)
-    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 
"s/$PATH_SEPARATOR/ /g"`
-    ;;
-  esac
+    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=
@@ -2133,7 +2067,7 @@
        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;
@@ -2153,13 +2087,7 @@
   if (lt_foo != "") { lt_freq[[lt_foo]]++; }
   if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
 }'`
-  # AWK program above erroneously prepends '/' to C:/dos/paths
-  # for these hosts.
-  case $host_os in
-    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
-  esac
-  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
 else
   sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi])
@@ -2247,7 +2175,7 @@
   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=`func_echo_all "$lib" | $SED 
'\''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'
+    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
   ;;
@@ -2278,9 +2206,8 @@
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$cc_basename in
-  yes,*)
-    # gcc
+  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}`~
@@ -2301,83 +2228,36 @@
     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}'
-m4_if([$1], [],[
-      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      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
-    dynamic_linker='Win32 ld.exe'
     ;;
 
-  *,cl*)
-    # Native MSVC
-    libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
-
-    case $build_os in
-    mingw*)
-      sys_lib_search_path_spec=
-      lt_save_ifs=$IFS
-      IFS=';'
-      for lt_path in $LIB
-      do
-        IFS=$lt_save_ifs
-        # Let DOS variable expansion print the short 8.3 style file name.
-        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do 
@echo %~si"`
-        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
-      done
-      IFS=$lt_save_ifs
-      # Convert to MSYS style.
-      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 
's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
-      ;;
-    cygwin*)
-      # Convert to unix form, then to dos form, then back to unix form
-      # but this time dos style (no spaces!) so that the unix form looks
-      # like /cygdrive/c/PROGRA~1:/cygdr...
-      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
-      sys_lib_search_path_spec=`cygpath --path --dos 
"$sys_lib_search_path_spec" 2>/dev/null`
-      sys_lib_search_path_spec=`cygpath --path --unix 
"$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
-      ;;
-    *)
-      sys_lib_search_path_spec="$LIB"
-      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; 
then
-        # It is most probably a Windows format PATH.
-        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
-      # FIXME: find the short name or the path components, as spaces are
-      # common. (e.g. "Program Files" -> "PROGRA~1")
-      ;;
-    esac
-
-    # 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'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $RM \$dlpath'
-    shlibpath_overrides_runpath=yes
-    dynamic_linker='Win32 link.exe'
-    ;;
-
   *)
-    # Assume MSVC wrapper
     library_names_spec='${libname}`echo ${release} | $SED -e 
's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    dynamic_linker='Win32 ld.exe'
     ;;
   esac
+  dynamic_linker='Win32 ld.exe'
   # FIXME: first we should search . and the directory the executable is in
   shlibpath_var=PATH
   ;;
@@ -2461,23 +2341,9 @@
   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
   ;;
 
-haiku*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  dynamic_linker="$host_os runtime_loader"
-  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=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib 
/boot/system/lib'
-  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.
@@ -2520,10 +2386,8 @@
     soname_spec='${libname}${release}${shared_ext}$major'
     ;;
   esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
   postinstall_cmds='chmod 555 $lib'
-  # or fails outright, so override atomically:
-  install_override_mode=555
   ;;
 
 interix[[3-9]]*)
@@ -2590,21 +2454,16 @@
   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
-  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
-    [lt_cv_shlibpath_overrides_runpath=no
-    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],
-        [lt_cv_shlibpath_overrides_runpath=yes])])
-    LDFLAGS=$save_LDFLAGS
-    libdir=$save_libdir
-    ])
-  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_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
@@ -2613,7 +2472,7 @@
 
   # 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;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
 
@@ -2858,8 +2717,6 @@
     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([], [install_override_mode], [1],
-    [Permission mode override for installation of shared libraries])
 _LT_DECL([], [postinstall_cmds], [2],
     [Command to use after installation of a shared archive])
 _LT_DECL([], [postuninstall_cmds], [2],
@@ -2972,7 +2829,6 @@
 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
@@ -3094,11 +2950,6 @@
 esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
-  cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
-      reload_cmds=false
-    fi
-    ;;
   darwin*)
     if test "$GCC" = yes; then
       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -3107,8 +2958,8 @@
     fi
     ;;
 esac
-_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_TAGDECL([], [reload_cmds], [2])dnl
+_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_DECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
@@ -3160,18 +3011,16 @@
   # 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.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  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
-    # Keep this pattern in sync with the one in func_win32_libid.
-    lt_cv_deplibs_check_method='file_magic file format 
(pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_deplibs_check_method='file_magic file format 
pei*-i386(.*architecture: i386)?'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
 
-cegcc*)
+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'
@@ -3201,10 +3050,6 @@
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-haiku*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
 hpux10.20* | hpux11*)
   lt_cv_file_magic_cmd=/usr/bin/file
   case $host_cpu in
@@ -3213,11 +3058,11 @@
     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])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC 
[0-9]\.[0-9]']
+    [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_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
@@ -3317,21 +3162,6 @@
   ;;
 esac
 ])
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
-  case $host_os in
-  mingw* | pw32*)
-    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
-      want_nocaseglob=yes
-    else
-      file_magic_glob=`echo 
aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e 
"s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
-    fi
-    ;;
-  esac
-fi
-
 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
@@ -3339,11 +3169,7 @@
 _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_DECL([], [file_magic_glob], [1],
-    [How to find potential files when deplibs_check_method = "file_magic"])
-_LT_DECL([], [want_nocaseglob], [1],
-    [Find potential files using nocaseglob when deplibs_check_method = 
"file_magic"])
+    [Command to use when deplibs_check_method == "file_magic"])
 ])# _LT_CHECK_MAGIC_METHOD
 
 
@@ -3400,19 +3226,7 @@
   NM="$lt_cv_path_NM"
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$DUMPBIN"; then :
-    # Let the user override the test.
-  else
-    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
-    *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
-      ;;
-    *)
-      DUMPBIN=:
-      ;;
-    esac
-  fi
+  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
   AC_SUBST([DUMPBIN])
   if test "$DUMPBIN" != ":"; then
     NM="$DUMPBIN"
@@ -3425,13 +3239,13 @@
 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:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (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:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" 
>&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:$LINENO: output\"" >&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"
@@ -3446,68 +3260,7 @@
 dnl AC_DEFUN([AM_PROG_NM], [])
 dnl AC_DEFUN([AC_PROG_NM], [])
 
-# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-# --------------------------------
-# how to determine the name of the shared library
-# associated with a specific link library.
-#  -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-m4_require([_LT_DECL_DLLTOOL])
-AC_CACHE_CHECK([how to associate runtime and link libraries],
-lt_cv_sharedlib_from_linklib_cmd,
-[lt_cv_sharedlib_from_linklib_cmd='unknown'
 
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
-  case `$DLLTOOL --help 2>&1` in
-  *--identify-strict*)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
-    ;;
-  *)
-    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
-    ;;
-  esac
-  ;;
-*)
-  # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
-  ;;
-esac
-])
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
-    [Command to associate shared and link libraries])
-])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
-
-
-# _LT_PATH_MANIFEST_TOOL
-# ----------------------
-# locate the manifest tool
-m4_defun([_LT_PATH_MANIFEST_TOOL],
-[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], 
[lt_cv_path_mainfest_tool],
-  [lt_cv_path_mainfest_tool=no
-  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
-  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
-  cat conftest.err >&AS_MESSAGE_LOG_FD
-  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
-    lt_cv_path_mainfest_tool=yes
-  fi
-  rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
-  MANIFEST_TOOL=:
-fi
-_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
-])# _LT_PATH_MANIFEST_TOOL
-
-
 # LT_LIB_M
 # --------
 # check for math library
@@ -3515,7 +3268,7 @@
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 LIBM=
 case $host in
-*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
@@ -3543,12 +3296,7 @@
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
 if test "$GCC" = yes; then
-  case $cc_basename in
-  nvcc*)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler 
-fno-builtin' ;;
-  *)
-    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
-  esac
+  _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,
@@ -3565,7 +3313,6 @@
 m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
 AC_REQUIRE([LT_PATH_LD])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -3633,8 +3380,8 @@
 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'"
+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=
@@ -3670,7 +3417,6 @@
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    
]]\($symcode$symcode*\)[[       ]][[    
]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
   fi
-  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ 
__gnu_lto/d'"
 
   # Check to see that the pipe works correctly.
   pipe_works=no
@@ -3692,7 +3438,7 @@
   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
+    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"
@@ -3704,18 +3450,6 @@
       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
        if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
          cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  
*/
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
-   relocations are performed -- see ld's documentation on pseudo-relocs.  */
-# define LT@&address@hidden
-#elif defined(__osf__)
-/* This system does not cope well with relocations in const data.  */
-# define LT@&address@hidden
-#else
-# define LT@&address@hidden const
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -3727,7 +3461,7 @@
          cat <<_LT_EOF >> conftest.$ac_ext
 
 /* The mapping between symbol names and symbols.  */
-LT@&address@hidden struct {
+const struct {
   const char *name;
   void       *address;
 }
@@ -3753,15 +3487,15 @@
 _LT_EOF
          # Now try linking the two files.
          mv conftest.$ac_objext conftstm.$ac_objext
-         lt_globsym_save_LIBS=$LIBS
-         lt_globsym_save_CFLAGS=$CFLAGS
+         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_globsym_save_LIBS
-         CFLAGS=$lt_globsym_save_CFLAGS
+         LIBS="$lt_save_LIBS"
+         CFLAGS="$lt_save_CFLAGS"
        else
          echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
        fi
@@ -3794,13 +3528,6 @@
   AC_MSG_RESULT(ok)
 fi
 
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-  nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep 'address@hidden' >/dev/null; then
-  nm_file_list_spec='@'
-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],
@@ -3811,8 +3538,6 @@
 _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_DECL([], [nm_file_list_spec], [1],
-    [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
 
 
@@ -3824,6 +3549,7 @@
 _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
@@ -3874,11 +3600,6 @@
       # DJGPP does not support shared libraries at all
       _LT_TAGVAR(lt_prog_compiler_pic, $1)=
       ;;
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
     interix[[3-9]]*)
       # Interix 3.x gcc -fpic/-fPIC options generate broken code.
       # Instead, we relocate shared libraries at runtime.
@@ -3928,12 +3649,6 @@
          ;;
        esac
        ;;
-      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).
-       m4_if([$1], [GCJ], [],
-         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
-       ;;
       dgux*)
        case $cc_basename in
          ec++*)
@@ -4023,8 +3738,8 @@
            _LT_TAGVAR(lt_prog_compiler_pic, $1)=
            _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
            ;;
-         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
-           # IBM XL 8.0, 9.0 on PPC and BlueGene
+         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'
@@ -4086,7 +3801,7 @@
        ;;
       solaris*)
        case $cc_basename in
-         CC* | sunCC*)
+         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'
@@ -4190,12 +3905,6 @@
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
       ;;
 
-    haiku*)
-      # PIC is the default for Haiku.
-      # The "-static" flag exists, but is broken.
-      _LT_TAGVAR(lt_prog_compiler_static, $1)=
-      ;;
-
     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
@@ -4238,13 +3947,6 @@
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
     esac
-
-    case $cc_basename in
-    nvcc*) # Cuda Compiler Driver 2.2
-      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
-      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
-      ;;
-    esac
   else
     # PORTME Check for flag to pass linker flags through the system compiler.
     case $host_os in
@@ -4308,13 +4010,7 @@
        _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
        _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
        ;;
-      nagfor*)
-       # NAG Fortran compiler
-       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
-       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-       ;;
-      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+      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,'
@@ -4326,26 +4022,26 @@
         # All Alpha code is PIC.
         _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
         ;;
-      xl* | bgxl* | bgf* | mpixl*)
-       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+      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\ F* | *Sun*Fortran*)
-         # 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)=''
-         ;;
        *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
@@ -4376,7 +4072,7 @@
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+      f77* | f90* | f95*)
        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
       *)
        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
@@ -4433,12 +4129,10 @@
     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, 
$1)@&address@hidden([$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])
 
-AC_CACHE_CHECK([for $compiler option to produce PIC],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
-  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, 
$1)])
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
-
 #
 # Check to make sure the PIC flag actually works.
 #
@@ -4456,8 +4150,6 @@
 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
        [Additional compiler flags for building library objects])
 
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
-       [How to pass a linker flag through the compiler])
 #
 # Check to make sure the static flag actually works.
 #
@@ -4478,7 +4170,6 @@
 m4_defun([_LT_LINKER_SHLIBS],
 [AC_REQUIRE([LT_PATH_LD])dnl
 AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_DECL_SED])dnl
@@ -4487,38 +4178,30 @@
 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'
-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   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
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
     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") || (\$ 2 == 
"W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > 
$export_symbols'
+      _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*)
-    case $cc_basename in
-    cl*) ;;
-    *)
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 
DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ 
]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, 
$1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
-      ;;
-    esac
-    ;;
-  linux* | k*bsd*-gnu | gnu*)
+    _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'
+  ;;
+  linux* | k*bsd*-gnu)
     _LT_TAGVAR(link_all_deplibs, $1)=no
-    ;;
+  ;;
   *)
     _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)=
@@ -4578,39 +4261,13 @@
   openbsd*)
     with_gnu_ld=no
     ;;
-  linux* | k*bsd*-gnu | gnu*)
+  linux* | k*bsd*-gnu)
     _LT_TAGVAR(link_all_deplibs, $1)=no
     ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
-
-  # On some targets, GNU ld is compatible enough with the native linker
-  # that we're better off using the native interface for both.
-  lt_use_gnu_ld_interface=no
   if test "$with_gnu_ld" = yes; then
-    case $host_os in
-      aix*)
-       # The AIX port of GNU ld has always aspired to compatibility
-       # with the native linker.  However, as the warning in the GNU ld
-       # block says, versions before 2.19.5* couldn't really create working
-       # shared libraries, regardless of the interface used.
-       case `$LD -v 2>&1` in
-         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
-         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
-         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
-         *)
-           lt_use_gnu_ld_interface=yes
-           ;;
-       esac
-       ;;
-      *)
-       lt_use_gnu_ld_interface=yes
-       ;;
-    esac
-  fi
-
-  if test "$lt_use_gnu_ld_interface" = yes; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
     wlarc='${wl}'
 
@@ -4644,12 +4301,11 @@
        _LT_TAGVAR(ld_shlibs, $1)=no
        cat <<_LT_EOF 1>&2
 
-*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** 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 install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
+*** 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
@@ -4685,12 +4341,10 @@
       # _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(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
       _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/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ 
]]/s/.* //'\'' | sort | uniq > $export_symbols'
-      _LT_TAGVAR(exclude_expsyms, 
$1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      _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'
@@ -4708,11 +4362,6 @@
       fi
       ;;
 
-    haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-      _LT_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
-
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4738,16 +4387,15 @@
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
         && test "$tmp_diet" = no
       then
-       tmp_addflag=' $pic_flag'
+       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; func_echo_all 
\"$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'
          ;;
-       pgf77* | pgf90* | pgf95* | pgfortran*)
-                                       # 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; func_echo_all 
\"$new_convenience\"` ${wl}--no-whole-archive'
+       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' ;;
@@ -4758,17 +4406,13 @@
        lf95*)                          # Lahey Fortran 8.1
          _LT_TAGVAR(whole_archive_flag_spec, $1)=
          tmp_sharedflag='--shared' ;;
-       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal 
with xlf below)
+       xl[[cC]]*)                      # IBM XL C 8.0 on PPC (deal with xlf 
below)
          tmp_sharedflag='-qmkshrobj'
          tmp_addflag= ;;
-       nvcc*)  # Cuda Compiler Driver 2.2
-         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for 
conv in $convenience\"\"; do test  -n \"$conv\" && 
new_convenience=\"$new_convenience,$conv\"; done; func_echo_all 
\"$new_convenience\"` ${wl}--no-whole-archive'
-         _LT_TAGVAR(compiler_needs_object, $1)=yes
-         ;;
        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; 
func_echo_all \"$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
@@ -4784,17 +4428,17 @@
         fi
 
        case $cc_basename in
-       xlf* | bgf* | bgxlf* | mpixlf*)
+       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 
$linker_flags -soname $soname -o $lib'
+         _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 $linker_flags -soname $soname 
-version-script $output_objdir/$libname.ver -o $lib'
+             $LD -shared $libobjs $deplibs $compiler_flags -soname $soname 
-version-script $output_objdir/$libname.ver -o $lib'
          fi
          ;;
        esac
@@ -4808,8 +4452,8 @@
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs 
$linker_flags -o $lib'
        wlarc=
       else
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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
       ;;
 
@@ -4827,8 +4471,8 @@
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; 
then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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'
       else
        _LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4874,8 +4518,8 @@
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $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'
       else
        _LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4915,10 +4559,8 @@
       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
-       # Also, AIX nm treats weak defined symbols like other global
-       # defined symbols, whereas GNU nm marks them as "W".
        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") || (\$ 2 == 
"W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > 
$export_symbols'
+         _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
@@ -5006,9 +4648,9 @@
        _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
+        _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 func_echo_all 
"${wl}${allow_undefined_flag}"; else :; fi` 
'"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _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'
@@ -5017,19 +4659,14 @@
        else
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        _LT_SYS_MODULE_PATH_AIX([$1])
+        _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'
-         if test "$with_gnu_ld" = yes; then
-           # We only use this code for GNU lds that support --whole-archive.
-           _LT_TAGVAR(whole_archive_flag_spec, 
$1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-         else
-           # Exported symbols can be pulled into shared objects from archives
-           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-         fi
+         # 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'
@@ -5061,63 +4698,20 @@
       # Microsoft Visual C++.
       # hardcode_libdir_flag_spec is actually meaningless, as there is
       # no search path for DLLs.
-      case $cc_basename in
-      cl*)
-       # Native MSVC
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-       _LT_TAGVAR(always_export_symbols, $1)=yes
-       _LT_TAGVAR(file_list_spec, $1)='@'
-       # 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 $output_objdir/$soname $libobjs 
$compiler_flags $deplibs -Wl,-dll~linknames='
-       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
-           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e 
'1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-         else
-           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < 
$export_symbols > $output_objdir/$soname.exp;
-         fi~
-         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs 
"@$tool_output_objdir$soname.exp" 
-Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-         linknames='
-       # The linker will not automatically build a static lib if we build a 
DLL.
-       # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-       _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'
-       # Don't use ranlib
-       _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-         lt_tool_outputfile="@TOOL_OUTPUT@"~
-         case $lt_outputfile in
-           *.exe|*.EXE) ;;
-           *)
-             lt_outputfile="$lt_outputfile.exe"
-             lt_tool_outputfile="$lt_tool_outputfile.exe"
-             ;;
-         esac~
-         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; 
then
-           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" 
-outputresource:"$lt_tool_outputfile" || exit 1;
-           $RM "$lt_outputfile.manifest";
-         fi'
-       ;;
-      *)
-       # Assume MSVC wrapper
-       _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 
`func_echo_all "$deplibs" | $SED '\''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(enable_shared_with_static_runtimes, $1)=yes
-       ;;
-      esac
+      _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*)
@@ -5155,7 +4749,7 @@
 
     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
     freebsd* | dragonfly*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs 
$deplibs $compiler_flags'
+      _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
@@ -5163,7 +4757,7 @@
 
     hpux9*)
       if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared 
$pic_flag ${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_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
@@ -5178,8 +4772,8 @@
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h 
${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs 
$compiler_flags'
+      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
@@ -5197,16 +4791,16 @@
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      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 $pic_flag ${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_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${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
@@ -5218,14 +4812,7 @@
          _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname 
${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
          ;;
        *)
-       m4_if($1, [], [
-         # Older versions of the 11.00 compiler do not understand -b yet
-         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP 
does)
-         _LT_LINKER_OPTION([if $CC understands -b],
-           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-           [_LT_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)='$LD -b +h $soname +b $install_libdir 
-o $lib $libobjs $deplibs $linker_flags'])],
-         [_LT_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
@@ -5253,34 +4840,19 @@
 
     irix5* | irix6* | nonstopux*)
       if test "$GCC" = yes; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 
func_echo_all "${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.
-       # This should be the same for all languages, so no per-tag cache 
variable.
-       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
-         [lt_cv_irix_exported_symbol],
-         [save_LDFLAGS="$LDFLAGS"
-          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo 
${wl}-update_registry ${wl}/dev/null"
-          AC_LINK_IFELSE(
-            [AC_LANG_SOURCE(
-               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
-                             [C++], [[int foo (void) { return 0; }]],
-                             [Fortran 77], [[
-      subroutine foo
-      end]],
-                             [Fortran], [[
-      subroutine foo
-      end]])])],
-             [lt_cv_irix_exported_symbol=yes],
-             [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-       if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs 
$deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && 
func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry 
${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o 
$lib'
-       fi
+        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" && func_echo_all 
"-set_version $verstring"` -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" && func_echo_all 
"-set_version $verstring"` -update_registry ${output_objdir}/so_locations 
-exports_file $export_symbols -o $lib'
+       _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'
@@ -5342,17 +4914,17 @@
       _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(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" && func_echo_all "${wl}-set_version ${wl}$verstring"` 
${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _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" && 
func_echo_all "-set_version $verstring"` -update_registry 
${output_objdir}/so_locations -o $lib'
+       _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'
@@ -5362,13 +4934,13 @@
     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} 
$pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname 
${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version 
${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o 
$lib'
+       _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" 
&& func_echo_all "-set_version $verstring"` -update_registry 
${output_objdir}/so_locations -o $lib'
+       _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 "-set_version $verstring"` -update_registry ${output_objdir}/so_locations 
-o $lib~$RM $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'
@@ -5381,9 +4953,9 @@
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
       if test "$GCC" = yes; then
        wlarc='${wl}'
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text 
${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h 
${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $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"*)
@@ -5559,38 +5131,36 @@
       # 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_CACHE_CHECK([whether -lc should be explicitly linked in],
-       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
-       [$RM conftest*
-       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+      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_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-         else
-           lt_cv_[]_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*
-       ])
-      _LT_TAGVAR(archive_cmds_need_lc, 
$1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      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
@@ -5655,6 +5225,8 @@
     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],
@@ -5665,8 +5237,6 @@
     [Symbols that must always be exported])
 _LT_TAGDECL([], [prelink_cmds], [2],
     [Commands necessary for linking programs (against libraries) with 
templates])
-_LT_TAGDECL([], [postlink_cmds], [2],
-    [Commands necessary for finishing linking programs])
 _LT_TAGDECL([], [file_list_spec], [1],
     [Specify filename containing input files])
 dnl FIXME: Not yet implemented
@@ -5760,15 +5330,14 @@
 ])# _LT_LANG_C_CONFIG
 
 
-# _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],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+# _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
@@ -5776,7 +5345,23 @@
 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)=
@@ -5797,8 +5382,6 @@
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -5830,7 +5413,6 @@
 
   # Allow CC to be a program name with arguments.
   lt_save_CC=$CC
-  lt_save_CFLAGS=$CFLAGS
   lt_save_LD=$LD
   lt_save_GCC=$GCC
   GCC=$GXX
@@ -5848,7 +5430,6 @@
   fi
   test -z "${LDCXX+set}" || LD=$LDCXX
   CC=${CXX-"c++"}
-  CFLAGS=$CXXFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -5870,8 +5451,8 @@
       # 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 $pic_flag -shared -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
$wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -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(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'
@@ -5903,7 +5484,7 @@
       # 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 -v "^Configured with:" | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | 
$GREP "\-L"'
 
     else
       GXX=no
@@ -6012,10 +5593,10 @@
           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          _LT_SYS_MODULE_PATH_AIX([$1])
+          _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 func_echo_all 
"${wl}${allow_undefined_flag}"; else :; fi` 
'"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _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'
@@ -6024,19 +5605,14 @@
           else
            # Determine the default libpath from the value encoded in an
            # empty executable.
-           _LT_SYS_MODULE_PATH_AIX([$1])
+           _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'
-           if test "$with_gnu_ld" = yes; then
-             # We only use this code for GNU lds that support --whole-archive.
-             _LT_TAGVAR(whole_archive_flag_spec, 
$1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-           else
-             # Exported symbols can be pulled into shared objects from archives
-             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
-           fi
+           # 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.
@@ -6066,75 +5642,28 @@
         ;;
 
       cygwin* | mingw* | pw32* | cegcc*)
-       case $GXX,$cc_basename in
-       ,cl* | no,cl*)
-         # Native MSVC
-         # 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
-         _LT_TAGVAR(always_export_symbols, $1)=yes
-         _LT_TAGVAR(file_list_spec, $1)='@'
-         # 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 $output_objdir/$soname $libobjs 
$compiler_flags $deplibs -Wl,-dll~linknames='
-         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q 
$export_symbols`" = xEXPORTS; then
-             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e 
'1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-           else
-             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < 
$export_symbols > $output_objdir/$soname.exp;
-           fi~
-           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs 
"@$tool_output_objdir$soname.exp" 
-Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-           linknames='
-         # The linker will not automatically build a static lib if we build a 
DLL.
-         # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
-         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-         # Don't use ranlib
-         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
-         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-           lt_tool_outputfile="@TOOL_OUTPUT@"~
-           case $lt_outputfile in
-             *.exe|*.EXE) ;;
-             *)
-               lt_outputfile="$lt_outputfile.exe"
-               lt_tool_outputfile="$lt_tool_outputfile.exe"
-               ;;
-           esac~
-           func_to_tool_file "$lt_outputfile"~
-           if test "$MANIFEST_TOOL" != ":" && test -f 
"$lt_outputfile.manifest"; then
-             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" 
-outputresource:"$lt_tool_outputfile" || exit 1;
-             $RM "$lt_outputfile.manifest";
-           fi'
-         ;;
-       *)
-         # g++
-         # _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(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
-         _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(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
-         ;;
-       esac
-       ;;
+        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)
        ;;
@@ -6176,11 +5705,6 @@
       gnu*)
         ;;
 
-      haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(link_all_deplibs, $1)=yes
-        ;;
-
       hpux9*)
         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
@@ -6205,11 +5729,11 @@
             # 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; func_echo_all "$list"'
+            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 $pic_flag ${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'
+              _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
@@ -6270,7 +5794,7 @@
            # 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; func_echo_all "$list"'
+           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
@@ -6280,10 +5804,10 @@
                    _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 
$pic_flag ${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}+nodefaultrpath -o $lib $predep_objects $libobjs 
$deplibs $postdep_objects $compiler_flags'
                    ;;
                  *)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib 
$pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -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
@@ -6313,7 +5837,7 @@
         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" && func_echo_all "-set_version $verstring"` 
-update_registry ${output_objdir}/so_locations -o $lib'
+           _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
@@ -6324,9 +5848,9 @@
           *)
            if test "$GXX" = yes; then
              if test "$with_gnu_ld" = no; then
-               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version 
${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o 
$lib'
+               _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 $pic_flag -nostdlib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname 
${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version 
${wl}$verstring"` -o $lib'
+               _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
@@ -6355,7 +5879,7 @@
            # 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; func_echo_all "$list"'
+           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'
@@ -6392,26 +5916,26 @@
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
            case `$CC -V` in
-           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+           *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 | 
sort | $NL2SP`"'
+               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 | sort | $NL2SP`~
+               $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 | sort | $NL2SP` $postdep_objects $compiler_flags 
${wl}-soname ${wl}$soname -o $lib'
+               $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 | sort | $NL2SP` $postdep_objects $compiler_flags 
${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o 
$lib'
+               $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 and above use weak symbols
+           *) # 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'
              ;;
@@ -6419,7 +5943,7 @@
 
            _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; func_echo_all 
\"$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'
             ;;
          cxx*)
            # Compaq C++
@@ -6438,9 +5962,9 @@
            # 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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed'
+           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* | mpixl* | bgxl*)
+         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'
@@ -6460,13 +5984,13 @@
              _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; 
func_echo_all \"$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
 
              # Not sure whether something based on
              # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
              # would be better.
-             output_verbose_link_cmd='func_echo_all'
+             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
@@ -6535,7 +6059,7 @@
            _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=func_echo_all
+         output_verbose_link_cmd=echo
        else
          _LT_TAGVAR(ld_shlibs, $1)=no
        fi
@@ -6570,15 +6094,15 @@
            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" && 
func_echo_all "${wl}-set_version $verstring"` -update_registry 
${output_objdir}/so_locations -o $lib'
+               _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" && 
func_echo_all "-set_version $verstring"` -update_registry 
${output_objdir}/so_locations -o $lib'
+               _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 "-set_version $verstring"` 
-update_registry ${output_objdir}/so_locations -o $lib~
+                 $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'
                ;;
@@ -6594,17 +6118,17 @@
            # 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=`func_echo_all 
"$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; func_echo_all "$list"'
+           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" && 
func_echo_all "${wl}-set_version ${wl}$verstring"` ${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}-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 $pic_flag -nostdlib 
${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects 
$compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && 
func_echo_all "${wl}-set_version ${wl}$verstring"` ${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
 
@@ -6614,7 +6138,7 @@
              # 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 -v "^Configured with:" | $GREP "\-L"'
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 
2>&1 | $GREP "\-L"'
 
            else
              # FIXME: insert proper C++ library support
@@ -6650,7 +6174,7 @@
 
       solaris*)
         case $cc_basename in
-          CC* | sunCC*)
+          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'
@@ -6671,7 +6195,7 @@
            esac
            _LT_TAGVAR(link_all_deplibs, $1)=yes
 
-           output_verbose_link_cmd='func_echo_all'
+           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
@@ -6691,14 +6215,14 @@
            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 $pic_flag -nostdlib 
$LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags 
${wl}-h $wl$soname -o $lib'
+               _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 $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $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 -v "^Configured with:" | $GREP "\-L"'
+               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.
@@ -6709,7 +6233,7 @@
                # 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 -v "^Configured with:" | $GREP "\-L"'
+               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'
@@ -6763,10 +6287,6 @@
           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(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-             '"$_LT_TAGVAR(old_archive_cmds, $1)"
-           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-             '"$_LT_TAGVAR(reload_cmds, $1)"
            ;;
          *)
            _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib 
$libobjs $deplibs $compiler_flags'
@@ -6822,7 +6342,6 @@
   fi # test -n "$compiler"
 
   CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
   LDCXX=$LD
   LD=$lt_save_LD
   GCC=$lt_save_GCC
@@ -6837,29 +6356,6 @@
 ])# _LT_LANG_CXX_CONFIG
 
 
-# _LT_FUNC_STRIPNAME_CNF
-# ----------------------
-# func_stripname_cnf 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).
-#
-# This function is identical to the (non-XSI) version of func_stripname,
-# except this one can be used by m4 code that may be executed by configure,
-# rather than the libtool script.
-m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
-AC_REQUIRE([_LT_DECL_SED])
-AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
-func_stripname_cnf ()
-{
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-  esac
-} # func_stripname_cnf
-])# _LT_FUNC_STRIPNAME_CNF
-
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -6868,7 +6364,6 @@
 # objects, libraries and library flags.
 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
 # Dependencies to place before and after the object being linked:
 _LT_TAGVAR(predep_objects, $1)=
 _LT_TAGVAR(postdep_objects, $1)=
@@ -6919,13 +6414,6 @@
 };
 _LT_EOF
 ])
-
-_lt_libdeps_save_CFLAGS=$CFLAGS
-case "$CC $CFLAGS " in #(
-*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
-*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
-esac
-
 dnl Parse the compiler output and extract the necessary
 dnl objects, libraries and library flags.
 if AC_TRY_EVAL(ac_compile); then
@@ -6937,7 +6425,7 @@
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
@@ -6946,22 +6434,13 @@
           test $p = "-R"; then
         prev=$p
         continue
+       else
+        prev=
        fi
 
-       # Expand the sysroot to ease extracting the directories later.
-       if test -z "$prev"; then
-         case $p in
-         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; 
p=$func_stripname_result ;;
-         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; 
p=$func_stripname_result ;;
-         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; 
p=$func_stripname_result ;;
-         esac
-       fi
-       case $p in
-       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result 
;;
-       esac
        if test "$pre_test_object_deps_done" = no; then
-        case ${prev} in
-        -L | -R)
+        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.
@@ -6981,10 +6460,8 @@
           _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
         fi
        fi
-       prev=
        ;;
 
-    *.lto.$objext) ;; # Ignore GCC LTO objects
     *.$objext)
        # This assumes that the test object file only shows up
        # once in the compiler output.
@@ -7020,7 +6497,6 @@
 fi
 
 $RM -f confest.$objext
-CFLAGS=$_lt_libdeps_save_CFLAGS
 
 # PORTME: override above test on systems where it is broken
 m4_if([$1], [CXX],
@@ -7057,7 +6533,7 @@
 
 solaris*)
   case $cc_basename in
-  CC* | sunCC*)
+  CC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as
@@ -7101,16 +6577,32 @@
 ])# _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_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
-  _lt_disable_F77=yes
-fi
+[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)=
@@ -7129,8 +6621,6 @@
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -7170,9 +6660,7 @@
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
-  CFLAGS=$FFLAGS
   compiler=$CC
   _LT_TAGVAR(compiler, $1)=$CC
   _LT_CC_BASENAME([$compiler])
@@ -7226,25 +6714,39 @@
 
   GCC=$lt_save_GCC
   CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
 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_LANG_PUSH(Fortran)
+[AC_REQUIRE([_LT_PROG_FC])dnl
+AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test "X$FC" = "Xno"; then
-  _lt_disable_FC=yes
-fi
-
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 _LT_TAGVAR(allow_undefined_flag, $1)=
 _LT_TAGVAR(always_export_symbols, $1)=no
@@ -7262,8 +6764,6 @@
 _LT_TAGVAR(module_expsym_cmds, $1)=
 _LT_TAGVAR(link_all_deplibs, $1)=unknown
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 _LT_TAGVAR(no_undefined_flag, $1)=
 _LT_TAGVAR(whole_archive_flag_spec, $1)=
 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
@@ -7303,9 +6803,7 @@
   # Allow CC to be a program name with arguments.
   lt_save_CC="$CC"
   lt_save_GCC=$GCC
-  lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
-  CFLAGS=$FCFLAGS
   compiler=$CC
   GCC=$ac_cv_fc_compiler_gnu
 
@@ -7361,8 +6859,7 @@
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC=$lt_save_CC
-  CFLAGS=$lt_save_CFLAGS
+  CC="$lt_save_CC"
 fi # test "$_lt_disable_FC" != yes
 
 AC_LANG_POP
@@ -7399,12 +6896,10 @@
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_CFLAGS=$CFLAGS
+lt_save_CC="$CC"
 lt_save_GCC=$GCC
 GCC=yes
 CC=${GCJ-"gcj"}
-CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_TAGVAR(LD, $1)="$LD"
@@ -7414,8 +6909,6 @@
 _LT_TAGVAR(archive_cmds_need_lc, $1)=no
 
 _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(reload_flag, $1)=$reload_flag
-_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
 
 ## CAVEAT EMPTOR:
 ## There is no encapsulation within the following macros, do not change
@@ -7435,8 +6928,7 @@
 AC_LANG_RESTORE
 
 GCC=$lt_save_GCC
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
+CC="$lt_save_CC"
 ])# _LT_LANG_GCJ_CONFIG
 
 
@@ -7471,11 +6963,9 @@
 
 # Allow CC to be a program name with arguments.
 lt_save_CC="$CC"
-lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
 CC=${RC-"windres"}
-CFLAGS=
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
 _LT_CC_BASENAME([$compiler])
@@ -7488,8 +6978,7 @@
 
 GCC=$lt_save_GCC
 AC_LANG_RESTORE
-CC=$lt_save_CC
-CFLAGS=$lt_save_CFLAGS
+CC="$lt_save_CC"
 ])# _LT_LANG_RC_CONFIG
 
 
@@ -7548,15 +7037,6 @@
 AC_SUBST([OBJDUMP])
 ])
 
-# _LT_DECL_DLLTOOL
-# ----------------
-# Ensure DLLTOOL variable is set.
-m4_defun([_LT_DECL_DLLTOOL],
-[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
-AC_SUBST([DLLTOOL])
-])
 
 # _LT_DECL_SED
 # ------------
@@ -7650,8 +7130,8 @@
 # Try some XSI features
 xsi_shell=no
 ( _lt_dummy="a/b/c"
-  test 
"${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,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
@@ -7690,162 +7170,208 @@
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f 
"$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
+# _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
+}
 
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are 
available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    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##*/}"
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    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}"}
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # 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#*=}
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
 
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
+# 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
+}
 
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
+}
 
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+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.
 
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > 
$cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f 
"$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > 
$cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f 
"$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
+# 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
+}
 
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
 
-# _LT_PATH_CONVERSION_FUNCTIONS
-# -----------------------------
-# Determine which file name conversion functions should be used by
-# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
-# for certain cross-compile configurations and native mingw.
-m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_MSG_CHECKING([how to convert $build file names to $host format])
-AC_CACHE_VAL(lt_cv_to_host_file_cmd,
-[case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
-        ;;
-    esac
-    ;;
-  *-*-cygwin* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
-        ;;
-      *-*-cygwin* )
-        lt_cv_to_host_file_cmd=func_convert_file_noop
-        ;;
-      * ) # otherwise, assume *nix
-        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
-        ;;
-    esac
-    ;;
-  * ) # unhandled hosts (and "normal" native builds)
-    lt_cv_to_host_file_cmd=func_convert_file_noop
-    ;;
+# 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 "address@hidden"`
+}
+
+# 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
-])
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
-_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
-         [0], [convert $build file names to $host format])dnl
 
-AC_MSG_CHECKING([how to convert $build file names to toolchain format])
-AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
-[#assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
-  *-*-mingw* )
-    case $build in
-      *-*-mingw* ) # actually msys
-        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
-        ;;
-    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
     ;;
-esac
+  *)
+    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
 ])
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
-_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
-         [0], [convert $build files to toolchain format])dnl
-])# _LT_PATH_CONVERSION_FUNCTIONS

Modified: monkey/branches/MonkeyBacktracking/monkey/m4/ltoptions.m4
===================================================================
--- monkey/m4/ltoptions.m4      2011-10-05 10:26:47 UTC (rev 17195)
+++ monkey/branches/MonkeyBacktracking/monkey/m4/ltoptions.m4   2012-01-17 
13:42:55 UTC (rev 19189)
@@ -1,14 +1,13 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   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 7 ltoptions.m4
+# 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])])
@@ -126,7 +125,7 @@
 [enable_win32_dll=yes
 
 case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
   AC_CHECK_TOOL(AS, as, false)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(OBJDUMP, objdump, false)
@@ -134,13 +133,13 @@
 esac
 
 test -z "$AS" && AS=as
-_LT_DECL([], [AS],      [1], [Assembler program])dnl
+_LT_DECL([], [AS],      [0], [Assembler program])dnl
 
 test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
 
 test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
 ])# win32-dll
 
 AU_DEFUN([AC_LIBTOOL_WIN32_DLL],

Modified: monkey/branches/MonkeyBacktracking/monkey/m4/ltversion.m4
===================================================================
--- monkey/m4/ltversion.m4      2011-10-05 10:26:47 UTC (rev 17195)
+++ monkey/branches/MonkeyBacktracking/monkey/m4/ltversion.m4   2012-01-17 
13:42:55 UTC (rev 19189)
@@ -7,17 +7,17 @@
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# @configure_input@
+# Generated from ltversion.in.
 
-# serial 3293 ltversion.m4
+# serial 3017 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3293])
+m4_define([LT_PACKAGE_VERSION], [2.2.6b])
+m4_define([LT_PACKAGE_REVISION], [1.3017])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4'
-macro_revision='1.3293'
+[macro_version='2.2.6b'
+macro_revision='1.3017'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])

Modified: monkey/branches/MonkeyBacktracking/monkey/m4/lt~obsolete.m4
===================================================================
--- monkey/m4/lt~obsolete.m4    2011-10-05 10:26:47 UTC (rev 17195)
+++ monkey/branches/MonkeyBacktracking/monkey/m4/lt~obsolete.m4 2012-01-17 
13:42:55 UTC (rev 19189)
@@ -1,13 +1,13 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   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 5 lt~obsolete.m4
+# serial 4 lt~obsolete.m4
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
@@ -77,6 +77,7 @@
 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])])
@@ -89,10 +90,3 @@
 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])])
-m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        
[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
-m4_ifndef([_LT_AC_PROG_CXXCPP],                
[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
-m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        
[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
-m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
-m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
-m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])

Copied: monkey/branches/MonkeyBacktracking/monkey/src/include/gettext.h (from 
rev 17216, monkey/src/include/gettext.h)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/include/gettext.h             
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/include/gettext.h     
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,71 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+   Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU Library General Public License as published
+   by the Free Software Foundation; either version 2, 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
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+   USA.  */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option.  */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions.  */
+#include <libintl.h>
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+   chokes if dcgettext is defined as a macro.  So include it now, to make
+   later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
+   as well because people using "gettext.h" will not include <libintl.h>,
+   and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+   is GNUNET_OK.  */
+#if defined(__sun)
+#include <locale.h>
+#endif
+
+/* Disabled NLS.
+   The casts to 'const char *' serve the purpose of producing warnings
+   for invalid uses of the value returned from these functions.
+   On pre-ANSI systems without 'const', the config.h file is supposed to
+   contain "#define const".  */
+#define gettext(Msgid) ((const char *) (Msgid))
+#define dgettext(Domainname, Msgid) ((const char *) (Msgid))
+#define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
+#define ngettext(Msgid1, Msgid2, N) \
+    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+#define dngettext(Domainname, Msgid1, Msgid2, N) \
+    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+    ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+/* slight modification here to avoid warnings: generate GNUNET_NO code,
+   not even the cast... */
+#define textdomain(Domainname)
+#define bindtextdomain(Domainname, Dirname)
+#define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
+
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+   extraction of messages, but does not call gettext().  The run-time
+   translation is done at a different place in the code.
+   The argument, String, should be a literal string.  Concatenated strings
+   and other string expressions won't work.
+   The macro's expansion is not parenthesized, so that it is suitable as
+   initializer for static 'char[]' or 'const char[]' variables.  */
+#define gettext_noop(String) String
+
+#endif /* _LIBGETTEXT_H */

Copied: monkey/branches/MonkeyBacktracking/monkey/src/include/plibc.h (from rev 
17216, monkey/src/include/plibc.h)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/include/plibc.h               
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/include/plibc.h       
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,810 @@
+/*
+     This file is part of PlibC.
+     (C) 2005, 2006, 2007, 2008, 2009, 2010 Nils Durner (and other 
contributing authors)
+
+          This library is free software; you can redistribute it and/or
+          modify it under the terms of the GNU Lesser General Public
+          License as published by the Free Software Foundation; either
+          version 2.1 of the License, or (at your option) any later version.
+
+          This library 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
+          Lesser General Public License for more details.
+
+          You should have received a copy of the GNU Lesser General Public
+          License along with this library; if not, write to the Free Software
+          Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
 USA
+*/
+
+/**
+ * @file include/plibc.h
+ * @brief PlibC header
+ * @attention This file is usually not installed under Unix,
+ *            so ship it with your application
+ * @version $Revision: 69 $
+ */
+
+#ifndef _PLIBC_H_
+#define _PLIBC_H_
+
+#ifndef SIGALRM
+#define SIGALRM 14
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#include <stddef.h>
+
+#ifdef Q_OS_WIN32
+#define WINDOWS 1
+#endif
+
+#define HAVE_PLIBC_FD 0
+
+#ifdef WINDOWS
+
+#if ENABLE_NLS
+#include "langinfo.h"
+#endif
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#include <sys/types.h>
+#include <time.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <errno.h>
+#include <stdarg.h>
+
+#define __BYTE_ORDER BYTE_ORDER
+#define __BIG_ENDIAN BIG_ENDIAN
+
+/* Conflicts with our definitions */
+#define __G_WIN32_H__
+
+/* Convert LARGE_INTEGER to double */
+#define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \
+  (double)((x).LowPart))
+
+  struct stat64
+  {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    _mode_t st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    __int64 st_size;
+    __time64_t st_atime;
+    __time64_t st_mtime;
+    __time64_t st_ctime;
+  };
+
+  typedef unsigned int sa_family_t;
+
+  struct sockaddr_un
+  {
+    short sun_family;           /*AF_UNIX */
+    char sun_path[108];         /*path name */
+  };
+
+#ifndef pid_t
+#define pid_t DWORD
+#endif
+
+#ifndef error_t
+#define error_t int
+#endif
+
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+#endif
+
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+
+  enum
+  {
+    _SC_PAGESIZE = 30,
+    _SC_PAGE_SIZE = 30
+  };
+
+/* Thanks to the Cygwin project */
+#define ENOCSI 43               /* No CSI structure available */
+#define EL2HLT 44               /* Level 2 halted */
+#ifndef  EDEADLK
+#define EDEADLK 45              /* Deadlock condition */
+#endif
+#ifndef  ENOLCK
+#define ENOLCK 46               /* No record locks available */
+#endif
+#define EBADE 50                /* Invalid exchange */
+#define EBADR 51                /* Invalid request descriptor */
+#define EXFULL 52               /* Exchange full */
+#define ENOANO 53               /* No anode */
+#define EBADRQC 54              /* Invalid request code */
+#define EBADSLT 55              /* Invalid slot */
+#ifndef  EDEADLOCK
+#define EDEADLOCK EDEADLK       /* File locking deadlock error */
+#endif
+#define EBFONT 57               /* Bad font file fmt */
+#define ENOSTR 60               /* Device not a stream */
+#define ENODATA 61              /* No data (for no delay io) */
+#define ETIME 62                /* Timer expired */
+#define ENOSR 63                /* Out of streams resources */
+#define ENONET 64               /* Machine is not on the network */
+#define ENOPKG 65               /* Package not installed */
+#define EREMOTE 66              /* The object is remote */
+#define ENOLINK 67              /* The link has been severed */
+#define EADV 68                 /* Advertise error */
+#define ESRMNT 69               /* Srmount error */
+#define ECOMM 70                /* Communication error on send */
+#define EPROTO 71               /* Protocol error */
+#define EMULTIHOP 74            /* Multihop attempted */
+#define ELBIN 75                /* Inode is remote (not really error) */
+#define EDOTDOT 76              /* Cross mount point (not really error) */
+#define EBADMSG 77              /* Trying to read unreadable message */
+#define ENOTUNIQ 80             /* Given log. name not unique */
+#define EBADFD 81               /* f.d. invalid for this operation */
+#define EREMCHG 82              /* Remote address changed */
+#define ELIBACC 83              /* Can't access a needed shared lib */
+#define ELIBBAD 84              /* Accessing a corrupted shared lib */
+#define ELIBSCN 85              /* .lib section in a.out corrupted */
+#define ELIBMAX 86              /* Attempting to link in too many libs */
+#define ELIBEXEC 87             /* Attempting to exec a shared library */
+#ifndef  ENOSYS
+#define ENOSYS 88               /* Function not implemented */
+#endif
+#define ENMFILE 89              /* No more files */
+#ifndef  ENOTEMPTY
+#define ENOTEMPTY 90            /* Directory not empty */
+#endif
+#ifndef  ENAMETOOLONG
+#define ENAMETOOLONG 91         /* File or path name too long */
+#endif
+#define ELOOP 92                /* Too many symbolic links */
+#define EOPNOTSUPP 95           /* Operation not supported on transport 
endpoint */
+#define EPFNOSUPPORT 96         /* Protocol family not supported */
+#define ECONNRESET 104          /* Connection reset by peer */
+#define ENOBUFS 105             /* No buffer space available */
+#define EAFNOSUPPORT 106        /* Address family not supported by protocol 
family */
+#define EPROTOTYPE 107          /* Protocol wrong type for socket */
+#define ENOTSOCK 108            /* Socket operation on non-socket */
+#define ENOPROTOOPT 109         /* Protocol not available */
+#define ESHUTDOWN 110           /* Can't send after socket shutdown */
+#define ECONNREFUSED 111        /* Connection refused */
+#define EADDRINUSE 112          /* Address already in use */
+#define ECONNABORTED 113        /* Connection aborted */
+#define ENETUNREACH 114         /* Network is unreachable */
+#define ENETDOWN 115            /* Network interface is not configured */
+#ifndef  ETIMEDOUT
+#define ETIMEDOUT 116           /* Connection timed out */
+#endif
+#define EHOSTDOWN 117           /* Host is down */
+#define EHOSTUNREACH 118        /* Host is unreachable */
+#define EINPROGRESS 119         /* Connection already in progress */
+#define EALREADY 120            /* Socket already connected */
+#define EDESTADDRREQ 121        /* Destination address required */
+#define EMSGSIZE 122            /* Message too long */
+#define EPROTONOSUPPORT 123     /* Unknown protocol */
+#define ESOCKTNOSUPPORT 124     /* Socket type not supported */
+#define EADDRNOTAVAIL 125       /* Address not available */
+#define ENETRESET 126           /* Connection aborted by network */
+#define EISCONN 127             /* Socket is already connected */
+#define ENOTCONN 128            /* Socket is not connected */
+#define ETOOMANYREFS 129        /* Too many references: cannot splice */
+#define EPROCLIM 130            /* Too many processes */
+#define EUSERS 131              /* Too many users */
+#define EDQUOT 132              /* Disk quota exceeded */
+#define ESTALE 133              /* Unknown error */
+#ifndef  ENOTSUP
+#define ENOTSUP 134             /* Not supported */
+#endif
+#define ENOMEDIUM 135           /* No medium (in tape drive) */
+#define ENOSHARE 136            /* No such host or network path */
+#define ECASECLASH 137          /* Filename exists with different case */
+#define EWOULDBLOCK EAGAIN      /* Operation would block */
+#define EOVERFLOW 139           /* Value too large for defined data type */
+
+#undef HOST_NOT_FOUND
+#define HOST_NOT_FOUND 1
+#undef TRY_AGAIN
+#define TRY_AGAIN 2
+#undef NO_RECOVERY
+#define NO_RECOVERY 3
+#undef NO_ADDRESS
+#define NO_ADDRESS 4
+
+#define PROT_READ   0x1
+#define PROT_WRITE  0x2
+#define MAP_SHARED  0x1
+#define MAP_PRIVATE 0x2         /* unsupported */
+#define MAP_FIXED   0x10
+#define MAP_FAILED  ((void *)-1)
+
+  struct statfs
+  {
+    long f_type;                /* type of filesystem (see below) */
+    long f_bsize;               /* optimal transfer block size */
+    long f_blocks;              /* total data blocks in file system */
+    long f_bfree;               /* free blocks in fs */
+    long f_bavail;              /* free blocks avail to non-superuser */
+    long f_files;               /* total file nodes in file system */
+    long f_ffree;               /* free file nodes in fs */
+    long f_fsid;                /* file system id */
+    long f_namelen;             /* maximum length of filenames */
+    long f_spare[6];            /* spare for later */
+  };
+
+  extern const struct in6_addr in6addr_any;     /* :: */
+  extern const struct in6_addr in6addr_loopback;        /* ::1 */
+
+/* Taken from the Wine project <http://www.winehq.org>
+    /wine/include/winternl.h */
+  enum SYSTEM_INFORMATION_CLASS
+  {
+    SystemBasicInformation = 0,
+    Unknown1,
+    SystemPerformanceInformation = 2,
+    SystemTimeOfDayInformation = 3,     /* was SystemTimeInformation */
+    Unknown4,
+    SystemProcessInformation = 5,
+    Unknown6,
+    Unknown7,
+    SystemProcessorPerformanceInformation = 8,
+    Unknown9,
+    Unknown10,
+    SystemDriverInformation,
+    Unknown12,
+    Unknown13,
+    Unknown14,
+    Unknown15,
+    SystemHandleList,
+    Unknown17,
+    Unknown18,
+    Unknown19,
+    Unknown20,
+    SystemCacheInformation,
+    Unknown22,
+    SystemInterruptInformation = 23,
+    SystemExceptionInformation = 33,
+    SystemRegistryQuotaInformation = 37,
+    SystemLookasideInformation = 45
+  };
+
+  typedef struct
+  {
+    LARGE_INTEGER IdleTime;
+    LARGE_INTEGER KernelTime;
+    LARGE_INTEGER UserTime;
+    LARGE_INTEGER Reserved1[2];
+    ULONG Reserved2;
+  } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION;
+
+#define sleep(secs) (Sleep(secs * 1000))
+
+/*********************** statfs *****************************/
+/* fake block size */
+#define FAKED_BLOCK_SIZE 512
+
+/* linux-compatible values for fs type */
+#define MSDOS_SUPER_MAGIC     0x4d44
+#define NTFS_SUPER_MAGIC      0x5346544E
+
+/*********************** End of statfs ***********************/
+
+#define SHUT_RDWR SD_BOTH
+
+/* Operations for flock() */
+#define LOCK_SH  1              /* shared lock */
+#define LOCK_EX  2              /* exclusive lock */
+#define LOCK_NB  4              /* or'd with one of the above to prevent
+                                 * blocking */
+#define LOCK_UN  8              /* remove lock */
+
+/* Not supported under MinGW */
+#define S_IRGRP 0
+#define S_IWGRP 0
+#define S_IROTH 0
+#define S_IXGRP 0
+#define S_IWOTH 0
+#define S_IXOTH 0
+#define S_ISUID 0
+#define S_ISGID 0
+#define S_ISVTX 0
+#define S_IRWXG 0
+#define S_IRWXO 0
+
+#define SHUT_WR SD_SEND
+#define SHUT_RD SD_RECEIVE
+#define SHUT_RDWR SD_BOTH
+
+#define SIGKILL 9
+#define SIGTERM 15
+
+#define SetErrnoFromWinError(e) _SetErrnoFromWinError(e, __FILE__, __LINE__)
+
+  BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest);
+  BOOL _plibc_DereferenceShortcut (char *pszShortcut);
+  char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags);
+  char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags);
+  long QueryRegistry (HKEY hMainKey, const char *pszKey, const char *pszSubKey,
+                      char *pszBuffer, long *pdLength);
+
+  BOOL __win_IsHandleMarkedAsBlocking (int hHandle);
+  void __win_SetHandleBlockingMode (int s, BOOL bBlocking);
+  void __win_DiscardHandleBlockingMode (int s);
+  int _win_isSocketValid (int s);
+  int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows);
+  unsigned plibc_get_handle_count ();
+
+  typedef void (*TPanicProc) (int, char *);
+  void plibc_set_panic_proc (TPanicProc proc);
+
+  int flock (int fd, int operation);
+  int fsync (int fildes);
+  int inet_pton (int af, const char *src, void *dst);
+  int inet_pton4 (const char *src, u_char * dst, int pton);
+#if USE_IPV6
+  int inet_pton6 (const char *src, u_char * dst);
+#endif
+  int truncate (const char *fname, int distance);
+  int statfs (const char *path, struct statfs *buf);
+  const char *hstrerror (int err);
+  int mkstemp (char *tmplate);
+  char *strptime (const char *buf, const char *format, struct tm *tm);
+  const char *inet_ntop (int af, const void *src, char *dst, size_t size);
+
+  int plibc_init (char *pszOrg, char *pszApp);
+  void plibc_shutdown ();
+  int plibc_initialized ();
+  int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows,
+                                 int derefLinks);
+  void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine);
+  void SetErrnoFromWinsockError (long lWinError);
+  void SetHErrnoFromWinError (long lWinError);
+  void SetErrnoFromHRESULT (HRESULT hRes);
+  int GetErrnoFromWinsockError (long lWinError);
+  FILE *_win_fopen (const char *filename, const char *mode);
+  DIR *_win_opendir (const char *dirname);
+  int _win_open (const char *filename, int oflag, ...);
+#ifdef ENABLE_NLS
+  char *_win_bindtextdomain (const char *domainname, const char *dirname);
+#endif
+  int _win_chdir (const char *path);
+  int _win_close (int fd);
+  int _win_creat (const char *path, mode_t mode);
+  char *_win_ctime (const time_t * clock);
+  char *_win_ctime_r (const time_t * clock, char *buf);
+  int _win_fstat (int handle, struct stat *buffer);
+  int _win_ftruncate (int fildes, off_t length);
+  void _win_gettimeofday (struct timeval *tp, void *tzp);
+  int _win_kill (pid_t pid, int sig);
+  int _win_pipe (int *phandles);
+  int _win_rmdir (const char *path);
+  int _win_access (const char *path, int mode);
+  int _win_chmod (const char *filename, int pmode);
+  char *realpath (const char *file_name, char *resolved_name);
+  long _win_random (void);
+  void _win_srandom (unsigned int seed);
+  int _win_remove (const char *path);
+  int _win_rename (const char *oldname, const char *newname);
+  int _win_stat (const char *path, struct stat *buffer);
+  int _win_stat64 (const char *path, struct stat64 *buffer);
+  long _win_sysconf (int name);
+  int _win_unlink (const char *filename);
+  int _win_write (int fildes, const void *buf, size_t nbyte);
+  int _win_read (int fildes, void *buf, size_t nbyte);
+  size_t _win_fwrite (const void *buffer, size_t size, size_t count,
+                      FILE * stream);
+  size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream);
+  int _win_symlink (const char *path1, const char *path2);
+  void *_win_mmap (void *start, size_t len, int access, int flags, int fd,
+                   unsigned long long offset);
+  int _win_munmap (void *start, size_t length);
+  int _win_lstat (const char *path, struct stat *buf);
+  int _win_lstat64 (const char *path, struct stat64 *buf);
+  int _win_readlink (const char *path, char *buf, size_t bufsize);
+  int _win_accept (int s, struct sockaddr *addr, int *addrlen);
+  int _win_printf (const char *format, ...);
+  int _win_fprintf (FILE * f, const char *format, ...);
+  int _win_vprintf (const char *format, va_list ap);
+  int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr);
+  int _win_vsprintf (char *dest, const char *format, va_list arg_ptr);
+  int _win_vsnprintf (char *str, size_t size, const char *format,
+                      va_list arg_ptr);
+  int _win_snprintf (char *str, size_t size, const char *format, ...);
+  int _win_sprintf (char *dest, const char *format, ...);
+  int _win_vsscanf (const char *str, const char *format, va_list arg_ptr);
+  int _win_sscanf (const char *str, const char *format, ...);
+  int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr);
+  int _win_vscanf (const char *format, va_list arg_ptr);
+  int _win_scanf (const char *format, ...);
+  int _win_fscanf (FILE * stream, const char *format, ...);
+  pid_t _win_waitpid (pid_t pid, int *stat_loc, int options);
+  int _win_bind (int s, const struct sockaddr *name, int namelen);
+  int _win_connect (int s, const struct sockaddr *name, int namelen);
+  int _win_getpeername (int s, struct sockaddr *name, int *namelen);
+  int _win_getsockname (int s, struct sockaddr *name, int *namelen);
+  int _win_getsockopt (int s, int level, int optname, char *optval,
+                       int *optlen);
+  int _win_listen (int s, int backlog);
+  int _win_recv (int s, char *buf, int len, int flags);
+  int _win_recvfrom (int s, void *buf, int len, int flags,
+                     struct sockaddr *from, int *fromlen);
+  int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds,
+                   const struct timeval *tv);
+  int _win_send (int s, const char *buf, int len, int flags);
+  int _win_sendto (int s, const char *buf, int len, int flags,
+                   const struct sockaddr *to, int tolen);
+  int _win_setsockopt (int s, int level, int optname, const void *optval,
+                       int optlen);
+  int _win_shutdown (int s, int how);
+  int _win_socket (int af, int type, int protocol);
+  struct hostent *_win_gethostbyaddr (const char *addr, int len, int type);
+  struct hostent *_win_gethostbyname (const char *name);
+  struct hostent *gethostbyname2 (const char *name, int af);
+  char *_win_strerror (int errnum);
+  int IsWinNT ();
+  char *index (const char *s, int c);
+
+#if !HAVE_STRNDUP
+  char *strndup (const char *s, size_t n);
+#endif
+#if !HAVE_STRNLEN
+  size_t strnlen (const char *str, size_t maxlen);
+#endif
+  char *stpcpy (char *dest, const char *src);
+  char *strcasestr (const char *haystack_start, const char *needle_start);
+
+#define strcasecmp(a, b) stricmp(a, b)
+#define strncasecmp(a, b, c) strnicmp(a, b, c)
+
+#endif                          /* WINDOWS */
+
+#ifndef WINDOWS
+#define DIR_SEPARATOR '/'
+#define DIR_SEPARATOR_STR "/"
+#define PATH_SEPARATOR ':'
+#define PATH_SEPARATOR_STR ":"
+#define NEWLINE "\n"
+
+#ifdef ENABLE_NLS
+#define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n)
+#endif
+#define CREAT(p, m) creat(p, m)
+#define PLIBC_CTIME(c) ctime(c)
+#define CTIME_R(c, b) ctime_r(c, b)
+#undef FOPEN
+#define FOPEN(f, m) fopen(f, m)
+#define FTRUNCATE(f, l) ftruncate(f, l)
+#define OPENDIR(d) opendir(d)
+#define OPEN open
+#define CHDIR(d) chdir(d)
+#define CLOSE(f) close(f)
+#define LSEEK(f, o, w) lseek(f, o, w)
+#define RMDIR(f) rmdir(f)
+#define ACCESS(p, m) access(p, m)
+#define CHMOD(f, p) chmod(f, p)
+#define FSTAT(h, b) fstat(h, b)
+#define PLIBC_KILL(p, s) kill(p, s)
+#define PIPE(h) pipe(h)
+#define REMOVE(p) remove(p)
+#define RENAME(o, n) rename(o, n)
+#define STAT(p, b) stat(p, b)
+#define STAT64(p, b) stat64(p, b)
+#define SYSCONF(n) sysconf(n)
+#define UNLINK(f) unlink(f)
+#define WRITE(f, b, n) write(f, b, n)
+#define READ(f, b, n) read(f, b, n)
+#define GN_FREAD(b, s, c, f) fread(b, s, c, f)
+#define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f)
+#define SYMLINK(a, b) symlink(a, b)
+#define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o)
+#define MUNMAP(s, l) munmap(s, l)
+#define STRERROR(i) strerror(i)
+#define RANDOM() random()
+#define SRANDOM(s) srandom(s)
+#define READLINK(p, b, s) readlink(p, b, s)
+#define LSTAT(p, b) lstat(p, b)
+#define LSTAT64(p, b) lstat64(p, b)
+#define PRINTF printf
+#define FPRINTF fprintf
+#define VPRINTF(f, a) vprintf(f, a)
+#define VFPRINTF(s, f, a) vfprintf(s, f, a)
+#define VSPRINTF(d, f, a) vsprintf(d, f, a)
+#define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a)
+#define _REAL_SNPRINTF snprintf
+#define SPRINTF sprintf
+#define VSSCANF(s, f, a) vsscanf(s, f, a)
+#define SSCANF sscanf
+#define VFSCANF(s, f, a) vfscanf(s, f, a)
+#define VSCANF(f, a) vscanf(f, a)
+#define SCANF scanf
+#define FSCANF fscanf
+#define WAITPID(p, s, o) waitpid(p, s, o)
+#define ACCEPT(s, a, l) accept(s, a, l)
+#define BIND(s, n, l) bind(s, n, l)
+#define CONNECT(s, n, l) connect(s, n, l)
+#define GETPEERNAME(s, n, l) getpeername(s, n, l)
+#define GETSOCKNAME(s, n, l) getsockname(s, n, l)
+#define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p)
+#define LISTEN(s, b) listen(s, b)
+#define RECV(s, b, l, f) recv(s, b, l, f)
+#define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o)
+#define SELECT(n, r, w, e, t) select(n, r, w, e, t)
+#define SEND(s, b, l, f) send(s, b, l, f)
+#define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n)
+#define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n)
+#define SHUTDOWN(s, h) shutdown(s, h)
+#define SOCKET(a, t, p) socket(a, t, p)
+#define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t)
+#define GETHOSTBYNAME(n) gethostbyname(n)
+#define GETTIMEOFDAY(t, n) gettimeofday(t, n)
+#define INSQUE(e, p) insque(e, p)
+#define REMQUE(e) remque(e)
+#define HSEARCH(i, a) hsearch(i, a)
+#define HCREATE(n) hcreate(n)
+#define HDESTROY() hdestroy()
+#define HSEARCH_R(i, a, r, h) hsearch_r(i, a, r, h)
+#define HCREATE_R(n, h) hcreate_r(n, h)
+#define HDESTROY_R(h) hdestroy_r(h)
+#define TSEARCH(k, r, c) tsearch(k, r, c)
+#define TFIND(k, r, c) tfind(k, r, c)
+#define TDELETE(k, r, c) tdelete(k, r, c)
+#define TWALK(r, a) twalk(r, a)
+#define TDESTROY(r, f) tdestroy(r, f)
+#define LFIND(k, b, n, s, c) lfind(k, b, n, s, c)
+#define LSEARCH(k, b, n, s, c) lsearch(k, b, n, s, c)
+#else
+#define DIR_SEPARATOR '\\'
+#define DIR_SEPARATOR_STR "\\"
+#define PATH_SEPARATOR ';'
+#define PATH_SEPARATOR_STR ";"
+#define NEWLINE "\r\n"
+
+#ifdef ENABLE_NLS
+#define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n)
+#endif
+#define CREAT(p, m) _win_creat(p, m)
+#define PLIBC_CTIME(c) _win_ctime(c)
+#define CTIME_R(c, b) _win_ctime_r(c, b)
+#define FOPEN(f, m) _win_fopen(f, m)
+#define FTRUNCATE(f, l) _win_ftruncate(f, l)
+#define OPENDIR(d) _win_opendir(d)
+#define OPEN _win_open
+#define CHDIR(d) _win_chdir(d)
+#define CLOSE(f) _win_close(f)
+#define PLIBC_KILL(p, s) _win_kill(p, s)
+#define LSEEK(f, o, w) _win_lseek(f, o, w)
+#define FSTAT(h, b) _win_fstat(h, b)
+#define RMDIR(f) _win_rmdir(f)
+#define ACCESS(p, m) _win_access(p, m)
+#define CHMOD(f, p) _win_chmod(f, p)
+#define PIPE(h) _win_pipe(h)
+#define RANDOM() _win_random()
+#define SRANDOM(s) _win_srandom(s)
+#define REMOVE(p) _win_remove(p)
+#define RENAME(o, n) _win_rename(o, n)
+#define STAT(p, b) _win_stat(p, b)
+#define STAT64(p, b) _win_stat64(p, b)
+#define SYSCONF(n) _win_sysconf(n)
+#define UNLINK(f) _win_unlink(f)
+#define WRITE(f, b, n) _win_write(f, b, n)
+#define READ(f, b, n) _win_read(f, b, n)
+#define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f)
+#define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f)
+#define SYMLINK(a, b) _win_symlink(a, b)
+#define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o)
+#define MUNMAP(s, l) _win_munmap(s, l)
+#define STRERROR(i) _win_strerror(i)
+#define READLINK(p, b, s) _win_readlink(p, b, s)
+#define LSTAT(p, b) _win_lstat(p, b)
+#define LSTAT64(p, b) _win_lstat64(p, b)
+#define PRINTF(f, ...) _win_printf(f , __VA_ARGS__)
+#define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__)
+#define VPRINTF(f, a) _win_vprintf(f, a)
+#define VFPRINTF(s, f, a) _win_vfprintf(s, f, a)
+#define VSPRINTF(d, f, a) _win_vsprintf(d, f, a)
+#define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a)
+#define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, 
__VA_ARGS__)
+#define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__)
+#define VSSCANF(s, f, a) _win_vsscanf(s, f, a)
+#define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__)
+#define VFSCANF(s, f, a) _win_vfscanf(s, f, a)
+#define VSCANF(f, a) _win_vscanf(f, a)
+#define SCANF(f, ...) _win_scanf(f, __VA_ARGS__)
+#define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__)
+#define WAITPID(p, s, o) _win_waitpid(p, s, o)
+#define ACCEPT(s, a, l) _win_accept(s, a, l)
+#define BIND(s, n, l) _win_bind(s, n, l)
+#define CONNECT(s, n, l) _win_connect(s, n, l)
+#define GETPEERNAME(s, n, l) _win_getpeername(s, n, l)
+#define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l)
+#define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p)
+#define LISTEN(s, b) _win_listen(s, b)
+#define RECV(s, b, l, f) _win_recv(s, b, l, f)
+#define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o)
+#define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t)
+#define SEND(s, b, l, f) _win_send(s, b, l, f)
+#define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n)
+#define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n)
+#define SHUTDOWN(s, h) _win_shutdown(s, h)
+#define SOCKET(a, t, p) _win_socket(a, t, p)
+#define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t)
+#define GETHOSTBYNAME(n) _win_gethostbyname(n)
+#define GETTIMEOFDAY(t, n) _win_gettimeofday(t, n)
+#define INSQUE(e, p) _win_insque(e, p)
+#define REMQUE(e) _win_remque(e)
+#define HSEARCH(i, a) _win_hsearch(i, a)
+#define HCREATE(n) _win_hcreate(n)
+#define HDESTROY() _win_hdestroy()
+#define HSEARCH_R(i, a, r, h) _win_hsearch_r(i, a, r, h)
+#define HCREATE_R(n, h) _win_hcreate_r(n, h)
+#define HDESTROY_R(h) _win_hdestroy_r(h)
+#define TSEARCH(k, r, c) _win_tsearch(k, r, c)
+#define TFIND(k, r, c) _win_tfind(k, r, c)
+#define TDELETE(k, r, c) _win_tdelete(k, r, c)
+#define TWALK(r, a) _win_twalk(r, a)
+#define TDESTROY(r, f) _win_tdestroy(r, f)
+#define LFIND(k, b, n, s, c) _win_lfind(k, b, n, s, c)
+#define LSEARCH(k, b, n, s, c) _win_lsearch(k, b, n, s, c)
+#endif
+
+/* search.h */
+
+/* Prototype structure for a linked-list data structure.
+   This is the type used by the `insque' and `remque' functions.  */
+
+  struct PLIBC_SEARCH_QELEM
+  {
+    struct qelem *q_forw;
+    struct qelem *q_back;
+    char q_data[1];
+  };
+
+
+/* Insert ELEM into a doubly-linked list, after PREV.  */
+  void _win_insque (void *__elem, void *__prev);
+
+/* Unlink ELEM from the doubly-linked list that it is in.  */
+  void _win_remque (void *__elem);
+
+
+/* For use with hsearch(3).  */
+  typedef int (*PLIBC_SEARCH__compar_fn_t) (__const void *, __const void *);
+
+  typedef PLIBC_SEARCH__compar_fn_t _win_comparison_fn_t;
+
+/* Action which shall be performed in the call the hsearch.  */
+  typedef enum
+  {
+    PLIBC_SEARCH_FIND,
+    PLIBC_SEARCH_ENTER
+  }
+  PLIBC_SEARCH_ACTION;
+
+  typedef struct PLIBC_SEARCH_entry
+  {
+    char *key;
+    void *data;
+  }
+  PLIBC_SEARCH_ENTRY;
+
+/* The reentrant version has no static variables to maintain the state.
+   Instead the interface of all functions is extended to take an argument
+   which describes the current status.  */
+  typedef struct _PLIBC_SEARCH_ENTRY
+  {
+    unsigned int used;
+    PLIBC_SEARCH_ENTRY entry;
+  }
+  _PLIBC_SEARCH_ENTRY;
+
+
+/* Family of hash table handling functions.  The functions also
+   have reentrant counterparts ending with _r.  The non-reentrant
+   functions all work on a signle internal hashing table.  */
+
+/* Search for entry matching ITEM.key in internal hash table.  If
+   ACTION is `FIND' return found entry or signal error by returning
+   NULL.  If ACTION is `ENTER' replace existing data (if any) with
+   ITEM.data.  */
+  PLIBC_SEARCH_ENTRY *_win_hsearch (PLIBC_SEARCH_ENTRY __item,
+                                    PLIBC_SEARCH_ACTION __action);
+
+/* Create a new hashing table which will at most contain NEL elements.  */
+  int _win_hcreate (size_t __nel);
+
+/* Destroy current internal hashing table.  */
+  void _win_hdestroy (void);
+
+/* Data type for reentrant functions.  */
+  struct PLIBC_SEARCH_hsearch_data
+  {
+    struct _PLIBC_SEARCH_ENTRY *table;
+    unsigned int size;
+    unsigned int filled;
+  };
+
+/* Reentrant versions which can handle multiple hashing tables at the
+   same time.  */
+  int _win_hsearch_r (PLIBC_SEARCH_ENTRY __item, PLIBC_SEARCH_ACTION __action,
+                      PLIBC_SEARCH_ENTRY ** __retval,
+                      struct PLIBC_SEARCH_hsearch_data *__htab);
+  int _win_hcreate_r (size_t __nel, struct PLIBC_SEARCH_hsearch_data *__htab);
+  void _win_hdestroy_r (struct PLIBC_SEARCH_hsearch_data *__htab);
+
+
+/* The tsearch routines are very interesting. They make many
+   assumptions about the compiler.  It assumes that the first field
+   in node must be the "key" field, which points to the datum.
+   Everything depends on that.  */
+/* For tsearch */
+  typedef enum
+  {
+    PLIBC_SEARCH_preorder,
+    PLIBC_SEARCH_postorder,
+    PLIBC_SEARCH_endorder,
+    PLIBC_SEARCH_leaf
+  }
+  PLIBC_SEARCH_VISIT;
+
+/* Search for an entry matching the given KEY in the tree pointed to
+   by *ROOTP and insert a new element if not found.  */
+  void *_win_tsearch (__const void *__key, void **__rootp,
+                      PLIBC_SEARCH__compar_fn_t __compar);
+
+/* Search for an entry matching the given KEY in the tree pointed to
+   by *ROOTP.  If no matching entry is available return NULL.  */
+  void *_win_tfind (__const void *__key, void *__const * __rootp,
+                    PLIBC_SEARCH__compar_fn_t __compar);
+
+/* Remove the element matching KEY from the tree pointed to by *ROOTP.  */
+  void *_win_tdelete (__const void *__restrict __key, void **__restrict 
__rootp,
+                      PLIBC_SEARCH__compar_fn_t __compar);
+
+  typedef void (*PLIBC_SEARCH__action_fn_t) (__const void *__nodep,
+                                             PLIBC_SEARCH_VISIT __value,
+                                             int __level);
+
+/* Walk through the whole tree and call the ACTION callback for every node
+   or leaf.  */
+  void _win_twalk (__const void *__root, PLIBC_SEARCH__action_fn_t __action);
+
+/* Callback type for function to free a tree node.  If the keys are atomic
+   data this function should do nothing.  */
+  typedef void (*PLIBC_SEARCH__free_fn_t) (void *__nodep);
+
+/* Destroy the whole tree, call FREEFCT for each node or leaf.  */
+  void _win_tdestroy (void *__root, PLIBC_SEARCH__free_fn_t __freefct);
+
+
+/* Perform linear search for KEY by comparing by COMPAR in an array
+   [BASE,BASE+NMEMB*SIZE).  */
+  void *_win_lfind (__const void *__key, __const void *__base, size_t * 
__nmemb,
+                    size_t __size, PLIBC_SEARCH__compar_fn_t __compar);
+
+/* Perform linear search for KEY by comparing by COMPAR function in
+   array [BASE,BASE+NMEMB*SIZE) and insert entry if not found.  */
+  void *_win_lsearch (__const void *__key, void *__base, size_t * __nmemb,
+                      size_t __size, PLIBC_SEARCH__compar_fn_t __compar);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif                          //_PLIBC_H_
+
+/* end of plibc.h */

Deleted: monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am
===================================================================
--- monkey/src/monkey/Makefile.am       2011-12-08 09:27:43 UTC (rev 18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am    
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,139 +0,0 @@
-INCLUDES = -I$(top_srcdir)/src/include
-
-if MINGW
- WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols 
-endif
-
-if USE_COVERAGE
-  AM_CFLAGS = --coverage -O0
-  XLIB = -lgcov
-endif
-
-
-if !MINGW
-if HAVE_ESMTP
-if HAVE_OPENSSL
-
-
-lib_LTLIBRARIES = libmonkeyedb.la \
-                                 libmonkeyaction.la
-
-libmonkeyedb_la_SOURCES = \
-  edb_api.c \
-  gnunet_monkey_edb.h
-
-libmonkeyedb_la_LIBADD = \
-  -lgnunetutil \
-  -lsqlite3 \
-  $(GN_LIBINTL) $(XLIB)  
-
-libmonkeyaction_la_SOURCES = \
-  action_api.c \
-  gnunet_monkey_action.h
-
-libmonkeyaction_la_LIBADD = \
-  -lgnunetutil \
-  $(GN_LIBINTL) $(XLIB)  
-
-bin_PROGRAMS = \
- gnunet-monkey \
- gnunet-service-monkey \
- bug_null_pointer_exception \
- bug_bad_memory_access \
- bug_assertion_failure \
- bug_crypto_crc \
- bug_division_by_zero_loop
-
-#noinst_PROGRAMS = \
- bug_null_pointer_exception \
- bug_bad_memory_access \
- bug_assertion_failure \
- bug_crypto_crc \
- bug_division_by_zero_loop
-
-gnunet_monkey_SOURCES = \
- gdbmi.h \
- gdbmi_alloc.c \
- gdbmi_breakpoint.c \
- gdbmi_connect.c \
- gdbmi_data_man.c \
- gdbmi_error.c \
- gdbmi_get_free_pty.c \
- gdbmi_get_free_vt.c \
- gdbmi_misc.c \
- gdbmi_parse.c \
- gdbmi_prg_control.c \
- gdbmi_stack_man.c \
- gdbmi_symbol_query.c \
- gdbmi_target_man.c \
- gdbmi_thread.c \
- gdbmi_var_obj.c \
- gnunet-monkey.c \
- mail_sender.c
-
-gnunet_monkey_LDADD = \
-  -lgnunetutil \
-  $(top_builddir)/src/monkey/libmonkeyedb.la \
-  $(top_builddir)/src/monkey/libmonkeyaction.la \
-  -lesmtp \
-  $(GN_LIBINTL)
-
-
-gnunet_service_monkey_SOURCES = \
- gnunet-service-monkey.c         
-gnunet_service_monkey_LDADD = \
-  -lgnunetutil \
-  $(GN_LIBINTL)
-
-
-bug_null_pointer_exception:
-       gcc -g -O0 -o bug_null_pointer_exception bug_null_pointer_exception.c
-
-bug_bad_memory_access:
-       gcc -g -O0 -o bug_bad_memory_access bug_bad_memory_access.c     
-
-bug_assertion_failure:
-       gcc -g -O0 -o bug_assertion_failure bug_assertion_failure.c     
-
-bug_crypto_crc:
-       gcc -g -O0 -o bug_crypto_crc bug_crypto_crc.c
-       
-bug_division_by_zero_loop:
-       gcc -g -O0 -o bug_division_by_zero_loop bug_division_by_zero_loop.c     
-
-check_PROGRAMS = \
-    test_monkey_edb
-    #test_gnunet_monkey        
-
-if ENABLE_TEST_RUN
-# TESTS = $(check_SCRIPTS)
-TESTS = $(check_PROGRAMS)
-endif
-
-test_monkey_edb_SOURCES = \
-  test_monkey_edb.c
-test_monkey_edb_LDADD = \
-  -lgnunetutil \
-  $(top_builddir)/src/monkey/libmonkeyedb.la
-
-#test_gnunet_monkey_SOURCES = \
- #test_gnunet_monkey.c
-#test_gnunet_monkey_LDADD = \
-  -lgnunetarm \
-  -lgnunetutil
-
-
-check_SCRIPTS = \
-  #test_gnunet_monkey.sh \
-  #test_monkey_npe.sh
-
-EXTRA_DIST = \
-  test_gnunet_monkey_data.conf \
-  test.db \
-  bug_null_pointer_exception.db
-  
-#$(check_SCRIPTS) 
-
-endif
-endif
-endif

Copied: monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am (from 
rev 18819, monkey/src/monkey/Makefile.am)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am            
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/Makefile.am    
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,149 @@
+INCLUDES = -I$(top_srcdir)/src/include
+
+if MINGW
+ WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols 
+endif
+
+if USE_COVERAGE
+  AM_CFLAGS = --coverage -O0
+  XLIB = -lgcov
+endif
+
+
+if !MINGW
+if HAVE_ESMTP
+if HAVE_OPENSSL
+
+
+lib_LTLIBRARIES = libmonkeyedb.la \
+                                 libmonkeyaction.la \
+                                 libmonkeyxml.la
+
+libmonkeyedb_la_SOURCES = \
+  edb_api.c \
+  gnunet_monkey_edb.h
+
+libmonkeyedb_la_LIBADD = \
+  -lgnunetutil \
+  -lsqlite3 \
+  $(GN_LIBINTL) $(XLIB)  
+
+libmonkeyaction_la_SOURCES = \
+  action_api.c \
+  gnunet_monkey_action.h
+
+libmonkeyaction_la_LIBADD = \
+  -lgnunetutil \
+  $(GN_LIBINTL) $(XLIB)  
+
+libmonkeyxml_la_LIBADD = \
+  -lgnunetutil \
+   $(GN_LIBINTL) $(XLIB)
+   
+libmonkeyxml_la_SOURCES = \
+  xml_writer.c \
+  gnunet_monkey_xml_writer.h
+  
+bin_PROGRAMS = \
+ gnunet-monkey \
+ gnunet-service-monkey \
+ bug_null_pointer_exception \
+ bug_bad_memory_access \
+ bug_assertion_failure \
+ bug_crypto_crc \
+ bug_division_by_zero_loop
+
+#noinst_PROGRAMS = \
+ bug_null_pointer_exception \
+ bug_bad_memory_access \
+ bug_assertion_failure \
+ bug_crypto_crc \
+ bug_division_by_zero_loop
+
+gnunet_monkey_SOURCES = \
+ gdbmi.h \
+ gdbmi_alloc.c \
+ gdbmi_breakpoint.c \
+ gdbmi_connect.c \
+ gdbmi_data_man.c \
+ gdbmi_error.c \
+ gdbmi_get_free_pty.c \
+ gdbmi_get_free_vt.c \
+ gdbmi_misc.c \
+ gdbmi_parse.c \
+ gdbmi_prg_control.c \
+ gdbmi_stack_man.c \
+ gdbmi_symbol_query.c \
+ gdbmi_target_man.c \
+ gdbmi_thread.c \
+ gdbmi_var_obj.c \
+ gnunet-monkey.c \
+ mail_sender.c
+
+gnunet_monkey_LDADD = \
+  -lgnunetutil \
+  $(top_builddir)/src/monkey/libmonkeyedb.la \
+  $(top_builddir)/src/monkey/libmonkeyaction.la \
+  $(top_builddir)/src/monkey/libmonkeyxml.la \
+  -lesmtp \
+  $(GN_LIBINTL)
+
+
+gnunet_service_monkey_SOURCES = \
+ gnunet-service-monkey.c         
+gnunet_service_monkey_LDADD = \
+  -lgnunetutil \
+  $(GN_LIBINTL)
+
+
+bug_null_pointer_exception:
+       gcc -g -O0 -o bug_null_pointer_exception bug_null_pointer_exception.c
+
+bug_bad_memory_access:
+       gcc -g -O0 -o bug_bad_memory_access bug_bad_memory_access.c     
+
+bug_assertion_failure:
+       gcc -g -O0 -o bug_assertion_failure bug_assertion_failure.c     
+
+bug_crypto_crc:
+       gcc -g -O0 -o bug_crypto_crc bug_crypto_crc.c
+       
+bug_division_by_zero_loop:
+       gcc -g -O0 -o bug_division_by_zero_loop bug_division_by_zero_loop.c     
+
+check_PROGRAMS = \
+    test_monkey_edb
+    #test_gnunet_monkey        
+
+if ENABLE_TEST_RUN
+# TESTS = $(check_SCRIPTS)
+TESTS = $(check_PROGRAMS)
+endif
+
+test_monkey_edb_SOURCES = \
+  test_monkey_edb.c
+test_monkey_edb_LDADD = \
+  -lgnunetutil \
+  $(top_builddir)/src/monkey/libmonkeyedb.la
+
+#test_gnunet_monkey_SOURCES = \
+ #test_gnunet_monkey.c
+#test_gnunet_monkey_LDADD = \
+  -lgnunetarm \
+  -lgnunetutil
+
+
+check_SCRIPTS = \
+  #test_gnunet_monkey.sh \
+  #test_monkey_npe.sh
+
+EXTRA_DIST = \
+  test_gnunet_monkey_data.conf \
+  test.db \
+  bug_null_pointer_exception.db
+  
+#$(check_SCRIPTS) 
+
+endif
+endif
+endif

Deleted: monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c
===================================================================
--- monkey/src/monkey/action_api.c      2011-12-08 09:27:43 UTC (rev 18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,777 +0,0 @@
-/*
-     This file is part of GNUnet.
-     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
-
-     GNUnet 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 3, or (at your
-     option) any later version.
-
-     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file monkey/action_api.c
- * @brief Monkey API for actions taken by Monkey while debugging
- */
-
-#include "platform.h"
-#include <gnunet/gnunet_common.h>
-#include "gnunet_monkey_action.h"
-#include "gnunet_monkey_edb.h"
-#include <gnunet/gnunet_container_lib.h>
-#include <libesmtp.h>
-
-extern void sendMail (const char *messageContents, const char *emailAddress);
-
-
-static int async_c = 0;
-static struct Expression *expressionListHead = NULL;
-static struct Expression *expressionListTail = NULL;
-static struct WatchInfo *watchInfoListHead = NULL;
-static struct WatchInfo *watchInfoListTail = NULL;
-static struct Expression *faultyExpression = NULL;
-static struct FileName *fileNameListHead = NULL;
-static struct FileName *fileNameListTail = NULL;
-
-
-struct FileName
-{
-  struct FileNames *next;
-  struct FileNames *prev;
-
-  const char *name;
-};
-
-
-struct Expression
-{
-  struct Expression *next;
-  struct Expression *prev;
-  const char *expressionSyntax;
-  const char *expressionValue;
-  int lineNo;
-};
-
-struct WatchInfo
-{
-  struct WatchInfo *next;
-  struct WatchInfo *prev;
-  int hitNumber;
-  const char *value;
-};
-
-
-static void
-cb_console (const char *str, void *data)
-{
-  printf ("CONSOLE> %s\n", str);
-}
-
-
-/* Note that unlike what's documented in gdb docs it isn't usable. */
-static void
-cb_target (const char *str, void *data)
-{
-  printf ("TARGET> %s\n", str);
-}
-
-
-static void
-cb_log (const char *str, void *data)
-{
-  printf ("LOG> %s\n", str);
-}
-
-
-static void
-cb_to (const char *str, void *data)
-{
-  printf (">> %s", str);
-}
-
-
-static void
-cb_from (const char *str, void *data)
-{
-  printf ("<< %s\n", str);
-}
-
-
-static void
-cb_async (mi_output * o, void *data)
-{
-  printf ("ASYNC\n");
-  async_c++;
-}
-
-static int
-isInCodeBase (const char *name)
-{
-  struct FileName *fileName = fileNameListHead;
-  while (NULL != fileName)
-    {
-      if (strcmp (fileName->name, name) == 0)
-       return GNUNET_YES;
-      fileName = fileName->next;
-    }
-  return GNUNET_NO;
-}
-
-
-static int
-wait_for_stop (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  while (!mi_get_response (cntxt->gdb_handle))
-    usleep (1000);
-  /* The end of the async. */
-  cntxt->gdb_stop_reason = mi_res_stop (cntxt->gdb_handle);
-  if (cntxt->gdb_stop_reason)
-    {
-      switch (cntxt->gdb_stop_reason->reason)
-       {
-       case sr_exited_normally:
-         return GDB_STATE_EXIT_NORMALLY;
-
-       case sr_bkpt_hit:
-         {
-           /* We want to inspect an expression */
-           /* Set hardware watch at the expression to inspect */
-           mi_wp *wp =
-             gmi_break_watch (cntxt->gdb_handle, wm_write,
-                              cntxt->inspect_expression);
-           if (NULL == wp)
-             {
-               printf ("Error in setting a watchpoint at expression:%s\n",
-                       cntxt->inspect_expression);
-               return GDB_STATE_ERROR;
-             }
-           mi_free_wp (wp);
-           /* continue execution */
-           gmi_exec_continue (cntxt->gdb_handle);
-           return wait_for_stop (cntxt);
-         }
-       case sr_wp_trigger:
-         {
-           static int watchPointHitNumber = 0;
-           struct WatchInfo *watchInfo =
-             GNUNET_malloc (sizeof (struct WatchInfo));
-           watchInfo->hitNumber = ++watchPointHitNumber;
-           watchInfo->value = cntxt->gdb_stop_reason->wp_val;
-           GNUNET_CONTAINER_DLL_insert (watchInfoListHead, watchInfoListTail,
-                                        watchInfo);
-           if (watchPointHitNumber == 1023)
-             printf ("HEY! 1023! WE ARE GETTING OUT OF THE LOOP!\n");
-           gmi_exec_continue (cntxt->gdb_handle);
-           return wait_for_stop (cntxt);
-         }
-       case sr_wp_scope:
-         gmi_exec_continue (cntxt->gdb_handle);
-         return wait_for_stop (cntxt);
-
-       default:
-         break;
-       }
-
-      /* Reaching this line means that the program has stopped abnormally */
-
-      cntxt->gdb_frames = gmi_stack_info_frame (cntxt->gdb_handle);
-      if (NULL == cntxt->gdb_frames)
-       {
-         cntxt->gdb_frames = gmi_stack_list_frames (cntxt->gdb_handle);
-         /*
-          * When working with GDB > 6.1, this is normal.
-          * libmigdb fails to load current frame from the handle.
-          * Instead, it's available in the reason struct
-          */
-         //cntxt->gdb_frames = cntxt->gdb_stop_reason->frame;
-
-         //EXPERIMENTAL CODE:
-         while (GNUNET_YES != isInCodeBase (cntxt->gdb_frames->file))
-           {
-             cntxt->gdb_frames = cntxt->gdb_frames->next;
-           }
-
-         if (NULL == cntxt->gdb_frames)
-           GNUNET_break (0);
-       }
-
-      if (0 == cntxt->gdb_frames->line)
-       {
-         /*
-          * This happens if the program stops in a shared library (inner 
frames)
-          * We will move to outer frames until reaching the faulty line in the 
source code
-          */
-         cntxt->gdb_frames = gmi_stack_list_frames (cntxt->gdb_handle);
-         do
-           {
-             cntxt->gdb_frames = cntxt->gdb_frames->next;
-           }
-         while (0 == cntxt->gdb_frames->line);
-       }
-      /* Change current GDB frame to the one containing source code */
-      gmi_stack_select_frame (cntxt->gdb_handle, cntxt->gdb_frames->level);
-
-      return GDB_STATE_STOPPED;
-    }
-  return GDB_STATE_ERROR;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_report_file (struct GNUNET_MONKEY_ACTION_Context *cntxt,
-                                 const char *dumpFileName)
-{
-  FILE *file = fopen (dumpFileName, "w");
-  GNUNET_assert (NULL != file);
-  fprintf (file, "%s", cntxt->debug_report);
-  fclose (file);
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_report_email (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  if (cntxt->debug_mode == DEBUG_MODE_REPORT_READY)
-    sendMail (cntxt->debug_report, cntxt->email_address);
-
-  return GNUNET_OK;
-}
-
-
-static int
-iterateFileNames (void *cls, int numColumns, char **colValues,
-                 char **colNames)
-{
-  struct FileName *fileName;
-  char *token;
-  char *ext;
-  int tokenLength;
-
-  if (NULL == colValues[0] || NULL == colValues[1])
-    return 1;                  /* Error */
-
-  /* This is done to extract the only the file name from the full path coming 
from the Database */
-  token = strtok (colValues[0], "/");
-  if (NULL == token)
-    return 1;                  /* Error */
-  do
-    {
-      tokenLength = strlen (token);
-      ext = &token[tokenLength - 2];
-      printf ("%s\n", ext);
-      if (strcmp (ext, ".c") == 0)
-       {
-         fileName = GNUNET_malloc (sizeof (struct FileName));
-         fileName->name = strdup (token);
-         GNUNET_CONTAINER_DLL_insert (fileNameListHead, fileNameListTail,
-                                      fileName);
-         return 0;             /* OK */
-       }
-      token = strtok (NULL, "/");
-    }
-  while (NULL != token);
-
-
-  return 1;                    /* Error */
-}
-
-
-static int
-iterateExpressions (void *cls, int numColumns, char **colValues,
-                   char **colNames)
-{
-  struct Expression *expression;
-
-  if (NULL == colValues[0] || NULL == colValues[1])
-    return 1;                  /* Error */
-
-  expression = GNUNET_malloc (sizeof (struct Expression));
-  expression->expressionSyntax = strdup (colValues[0]);
-  expression->lineNo = atoi (colValues[1]);
-
-  GNUNET_CONTAINER_DLL_insert (expressionListHead, expressionListTail,
-                              expression);
-
-  return 0;                    /* OK */
-}
-
-
-static int
-scopeEndCallback (void *cls, int numColumns, char **colValues,
-                 char **colNames)
-{
-  int *scopeEnd = (int *) cls;
-
-  *scopeEnd = atoi (colValues[0]);
-  if (*scopeEnd < 0)
-    return 1;                  /* Error */
-  return 0;
-}
-
-
-static struct Expression *
-getFaultyExpression (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  struct Expression *faultyExpression = NULL;
-  struct Expression *tmp = NULL;
-  int expressionLength = 0;
-
-  tmp = expressionListHead;
-  while (NULL != tmp)
-    {
-      if ((tmp->lineNo == cntxt->gdb_frames->line)
-         && (strlen (tmp->expressionSyntax) > expressionLength))
-       {
-         expressionLength = strlen (tmp->expressionSyntax);
-         faultyExpression = tmp;
-       }
-      tmp = tmp->next;
-    }
-
-  return faultyExpression;
-}
-
-static int
-analyzeSegmentationFault (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  struct Expression *tmp;
-
-
-  faultyExpression = getFaultyExpression (cntxt);
-
-  if (NULL != faultyExpression)
-    {
-      tmp = expressionListHead;
-      while (NULL != tmp)
-       {
-         const char *eval;
-         if (tmp != faultyExpression)
-           {
-             eval =
-               gmi_data_evaluate_expression (cntxt->gdb_handle,
-                                             tmp->expressionSyntax);
-             if (NULL != eval
-                 && (strcmp (eval, "0x0") == 0
-                     || strcmp (eval, "NULL") == 0))
-               {
-                 cntxt->gdb_null_variable = tmp->expressionSyntax;
-                 return GNUNET_OK;
-               }
-           }
-         tmp = tmp->next;
-       }
-    }
-  /* Set watch points on the faulty-expression's subexpressions */
-//      if (NULL != faultyExpression) {
-//              tmp = expressionListHead;
-//              while (NULL != tmp) {
-//                      if (tmp != faultyExpression) {
-//                              /* Only subexpressions are interesting */
-//                               watchPoint = 
gmi_break_watch(cntxt->gdb_handle, wm_write, tmp->expressionSyntax);
-//                               if (!watchPoint)
-//                                 {
-//                                      printf("Error in setting 
watchpoint\n");
-//                                      return 1;
-//                                 }
-//                               printf("Watchpoint %d for expression: %s\n", 
watchPoint->number, watchPoint->exp);
-//                               mi_free_wp(watchPoint);
-//                      }
-//                      tmp = tmp->next;
-//              }
-//              return GNUNET_OK;
-//      }
-  return GDB_STATE_ERROR;
-}
-
-
-
-static int
-analyzeCustomFault (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  struct Expression *tmp;
-  faultyExpression = getFaultyExpression (cntxt);
-
-
-  if (NULL != faultyExpression)
-    {
-      tmp = expressionListHead;
-      while (NULL != tmp)
-       {
-         const char *eval;
-         eval =
-           gmi_data_evaluate_expression (cntxt->gdb_handle,
-                                         tmp->expressionSyntax);
-         if (NULL != eval)
-           {
-             tmp->expressionValue = eval;
-           }
-         tmp = tmp->next;
-       }
-    }
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_inspect_expression_database (struct
-                                                 GNUNET_MONKEY_ACTION_Context
-                                                 *cntxt)
-{
-  struct GNUNET_MONKEY_EDB_Context *edbCntxt;
-  int ret = GNUNET_OK;
-  int endScope;
-  const char *signalMeaning = cntxt->gdb_stop_reason->signal_meaning;
-
-  edbCntxt = GNUNET_MONKEY_EDB_connect (cntxt->expression_database_path);
-  if (NULL == edbCntxt)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Unable to connect to Expression Database file!\n");
-      return GNUNET_NO;
-    }
-
-  ret = GNUNET_MONKEY_EDB_get_expression_scope_end (edbCntxt,
-                                                   cntxt->gdb_frames->file,
-                                                   cntxt->gdb_frames->line,
-                                                   &scopeEndCallback,
-                                                   &endScope);
-  if (endScope < 0)
-    return GNUNET_NO;
-
-
-  if (strcasecmp (signalMeaning, "Segmentation fault") == 0)
-    {
-      cntxt->bug_detected = BUG_NULL_POINTER;
-      GNUNET_MONKEY_EDB_get_expressions (edbCntxt,
-                                        cntxt->gdb_frames->file,
-                                        cntxt->gdb_frames->line, endScope,
-                                        &iterateExpressions, NULL);
-      ret = analyzeSegmentationFault (cntxt);
-    }
-  else if (strcasecmp (signalMeaning, "Aborted") == 0)
-    {
-      cntxt->bug_detected = BUG_CUSTOM;
-      GNUNET_MONKEY_EDB_get_sub_expressions (edbCntxt,
-                                            cntxt->gdb_frames->file,
-                                            cntxt->gdb_frames->line,
-                                            endScope, &iterateExpressions,
-                                            NULL);
-      ret = analyzeCustomFault (cntxt);
-    }
-  else if (strcasecmp(signalMeaning, "Arithmetic exception") == 0) {
-         cntxt->bug_detected = BUG_CUSTOM;
-         GNUNET_MONKEY_EDB_get_sub_expressions (edbCntxt,
-                                                    cntxt->gdb_frames->file,
-                                                    cntxt->gdb_frames->line,
-                                                    endScope, 
&iterateExpressions,
-                                                    NULL);
-         ret = analyzeCustomFault (cntxt);
-  }
-
-  GNUNET_MONKEY_EDB_disconnect (edbCntxt);
-  mi_disconnect (cntxt->gdb_handle);
-  return ret;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_rerun_with_valgrind (struct GNUNET_MONKEY_ACTION_Context
-                                         *cntxt)
-{
-  char *valgrindCommand;
-  FILE *valgrindPipe;
-
-  GNUNET_asprintf (&cntxt->valgrind_output_tmp_file_name, "%d", rand ());
-  cntxt->debug_mode = DEBUG_MODE_VALGRIND;
-  GNUNET_asprintf (&valgrindCommand,
-                  "valgrind --leak-check=yes --log-file=%s %s",
-                  cntxt->valgrind_output_tmp_file_name, cntxt->binary_name);
-  valgrindPipe = popen (valgrindCommand, "r");
-  if (NULL == valgrindPipe)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error in running Valgrind!\n");
-      GNUNET_free (valgrindCommand);
-      return GNUNET_NO;
-    }
-
-  pclose (valgrindPipe);
-  GNUNET_free (valgrindCommand);
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_rerun_with_gdb (struct GNUNET_MONKEY_ACTION_Context
-                                    *cntxt)
-{
-  struct GNUNET_MONKEY_EDB_Context *edbCntxt;
-  cntxt->debug_mode = DEBUG_MODE_GDB;
-  /* This is like a file-handle for fopen.
-     Here we have all the state of gdb "connection". */
-  if (NULL != cntxt->gdb_binary_path)
-    mi_set_gdb_exe (cntxt->gdb_binary_path);
-  int ret;
-
-  /* Connect to gdb child. */
-  cntxt->gdb_handle = mi_connect_local ();
-  if (!cntxt->gdb_handle)
-    {
-      printf ("Connect failed\n");
-      return GNUNET_NO;
-    }
-  printf ("Connected to gdb!\n");
-
-  /* Set all callbacks. */
-  mi_set_console_cb (cntxt->gdb_handle, cb_console, NULL);
-  mi_set_target_cb (cntxt->gdb_handle, cb_target, NULL);
-  mi_set_log_cb (cntxt->gdb_handle, cb_log, NULL);
-  mi_set_async_cb (cntxt->gdb_handle, cb_async, NULL);
-  mi_set_to_gdb_cb (cntxt->gdb_handle, cb_to, NULL);
-  mi_set_from_gdb_cb (cntxt->gdb_handle, cb_from, NULL);
-
-  /* Set the name of the child and the command line arguments. */
-  if (!gmi_set_exec (cntxt->gdb_handle, cntxt->binary_name, NULL))
-    {
-      printf ("Error setting exec y args\n");
-      mi_disconnect (cntxt->gdb_handle);
-      return GNUNET_NO;
-    }
-
-  /* Tell gdb to attach the child to a terminal. */
-  if (!gmi_target_terminal (cntxt->gdb_handle, ttyname (STDIN_FILENO)))
-    {
-      printf ("Error selecting target terminal\n");
-      mi_disconnect (cntxt->gdb_handle);
-      return GNUNET_NO;
-    }
-
-  if ((NULL != cntxt->inspect_expression)
-      && (NULL != cntxt->inspect_function))
-    {
-      /* Setting a breakpoint at the function containing the expression to 
inspect */
-      mi_bkpt *bp =
-       gmi_break_insert_full (cntxt->gdb_handle, 0, 0, NULL, -1, -1,
-                              cntxt->inspect_function);
-      if (NULL == bp)
-       {
-         printf ("Error setting breakpoint at function:%s\n",
-                 cntxt->inspect_function);
-         mi_disconnect (cntxt->gdb_handle);
-         return GNUNET_NO;
-       }
-      mi_free_bkpt (bp);
-    }
-
-  /* Prepare a list of the file names for the source files we are analyzing */
-  edbCntxt = GNUNET_MONKEY_EDB_connect (cntxt->expression_database_path);
-  if (NULL == edbCntxt)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Unable to connect to Expression Database file!\n");
-      return GNUNET_NO;
-    }
-
-  if (GNUNET_OK != GNUNET_MONKEY_EDB_get_file_names (edbCntxt,
-                                                    &iterateFileNames, NULL))
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Error in executing Database query!\n");
-    }
-  GNUNET_MONKEY_EDB_disconnect (edbCntxt);
-
-
-  /* Run the program. */
-  if (!gmi_exec_run (cntxt->gdb_handle))
-    {
-      printf ("Error in run!\n");
-      mi_disconnect (cntxt->gdb_handle);
-      return GNUNET_NO;
-    }
-  /* Here we should be stopped when the program crashes */
-  ret = wait_for_stop (cntxt);
-  if (ret == GDB_STATE_ERROR || ret == GDB_STATE_EXIT_NORMALLY)
-    mi_disconnect (cntxt->gdb_handle);
-
-  return ret;
-}
-
-
-static const char *
-expressionListToString (struct Expression *head)
-{
-  char *string = GNUNET_strdup ("");
-  char *strTmp;
-  struct Expression *tmp;
-
-  for (tmp = head; NULL != tmp;  tmp = tmp->next)
-    {
-      GNUNET_asprintf (&strTmp,
-                      "%s%s = %s\n", 
-                      string,
-                      tmp->expressionSyntax,
-                      NULL ==
-                      tmp->expressionValue ? "Not evaluated" : tmp->
-                      expressionValue);
-      GNUNET_free (string);
-      string = strTmp;
-    }
-  return string;
-}
-
-#if 0
-static int
-getWatchInfoListSize (struct WatchInfo *head)
-{
-  int count = 0;
-  int largestStr = 0;
-  struct WatchInfo *tmp = head;
-
-  while (NULL != tmp)
-    {
-      if (largestStr < strlen (tmp->value))
-       largestStr = strlen (tmp->value);
-      tmp = tmp->next;
-      count++;
-    }
-
-  return count * largestStr;
-}
-
-static const char *
-watchInfoListToString (struct WatchInfo *head)
-{
-  char *string = GNUNET_malloc (getWatchInfoListSize (head));
-  char *strTmp;
-  struct WatchInfo *tmp = head;
-
-  GNUNET_asprintf (&strTmp, "%s\t \t%s\n", tmp->hitNumber, tmp->value);
-  strcpy (string, strTmp);
-  GNUNET_free (strTmp);
-  tmp = tmp->next;
-
-  while (NULL != tmp)
-    {
-      GNUNET_asprintf (&strTmp, "%s\t \t%s\n", tmp->hitNumber, tmp->value);
-      strcat (string, strTmp);
-      GNUNET_free (strTmp);
-      tmp = tmp->next;
-    }
-
-  return string;
-}
-#endif
-
-static const char *
-getValgrindOutput (struct GNUNET_MONKEY_ACTION_Context *cntxt)
-{
-  char *valgrindOutput;
-  int size;
-  FILE *valgrindFile = fopen (cntxt->valgrind_output_tmp_file_name, "r");
-  fseek (valgrindFile, 0L, SEEK_END);
-  size = ftell (valgrindFile);
-  fseek (valgrindFile, 0L, SEEK_SET);
-
-  valgrindOutput = GNUNET_malloc (size);
-  fread (valgrindOutput, size - 1, 1, valgrindFile);
-  fclose (valgrindFile);
-  return valgrindOutput;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_format_report (struct GNUNET_MONKEY_ACTION_Context
-                                   *cntxt)
-{
-  switch (cntxt->debug_mode)
-    {
-    case DEBUG_MODE_GDB:
-      if (cntxt->bug_detected == BUG_NULL_POINTER)
-       {
-         GNUNET_asprintf (&(cntxt->debug_report),
-                          "Bug detected in 
file:%s\nfunction:%s\nline:%d\nreason:%s\nreceived signal:%s\n%s\n Details:\n 
Expression:%s is NULL\n",
-                          cntxt->gdb_frames->file, cntxt->gdb_frames->func,
-                          cntxt->gdb_frames->line,
-                          mi_reason_enum_to_str (cntxt->
-                                                 gdb_stop_reason->reason),
-                          cntxt->gdb_stop_reason->signal_name,
-                          cntxt->gdb_stop_reason->signal_meaning,
-                          cntxt->gdb_null_variable);
-       }
-      else if (cntxt->bug_detected == BUG_CUSTOM)
-       {
-         if (NULL == cntxt->inspect_expression)
-           {
-             /* Assertion Failure */
-             //const char *expToString =
-               //expressionListToString (expressionListHead);
-
-           GNUNET_asprintf (&(cntxt->debug_report),
-                              "Bug detected in 
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nAssertion 
Failure\nExpression evaluation:\n%s\n",
-                              cntxt->gdb_frames->file,
-                              cntxt->gdb_frames->func,
-                              cntxt->gdb_frames->line,
-                              cntxt->gdb_stop_reason->signal_name,
-                              cntxt->gdb_stop_reason->signal_meaning,
-                              "hello/world\n");
-           }
-         else
-           {
-             /* Inspection of user-defined expression */
-             /*
-                GNUNET_asprintf(&(cntxt->debug_report),
-                "Inspection of expression: %s in function: %s, file:%s\nHit 
Number: \t \tValue:\n%s",
-                cntxt->inspect_expression, cntxt->inspect_function, 
cntxt->binary_name, watchInfoListToString(watchInfoListHead));
-              */
-           }
-       }
-      break;
-    case DEBUG_MODE_VALGRIND:
-      GNUNET_asprintf (&(cntxt->debug_report),
-                      "Bug detected in file:%s\nfunction:%s\nline:%d\nreceived 
signal:%s\n%s\n Details:\n Memory Check from Valgrind:\n%s",
-                      cntxt->gdb_frames->file, cntxt->gdb_frames->func,
-                      cntxt->gdb_frames->line,
-                      cntxt->gdb_stop_reason->signal_name,
-                      cntxt->gdb_stop_reason->signal_meaning,
-                      getValgrindOutput (cntxt));
-      break;
-    default:
-      break;
-    }
-
-  cntxt->debug_mode = DEBUG_MODE_REPORT_READY;
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_delete_context (struct GNUNET_MONKEY_ACTION_Context
-                                    *cntxt)
-{
-  if (NULL != cntxt->debug_report)
-    GNUNET_free (cntxt->debug_report);
-  if (NULL != cntxt->valgrind_output_tmp_file_name)
-    {
-      remove (cntxt->valgrind_output_tmp_file_name);
-      GNUNET_free (cntxt->valgrind_output_tmp_file_name);
-    }
-
-  GNUNET_free (cntxt);
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_ACTION_check_bug_redundancy ()
-{
-  return GNUNET_OK;
-}

Copied: monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c (from 
rev 18819, monkey/src/monkey/action_api.c)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c           
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/action_api.c   
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,977 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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 3, or (at your
+     option) any later version.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file monkey/action_api.c
+ * @brief Monkey API for actions taken by Monkey while debugging
+ */
+
+#include "platform.h"
+#include <gnunet/gnunet_common.h>
+#include "gnunet_monkey_action.h"
+#include "gnunet_monkey_edb.h"
+#include "gnunet_monkey_xml_writer.h"
+#include <gnunet/gnunet_container_lib.h>
+#include <libesmtp.h>
+
+extern void sendMail (const char *messageContents, const char *emailAddress);
+
+
+static int async_c = 0;
+static struct Expression *expressionListHead = NULL;
+static struct Expression *expressionListTail = NULL;
+static struct WatchInfo *watchInfoListHead = NULL;
+static struct WatchInfo *watchInfoListTail = NULL;
+static struct Expression *faultyExpression = NULL;
+static struct FileName *fileNameListHead = NULL;
+static struct FileName *fileNameListTail = NULL;
+static struct ScopeEnd *scopeEndListHead = NULL;
+static struct ScopeEnd *scopeEndListTail = NULL;
+
+
+struct ScopeEnd
+{
+       struct ScopeEnd *next;
+       struct ScopeEnd *prev;
+
+       int lineNo;
+};
+
+
+struct FileName
+{
+  struct FileNames *next;
+  struct FileNames *prev;
+
+  const char *name;
+};
+
+
+struct Expression
+{
+  struct Expression *next;
+  struct Expression *prev;
+  const char *expressionSyntax;
+  const char *expressionValue;
+  int lineNo;
+};
+
+struct WatchInfo
+{
+  struct WatchInfo *next;
+  struct WatchInfo *prev;
+  int hitNumber;
+  const char *value;
+};
+
+
+static void
+cb_console (const char *str, void *data)
+{
+  printf ("CONSOLE> %s\n", str);
+}
+
+
+/* Note that unlike what's documented in gdb docs it isn't usable. */
+static void
+cb_target (const char *str, void *data)
+{
+  printf ("TARGET> %s\n", str);
+}
+
+
+static void
+cb_log (const char *str, void *data)
+{
+  printf ("LOG> %s\n", str);
+}
+
+
+static void
+cb_to (const char *str, void *data)
+{
+  printf (">> %s", str);
+}
+
+
+static void
+cb_from (const char *str, void *data)
+{
+  printf ("<< %s\n", str);
+}
+
+
+static void
+cb_async (mi_output * o, void *data)
+{
+  printf ("ASYNC\n");
+  async_c++;
+}
+
+static int
+isInCodeBase (const char *name)
+{
+  struct FileName *fileName = fileNameListHead;
+  while (NULL != fileName)
+    {
+      if (strcmp (fileName->name, name) == 0)
+       return GNUNET_YES;
+      fileName = fileName->next;
+    }
+  return GNUNET_NO;
+}
+
+
+static int
+wait_for_stop (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  while (!mi_get_response (cntxt->gdb_handle))
+    usleep (1000);
+  /* The end of the async. */
+  cntxt->gdb_stop_reason = mi_res_stop (cntxt->gdb_handle);
+  if (cntxt->gdb_stop_reason)
+    {
+      switch (cntxt->gdb_stop_reason->reason)
+       {
+       case sr_exited_normally:
+         return GDB_STATE_EXIT_NORMALLY;
+
+       case sr_bkpt_hit:
+         {
+           /* We want to inspect an expression */
+           /* Set hardware watch at the expression to inspect */
+           mi_wp *wp =
+             gmi_break_watch (cntxt->gdb_handle, wm_write,
+                              cntxt->inspect_expression);
+           if (NULL == wp)
+             {
+               printf ("Error in setting a watchpoint at expression:%s\n",
+                       cntxt->inspect_expression);
+               return GDB_STATE_ERROR;
+             }
+           mi_free_wp (wp);
+           /* continue execution */
+           gmi_exec_continue (cntxt->gdb_handle);
+           return wait_for_stop (cntxt);
+         }
+       case sr_wp_trigger:
+         {
+                 /* Execution stopped because of hitting a watch point */
+           static int watchPointHitNumber = 0;
+           struct WatchInfo *watchInfo =
+             GNUNET_malloc (sizeof (struct WatchInfo));
+           watchInfo->hitNumber = ++watchPointHitNumber;
+           watchInfo->value = cntxt->gdb_stop_reason->wp_val;
+           GNUNET_CONTAINER_DLL_insert (watchInfoListHead, watchInfoListTail,
+                                        watchInfo);
+           if (watchPointHitNumber == 1023)
+             printf ("HEY! 1023! WE ARE GETTING OUT OF THE LOOP!\n");
+           gmi_exec_continue (cntxt->gdb_handle);
+           return wait_for_stop (cntxt);
+         }
+       case sr_wp_scope:
+         gmi_exec_continue (cntxt->gdb_handle);
+         return wait_for_stop (cntxt);
+
+       default:
+         break;
+       }
+
+      /* Reaching this line means that the program has stopped abnormally */
+
+      cntxt->gdb_frames = gmi_stack_info_frame (cntxt->gdb_handle);
+      if (NULL == cntxt->gdb_frames)
+       {
+         cntxt->gdb_frames = gmi_stack_list_frames (cntxt->gdb_handle);
+         /*
+          * When working with GDB > 6.1, this is normal.
+          * libmigdb fails to load current frame from the handle.
+          * Instead, it's available in the reason struct
+          */
+         //cntxt->gdb_frames = cntxt->gdb_stop_reason->frame;
+
+         //EXPERIMENTAL CODE:
+         while (GNUNET_YES != isInCodeBase (cntxt->gdb_frames->file))
+           {
+             cntxt->gdb_frames = cntxt->gdb_frames->next;
+           }
+
+         if (NULL == cntxt->gdb_frames)
+           GNUNET_break (0);
+       }
+
+      if (0 == cntxt->gdb_frames->line)
+       {
+         /*
+          * This happens if the program stops in a shared library (inner 
frames)
+          * We will move to outer frames until reaching the faulty line in the 
source code
+          */
+         cntxt->gdb_frames = gmi_stack_list_frames (cntxt->gdb_handle);
+         do
+           {
+             cntxt->gdb_frames = cntxt->gdb_frames->next;
+           }
+         while (0 == cntxt->gdb_frames->line);
+       }
+      /* Change current GDB frame to the one containing source code */
+      gmi_stack_select_frame (cntxt->gdb_handle, cntxt->gdb_frames->level);
+
+      return GDB_STATE_STOPPED;
+    }
+  return GDB_STATE_ERROR;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_report_file (struct GNUNET_MONKEY_ACTION_Context *cntxt,
+                                 const char *dumpFileName, int isXML)
+{
+       FILE *file = NULL;
+       if (!isXML) {
+         file = fopen (dumpFileName, "w");
+         GNUNET_assert (NULL != file);
+         fprintf (file, "%s", cntxt->debug_report);
+       } else {
+               file = GNUNET_MONKEY_XML_WRITER_create_document(dumpFileName);
+               GNUNET_MONKEY_XML_WRITER_write_document(file, 
cntxt->xmlReportRootNode);
+       }
+
+       if (NULL != file)
+               fclose(file);
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_report_email (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  if (cntxt->debug_mode == DEBUG_MODE_REPORT_READY)
+    sendMail (cntxt->debug_report, cntxt->email_address);
+
+  return GNUNET_OK;
+}
+
+
+static int
+iterateFileNames (void *cls, int numColumns, char **colValues,
+                 char **colNames)
+{
+  struct FileName *fileName;
+  char *token;
+  char *ext;
+  int tokenLength;
+
+  if (NULL == colValues[0] || NULL == colValues[1])
+    return 1;                  /* Error */
+
+  /* This is done to extract the only the file name from the full path coming 
from the Database */
+  token = strtok (colValues[0], "/");
+  if (NULL == token)
+    return 1;                  /* Error */
+  do
+    {
+      tokenLength = strlen (token);
+      ext = &token[tokenLength - 2];
+      printf ("%s\n", ext);
+      if (strcmp (ext, ".c") == 0)
+       {
+         fileName = GNUNET_malloc (sizeof (struct FileName));
+         fileName->name = strdup (token);
+         GNUNET_CONTAINER_DLL_insert (fileNameListHead, fileNameListTail,
+                                      fileName);
+         return 0;             /* OK */
+       }
+      token = strtok (NULL, "/");
+    }
+  while (NULL != token);
+
+
+  return 1;                    /* Error */
+}
+
+
+
+
+static int
+outerScopesCallback (void *cls, int numColumns, char **colValues,
+               char **colNames)
+{
+       if (NULL == colValues[0])
+               return 1; /* Error */
+
+       struct ScopeEnd *scopeEnd = GNUNET_malloc(sizeof(struct ScopeEnd));
+       scopeEnd->lineNo = atoi(colValues[0]);
+       GNUNET_CONTAINER_DLL_insert (scopeEndListHead, scopeEndListTail,
+                                                scopeEnd);
+       return 0; /* OK */
+}
+
+
+static int
+functionStartCallback (void *cls, int numColumns, char **colValues,
+               char **colNames)
+{
+       struct GNUNET_MONKEY_ACTION_Context *cntxt =
+                       (struct GNUNET_MONKEY_ACTION_Context *) cls;
+
+       if (NULL == colValues[0])
+               return 1; /* Error */
+
+       cntxt->function_start_line = atoi(colValues[0]);
+       return 0; /* OK */
+}
+
+
+static int
+iterateExpressions (void *cls, int numColumns, char **colValues,
+                   char **colNames)
+{
+  struct Expression *expression;
+
+  if (NULL == colValues[0] || NULL == colValues[1])
+    return 1;                  /* Error */
+
+  expression = GNUNET_malloc (sizeof (struct Expression));
+  expression->expressionSyntax = strdup (colValues[0]);
+  expression->lineNo = atoi (colValues[1]);
+
+  GNUNET_CONTAINER_DLL_insert (expressionListHead, expressionListTail,
+                              expression);
+
+  return 0;                    /* OK */
+}
+
+
+static int
+scopeEndCallback (void *cls, int numColumns, char **colValues,
+                 char **colNames)
+{
+  int *scopeEnd = (int *) cls;
+
+  *scopeEnd = atoi (colValues[0]);
+  if (*scopeEnd < 0)
+    return 1;                  /* Error */
+  return 0;
+}
+
+
+static struct Expression *
+getFaultyExpression (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  struct Expression *faultyExpression = NULL;
+  struct Expression *tmp = NULL;
+  int expressionLength = 0;
+
+  tmp = expressionListHead;
+  while (NULL != tmp)
+    {
+      if ((tmp->lineNo == cntxt->gdb_frames->line)
+         && (strlen (tmp->expressionSyntax) > expressionLength))
+       {
+         expressionLength = strlen (tmp->expressionSyntax);
+         faultyExpression = tmp;
+       }
+      tmp = tmp->next;
+    }
+
+  return faultyExpression;
+}
+
+static int
+analyzeSegmentationFault (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  struct Expression *tmp;
+
+
+  faultyExpression = getFaultyExpression (cntxt);
+
+  if (NULL != faultyExpression)
+    {
+      tmp = expressionListHead;
+      while (NULL != tmp)
+       {
+         const char *eval;
+         if (tmp != faultyExpression)
+           {
+             eval =
+               gmi_data_evaluate_expression (cntxt->gdb_handle,
+                                             tmp->expressionSyntax);
+             if (NULL != eval
+                 && (strcmp (eval, "0x0") == 0
+                     || strcmp (eval, "NULL") == 0))
+               {
+                 cntxt->gdb_null_variable = tmp->expressionSyntax;
+                 return GNUNET_OK;
+               }
+           }
+         tmp = tmp->next;
+       }
+    }
+  /* Set watch points on the faulty-expression's subexpressions */
+//      if (NULL != faultyExpression) {
+//              tmp = expressionListHead;
+//              while (NULL != tmp) {
+//                      if (tmp != faultyExpression) {
+//                              /* Only subexpressions are interesting */
+//                               watchPoint = 
gmi_break_watch(cntxt->gdb_handle, wm_write, tmp->expressionSyntax);
+//                               if (!watchPoint)
+//                                 {
+//                                      printf("Error in setting 
watchpoint\n");
+//                                      return 1;
+//                                 }
+//                               printf("Watchpoint %d for expression: %s\n", 
watchPoint->number, watchPoint->exp);
+//                               mi_free_wp(watchPoint);
+//                      }
+//                      tmp = tmp->next;
+//              }
+//              return GNUNET_OK;
+//      }
+  return GDB_STATE_ERROR;
+}
+
+
+
+static int
+analyzeCustomFault (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  struct Expression *tmp;
+  faultyExpression = getFaultyExpression (cntxt);
+
+
+  if (NULL != faultyExpression)
+    {
+      tmp = expressionListHead;
+      while (NULL != tmp)
+       {
+         const char *eval;
+         eval =
+           gmi_data_evaluate_expression (cntxt->gdb_handle,
+                                         tmp->expressionSyntax);
+         if (NULL != eval)
+           {
+             tmp->expressionValue = eval;
+           }
+         tmp = tmp->next;
+       }
+    }
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_inspect_expression_database (struct
+                                                 GNUNET_MONKEY_ACTION_Context
+                                                 *cntxt)
+{
+  struct GNUNET_MONKEY_EDB_Context *edbCntxt;
+  int ret = GNUNET_OK;
+  int endScope;
+  const char *signalMeaning = cntxt->gdb_stop_reason->signal_meaning;
+
+  edbCntxt = GNUNET_MONKEY_EDB_connect (cntxt->expression_database_path);
+  if (NULL == edbCntxt)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Unable to connect to Expression Database file!\n");
+      return GNUNET_NO;
+    }
+
+  ret = GNUNET_MONKEY_EDB_get_expression_scope_end (edbCntxt,
+                                                   cntxt->gdb_frames->file,
+                                                   cntxt->gdb_frames->line,
+                                                   &scopeEndCallback,
+                                                   &endScope);
+  if (endScope <= 0)
+    return GNUNET_NO;
+
+#if EXPRESSION_EVALUATION_DEPTH
+  struct ScopeEnd *scopeEndPtr;
+  int index = 1;
+
+  cntxt->scope_depth = EXPRESSION_EVALUATION_DEPTH;
+  ret = GNUNET_MONKEY_EDB_function_start_line_for_scope(edbCntxt, 
cntxt->gdb_frames->file,
+               endScope,
+               &functionStartCallback, cntxt);
+  if (ret == GNUNET_NO || cntxt->function_start_line <= 0)
+         return GNUNET_NO;
+
+  ret = GNUNET_MONKEY_EDB_get_all_outer_scopes(edbCntxt, 
cntxt->gdb_frames->file,
+               cntxt->function_start_line,
+               cntxt->gdb_frames->line,
+               endScope,
+               &outerScopesCallback, NULL);
+  if (ret == GNUNET_NO)
+         return GNUNET_NO;
+  if (NULL != scopeEndListHead) {
+         scopeEndPtr = scopeEndListHead;
+         while (index < cntxt->scope_depth && NULL != scopeEndPtr)
+                 scopeEndPtr = scopeEndPtr->next;
+         endScope = scopeEndPtr->lineNo;
+  }
+#endif
+
+  if (strcasecmp (signalMeaning, "Segmentation fault") == 0)
+    {
+      cntxt->bug_detected = BUG_NULL_POINTER;
+      GNUNET_MONKEY_EDB_get_expressions (edbCntxt,
+                                        cntxt->gdb_frames->file,
+                                        cntxt->gdb_frames->line, endScope,
+                                        &iterateExpressions, NULL);
+      ret = analyzeSegmentationFault (cntxt);
+    }
+  else if (strcasecmp (signalMeaning, "Aborted") == 0)
+    {
+      cntxt->bug_detected = BUG_CUSTOM;
+      /*
+      GNUNET_MONKEY_EDB_get_sub_expressions (edbCntxt,
+                                            cntxt->gdb_frames->file,
+                                            cntxt->gdb_frames->line,
+                                            endScope, &iterateExpressions,
+                                            NULL);
+                                            */
+      GNUNET_MONKEY_EDB_get_expressions (edbCntxt,
+                                        cntxt->gdb_frames->file,
+                                        cntxt->gdb_frames->line, endScope,
+                                        &iterateExpressions, NULL);
+      ret = analyzeCustomFault (cntxt);
+    }
+  else if (strcasecmp(signalMeaning, "Arithmetic exception") == 0) {
+         cntxt->bug_detected = BUG_CUSTOM;
+         /*
+         GNUNET_MONKEY_EDB_get_sub_expressions (edbCntxt,
+                                                    cntxt->gdb_frames->file,
+                                                    cntxt->gdb_frames->line,
+                                                    endScope, 
&iterateExpressions,
+                                                    NULL);
+                                                    */
+         if (cntxt->scope_depth > 0)
+                 GNUNET_MONKEY_EDB_get_expressions_outer_scopes (edbCntxt,
+                                                                        
cntxt->gdb_frames->file,
+                                                                        
cntxt->gdb_frames->line, endScope,
+                                                                        
&iterateExpressions, NULL);
+         else
+                 GNUNET_MONKEY_EDB_get_expressions (edbCntxt,
+                                                                        
cntxt->gdb_frames->file,
+                                                                        
cntxt->gdb_frames->line, endScope,
+                                                                        
&iterateExpressions, NULL);
+         ret = analyzeCustomFault (cntxt);
+  }
+
+  GNUNET_MONKEY_EDB_disconnect (edbCntxt);
+  mi_disconnect (cntxt->gdb_handle);
+  return ret;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_rerun_with_valgrind (struct GNUNET_MONKEY_ACTION_Context
+                                         *cntxt)
+{
+  char *valgrindCommand;
+  FILE *valgrindPipe;
+
+  GNUNET_asprintf (&cntxt->valgrind_output_tmp_file_name, "%d", rand ());
+  cntxt->debug_mode = DEBUG_MODE_VALGRIND;
+  GNUNET_asprintf (&valgrindCommand,
+                  "valgrind --leak-check=yes --log-file=%s %s",
+                  cntxt->valgrind_output_tmp_file_name, cntxt->binary_name);
+  valgrindPipe = popen (valgrindCommand, "r");
+  if (NULL == valgrindPipe)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error in running Valgrind!\n");
+      GNUNET_free (valgrindCommand);
+      return GNUNET_NO;
+    }
+
+  pclose (valgrindPipe);
+  GNUNET_free (valgrindCommand);
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_rerun_with_gdb (struct GNUNET_MONKEY_ACTION_Context
+                                    *cntxt)
+{
+  struct GNUNET_MONKEY_EDB_Context *edbCntxt;
+  cntxt->debug_mode = DEBUG_MODE_GDB;
+  /* This is like a file-handle for fopen.
+     Here we have all the state of gdb "connection". */
+  if (NULL != cntxt->gdb_binary_path)
+    mi_set_gdb_exe (cntxt->gdb_binary_path);
+  int ret;
+
+  /* Connect to gdb child. */
+  cntxt->gdb_handle = mi_connect_local ();
+  if (!cntxt->gdb_handle)
+    {
+      printf ("Connect failed\n");
+      return GNUNET_NO;
+    }
+  printf ("Connected to gdb!\n");
+
+  /* Set all callbacks. */
+  mi_set_console_cb (cntxt->gdb_handle, cb_console, NULL);
+  mi_set_target_cb (cntxt->gdb_handle, cb_target, NULL);
+  mi_set_log_cb (cntxt->gdb_handle, cb_log, NULL);
+  mi_set_async_cb (cntxt->gdb_handle, cb_async, NULL);
+  mi_set_to_gdb_cb (cntxt->gdb_handle, cb_to, NULL);
+  mi_set_from_gdb_cb (cntxt->gdb_handle, cb_from, NULL);
+
+  /* Set the name of the child and the command line arguments. */
+  if (!gmi_set_exec (cntxt->gdb_handle, cntxt->binary_name, NULL))
+    {
+      printf ("Error setting exec y args\n");
+      mi_disconnect (cntxt->gdb_handle);
+      return GNUNET_NO;
+    }
+
+  /* Tell gdb to attach the child to a terminal. */
+  if (!gmi_target_terminal (cntxt->gdb_handle, ttyname (STDIN_FILENO)))
+    {
+      printf ("Error selecting target terminal\n");
+      mi_disconnect (cntxt->gdb_handle);
+      return GNUNET_NO;
+    }
+
+  if ((NULL != cntxt->inspect_expression)
+      && (NULL != cntxt->inspect_function))
+    {
+      /* Setting a breakpoint at the function containing the expression to 
inspect */
+      mi_bkpt *bp =
+       gmi_break_insert_full (cntxt->gdb_handle, 0, 0, NULL, -1, -1,
+                              cntxt->inspect_function);
+      if (NULL == bp)
+       {
+         printf ("Error setting breakpoint at function:%s\n",
+                 cntxt->inspect_function);
+         mi_disconnect (cntxt->gdb_handle);
+         return GNUNET_NO;
+       }
+      mi_free_bkpt (bp);
+    }
+
+  /* Prepare a list of the file names for the source files we are analyzing */
+  edbCntxt = GNUNET_MONKEY_EDB_connect (cntxt->expression_database_path);
+  if (NULL == edbCntxt)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Unable to connect to Expression Database file!\n");
+      return GNUNET_NO;
+    }
+
+  if (GNUNET_OK != GNUNET_MONKEY_EDB_get_file_names (edbCntxt,
+                                                    &iterateFileNames, NULL))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error in executing Database query!\n");
+    }
+  GNUNET_MONKEY_EDB_disconnect (edbCntxt);
+
+
+  /* Run the program. */
+  if (!gmi_exec_run (cntxt->gdb_handle))
+    {
+      printf ("Error in run!\n");
+      mi_disconnect (cntxt->gdb_handle);
+      return GNUNET_NO;
+    }
+  /* Here we should be stopped when the program crashes */
+  ret = wait_for_stop (cntxt);
+  if (ret == GDB_STATE_ERROR || ret == GDB_STATE_EXIT_NORMALLY)
+    mi_disconnect (cntxt->gdb_handle);
+
+  return ret;
+}
+
+
+static const char *
+expressionListToString (struct Expression *head)
+{
+  char *string = GNUNET_strdup ("");
+  char *strTmp;
+  struct Expression *tmp;
+
+  for (tmp = head; NULL != tmp;  tmp = tmp->next)
+    {
+      GNUNET_asprintf (&strTmp,
+                      "%s%s => %s\n",
+                      string,
+                      tmp->expressionSyntax,
+                      NULL ==
+                      tmp->expressionValue ? "Not evaluated" : tmp->
+                      expressionValue);
+      GNUNET_free (string);
+      string = strTmp;
+    }
+  return string;
+}
+
+#if 0
+static int
+getWatchInfoListSize (struct WatchInfo *head)
+{
+  int count = 0;
+  int largestStr = 0;
+  struct WatchInfo *tmp = head;
+
+  while (NULL != tmp)
+    {
+      if (largestStr < strlen (tmp->value))
+       largestStr = strlen (tmp->value);
+      tmp = tmp->next;
+      count++;
+    }
+
+  return count * largestStr;
+}
+
+static const char *
+watchInfoListToString (struct WatchInfo *head)
+{
+  char *string = GNUNET_malloc (getWatchInfoListSize (head));
+  char *strTmp;
+  struct WatchInfo *tmp = head;
+
+  GNUNET_asprintf (&strTmp, "%s\t \t%s\n", tmp->hitNumber, tmp->value);
+  strcpy (string, strTmp);
+  GNUNET_free (strTmp);
+  tmp = tmp->next;
+
+  while (NULL != tmp)
+    {
+      GNUNET_asprintf (&strTmp, "%s\t \t%s\n", tmp->hitNumber, tmp->value);
+      strcat (string, strTmp);
+      GNUNET_free (strTmp);
+      tmp = tmp->next;
+    }
+
+  return string;
+}
+#endif
+
+static const char *
+getValgrindOutput (struct GNUNET_MONKEY_ACTION_Context *cntxt)
+{
+  char *valgrindOutput;
+  int size;
+  FILE *valgrindFile = fopen (cntxt->valgrind_output_tmp_file_name, "r");
+  fseek (valgrindFile, 0L, SEEK_END);
+  size = ftell (valgrindFile);
+  fseek (valgrindFile, 0L, SEEK_SET);
+
+  valgrindOutput = GNUNET_malloc (size);
+  fread (valgrindOutput, size - 1, 1, valgrindFile);
+  fclose (valgrindFile);
+  return valgrindOutput;
+}
+
+
+static struct GNUNET_MONKEY_XML_Node * createXmlSimpleNode(const char 
*nodeName) {
+       struct GNUNET_MONKEY_XML_Node *node =
+                       GNUNET_MONKEY_XML_WRITER_new_node(nodeName, NULL);
+       return node;
+}
+
+
+static struct GNUNET_MONKEY_XML_Node * createXmlCrashNode(const char 
*category, const char *function, int line, const char *file) {
+       struct GNUNET_MONKEY_XML_Node * node;
+       const char *lineStr;
+
+       GNUNET_asprintf(&lineStr, "%d", line);
+       node = GNUNET_MONKEY_XML_WRITER_new_node("crash", NULL);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "category", category);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "function", function);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "line", lineStr);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "file", file);
+       return node;
+}
+
+
+static struct GNUNET_MONKEY_XML_Node * createXmlEpochStep(int step) {
+       struct GNUNET_MONKEY_XML_Node * node;
+       const char *stepStr;
+       GNUNET_asprintf(&stepStr, "%d", step);
+       node = GNUNET_MONKEY_XML_WRITER_new_node("epoch", NULL);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "step", stepStr);
+       return node;
+}
+
+
+static struct GNUNET_MONKEY_XML_Node * createXmlFunctionNode(const char *name, 
int line, const char *file, int depth) {
+       struct GNUNET_MONKEY_XML_Node * node;
+       const char *lineStr;
+       const char *depthStr;
+
+       GNUNET_asprintf(&lineStr, "%d", line);
+       GNUNET_asprintf(&depthStr, "%d", depth);
+       node = GNUNET_MONKEY_XML_WRITER_new_node("function", NULL);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "name", name);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "line", lineStr);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "file", file);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "depth", depthStr);
+       return node;
+}
+
+
+static struct GNUNET_MONKEY_XML_Node * createXmlExpressionNode(const char 
*name, const char *value) {
+       struct GNUNET_MONKEY_XML_Node * node;
+
+       node = GNUNET_MONKEY_XML_WRITER_new_node("expression", value);
+       GNUNET_MONKEY_XML_WRITER_add_attribute(node, "name", name);
+       return node;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_format_report_xml (struct GNUNET_MONKEY_ACTION_Context
+                                       *cntxt) {
+       struct GNUNET_MONKEY_XML_Node *node;
+       char *str;
+
+       switch (cntxt->debug_mode) {
+       case DEBUG_MODE_GDB:
+               switch (cntxt->bug_detected) {
+               case BUG_NULL_POINTER:
+                       cntxt->xmlReportRootNode = createXmlCrashNode("npe", 
cntxt->gdb_frames->func, cntxt->gdb_frames->line, cntxt->gdb_frames->file);
+                       node = 
GNUNET_MONKEY_XML_WRITER_add_child(cntxt->xmlReportRootNode, 
createXmlSimpleNode("history"));
+                       node = GNUNET_MONKEY_XML_WRITER_add_child(node, 
createXmlEpochStep(0));
+                       node = GNUNET_MONKEY_XML_WRITER_add_child(node, 
createXmlSimpleNode("trace"));
+                       node = GNUNET_MONKEY_XML_WRITER_add_child(node, 
createXmlFunctionNode(cntxt->gdb_frames->func, cntxt->gdb_frames->line, 
cntxt->gdb_frames->file, 0));
+                       node = GNUNET_MONKEY_XML_WRITER_add_child(node, 
createXmlSimpleNode("expressions"));
+                       node = GNUNET_MONKEY_XML_WRITER_add_child(node, 
createXmlExpressionNode(cntxt->gdb_null_variable, "NULL"));
+
+                       break;
+               case BUG_CUSTOM:
+               default:
+                       return GNUNET_NO; //problem!
+               }
+               break;
+       case DEBUG_MODE_VALGRIND:
+               break;
+       default:
+               return GNUNET_NO; //problem!
+       }
+       return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_format_report (struct GNUNET_MONKEY_ACTION_Context
+                                   *cntxt)
+{
+  switch (cntxt->debug_mode)
+    {
+    case DEBUG_MODE_GDB:
+      if (cntxt->bug_detected == BUG_NULL_POINTER)
+       {
+         GNUNET_asprintf (&(cntxt->debug_report),
+                          "Bug detected in 
file:%s\nfunction:%s\nline:%d\nreason:%s\nreceived signal:%s\n%s\n Details:\n 
Expression:%s is NULL\n",
+                          cntxt->gdb_frames->file, cntxt->gdb_frames->func,
+                          cntxt->gdb_frames->line,
+                          mi_reason_enum_to_str (cntxt->
+                                                 gdb_stop_reason->reason),
+                          cntxt->gdb_stop_reason->signal_name,
+                          cntxt->gdb_stop_reason->signal_meaning,
+                          cntxt->gdb_null_variable);
+       }
+      else if (cntxt->bug_detected == BUG_CUSTOM)
+       {
+         if (NULL == cntxt->inspect_expression)
+           {
+             /* Assertion Failure or Arithmetic Exception (Division by Zero, 
etc...) */
+           const char *expToString =
+               expressionListToString (expressionListHead);
+
+           if (strcasecmp(cntxt->gdb_stop_reason->signal_meaning, "Arithmetic 
exception") == 0) {
+               GNUNET_asprintf (&(cntxt->debug_report),
+                                                          "Bug detected in 
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nArithmetic 
Exception: Division by Zero suspected\nExpression evaluation:\n%s\n",
+                                                          
cntxt->gdb_frames->file,
+                                                          
cntxt->gdb_frames->func,
+                                                          
cntxt->gdb_frames->line,
+                                                          
cntxt->gdb_stop_reason->signal_name,
+                                                          
cntxt->gdb_stop_reason->signal_meaning,
+                                                          expToString);
+           }
+           else {
+               /* Assertion Failure */
+                       GNUNET_asprintf (&(cntxt->debug_report),
+                                          "Bug detected in 
file:%s\nfunction:%s\nline:%d\nreceived signal:%s\n%s\nDetails:\nAssertion 
Failure\nExpression evaluation:\n%s\n",
+                                          cntxt->gdb_frames->file,
+                                          cntxt->gdb_frames->func,
+                                          cntxt->gdb_frames->line,
+                                          cntxt->gdb_stop_reason->signal_name,
+                                          
cntxt->gdb_stop_reason->signal_meaning,
+                                          expToString);
+           }
+           }
+         else
+           {
+             /* Inspection of user-defined expression */
+             /*
+                GNUNET_asprintf(&(cntxt->debug_report),
+                "Inspection of expression: %s in function: %s, file:%s\nHit 
Number: \t \tValue:\n%s",
+                cntxt->inspect_expression, cntxt->inspect_function, 
cntxt->binary_name, watchInfoListToString(watchInfoListHead));
+              */
+           }
+       }
+      break;
+    case DEBUG_MODE_VALGRIND:
+      GNUNET_asprintf (&(cntxt->debug_report),
+                      "Bug detected in file:%s\nfunction:%s\nline:%d\nreceived 
signal:%s\n%s\n Details:\n Memory Check from Valgrind:\n%s",
+                      cntxt->gdb_frames->file, cntxt->gdb_frames->func,
+                      cntxt->gdb_frames->line,
+                      cntxt->gdb_stop_reason->signal_name,
+                      cntxt->gdb_stop_reason->signal_meaning,
+                      getValgrindOutput (cntxt));
+      break;
+    default:
+      break;
+    }
+
+  cntxt->debug_mode = DEBUG_MODE_REPORT_READY;
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_delete_context (struct GNUNET_MONKEY_ACTION_Context
+                                    *cntxt)
+{
+  if (NULL != cntxt->debug_report)
+    GNUNET_free (cntxt->debug_report);
+  if (NULL != cntxt->valgrind_output_tmp_file_name)
+    {
+      remove (cntxt->valgrind_output_tmp_file_name);
+      GNUNET_free (cntxt->valgrind_output_tmp_file_name);
+    }
+  if (NULL != cntxt->xmlReportRootNode)
+         GNUNET_MONKEY_XML_WRITER_delete_tree(cntxt->xmlReportRootNode);
+
+  GNUNET_free (cntxt);
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_ACTION_check_bug_redundancy ()
+{
+  return GNUNET_OK;
+}

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_bug_assertion_failure.db
 (from rev 18581, monkey/src/monkey/bug_bug_assertion_failure.db)
===================================================================
Deleted: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
===================================================================
--- monkey/src/monkey/bug_division_by_zero_loop.c       2011-12-08 09:27:43 UTC 
(rev 18504)
+++ 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
    2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,19 +0,0 @@
-#include <stdio.h>
-
-int
-main (int argc, char *argv[])
-{
-  int i;
-  int k = -1;
-  int result = 10;
-  int tmp;
-
-  printf("I am alive!\n");
-  for (i = 0; i < 5; i++)
-    {
-      k += i;
-      result = result / k;     /* Division by zero in second iteration */
-      printf("result = %d\n", result);
-    }
-  return 0;
-}

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
 (from rev 18581, monkey/src/monkey/bug_division_by_zero_loop.c)
===================================================================
--- 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
                            (rev 0)
+++ 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.c
    2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,18 @@
+#include <stdio.h>
+
+int
+main (int argc, char *argv[])
+{
+  int i, k, result, tmp;
+  k = -1;
+  result = 10;
+
+  printf("I am alive!\n");
+  for (i = 0; i < 5; i++)
+    {
+      k += i;
+      result = result / k;     /* Division by zero in second iteration */
+      printf("result = %d\n", result);
+    }
+  return 0;
+}

Deleted: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.db
===================================================================
(Binary files differ)

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/bug_division_by_zero_loop.db
 (from rev 18581, monkey/src/monkey/bug_division_by_zero_loop.db)
===================================================================
(Binary files differ)

Deleted: monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c
===================================================================
--- monkey/src/monkey/edb_api.c 2011-12-08 09:27:43 UTC (rev 18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c      
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,229 +0,0 @@
-/*
-     This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
-
-     GNUnet 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 3, or (at your
-     option) any later version.
-
-     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file monkey/edb_api.c
- * @brief Monkey API for accessing the Expression Database (edb)
- */
-
-#include "platform.h"
-#include <gnunet/gnunet_common.h>
-#include "gnunet_monkey_edb.h"
-#include <sqlite3.h>
-
-
-/**
- * Context for Database connection and Expressions
- */
-struct GNUNET_MONKEY_EDB_Context
-{
-  /**
-   *  Database connection 
-   */
-  sqlite3 *db_handle;
-};
-
-
-/**
- * Establish a connection to the Expression Database
- *
- * @param db_file_name path the Expression Database file
- * @return context to use for Accessing the Expression Database, NULL on error
- */
-struct GNUNET_MONKEY_EDB_Context *
-GNUNET_MONKEY_EDB_connect (const char *db_file_name)
-{
-  int err;
-  struct GNUNET_MONKEY_EDB_Context *ctxt =
-    GNUNET_malloc (sizeof (struct GNUNET_MONKEY_EDB_Context));
-
-  err = sqlite3_open (db_file_name, &ctxt->db_handle);
-  if (err)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Cannot open Expression Database. `%s'\n",
-                 sqlite3_errmsg (ctxt->db_handle));
-      return NULL;
-    }
-  return ctxt;
-}
-
-
-/**
- * Disconnect from Database, and cleanup resources
- *
- * @param context context containing the Expression Database handle
- * @return GNUNET_OK on success, GNUNET_NO on failure
- */
-int
-GNUNET_MONKEY_EDB_disconnect (struct GNUNET_MONKEY_EDB_Context *cntxt)
-{
-  sqlite3_close (cntxt->db_handle);
-  GNUNET_free (cntxt);
-  return GNUNET_OK;
-}
-
-
-
-int
-GNUNET_MONKEY_EDB_get_file_names (struct GNUNET_MONKEY_EDB_Context *cntxt,
-                                 GNUNET_MONKEY_FileIterator iter,
-                                 void *iter_cls)
-{
-  int err;
-  char *errMsg;
-  char *query;
-
-  if (asprintf (&query, "select distinct file_name from Expression") == -1)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Memory allocation problem occurred during creating database 
query!\n");
-      return GNUNET_NO;
-    }
-
-  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
-  if (err)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Error occurred while executing Database query. `%s'",
-                 errMsg);
-      return GNUNET_NO;
-    }
-  return GNUNET_OK;
-}
-
-
-/**
- * Return the line number of the end-of-scope for the expression indicated by 
start_line_no
- *
- * @param cntxt context containing the Expression Database handle
- * @param file_name path to the file in which the expression in question exists
- * @param start_line_no expression's line
- * @param iter callback function, iterator for values returned from the 
Database
- * @param iter_cls closure for the expression iterator, will contain the 
scope-end line number
- * @return GNUNET_OK on success, GNUNET_NO on failure
- */
-int
-GNUNET_MONKEY_EDB_get_expression_scope_end (struct GNUNET_MONKEY_EDB_Context
-                                           *cntxt, const char *file_name,
-                                           int start_line_no,
-                                           GNUNET_MONKEY_ExpressionIterator
-                                           iter, void *iter_cls)
-{
-  int err;
-  char *errMsg;
-  char *query;
-
-  if (asprintf
-      (&query,
-       "select end_lineno from Expression where file_name LIKE \'%%/%s\' and 
start_lineno = %d",
-       file_name, start_line_no) == -1)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Memory allocation problem occurred during creating database 
query!\n");
-      return GNUNET_NO;
-    }
-
-  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
-  if (err)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Error occurred while executing Database query. `%s'",
-                 errMsg);
-      return GNUNET_NO;
-    }
-  return GNUNET_OK;
-}
-
-
-/**
- * Run an SQLite query to retrieve those expressions that are previous to
- * given expression and are in the same scope of the given expression
- * 
- * @param cntxt context containing the Expression Database handle
- * @param file_name path to the file in which the expression in question exists
- * @param start_line_no expression beginning line
- * @param end_line_no line number for the expression's scope end
- * @param iter callback function, iterator for expressions returned from the 
Database
- * @param iter_cls closure for the expression iterator
- * @return GNUNET_OK success, GNUNET_NO failure
- */
-int
-GNUNET_MONKEY_EDB_get_expressions (struct GNUNET_MONKEY_EDB_Context *cntxt,
-                                  const char *file_name, int start_line_no,
-                                  int end_line_no,
-                                  GNUNET_MONKEY_ExpressionIterator iter,
-                                  void *iter_cls)
-{
-  int err;
-  char *errMsg;
-  char *query;
-  if (asprintf
-      (&query,
-       "select expr_syntax, start_lineno from Expression where file_name LIKE 
\'%%/%s\' and start_lineno <= %d and end_lineno = %d",
-       file_name, start_line_no, end_line_no) == -1)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Memory allocation problem occurred!\n");
-      return GNUNET_NO;
-    }
-
-  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
-  if (err)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Error occurred while executing Database query. `%s'",
-                 errMsg);
-      return GNUNET_NO;
-    }
-  return GNUNET_OK;
-}
-
-
-int
-GNUNET_MONKEY_EDB_get_sub_expressions (struct GNUNET_MONKEY_EDB_Context
-                                      *cntxt, const char *file_name,
-                                      int start_line_no, int end_line_no,
-                                      GNUNET_MONKEY_ExpressionIterator iter,
-                                      void *iter_cls)
-{
-  int err;
-  char *errMsg;
-  char *query;
-  if (asprintf
-      (&query,
-       "select expr_syntax, start_lineno from Expression where file_name LIKE 
\'%%/%s\' and start_lineno = %d and end_lineno = %d",
-       file_name, start_line_no, end_line_no) == -1)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Memory allocation problem occurred!\n");
-      return GNUNET_NO;
-    }
-
-  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
-  if (err)
-    {
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                 "Error occurred while executing Database query. `%s'",
-                 errMsg);
-      return GNUNET_NO;
-    }
-  return GNUNET_OK;
-}

Copied: monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c (from 
rev 18581, monkey/src/monkey/edb_api.c)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c              
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/edb_api.c      
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,329 @@
+/*
+     This file is part of GNUnet.
+     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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 3, or (at your
+     option) any later version.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file monkey/edb_api.c
+ * @brief Monkey API for accessing the Expression Database (edb)
+ */
+
+#include "platform.h"
+#include <gnunet/gnunet_common.h>
+#include "gnunet_monkey_edb.h"
+#include <sqlite3.h>
+
+
+/**
+ * Context for Database connection and Expressions
+ */
+struct GNUNET_MONKEY_EDB_Context
+{
+  /**
+   *  Database connection 
+   */
+  sqlite3 *db_handle;
+};
+
+
+/**
+ * Establish a connection to the Expression Database
+ *
+ * @param db_file_name path the Expression Database file
+ * @return context to use for Accessing the Expression Database, NULL on error
+ */
+struct GNUNET_MONKEY_EDB_Context *
+GNUNET_MONKEY_EDB_connect (const char *db_file_name)
+{
+  int err;
+  struct GNUNET_MONKEY_EDB_Context *ctxt =
+    GNUNET_malloc (sizeof (struct GNUNET_MONKEY_EDB_Context));
+
+  err = sqlite3_open (db_file_name, &ctxt->db_handle);
+  if (err)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Cannot open Expression Database. `%s'\n",
+                 sqlite3_errmsg (ctxt->db_handle));
+      return NULL;
+    }
+  return ctxt;
+}
+
+
+/**
+ * Disconnect from Database, and cleanup resources
+ *
+ * @param context context containing the Expression Database handle
+ * @return GNUNET_OK on success, GNUNET_NO on failure
+ */
+int
+GNUNET_MONKEY_EDB_disconnect (struct GNUNET_MONKEY_EDB_Context *cntxt)
+{
+  sqlite3_close (cntxt->db_handle);
+  GNUNET_free (cntxt);
+  return GNUNET_OK;
+}
+
+
+
+int
+GNUNET_MONKEY_EDB_get_file_names (struct GNUNET_MONKEY_EDB_Context *cntxt,
+                                 GNUNET_MONKEY_FileIterator iter,
+                                 void *iter_cls)
+{
+  int err;
+  char *errMsg;
+  char *query;
+
+  if (asprintf (&query, "select distinct file_name from Expression") == -1)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Memory allocation problem occurred during creating database 
query!\n");
+      return GNUNET_NO;
+    }
+
+  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+  if (err)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error occurred while executing Database query. `%s'",
+                 errMsg);
+      return GNUNET_NO;
+    }
+  return GNUNET_OK;
+}
+
+
+
+int
+GNUNET_MONKEY_EDB_get_all_outer_scopes(struct GNUNET_MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int function_beginning,
+               int scope_in_question_start,
+               int scope_in_question_end,
+               GNUNET_MONKEY_ExpressionIterator
+               iter, void *iter_cls)
+{
+         int err;
+         char *errMsg;
+         char *query;
+
+         if (asprintf
+                 (&query,
+                  "select distinct end_lineno from Expression where file_name 
LIKE \'%%/%s\' and start_lineno >= %d and start_lineno < %d and end_lineno > %d 
order by end_lineno",
+                  file_name, function_beginning, scope_in_question_start, 
scope_in_question_end) == -1)
+               {
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Memory allocation problem occurred during creating 
database query!\n");
+                 return GNUNET_NO;
+               }
+
+         err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+         if (err)
+               {
+                 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Error occurred while executing Database query. `%s'",
+                         errMsg);
+                 return GNUNET_NO;
+               }
+         return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_EDB_function_start_line_for_scope(struct 
GNUNET_MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int scope_end,
+               GNUNET_MONKEY_ExpressionIterator
+               iter, void *iter_cls)
+{
+         int err;
+         char *errMsg;
+         char *query;
+
+         if (asprintf
+             (&query,
+              "select MIN(start_lineno) from Expression where file_name LIKE 
\'%%/%s\' and end_lineno >= %d",
+              file_name, scope_end) == -1)
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Memory allocation problem occurred during creating 
database query!\n");
+             return GNUNET_NO;
+           }
+
+         err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+         if (err)
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Error occurred while executing Database query. `%s'",
+                         errMsg);
+             return GNUNET_NO;
+           }
+         return GNUNET_OK;
+}
+
+
+/**
+ * Return the line number of the end-of-scope for the expression indicated by 
start_line_no
+ *
+ * @param cntxt context containing the Expression Database handle
+ * @param file_name path to the file in which the expression in question exists
+ * @param start_line_no expression's line
+ * @param iter callback function, iterator for values returned from the 
Database
+ * @param iter_cls closure for the expression iterator, will contain the 
scope-end line number
+ * @return GNUNET_OK on success, GNUNET_NO on failure
+ */
+int
+GNUNET_MONKEY_EDB_get_expression_scope_end (struct GNUNET_MONKEY_EDB_Context
+                                           *cntxt, const char *file_name,
+                                           int start_line_no,
+                                           GNUNET_MONKEY_ExpressionIterator
+                                           iter, void *iter_cls)
+{
+  int err;
+  char *errMsg;
+  char *query;
+
+  if (asprintf
+      (&query,
+       "select end_lineno from Expression where file_name LIKE \'%%/%s\' and 
start_lineno = %d",
+       file_name, start_line_no) == -1)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Memory allocation problem occurred during creating database 
query!\n");
+      return GNUNET_NO;
+    }
+
+  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+  if (err)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error occurred while executing Database query. `%s'",
+                 errMsg);
+      return GNUNET_NO;
+    }
+  return GNUNET_OK;
+}
+
+
+
+int
+GNUNET_MONKEY_EDB_get_expressions_outer_scopes (struct 
GNUNET_MONKEY_EDB_Context *cntxt,
+                                  const char *file_name, int start_line_no,
+                                  int end_line_no,
+                                  GNUNET_MONKEY_ExpressionIterator iter,
+                                  void *iter_cls) {
+  int err;
+  char *errMsg;
+  char *query;
+  if (asprintf
+         (&query,
+          "select expr_syntax, start_lineno from Expression where file_name 
LIKE \'%%/%s\' and start_lineno <= %d and end_lineno <= %d",
+          file_name, start_line_no, end_line_no) == -1)
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Memory allocation problem occurred!\n");
+         return GNUNET_NO;
+       }
+
+  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+  if (err)
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error occurred while executing Database query. `%s'",
+                 errMsg);
+         return GNUNET_NO;
+       }
+  return GNUNET_OK;
+}
+
+/**
+ * Run an SQLite query to retrieve those expressions that are previous to
+ * given expression and are in the same scope of the given expression
+ * 
+ * @param cntxt context containing the Expression Database handle
+ * @param file_name path to the file in which the expression in question exists
+ * @param start_line_no expression beginning line
+ * @param end_line_no line number for the expression's scope end
+ * @param iter callback function, iterator for expressions returned from the 
Database
+ * @param iter_cls closure for the expression iterator
+ * @return GNUNET_OK success, GNUNET_NO failure
+ */
+int
+GNUNET_MONKEY_EDB_get_expressions (struct GNUNET_MONKEY_EDB_Context *cntxt,
+                                  const char *file_name, int start_line_no,
+                                  int end_line_no,
+                                  GNUNET_MONKEY_ExpressionIterator iter,
+                                  void *iter_cls)
+{
+  int err;
+  char *errMsg;
+  char *query;
+  if (asprintf
+      (&query,
+       "select expr_syntax, start_lineno from Expression where file_name LIKE 
\'%%/%s\' and start_lineno <= %d and end_lineno = %d",
+       file_name, start_line_no, end_line_no) == -1)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Memory allocation problem occurred!\n");
+      return GNUNET_NO;
+    }
+
+  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+  if (err)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error occurred while executing Database query. `%s'",
+                 errMsg);
+      return GNUNET_NO;
+    }
+  return GNUNET_OK;
+}
+
+
+int
+GNUNET_MONKEY_EDB_get_sub_expressions (struct GNUNET_MONKEY_EDB_Context
+                                      *cntxt, const char *file_name,
+                                      int start_line_no, int end_line_no,
+                                      GNUNET_MONKEY_ExpressionIterator iter,
+                                      void *iter_cls)
+{
+  int err;
+  char *errMsg;
+  char *query;
+  if (asprintf
+      (&query,
+       "select expr_syntax, start_lineno from Expression where file_name LIKE 
\'%%/%s\' and start_lineno = %d and end_lineno = %d",
+       file_name, start_line_no, end_line_no) == -1)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Memory allocation problem occurred!\n");
+      return GNUNET_NO;
+    }
+
+  err = sqlite3_exec (cntxt->db_handle, query, iter, iter_cls, &errMsg);
+  if (err)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                 "Error occurred while executing Database query. `%s'",
+                 errMsg);
+      return GNUNET_NO;
+    }
+  return GNUNET_OK;
+}

Deleted: monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c
===================================================================
--- monkey/src/monkey/gnunet-monkey.c   2011-12-08 09:27:43 UTC (rev 18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c        
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,218 +0,0 @@
-/*
-     This file is part of GNUnet.
-     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
-
-     GNUnet 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 3, or (at your
-     option) any later version.
-
-     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
-*/
-
-/**
- * @file monkey/gnunet-monkey.c
- * @brief Monkey: gnunet automated debugging tool
- */
-
-#include <stdio.h>
-#include <sys/stat.h>
-#include "platform.h"
-#include <gnunet/gnunet_util_lib.h>
-#include "gnunet_monkey_action.h"
-
-static const char *mode;
-static const char *dumpFileName;
-static const char *binaryName;
-static const char *emailAddress;
-static const char *edbFilePath;
-static const char *gdbBinaryPath;
-static const char *inspectExpression;
-static const char *inspectFunction;
-static int ret = 0;
-
-/**
- * Main function that will launch the action api.
- *
- * @param cls closure
- * @param args remaining command-line arguments
- * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
- * @param c configuration
- */
-static void
-run (void *cls,
-     char *const *args,
-     const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
-{
-  int result;
-  struct GNUNET_MONKEY_ACTION_Context *cntxt;
-
-  if (NULL == edbFilePath)
-    {
-      /* lookup a file named test.db in the working directory */
-      struct stat buf;
-      if (0 != stat ("test.db", &buf))
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     "Expression Database file was not provided as and 
argument, "
-                     "and there is no file named test.db in monkey's working 
directory!\n");
-         GNUNET_break (0);
-         ret = 1;
-         return;
-       }
-
-    }
-
-  if (NULL == dumpFileName)
-    {
-      /* if no file name provided for the output report, use a default one in 
the current working directory */
-      dumpFileName = "monkey_output";
-    }
-
-  if (strcasecmp (mode, "email") == 0)
-    {
-      if (NULL == emailAddress)
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     "Working in email mode requires an email address!\n");
-         GNUNET_break (0);
-         ret = 1;
-         return;
-       }
-    }
-
-  /* Initialize context for the Action API */
-  cntxt = GNUNET_malloc (sizeof (struct GNUNET_MONKEY_ACTION_Context));
-  cntxt->binary_name = binaryName;
-  cntxt->expression_database_path = edbFilePath;
-  cntxt->gdb_binary_path = gdbBinaryPath;
-  cntxt->inspect_expression = inspectExpression;
-  cntxt->inspect_function = inspectFunction;
-
-  result = GNUNET_MONKEY_ACTION_rerun_with_gdb (cntxt);
-  switch (result)
-    {
-      int retVal;
-    case GDB_STATE_ERROR:
-      break;
-    case GDB_STATE_EXIT_NORMALLY:
-      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                 "Debug with gdb, program exited normally!\n");
-      /*FIXME: Valgrind should be launched here */
-      break;
-    case GDB_STATE_STOPPED:
-      /*FIXME: Expression Database should be inspected here (before writing 
the report) */
-      retVal = GNUNET_MONKEY_ACTION_inspect_expression_database (cntxt);
-      if (GNUNET_NO == retVal)
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     "Error using Expression Database!\n");
-         ret = 1;
-         break;
-       }
-      else if (GDB_STATE_ERROR == retVal)
-       {
-         /* GDB could not locate a NULL value expression, launch Valgrind */
-         retVal = GNUNET_MONKEY_ACTION_rerun_with_valgrind (cntxt);
-         if (GNUNET_NO == retVal)
-           {
-             GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error using Valgrind!\n");
-             ret = 1;
-             break;
-           }
-       }
-      if (GNUNET_OK != GNUNET_MONKEY_ACTION_format_report (cntxt))
-       {
-         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                     "Error in generating debug report!\n");
-         ret = 1;
-       }
-      if (strcasecmp (mode, "email") == 0)
-       {
-         if (GNUNET_OK != GNUNET_MONKEY_ACTION_report_email (cntxt))
-           {
-             GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error sending email!\n");
-             ret = 1;
-           }
-       }
-      else
-       {
-         /* text mode */
-         if (GNUNET_OK !=
-             GNUNET_MONKEY_ACTION_report_file (cntxt, dumpFileName))
-           {
-             GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                         "Error in saving debug file!\n");
-             ret = 1;
-           }
-       }
-      break;
-    default:
-      break;
-    }
-  GNUNET_MONKEY_ACTION_delete_context (cntxt);
-}
-
-
-int
-main (int argc, char *argv[])
-{
-  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
-    {'m', "mode", NULL,
-     gettext_noop
-     ("mandatory:monkey's mode of operation: options are \"text\" or 
\"email\""),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &mode},
-    {'b', "binary", NULL,
-     gettext_noop
-     ("mandatory:path to a binary file for a program to debug with monkey"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &binaryName},
-    {'o', "output", NULL,
-     gettext_noop
-     ("path to the debug report generated by monkey. If not provided, monkey 
will save the report in file named monkey_output"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &dumpFileName},
-    {'a', "address", NULL,
-     gettext_noop ("email address to which monkey will send debug report"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &emailAddress},
-    {'d', "database", NULL,
-     gettext_noop ("mandatory:path to Expression Database file"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &edbFilePath},
-    {'g', "gdb", NULL,
-     gettext_noop ("path to gdb binary to use. Default is /usr/bin/gdb"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &gdbBinaryPath},
-    {'f', "function", NULL,
-     gettext_noop ("monkey will set a breakpoint on this function"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &inspectFunction},
-    {'i', "inspect", NULL,
-     gettext_noop
-     ("expression to inspect in the function specified after the argument f"),
-     GNUNET_YES, &GNUNET_GETOPT_set_string, &inspectExpression},
-    GNUNET_GETOPT_OPTION_END
-  };
-
-  if (argc < 2)
-    {
-      printf ("%s",
-             "Monkey should take arguments: Use --help to get a list of 
options.\n");
-      return 1;
-    }
-
-  if (GNUNET_OK == GNUNET_PROGRAM_run (argc,
-                                      argv,
-                                      "gnunet-monkey",
-                                      gettext_noop
-                                      ("Automatically debug a service"),
-                                      options, &run, NULL))
-    {
-      return ret;
-    }
-
-  return 1;
-}

Copied: monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c 
(from rev 18819, monkey/src/monkey/gnunet-monkey.c)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c        
                        (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet-monkey.c        
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,221 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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 3, or (at your
+     option) any later version.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file monkey/gnunet-monkey.c
+ * @brief Monkey: gnunet automated debugging tool
+ */
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include "platform.h"
+#include <gnunet/gnunet_util_lib.h>
+#include "gnunet_monkey_action.h"
+
+static const char *mode;
+static const char *dumpFileName;
+static const char *binaryName;
+static const char *emailAddress;
+static const char *edbFilePath;
+static const char *gdbBinaryPath;
+static const char *inspectExpression;
+static const char *inspectFunction;
+static int ret = 0;
+
+/**
+ * Main function that will launch the action api.
+ *
+ * @param cls closure
+ * @param args remaining command-line arguments
+ * @param cfgfile name of the configuration file used (for saving, can be 
NULL!)
+ * @param c configuration
+ */
+static void
+run (void *cls,
+     char *const *args,
+     const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
+{
+  int result;
+  struct GNUNET_MONKEY_ACTION_Context *cntxt;
+
+  if (NULL == edbFilePath)
+    {
+      /* lookup a file named test.db in the working directory */
+      struct stat buf;
+      if (0 != stat ("test.db", &buf))
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     "Expression Database file was not provided as and 
argument, "
+                     "and there is no file named test.db in monkey's working 
directory!\n");
+         GNUNET_break (0);
+         ret = 1;
+         return;
+       }
+
+    }
+
+  if (NULL == dumpFileName)
+    {
+      /* if no file name provided for the output report, use a default one in 
the current working directory */
+      dumpFileName = "monkey_output";
+    }
+
+  if (strcasecmp (mode, "email") == 0)
+    {
+      if (NULL == emailAddress)
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     "Working in email mode requires an email address!\n");
+         GNUNET_break (0);
+         ret = 1;
+         return;
+       }
+    }
+
+  /* Initialize context for the Action API */
+  cntxt = GNUNET_malloc (sizeof (struct GNUNET_MONKEY_ACTION_Context));
+  cntxt->binary_name = binaryName;
+  cntxt->expression_database_path = edbFilePath;
+  cntxt->gdb_binary_path = gdbBinaryPath;
+  cntxt->inspect_expression = inspectExpression;
+  cntxt->inspect_function = inspectFunction;
+  cntxt->function_start_line = 0;
+  cntxt->scope_depth = 0;
+  cntxt->xmlReportRootNode = NULL;
+
+  result = GNUNET_MONKEY_ACTION_rerun_with_gdb (cntxt);
+  switch (result)
+    {
+      int retVal;
+    case GDB_STATE_ERROR:
+      break;
+    case GDB_STATE_EXIT_NORMALLY:
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                 "Debug with gdb, program exited normally!\n");
+      /*FIXME: Valgrind should be launched here */
+      break;
+    case GDB_STATE_STOPPED:
+      /*FIXME: Expression Database should be inspected here (before writing 
the report) */
+      retVal = GNUNET_MONKEY_ACTION_inspect_expression_database (cntxt);
+      if (GNUNET_NO == retVal)
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     "Error using Expression Database!\n");
+         ret = 1;
+         break;
+       }
+      else if (GDB_STATE_ERROR == retVal)
+       {
+         /* GDB could not locate a NULL value expression, launch Valgrind */
+         retVal = GNUNET_MONKEY_ACTION_rerun_with_valgrind (cntxt);
+         if (GNUNET_NO == retVal)
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error using Valgrind!\n");
+             ret = 1;
+             break;
+           }
+       }
+      if (GNUNET_OK != GNUNET_MONKEY_ACTION_format_report_xml (cntxt))
+       {
+         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                     "Error in generating debug report!\n");
+         ret = 1;
+       }
+      if (strcasecmp (mode, "email") == 0)
+       {
+         if (GNUNET_OK != GNUNET_MONKEY_ACTION_report_email (cntxt))
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error sending email!\n");
+             ret = 1;
+           }
+       }
+      else
+       {
+         /* text mode */
+         if (GNUNET_OK !=
+             GNUNET_MONKEY_ACTION_report_file (cntxt, dumpFileName, 
GNUNET_YES))
+           {
+             GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                         "Error in saving debug file!\n");
+             ret = 1;
+           }
+       }
+      break;
+    default:
+      break;
+    }
+  GNUNET_MONKEY_ACTION_delete_context (cntxt);
+}
+
+
+int
+main (int argc, char *argv[])
+{
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'m', "mode", NULL,
+     gettext_noop
+     ("mandatory:monkey's mode of operation: options are \"text\" or 
\"email\""),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &mode},
+    {'b', "binary", NULL,
+     gettext_noop
+     ("mandatory:path to a binary file for a program to debug with monkey"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &binaryName},
+    {'o', "output", NULL,
+     gettext_noop
+     ("path to the debug report generated by monkey. If not provided, monkey 
will save the report in file named monkey_output"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &dumpFileName},
+    {'a', "address", NULL,
+     gettext_noop ("email address to which monkey will send debug report"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &emailAddress},
+    {'d', "database", NULL,
+     gettext_noop ("mandatory:path to Expression Database file"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &edbFilePath},
+    {'g', "gdb", NULL,
+     gettext_noop ("path to gdb binary to use. Default is /usr/bin/gdb"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &gdbBinaryPath},
+    {'f', "function", NULL,
+     gettext_noop ("monkey will set a breakpoint on this function"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &inspectFunction},
+    {'i', "inspect", NULL,
+     gettext_noop
+     ("expression to inspect in the function specified after the argument f"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &inspectExpression},
+    GNUNET_GETOPT_OPTION_END
+  };
+
+  if (argc < 2)
+    {
+      printf ("%s",
+             "Monkey should take arguments: Use --help to get a list of 
options.\n");
+      return 1;
+    }
+
+  if (GNUNET_OK == GNUNET_PROGRAM_run (argc,
+                                      argv,
+                                      "gnunet-monkey",
+                                      gettext_noop
+                                      ("Automatically debug a service"),
+                                      options, &run, NULL))
+    {
+      return ret;
+    }
+
+  return 1;
+}

Deleted: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h
===================================================================
--- monkey/src/monkey/gnunet_monkey_action.h    2011-12-08 09:27:43 UTC (rev 
18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h 
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,104 +0,0 @@
-/*
-      This file is part of GNUnet
-      (C) 2010, 2011 Christian Grothoff (and other contributing authors)
-
-      GNUnet 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 3, or (at your
-      option) any later version.
-
-      GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-      Boston, MA 02111-1307, USA.
- */
-
-/**
- * @file monkey/gnunet_monkey_action.h
- * @brief Monkey API for actions taken by Monkey while debugging
- */
-
-#ifndef GNUNET_MONKEY_ACTION_H
-#define GNUNET_MONKEY_ACTION_H
-
-#include "gdbmi.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                          /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-/* Debug constants */
-#define DEBUG_MODE_GDB 0
-#define GDB_STATE_STOPPED 1
-#define GDB_STATE_EXIT_NORMALLY 2
-#define GDB_STATE_ERROR 3
-#define DEBUG_MODE_VALGRIND 4
-#define DEBUG_MODE_REPORT_READY 5
-#define BUG_NULL_POINTER 6
-#define BUG_CUSTOM 7
-
-
-/**
- * Context for the Action API
- */
-struct GNUNET_MONKEY_ACTION_Context
-{
-  const char *binary_name;
-  const char *email_address;
-  const char *expression_database_path;
-  const char *gdb_binary_path;
-  const char *inspect_expression;
-  const char *inspect_function;
-  int debug_mode;
-  int bug_detected;
-  char *debug_report;
-
-  /* gdb debugging attributes */
-  int run_reverse;
-  mi_h *gdb_handle;
-  const char *gdb_in_use;
-  mi_stop *gdb_stop_reason;
-  mi_frames *gdb_frames;
-  const char *gdb_null_variable;
-
-  /* Valgrind memcheck attributes */
-  char* valgrind_output_tmp_file_name;
-};
-
-
-int GNUNET_MONKEY_ACTION_report_file (struct GNUNET_MONKEY_ACTION_Context
-                                     *cntxt, const char *dumpFileName);
-int GNUNET_MONKEY_ACTION_report_email (struct GNUNET_MONKEY_ACTION_Context
-                                      *cntxt);
-int GNUNET_MONKEY_ACTION_inspect_expression_database (struct
-                                                     
GNUNET_MONKEY_ACTION_Context
-                                                     *cntxt);
-int GNUNET_MONKEY_ACTION_rerun_with_gdb (struct GNUNET_MONKEY_ACTION_Context
-                                        *cntxt);
-int GNUNET_MONKEY_ACTION_rerun_with_valgrind (struct
-                                             GNUNET_MONKEY_ACTION_Context
-                                             *cntxt);
-int GNUNET_MONKEY_ACTION_format_report (struct GNUNET_MONKEY_ACTION_Context
-                                       *cntxt);
-int GNUNET_MONKEY_ACTION_delete_context(struct GNUNET_MONKEY_ACTION_Context 
*cntxt);
-
-int GNUNET_MONKEY_ACTION_check_bug_redundancy (void);
-
-
-#if 0                          /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-#endif

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h 
(from rev 18819, monkey/src/monkey/gnunet_monkey_action.h)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h 
                        (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_action.h 
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,111 @@
+/*
+      This file is part of GNUnet
+      (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+
+      GNUnet 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 3, or (at your
+      option) any later version.
+
+      GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+      Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * @file monkey/gnunet_monkey_action.h
+ * @brief Monkey API for actions taken by Monkey while debugging
+ */
+
+#ifndef GNUNET_MONKEY_ACTION_H
+#define GNUNET_MONKEY_ACTION_H
+
+#include "gdbmi.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0                          /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+
+/* Debug constants */
+#define DEBUG_MODE_GDB 0
+#define GDB_STATE_STOPPED 1
+#define GDB_STATE_EXIT_NORMALLY 2
+#define GDB_STATE_ERROR 3
+#define DEBUG_MODE_VALGRIND 4
+#define DEBUG_MODE_REPORT_READY 5
+#define BUG_NULL_POINTER 6
+#define BUG_CUSTOM 7
+#define EXPRESSION_EVALUATION_DEPTH 0
+
+
+/**
+ * Context for the Action API
+ */
+struct GNUNET_MONKEY_ACTION_Context
+{
+  const char *binary_name;
+  const char *email_address;
+  const char *expression_database_path;
+  const char *gdb_binary_path;
+  const char *inspect_expression;
+  const char *inspect_function;
+  int debug_mode;
+  int bug_detected;
+  char *debug_report;
+  struct GNUNET_MONKEY_XML_WRITER_node *xmlReportRootNode;
+
+  /* gdb debugging attributes */
+  int run_reverse;
+  int function_start_line;
+  int scope_depth;
+  mi_h *gdb_handle;
+  const char *gdb_in_use;
+  mi_stop *gdb_stop_reason;
+  mi_frames *gdb_frames;
+  const char *gdb_null_variable;
+
+  /* Valgrind memcheck attributes */
+  char* valgrind_output_tmp_file_name;
+};
+
+
+int GNUNET_MONKEY_ACTION_report_file (struct GNUNET_MONKEY_ACTION_Context
+                                     *cntxt, const char *dumpFileName, int 
isXML);
+int GNUNET_MONKEY_ACTION_report_email (struct GNUNET_MONKEY_ACTION_Context
+                                      *cntxt);
+int GNUNET_MONKEY_ACTION_inspect_expression_database (struct
+                                                     
GNUNET_MONKEY_ACTION_Context
+                                                     *cntxt);
+int GNUNET_MONKEY_ACTION_rerun_with_gdb (struct GNUNET_MONKEY_ACTION_Context
+                                        *cntxt);
+int GNUNET_MONKEY_ACTION_rerun_with_valgrind (struct
+                                             GNUNET_MONKEY_ACTION_Context
+                                             *cntxt);
+int GNUNET_MONKEY_ACTION_format_report (struct GNUNET_MONKEY_ACTION_Context
+                                       *cntxt);
+int
+GNUNET_MONKEY_ACTION_format_report_xml (struct GNUNET_MONKEY_ACTION_Context
+                                       *cntxt);
+int GNUNET_MONKEY_ACTION_delete_context(struct GNUNET_MONKEY_ACTION_Context 
*cntxt);
+
+int GNUNET_MONKEY_ACTION_check_bug_redundancy (void);
+
+
+#if 0                          /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif

Deleted: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h
===================================================================
--- monkey/src/monkey/gnunet_monkey_edb.h       2011-12-08 09:27:43 UTC (rev 
18504)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h    
2012-01-17 13:42:55 UTC (rev 19189)
@@ -1,146 +0,0 @@
-/*
-      This file is part of GNUnet
-      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
-
-      GNUnet 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 3, or (at your
-      option) any later version.
-
-      GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-      Boston, MA 02111-1307, USA.
- */
-
-/**
- * @file monkey/gnunet_monkey_edb.h
- * @brief Monkey API for accessing the Expression Database (edb)
- */
-
-#ifndef GNUNET_MONKEY_EDB_H
-#define GNUNET_MONKEY_EDB_H
-
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                          /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
-
-struct GNUNET_MONKEY_EDB_Context;
-
-/**
- * Establish a connection to the Expression Database
- *
- * @param db_file_name path the Expression Database file
- * @return context to use for Accessing the Expression Database, NULL on error
- */
-struct GNUNET_MONKEY_EDB_Context *GNUNET_MONKEY_EDB_connect (const char
-                                                            *db_file_name);
-
-
-/**
- * Disconnect from Database, and cleanup resources
- *
- * @param context context
- * @return GNUNET_OK on success, GNUNET_NO on failure
- */
-int GNUNET_MONKEY_EDB_disconnect (struct GNUNET_MONKEY_EDB_Context *cntxt);
-
-
-typedef int (*GNUNET_MONKEY_ExpressionIterator) (void *, int, char **,
-                                                char **);
-
-typedef int (*GNUNET_MONKEY_FileIterator) (void *, int, char **, char **);
-
-
-
-/**
- * Return the line number of the end-of-scope for the expression indicated by 
start_line_no
- *
- * @param cntxt context containing the Expression Database handle
- * @param file_name path to the file in which the expression in question exists
- * @param start_line_no expression's line
- * @param iter callback function, iterator for values returned from the 
Database
- * @param iter_cls closure for the expression iterator, will contain the 
scope-end line number
- * @return GNUNET_OK on success, GNUNET_NO on failure
- */
-int
-GNUNET_MONKEY_EDB_get_expression_scope_end (struct GNUNET_MONKEY_EDB_Context
-                                           *cntxt, const char *file_name,
-                                           int start_line_no,
-                                           GNUNET_MONKEY_ExpressionIterator
-                                           iter, void *iter_cls);
-
-
-
-/**
- * Return all the source code file names available in the Expression Database
- *
- * @param cntxt context containing the Expression Database handle
- * @param iter callback function, iterator for values returned from the 
Database
- * @param iter_cls closure for the file names iterator, will contain the file 
names
- * @return GNUNET_OK on success, GNUNET_NO on failure
- */
-int
-GNUNET_MONKEY_EDB_get_file_names (struct GNUNET_MONKEY_EDB_Context *cntxt,
-                                 GNUNET_MONKEY_FileIterator iter,
-                                 void *iter_cls);
-
-/**
- * Run an SQLite query to retrieve those expressions that are previous to
- * given expression and are in the same scope of the given expression
- * For example, consider the following code snippet:
- *
- * {
- *   struct Something whole; // line no.1 
- *   struct SomethingElse part; // line no.2
- *   whole.part = &part; // line no.3
- *   whole.part->member = 1; // line no.4
- * }
- *
- * If the expression supplied to the function is that of line no.4 
"whole.part->member = 1;"
- * The returned list of expressions will be: whole.part (line no.4), 
whole.part->member (line no.4),
- * whole (line no.3), whole.part (line no.3), &part (line no.3), whole.part = 
&part (line no.3)
- *
- * @param cntxt context containing the Expression Database handle.
- * @param file_name path to the file in which the expression in question exists
- * @param start_line_no expression beginning line
- * @param end_line_no line number for the expression's scope end
- * @param iter callback function, iterator for expressions returned from the 
Database
- * @param iter_cls closure for the expression iterator
- * @return GNUNET_OK success, GNUNET_NO failure
- */
-int
-GNUNET_MONKEY_EDB_get_expressions (struct GNUNET_MONKEY_EDB_Context *cntxt,
-                                  const char *file_name, int start_line_no,
-                                  int end_line_no,
-                                  GNUNET_MONKEY_ExpressionIterator iter,
-                                  void *iter_cls);
-
-
-int
-GNUNET_MONKEY_EDB_get_sub_expressions (struct GNUNET_MONKEY_EDB_Context
-                                      *cntxt, const char *file_name,
-                                      int start_line_no, int end_line_no,
-                                      GNUNET_MONKEY_ExpressionIterator iter,
-                                      void *iter_cls);
-
-
-
-#if 0                          /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-#endif

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h (from 
rev 18581, monkey/src/monkey/gnunet_monkey_edb.h)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h    
                        (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_edb.h    
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,169 @@
+/*
+      This file is part of GNUnet
+      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+
+      GNUnet 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 3, or (at your
+      option) any later version.
+
+      GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+      Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+      Boston, MA 02111-1307, USA.
+ */
+
+/**
+ * @file monkey/gnunet_monkey_edb.h
+ * @brief Monkey API for accessing the Expression Database (edb)
+ */
+
+#ifndef GNUNET_MONKEY_EDB_H
+#define GNUNET_MONKEY_EDB_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0                          /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+
+struct GNUNET_MONKEY_EDB_Context;
+
+/**
+ * Establish a connection to the Expression Database
+ *
+ * @param db_file_name path the Expression Database file
+ * @return context to use for Accessing the Expression Database, NULL on error
+ */
+struct GNUNET_MONKEY_EDB_Context *GNUNET_MONKEY_EDB_connect (const char
+                                                            *db_file_name);
+
+
+/**
+ * Disconnect from Database, and cleanup resources
+ *
+ * @param context context
+ * @return GNUNET_OK on success, GNUNET_NO on failure
+ */
+int GNUNET_MONKEY_EDB_disconnect (struct GNUNET_MONKEY_EDB_Context *cntxt);
+
+
+typedef int (*GNUNET_MONKEY_ExpressionIterator) (void *, int, char **,
+                                                char **);
+
+typedef int (*GNUNET_MONKEY_FileIterator) (void *, int, char **, char **);
+
+
+
+int
+GNUNET_MONKEY_EDB_get_all_outer_scopes(struct GNUNET_MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int function_beginning,
+               int scope_in_question_start,
+               int scope_in_question_end,
+               GNUNET_MONKEY_ExpressionIterator
+               iter, void *iter_cls);
+
+int
+GNUNET_MONKEY_EDB_function_start_line_for_scope(struct 
GNUNET_MONKEY_EDB_Context
+               *cntxt, const char *file_name,
+               int scope_end,
+               GNUNET_MONKEY_ExpressionIterator
+               iter, void *iter_cls);
+/**
+ * Return the line number of the end-of-scope for the expression indicated by 
start_line_no
+ *
+ * @param cntxt context containing the Expression Database handle
+ * @param file_name path to the file in which the expression in question exists
+ * @param start_line_no expression's line
+ * @param iter callback function, iterator for values returned from the 
Database
+ * @param iter_cls closure for the expression iterator, will contain the 
scope-end line number
+ * @return GNUNET_OK on success, GNUNET_NO on failure
+ */
+int
+GNUNET_MONKEY_EDB_get_expression_scope_end (struct GNUNET_MONKEY_EDB_Context
+                                           *cntxt, const char *file_name,
+                                           int start_line_no,
+                                           GNUNET_MONKEY_ExpressionIterator
+                                           iter, void *iter_cls);
+
+
+
+/**
+ * Return all the source code file names available in the Expression Database
+ *
+ * @param cntxt context containing the Expression Database handle
+ * @param iter callback function, iterator for values returned from the 
Database
+ * @param iter_cls closure for the file names iterator, will contain the file 
names
+ * @return GNUNET_OK on success, GNUNET_NO on failure
+ */
+int
+GNUNET_MONKEY_EDB_get_file_names (struct GNUNET_MONKEY_EDB_Context *cntxt,
+                                 GNUNET_MONKEY_FileIterator iter,
+                                 void *iter_cls);
+
+
+int
+GNUNET_MONKEY_EDB_get_expressions_outer_scopes (struct 
GNUNET_MONKEY_EDB_Context *cntxt,
+                                  const char *file_name, int start_line_no,
+                                  int end_line_no,
+                                  GNUNET_MONKEY_ExpressionIterator iter,
+                                  void *iter_cls);
+
+/**
+ * Run an SQLite query to retrieve those expressions that are previous to
+ * given expression and are in the same scope of the given expression
+ * For example, consider the following code snippet:
+ *
+ * {
+ *   struct Something whole; // line no.1 
+ *   struct SomethingElse part; // line no.2
+ *   whole.part = &part; // line no.3
+ *   whole.part->member = 1; // line no.4
+ * }
+ *
+ * If the expression supplied to the function is that of line no.4 
"whole.part->member = 1;"
+ * The returned list of expressions will be: whole.part (line no.4), 
whole.part->member (line no.4),
+ * whole (line no.3), whole.part (line no.3), &part (line no.3), whole.part = 
&part (line no.3)
+ *
+ * @param cntxt context containing the Expression Database handle.
+ * @param file_name path to the file in which the expression in question exists
+ * @param start_line_no expression beginning line
+ * @param end_line_no line number for the expression's scope end
+ * @param iter callback function, iterator for expressions returned from the 
Database
+ * @param iter_cls closure for the expression iterator
+ * @return GNUNET_OK success, GNUNET_NO failure
+ */
+int
+GNUNET_MONKEY_EDB_get_expressions (struct GNUNET_MONKEY_EDB_Context *cntxt,
+                                  const char *file_name, int start_line_no,
+                                  int end_line_no,
+                                  GNUNET_MONKEY_ExpressionIterator iter,
+                                  void *iter_cls);
+
+
+int
+GNUNET_MONKEY_EDB_get_sub_expressions (struct GNUNET_MONKEY_EDB_Context
+                                      *cntxt, const char *file_name,
+                                      int start_line_no, int end_line_no,
+                                      GNUNET_MONKEY_ExpressionIterator iter,
+                                      void *iter_cls);
+
+
+
+#if 0                          /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif

Copied: 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_xml_writer.h 
(from rev 18819, monkey/src/monkey/gnunet_monkey_xml_writer.h)
===================================================================
--- 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_xml_writer.h 
                            (rev 0)
+++ 
monkey/branches/MonkeyBacktracking/monkey/src/monkey/gnunet_monkey_xml_writer.h 
    2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,74 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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 3, or (at your
+     option) any later version.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file monkey/gnunet_monkey_xml_writer.h
+ * @brief Monkey API for generating XML debug report
+ */
+
+
+#ifndef GNUNET_MONKEY_XML_WRITER_H
+#define GNUNET_MONKEY_XML_WRITER_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#if 0                          /* keep Emacsens' auto-indent happy */
+}
+#endif
+#endif
+
+
+struct XmlAttribute {
+       struct XmlAttribute *next;
+       struct XmlAttribute *prev;
+       const char *name;
+       const char *value;
+};
+
+
+struct GNUNET_MONKEY_XML_Node {
+       struct GNUNET_MONKEY_XML_Node *next;
+       struct GNUNET_MONKEY_XML_Node *prev;
+       const char *name;
+       const char *value;
+       const char *innerText;
+       struct XmlAttribute* attributeListHead;
+       struct XmlAttribute* attributeListTail;
+       struct GNUNET_MONKEY_XML_Node *childrenListHead;
+       struct GNUNET_MONKEY_XML_Node *childrenListTail;
+};
+
+struct GNUNET_MONKEY_XML_Node* GNUNET_MONKEY_XML_WRITER_new_node(const char 
*name, const char *innerText);
+int GNUNET_MONKEY_XML_WRITER_delete_tree(struct GNUNET_MONKEY_XML_Node *root);
+struct GNUNET_MONKEY_XML_Node* GNUNET_MONKEY_XML_WRITER_add_child(struct 
GNUNET_MONKEY_XML_Node *parent, struct GNUNET_MONKEY_XML_Node *child);
+int GNUNET_MONKEY_XML_WRITER_write_document(FILE* file, struct 
GNUNET_MONKEY_XML_Node *root);
+FILE* GNUNET_MONKEY_XML_WRITER_create_document(const char *filePath);
+int GNUNET_MONKEY_XML_WRITER_add_attribute(struct GNUNET_MONKEY_XML_Node* 
node, const char *attrName, const char *attrValue);
+int GNUNET_MONKEY_XML_WRITER_add_inner_text(struct GNUNET_MONKEY_XML_Node 
*node, const char *innerText);
+
+#if 0                          /* keep Emacsens' auto-indent happy */
+{
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif

Copied: monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c (from 
rev 18819, monkey/src/monkey/xml_writer.c)
===================================================================
--- monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c           
                (rev 0)
+++ monkey/branches/MonkeyBacktracking/monkey/src/monkey/xml_writer.c   
2012-01-17 13:42:55 UTC (rev 19189)
@@ -0,0 +1,128 @@
+/*
+     This file is part of GNUnet.
+     (C) 2010, 2011 Christian Grothoff (and other contributing authors)
+
+     GNUnet 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 3, or (at your
+     option) any later version.
+
+     GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+     Boston, MA 02111-1307, USA.
+*/
+
+/**
+ * @file monkey/xml_writer.c
+ * @brief Monkey API for generating XML debug report
+ */
+
+#include "platform.h"
+#include <gnunet/gnunet_common.h>
+#include <gnunet/gnunet_container_lib.h>
+#include <stdio.h>
+#include "gnunet_monkey_xml_writer.h"
+
+
+struct GNUNET_MONKEY_XML_Node* GNUNET_MONKEY_XML_WRITER_new_node(const char 
*name, const char *innerText) {
+       struct GNUNET_MONKEY_XML_Node *node = GNUNET_malloc(sizeof(struct 
GNUNET_MONKEY_XML_Node));
+       node->name = name;
+       node->innerText = innerText;
+       node->childrenListHead = NULL;
+       node->childrenListTail = NULL;
+       node->attributeListHead = NULL;
+       node->attributeListTail = NULL;
+       return node;
+}
+
+
+int GNUNET_MONKEY_XML_WRITER_add_attribute(struct GNUNET_MONKEY_XML_Node* 
node, const char *attrName, const char *attrValue)
+{
+       struct XmlAttribute *attribute = GNUNET_malloc(sizeof(struct 
XmlAttribute));
+       attribute->name = attrName;
+       attribute->value  = attrValue;
+       GNUNET_CONTAINER_DLL_insert_tail (node->attributeListHead, 
node->attributeListTail,
+                                                        attribute);
+       return GNUNET_OK;
+}
+
+
+int GNUNET_MONKEY_XML_WRITER_add_inner_text(struct GNUNET_MONKEY_XML_Node 
*node, const char *innerText)
+{
+       node->innerText = innerText;
+       return GNUNET_OK;
+}
+
+
+int GNUNET_MONKEY_XML_WRITER_delete_tree(struct GNUNET_MONKEY_XML_Node *root)
+{
+       struct GNUNET_MONKEY_XML_Node *tmp = NULL;
+       struct XmlAttribute *tmpAttribute = NULL;
+
+       /* Freeing children list - Depth First */
+       while (NULL != root->childrenListHead) {
+               tmp = root->childrenListHead;
+               root->childrenListHead = tmp->next;
+               GNUNET_MONKEY_XML_WRITER_delete_tree(tmp);
+       }
+
+       /* Freeing Attributes List */
+       while (NULL != root->attributeListHead) {
+               tmpAttribute = root->attributeListHead;
+               root->attributeListHead = tmpAttribute->next;
+               GNUNET_free(tmpAttribute);
+       }
+
+       /* Freeing Leaf Node */
+       GNUNET_free(root);
+
+       return GNUNET_OK;
+}
+
+
+struct GNUNET_MONKEY_XML_Node* GNUNET_MONKEY_XML_WRITER_add_child(struct 
GNUNET_MONKEY_XML_Node *parent, struct GNUNET_MONKEY_XML_Node *child) {
+       GNUNET_CONTAINER_DLL_insert_tail (parent->childrenListHead, 
parent->childrenListTail,
+                                                child);
+       return child;
+}
+
+
+FILE* GNUNET_MONKEY_XML_WRITER_create_document(const char *filePath) {
+       FILE* file = fopen(filePath, "w");
+       if (NULL != file) {
+               fprintf(file, "<?xml version=\"1.0\"?>\n");
+               return file;
+       }
+       return NULL;
+}
+
+
+int GNUNET_MONKEY_XML_WRITER_write_document(FILE* file, struct 
GNUNET_MONKEY_XML_Node *root) {
+       struct GNUNET_MONKEY_XML_Node *tmp = root->childrenListHead;
+       struct XmlAttribute *tmpAttribute = root->attributeListHead;
+       if (NULL == tmpAttribute)
+               fprintf(file, "<%s>", root->name);
+       else {
+               fprintf(file, "<%s ", root->name);
+               while (NULL != tmpAttribute) {
+                       fprintf(file, "%s=\"%s\" ", tmpAttribute->name, 
tmpAttribute->value);
+                       tmpAttribute = tmpAttribute->next;
+               }
+               fprintf(file, ">\n");
+       }
+       if (NULL != root->innerText)
+               fprintf(file, "%s", root->innerText);
+
+       while (NULL != tmp) {
+               GNUNET_MONKEY_XML_WRITER_write_document(file, tmp);
+               tmp = tmp->next;
+       }
+       fprintf(file, "</%s>\n", root->name);//End
+       return GNUNET_OK;
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]