From MAILER-DAEMON Sun Feb 21 00:33:24 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nj4RY-0001VK-Pz
	for mharc-libtool-commit@gnu.org; Sun, 21 Feb 2010 00:33:24 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nj4RW-0001V8-PR
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:33:22 -0500
Received: from [140.186.70.92] (port=52366 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nj4RU-0001V0-4V
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:33:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4RR-00028g-8D
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:33:20 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:56423
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4RR-00028b-5N
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:33:17 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4RR-0002p7-2T
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 05:33:17 +0000
Received: from cwilson by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4RQ-0004nK-HF
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 05:33:17 +0000
From: "Charles Wilson" <libtool@cwilson.fastmail.fm>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7e8be90f4872b8140a718a0af0a1544d1f9371d9
X-Git-Newrev: 2613ea3ab217696ef2799e887bfc9e9362e91e35
Message-Id: <E1Nj4RQ-0004nK-HF@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 21 Feb 2010 05:33:16 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-183-g2613ea3
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Feb 2010 05:33:23 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  2613ea3ab217696ef2799e887bfc9e9362e91e35 (commit)
      from  7e8be90f4872b8140a718a0af0a1544d1f9371d9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2613ea3ab217696ef2799e887bfc9e9362e91e35
Author: Charles Wilson <libtool@cwilson.fastmail.fm>
Date:   Sun Jul 12 14:30:44 2009 -0400

    Enable runtime cwrapper debugging; add tests
    
    * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
    Update comments. Initialize program_name. Eliminate _LENGTH
    variables for string constants. In debug mode, print a
    banner with known content before any other output. Remove
    LTWRAPPER_DEBUGPRINTF macro. Add constants and variables
    to support new --lt-debug option.
    (func_emit_cwrapperexe_src:ltwrapper_debugprintf): Renamed to...
    (func_emit_cwrapperexe_src:lt_debugprintf): this. Only print
    messages if lt_debug != 0. Ensure appearance of messages
    conforms to GCS.
    (func_emit_cwrapperexe_src:lt_fatal): Ditto.
    (func_emit_cwrapperexe_src:lt_error_core): Ditto.
    (func_emit_cwrapperexe_src): Update all callers to lt_fatal.
    Update all users of LTWRAPPER_DEBUGPRINTF (()) to call
    lt_debugprintf () directly.
    (func_emit_cwrapperexe_src:main): Consolidate option parsing.
    Ensure first use of lt_debugprintf occurs after option parsing.
    Add stanza to parse for --lt-debug and set lt_debug variable.
    Use strcmp rather than strncmp, where safe.
    * tests/cwrapper.at: Add new tests for --lt-debug and
    -DLT_DEBUGWRAPPER.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   25 ++++++
 libltdl/config/ltmain.m4sh |  207 ++++++++++++++++++++++++++------------------
 tests/cwrapper.at          |   53 +++++++++++
 3 files changed, 200 insertions(+), 85 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f4b4a3f..c9027e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
+
+	Enable runtime cwrapper debugging; add tests
+	* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
+	Update comments. Initialize program_name. Eliminate _LENGTH
+	variables for string constants. In debug mode, print a
+	banner with known content before any other output. Remove
+	LTWRAPPER_DEBUGPRINTF macro. Add constants and variables
+	to support new --lt-debug option.
+	(func_emit_cwrapperexe_src:ltwrapper_debugprintf): Renamed to...
+	(func_emit_cwrapperexe_src:lt_debugprintf): this. Only print
+	messages if lt_debug != 0. Ensure appearance of messages
+	conforms to GCS.
+	(func_emit_cwrapperexe_src:lt_fatal): Ditto.
+	(func_emit_cwrapperexe_src:lt_error_core): Ditto.
+	(func_emit_cwrapperexe_src): Update all callers to lt_fatal.
+	Update all users of LTWRAPPER_DEBUGPRINTF (()) to call
+	lt_debugprintf () directly.
+	(func_emit_cwrapperexe_src:main): Consolidate option parsing.
+	Ensure first use of lt_debugprintf occurs after option parsing.
+	Add stanza to parse for --lt-debug and set lt_debug variable.
+	Use strcmp rather than strncmp, where safe.
+	* tests/cwrapper.at: Add new tests for --lt-debug and
+	-DLT_DEBUGWRAPPER.
+
 2010-01-31  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	Use --email with gendocs.sh.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 80a1ff3..cb0672b 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2727,10 +2727,6 @@ func_emit_cwrapperexe_src ()
 
    This wrapper executable should never be moved out of the build directory.
    If it is, it will not operate correctly.
-
-   Currently, it simply execs the wrapper *script* "$SHELL $output",
-   but could eventually absorb all of the scripts functionality and
-   exec $objdir/$outputname directly.
 */
 EOF
 	    cat <<"EOF"
@@ -2855,22 +2851,13 @@ int setenv (const char *, const char *, int);
   if (stale) { free ((void *) stale); stale = 0; } \
 } while (0)
 
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined LT_DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
-    va_list args;
-    va_start (args, fmt);
-    (void) vfprintf (stderr, fmt, args);
-    va_end (args);
-}
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
 #else
-# define LTWRAPPER_DEBUGPRINTF(args)
+static int lt_debug = 0;
 #endif
 
-const char *program_name = NULL;
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
 
 void *xmalloc (size_t num);
 char *xstrdup (const char *string);
@@ -2880,7 +2867,10 @@ char *chase_symlinks (const char *pathspec);
 int make_executable (const char *path);
 int check_executable (const char *path);
 char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
 void lt_setenv (const char *name, const char *value);
 char *lt_extend_str (const char *orig_value, const char *add, int to_end);
 void lt_update_exe_path (const char *name, const char *value);
@@ -2932,12 +2922,10 @@ EOF
 	    cat <<"EOF"
 
 #define LTWRAPPER_OPTION_PREFIX         "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
 
-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
 static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
 static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
 
 int
 main (int argc, char *argv[])
@@ -2954,10 +2942,13 @@ main (int argc, char *argv[])
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
+  newargz = XMALLOC (char *, argc + 1);
 
-  /* very simple arg parsing; don't want to rely on getopt */
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
   for (i = 1; i < argc; i++)
     {
       if (strcmp (argv[i], dumpscript_opt) == 0)
@@ -2974,21 +2965,54 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
     }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
 
-  newargz = XMALLOC (char *, argc + 1);
   tmp_pathspec = find_executable (argv[0]);
   if (tmp_pathspec == NULL)
-    lt_fatal ("Couldn't find %s", argv[0]);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
-			  tmp_pathspec));
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
 
   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
-			  actual_cwrapper_path));
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
   XFREE (tmp_pathspec);
 
-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
   strendzap (actual_cwrapper_path, actual_cwrapper_name);
 
   /* wrapper name transforms */
@@ -3006,8 +3030,9 @@ EOF
   target_name = tmp_pathspec;
   tmp_pathspec = 0;
 
-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
-			  target_name));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
 EOF
 
 	    cat <<EOF
@@ -3060,32 +3085,12 @@ EOF
   lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
 
-  newargc=0;
-  for (i = 1; i < argc; i++)
-    {
-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
-        {
-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
-             namespace, but it is not one of the ones we know about and
-             have already dealt with, above (inluding dump-script), then
-             report an error. Otherwise, targets might begin to believe
-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
-             namespace. The first time any user complains about this, we'll
-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
-             or a configure.ac-settable value.
-           */
-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
-                    ltwrapper_option_prefix, argv[i]);
-        }
-      /* otherwise ... */
-      newargz[++newargc] = xstrdup (argv[i]);
-    }
-  newargz[++newargc] = NULL;
-
-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
   for (i = 0; i < newargc; i++)
     {
-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
     }
 
 EOF
@@ -3099,7 +3104,9 @@ EOF
   if (rval == -1)
     {
       /* failed to start process */
-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, strerror (errno));
       return 127;
     }
   return rval;
@@ -3121,7 +3128,7 @@ xmalloc (size_t num)
 {
   void *p = (void *) malloc (num);
   if (!p)
-    lt_fatal ("Memory exhausted");
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
 
   return p;
 }
@@ -3155,8 +3162,8 @@ check_executable (const char *path)
 {
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3173,8 +3180,8 @@ make_executable (const char *path)
   int rval = 0;
   struct stat st;
 
-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
   if ((!path) || (!*path))
     return 0;
 
@@ -3200,8 +3207,8 @@ find_executable (const char *wrapper)
   int tmp_len;
   char *concat_name;
 
-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
 
   if ((wrapper == NULL) || (*wrapper == '\0'))
     return NULL;
@@ -3254,7 +3261,8 @@ find_executable (const char *wrapper)
 		{
 		  /* empty path: current directory */
 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
-		    lt_fatal ("getcwd failed");
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              strerror (errno));
 		  tmp_len = strlen (tmp);
 		  concat_name =
 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
@@ -3279,7 +3287,7 @@ find_executable (const char *wrapper)
     }
   /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal ("getcwd failed");
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", strerror (errno));
   tmp_len = strlen (tmp);
   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
   memcpy (concat_name, tmp, tmp_len);
@@ -3305,8 +3313,9 @@ chase_symlinks (const char *pathspec)
   int has_symlinks = 0;
   while (strlen (tmp_pathspec) && !has_symlinks)
     {
-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
-			      tmp_pathspec));
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
       if (lstat (tmp_pathspec, &s) == 0)
 	{
 	  if (S_ISLNK (s.st_mode) != 0)
@@ -3328,8 +3337,9 @@ chase_symlinks (const char *pathspec)
 	}
       else
 	{
-	  char *errstr = strerror (errno);
-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, strerror (errno));
 	}
     }
   XFREE (tmp_pathspec);
@@ -3342,7 +3352,8 @@ chase_symlinks (const char *pathspec)
   tmp_pathspec = realpath (pathspec, buf);
   if (tmp_pathspec == 0)
     {
-      lt_fatal ("Could not follow symlinks for %s", pathspec);
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
     }
   return xstrdup (tmp_pathspec);
 #endif
@@ -3368,11 +3379,25 @@ strendzap (char *str, const char *pat)
   return str;
 }
 
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
 static void
-lt_error_core (int exit_status, const char *mode,
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
 	       const char *message, va_list ap)
 {
-  fprintf (stderr, "%s: %s: ", program_name, mode);
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
   vfprintf (stderr, message, ap);
   fprintf (stderr, ".\n");
 
@@ -3381,20 +3406,32 @@ lt_error_core (int exit_status, const char *mode,
 }
 
 void
-lt_fatal (const char *message, ...)
+lt_fatal (const char *file, int line, const char *message, ...)
 {
   va_list ap;
   va_start (ap, message);
-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
   va_end (ap);
 }
 
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
 void
 lt_setenv (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
   {
 #ifdef HAVE_SETENV
     /* always make a copy, for consistency with !HAVE_SETENV */
@@ -3442,9 +3479,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
 void
 lt_update_exe_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
@@ -3463,9 +3500,9 @@ lt_update_exe_path (const char *name, const char *value)
 void
 lt_update_lib_path (const char *name, const char *value)
 {
-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
-                          (name ? name : "<NULL>"),
-                          (value ? value : "<NULL>")));
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
 
   if (name && *name && value && *value)
     {
diff --git a/tests/cwrapper.at b/tests/cwrapper.at
index 42f8d0f..babd91e 100644
--- a/tests/cwrapper.at
+++ b/tests/cwrapper.at
@@ -79,5 +79,58 @@ for restrictive_flags in '-Wall -Werror' '-std=c89 -Wall -Werror' '-std=c99 -Wal
   LT_AT_EXEC_CHECK([./usea], [0], [ignore], [ignore], [])
 done
 
+
+# Test run-time activation of wrapper debugging.
+# This is not part of the loop above, because we
+# need to check, not ignore, the output.
+CFLAGS="$orig_CFLAGS"
+LIBTOOL=$orig_LIBTOOL
+
+AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c liba.c],
+         [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -no-undefined -o liba.la -rpath /foo liba.lo],
+         [], [ignore], [ignore])
+AT_CHECK([test -f liba.la])
+
+AT_CHECK([$CC $CPPFLAGS $CFLAGS -c usea.c],
+         [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o usea$EXEEXT usea.$OBJEXT liba.la],
+         [], [ignore], [ignore])
+LT_AT_EXEC_CHECK([./usea], [0], [ignore], [stderr], [--lt-debug])
+LT_AT_UNIFY_NL([stderr])
+AT_CHECK([grep 'libtool wrapper' stderr], [0], [ignore], [ignore])
+
+
+# Test compile-time activation of wrapper debugging.
+# We structure this test as a loop, so that we can 'break' out of it
+# if necessary -- even though the loop by design executes only once.
+for debugwrapper_flags in '-DLT_DEBUGWRAPPER'; do
+  CFLAGS="$orig_CFLAGS $debugwrapper_flags"
+  sed -e "s/LTCFLAGS=.*/&' $debugwrapper_flags'/" \
+      -e "s/^lt_option_debug=/lt_option_debug=1/" \
+    < "$orig_LIBTOOL" > ./libtool
+  LIBTOOL=./libtool
+
+  # make sure $debugwrapper_flags do not cause a failure
+  # themselves (e.g. because a non-gcc compiler doesn't
+  # understand them)
+  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c trivial.c || continue
+
+  AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c liba.c],
+           [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -no-undefined -o liba.la -rpath /foo liba.lo],
+           [], [ignore], [ignore])
+  AT_CHECK([test -f liba.la])
+
+  AT_CHECK([$CC $CPPFLAGS $CFLAGS -c usea.c],
+           [], [ignore], [ignore])
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o usea$EXEEXT usea.$OBJEXT liba.la],
+           [], [ignore], [ignore])
+  LT_AT_EXEC_CHECK([./usea], [0], [ignore], [stderr], [])
+  LT_AT_UNIFY_NL([stderr])
+  AT_CHECK([grep 'libtool wrapper' stderr], [0], [ignore], [ignore])
+done
+
+
 AT_CLEANUP
 


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Sun Feb 21 00:43:22 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nj4bB-0003t0-Vq
	for mharc-libtool-commit@gnu.org; Sun, 21 Feb 2010 00:43:22 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nj4bA-0003sr-2C
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:43:20 -0500
Received: from [140.186.70.92] (port=40394 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nj4b7-0003sa-Ue
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:43:18 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4b7-0002p4-92
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:43:17 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:41313
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4b7-0002ow-6v
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 00:43:17 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4b7-0002xZ-0E
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 05:43:17 +0000
Received: from cwilson by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nj4b6-00053e-Rh
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 05:43:16 +0000
From: "Charles Wilson" <libtool@cwilson.fastmail.fm>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 2613ea3ab217696ef2799e887bfc9e9362e91e35
X-Git-Newrev: efa47280559a504a410c83b2ae599d52c0af7e34
Message-Id: <E1Nj4b6-00053e-Rh@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 21 Feb 2010 05:43:16 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-184-gefa4728
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Feb 2010 05:43:20 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  efa47280559a504a410c83b2ae599d52c0af7e34 (commit)
      from  2613ea3ab217696ef2799e887bfc9e9362e91e35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit efa47280559a504a410c83b2ae599d52c0af7e34
Author: Charles Wilson <libtool@cwilson.fastmail.fm>
Date:   Sun Jul 12 17:40:26 2009 -0400

    Add --lt-* options to shell wrapper
    
    * libltdl/config/ltmain.m4sh (func_emit_wrapper): Call
    func_parse_lt_options early. Use func_exec_program.
    (func_emit_wrapper:func_parse_lt_options): New function.
    (func_emit_wrapper:func_lt_dump_args): New function.
    (func_emit_wrapper:func_exec_program_core): New function.
    (func_emit_wrapper:func_exec_program): New function.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   10 ++++
 libltdl/config/ltmain.m4sh |  124 +++++++++++++++++++++++++++++++++++++-------
 2 files changed, 115 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c9027e9..6dde890 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
 
+	Add --lt-* options to shell wrapper
+	* libltdl/config/ltmain.m4sh (func_emit_wrapper): Call
+	func_parse_lt_options early. Use func_exec_program.
+	(func_emit_wrapper:func_parse_lt_options): New function.
+	(func_emit_wrapper:func_lt_dump_args): New function.
+	(func_emit_wrapper:func_exec_program_core): New function.
+	(func_emit_wrapper:func_exec_program): New function.
+
+2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
+
 	Enable runtime cwrapper debugging; add tests
 	* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src):
 	Update comments. Initialize program_name. Eliminate _LENGTH
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index cb0672b..043d980 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2407,7 +2407,110 @@ func_fallback_echo ()
 _LTECHO_EOF'
 }
     ECHO=\"$qECHO\"
-  fi\
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  for lt_wr_arg
+  do
+    case \$lt_wr_arg in
+    --lt-*) ;;
+    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+    esac
+    shift
+  done
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
 
   # Find the directory that this script lives in.
   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
@@ -2520,24 +2623,7 @@ _LTECHO_EOF'
 	$ECHO "\
     if test \"\$libtool_execute_magic\" != \"$magic\"; then
       # Run the actual program with our arguments.
-"
-	case $host in
-	# Backslashes separate directories on plain windows
-	*-*-mingw | *-*-os2* | *-cegcc*)
-	  $ECHO "\
-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
-	  ;;
-
-	*)
-	  $ECHO "\
-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
-	  ;;
-	esac
-	$ECHO "\
-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
-      exit 1
+      func_exec_program \${1+\"\$@\"}
     fi
   else
     # The program doesn't exist.


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Sun Feb 21 15:08:01 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NjI5x-0005YB-Ah
	for mharc-libtool-commit@gnu.org; Sun, 21 Feb 2010 15:08:01 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NjI5v-0005Xs-1J
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 15:07:59 -0500
Received: from [140.186.70.92] (port=45794 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NjI5s-0005Xi-KY
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 15:07:57 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjI5q-0004uu-AV
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 15:07:56 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:48341
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjI5q-0004uq-7T
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 15:07:54 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjI5q-0004wf-42
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 20:07:54 +0000
Received: from cwilson by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjI5p-0002wL-Vm
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 20:07:54 +0000
From: "Charles Wilson" <libtool@cwilson.fastmail.fm>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: efa47280559a504a410c83b2ae599d52c0af7e34
X-Git-Newrev: 76735dcb937afb53790e0ef3d4df1622ba133e00
Message-Id: <E1NjI5p-0002wL-Vm@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 21 Feb 2010 20:07:54 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-185-g76735dc
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Feb 2010 20:07:59 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  76735dcb937afb53790e0ef3d4df1622ba133e00 (commit)
      from  efa47280559a504a410c83b2ae599d52c0af7e34 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 76735dcb937afb53790e0ef3d4df1622ba133e00
Author: Charles Wilson <libtool@cwilson.fastmail.fm>
Date:   Sun Jul 12 18:49:06 2009 -0400

    Document wrapper changes.
    
    * NEWS: Indicate new feature and incompatibility.
    * doc/libtool.texi [detailmenu]: Add reference to subsection
    'Wrapper executables for programs', in Platform Quirks category.
    [Linking executables]: Mention wrapper executables, in
    addition to wrapper scripts. Add menu referencing subsection
    'Wrapper executables for programs'.
    [Wrapper executables for programs]: New subsection. Documents
    cwrapper rationale and command line options.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |   12 ++++++++++
 NEWS             |   11 +++++++++
 doc/libtool.texi |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6dde890..9d8ced9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
 
+	Document wrapper changes.
+	* NEWS: Indicate new feature and incompatibility.
+	* doc/libtool.texi [detailmenu]: Add reference to subsection
+	'Wrapper executables for programs', in Platform Quirks category.
+	[Linking executables]: Mention wrapper executables, in
+	addition to wrapper scripts. Add menu referencing subsection
+	'Wrapper executables for programs'.
+	[Wrapper executables for programs]: New subsection. Documents
+	cwrapper rationale and command line options.
+
+2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
+
 	Add --lt-* options to shell wrapper
 	* libltdl/config/ltmain.m4sh (func_emit_wrapper): Call
 	func_parse_lt_options early. Use func_exec_program.
diff --git a/NEWS b/NEWS
index d41db5e..61638fd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,17 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, Libtool team:
     runs on Windows with popup windows in the middle, and `check-interactive'
     for the complement set of tests.
   - New link mode flag -bindir to specify the location for installed PE DLLs.
+  - Wrapper scripts and wrapper executables for programs linked against
+    uninstalled shared libraries now support command-line options --lt-debug
+    and --lt-dump-script.
+
+* Important incompatible changes:
+
+  - The wrapper command line option support described above introduces the
+    following incompatibility: the wrapper will remove any command line
+    options that begin with '--lt-*' from the argument list before launching
+    (uninstalled) programs. Any '--lt-*' option on the command line not
+    recognized by the wrapper will result in an error.
 
 * Changes in supported systems or compilers:
 
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 482e635..8a191df 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -212,6 +212,7 @@ Platform quirks
 * Reloadable objects::          Binding object files together.
 * Multiple dependencies::       Removing duplicate dependent libraries.
 * Archivers::                   Programs that create static archives.
+* Wrapper executables::         Wrapper executables for some platforms.
 
 @end detailmenu
 @end menu
@@ -790,8 +791,9 @@ Note that libtool added the necessary run-time path flag, as well as
 @cindex wrapper scripts for programs
 @cindex program wrapper scripts
 Notice that the executable, @code{hell}, was actually created in the
-@file{@value{objdir}} subdirectory.  Then, a wrapper script was created
-in the current directory.
+@file{@value{objdir}} subdirectory.  Then, a wrapper script (or, on
+certain platforms, a wrapper executable @pxref{Wrapper executables}) was
+created in the current directory.
 
 Since libtool created a wrapper script, you should use libtool to
 install it and debug it too.  However, since the program does not depend
@@ -845,6 +847,60 @@ price of being dynamic is eight kilobytes, and the payoff is about four
 kilobytes.  So, having a shared @file{libhello} won't be an advantage
 until we link it against at least a few more programs.
 
+@menu
+* Wrapper executables::         Wrapper executables for some platforms.
+@end menu
+
+@node Wrapper executables
+@subsection Wrapper executables for uninstalled programs
+@cindex wrapper executables for uninstalled programs
+@cindex program wrapper executables
+
+Some platforms, notably those hosted on Windows such as Cygwin
+and MinGW, use a wrapper executable rather than a wrapper script
+to ensure proper operation of uninstalled programs linked by libtool
+against uninstalled shared libraries. The wrapper executable thus
+performs the same function as the wrapper script used on other
+platforms, but allows to satisfy the @command{make} rules for the
+program, whose name ends in @code{$(EXEEXT)}. The actual program
+executable is created below @value{objdir}, and its name will end
+in @code{$(EXEEXT)} and may or may not contain an @code{lt-} prefix.
+This wrapper executable sets various environment values so that the
+program executable may locate its (uninstalled) shared libraries,
+and then launches the program executable.
+
+The wrapper executable provides a debug mode, enabled by passing the
+command-line option @code{--lt-debug} (see below). When executing in
+debug mode, diagnostic information will be printed to @code{stderr}
+before the program executable is launched.
+
+Finally, the wrapper executable supports a number of command line
+options that may be useful when debugging the operation of the wrapper
+system. All of these options begin with @code{--lt-}, and if present
+they and their arguments will be removed from the argument list passed
+on to the program executable.  Therefore, the program executable may not
+employ command line options that begin with @code{--lt-}. (In fact, the
+wrapper executable will detect any command line options that begin with
+@code{--lt-} and abort with an error message if the option is not
+recognized). If this presents a problem, please contact the Libtool
+team at @email{bug-libtool@@gnu.org}.
+
+These command line options include:
+
+@table @option
+@item --lt-dump-script
+Causes the wrapper to print a copy of the wrapper @emph{script}
+to @code{stdout}, and exit.
+
+@item --lt-debug
+Causes the wrapper to print diagnostic information to @code{stdout},
+before launching the program executable.
+
+@end table
+
+For consistency, both the wrapper @emph{script} and the wrapper
+@emph{executable} support these options.
+
 @node Debugging executables
 @section Debugging executables
 


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Sun Feb 21 16:59:42 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NjJq2-0002Oq-H3
	for mharc-libtool-commit@gnu.org; Sun, 21 Feb 2010 16:59:42 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NjJq0-0002Nq-Cb
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 16:59:40 -0500
Received: from [140.186.70.92] (port=55455 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NjJpj-0002Iu-CK
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 16:59:40 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjJpi-0006BF-RW
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 16:59:23 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:35080
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjJpi-0006BA-Od
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 16:59:22 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjJpi-0006HI-7I
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 21:59:22 +0000
Received: from cwilson by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjJpi-0008T0-2o
	for libtool-commit@gnu.org; Sun, 21 Feb 2010 21:59:22 +0000
From: "Charles Wilson" <libtool@cwilson.fastmail.fm>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 76735dcb937afb53790e0ef3d4df1622ba133e00
X-Git-Newrev: 948e6bbecd55a6388297d8f0a85396e02888ab09
Message-Id: <E1NjJpi-0008T0-2o@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 21 Feb 2010 21:59:22 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-186-g948e6bb
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 21 Feb 2010 21:59:41 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  948e6bbecd55a6388297d8f0a85396e02888ab09 (commit)
      from  76735dcb937afb53790e0ef3d4df1622ba133e00 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 948e6bbecd55a6388297d8f0a85396e02888ab09
Author: Charles Wilson <libtool@cwilson.fastmail.fm>
Date:   Sun Feb 21 16:56:44 2010 -0500

    Guard against strerror()==NULL
    
    * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src:main):
    Check return value of strerror() using nonnull().
    (func_emit_cwrapperexe_src:find_executable): Ditto.
    (func_emit_cwrapperexe_src:chase_symlinks): Ditto.

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |    8 ++++++++
 libltdl/config/ltmain.m4sh |    9 +++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9d8ced9..295123a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
 
+	Guard against strerror()==NULL
+	* libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src:main):
+	Check return value of strerror() using nonnull().
+	(func_emit_cwrapperexe_src:find_executable): Ditto.
+	(func_emit_cwrapperexe_src:chase_symlinks): Ditto.
+
+2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
+
 	Document wrapper changes.
 	* NEWS: Indicate new feature and incompatibility.
 	* doc/libtool.texi [detailmenu]: Add reference to subsection
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 043d980..56b7497 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -3192,7 +3192,7 @@ EOF
       /* failed to start process */
       lt_debugprintf (__FILE__, __LINE__,
 		      "(main) failed to launch target \"%s\": %s\n",
-		      lt_argv_zero, strerror (errno));
+		      lt_argv_zero, nonnull (strerror (errno)));
       return 127;
     }
   return rval;
@@ -3348,7 +3348,7 @@ find_executable (const char *wrapper)
 		  /* empty path: current directory */
 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
 		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
-                              strerror (errno));
+                              nonnull (strerror (errno)));
 		  tmp_len = strlen (tmp);
 		  concat_name =
 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
@@ -3373,7 +3373,8 @@ find_executable (const char *wrapper)
     }
   /* Relative path | not found in path: prepend cwd */
   if (getcwd (tmp, LT_PATHMAX) == NULL)
-    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", strerror (errno));
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
   tmp_len = strlen (tmp);
   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
   memcpy (concat_name, tmp, tmp_len);
@@ -3425,7 +3426,7 @@ chase_symlinks (const char *pathspec)
 	{
 	  lt_fatal (__FILE__, __LINE__,
 		    "error accessing file \"%s\": %s",
-		    tmp_pathspec, strerror (errno));
+		    tmp_pathspec, nonnull (strerror (errno)));
 	}
     }
   XFREE (tmp_pathspec);


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Mon Feb 22 16:14:05 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NjfbR-0001wG-BX
	for mharc-libtool-commit@gnu.org; Mon, 22 Feb 2010 16:14:05 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NjfbG-0001oW-7J
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 16:13:54 -0500
Received: from [140.186.70.92] (port=50873 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NjfbD-0001gu-Hl
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 16:13:52 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjfTd-00019P-M1
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 16:06:02 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:54939
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjfTd-00019K-AU
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 16:06:01 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjfTd-00069F-59
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 21:06:01 +0000
Received: from rwild by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NjfTc-0006Qi-W8
	for libtool-commit@gnu.org; Mon, 22 Feb 2010 21:06:01 +0000
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 948e6bbecd55a6388297d8f0a85396e02888ab09
X-Git-Newrev: 3cca61ae59c4eadb5d6bd423ec5cba435a337c8f
Message-Id: <E1NjfTc-0006Qi-W8@vcs-noshell.in.savannah.gnu.org>
Date: Mon, 22 Feb 2010 21:06:01 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-187-g3cca61a
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 22 Feb 2010 21:13:56 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  3cca61ae59c4eadb5d6bd423ec5cba435a337c8f (commit)
      from  948e6bbecd55a6388297d8f0a85396e02888ab09 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3cca61ae59c4eadb5d6bd423ec5cba435a337c8f
Author: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Date:   Mon Feb 22 22:05:14 2010 +0100

    manual: fix detailmenu ordering.
    
    * doc/libtool.texi (Top): Add section for `Linking executables'
    in the detailmenu.
    
    Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |    6 ++++++
 doc/libtool.texi |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 295123a..b8aae4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	manual: fix detailmenu ordering.
+	* doc/libtool.texi (Top): Add section for `Linking executables'
+	in the detailmenu.
+
 2010-02-21  Charles Wilson <libtool@cwilson.fastmail.fm>
 
 	Guard against strerror()==NULL
diff --git a/doc/libtool.texi b/doc/libtool.texi
index 8a191df..5f0d35c 100644
--- a/doc/libtool.texi
+++ b/doc/libtool.texi
@@ -120,6 +120,10 @@ Using libtool
 * Installing executables::      Making programs available to users.
 * Static libraries::            When shared libraries are not wanted.
 
+Linking executables
+
+* Wrapper executables::         Wrapper executables for some platforms.
+
 Invoking @code{libtool}
 
 * Compile mode::                Creating library object files.
@@ -212,7 +216,6 @@ Platform quirks
 * Reloadable objects::          Binding object files together.
 * Multiple dependencies::       Removing duplicate dependent libraries.
 * Archivers::                   Programs that create static archives.
-* Wrapper executables::         Wrapper executables for some platforms.
 
 @end detailmenu
 @end menu


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Wed Feb 24 16:02:32 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NkONL-0006HD-MD
	for mharc-libtool-commit@gnu.org; Wed, 24 Feb 2010 16:02:31 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NkONK-0006Gi-2j
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 16:02:30 -0500
Received: from [140.186.70.92] (port=53239 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NkONJ-0006GY-Ah
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 16:02:29 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NkONI-0008QL-EM
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 16:02:29 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:56192
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NkONI-0008QG-Cb
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 16:02:28 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NkONH-0006rI-SC
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 21:02:27 +0000
Received: from rwild by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NkONH-0005iv-Gj
	for libtool-commit@gnu.org; Wed, 24 Feb 2010 21:02:27 +0000
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3cca61ae59c4eadb5d6bd423ec5cba435a337c8f
X-Git-Newrev: 5627b263cc369f26ae90384e673653f64e0108ff
Message-Id: <E1NkONH-0005iv-Gj@vcs-noshell.in.savannah.gnu.org>
Date: Wed, 24 Feb 2010 21:02:27 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-188-g5627b26
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Feb 2010 21:02:30 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  5627b263cc369f26ae90384e673653f64e0108ff (commit)
      from  3cca61ae59c4eadb5d6bd423ec5cba435a337c8f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5627b263cc369f26ae90384e673653f64e0108ff
Author: Scott McCreary <scottmc2@gmail.com>
Date:   Wed Feb 24 22:10:52 2010 +0100

    Update search path on Haiku for legacy system directory.
    
    * libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [haiku]
    <sys_lib_dlsearch_path_spec>: Replace legacy
    /boot/beos/system/lib directory with /boot/system/lib.
    * THANKS: Update.
    
    Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    8 ++++++++
 THANKS                |    1 +
 libltdl/m4/libtool.m4 |    2 +-
 3 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b8aae4a..8445fbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-24  Scott McCreary  <scottmc2@gmail.com>  (tiny change)
+
+	Update search path on Haiku for legacy system directory.
+	* libltdl/m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER) [haiku]
+	<sys_lib_dlsearch_path_spec>: Replace legacy
+	/boot/beos/system/lib directory with /boot/system/lib.
+	* THANKS: Update.
+
 2010-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
 	manual: fix detailmenu ordering.
diff --git a/THANKS b/THANKS
index 110b514..7ff58a8 100644
--- a/THANKS
+++ b/THANKS
@@ -158,6 +158,7 @@
   Roumen Petrov			bugtrack@roumenpetrov.info
   Rudolf Leitgeb		r.leitgeb@x-pin.com
   Sam Thursfield		ssssam@gmail.com
+  Scott McCreary		scottmc2@gmail.com
   Sebastian Wilhelmi		wilhelmi@ira.uka.de
   Simon Josefsson		jas@extundo.com
   Stephan Kulow			coolo@kde.org
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index 29f1222..b538fa6 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -2335,7 +2335,7 @@ haiku*)
   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/beos/system/lib'
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
 


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Sat Feb 27 23:49:10 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nlb5a-0005Cm-9t
	for mharc-libtool-commit@gnu.org; Sat, 27 Feb 2010 23:49:10 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nlb5Y-0005Bm-J3
	for libtool-commit@gnu.org; Sat, 27 Feb 2010 23:49:08 -0500
Received: from [140.186.70.92] (port=42437 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nlb5W-0005An-FA
	for libtool-commit@gnu.org; Sat, 27 Feb 2010 23:49:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nlb5V-0003In-Is
	for libtool-commit@gnu.org; Sat, 27 Feb 2010 23:49:06 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:44706
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nlb5V-0003Ij-Et
	for libtool-commit@gnu.org; Sat, 27 Feb 2010 23:49:05 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nlb5U-0005OR-VJ
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 04:49:04 +0000
Received: from rwild by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Nlb5U-00061m-Hg
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 04:49:04 +0000
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5627b263cc369f26ae90384e673653f64e0108ff
X-Git-Newrev: 7efdc2482e01bade122656c13b53423ec49f59db
Message-Id: <E1Nlb5U-00061m-Hg@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 28 Feb 2010 04:49:04 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-189-g7efdc24
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 28 Feb 2010 04:49:08 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  7efdc2482e01bade122656c13b53423ec49f59db (commit)
      from  5627b263cc369f26ae90384e673653f64e0108ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7efdc2482e01bade122656c13b53423ec49f59db
Author: Pierre Ossman <ossman@ossman.lkpg.cendio.se>
Date:   Mon Feb 22 22:44:04 2010 +0100

    Fix deplibs check fallback for 64-bit Windows and Windows CE.
    
    * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
    'pe-arm-wince' and 'pe-x86-64'.  Add note about consistency with ...
    * libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
    pattern here; sync pattern from the former.
    * tests/deplibs-mingw.at (deplibs without file command): New
    file, new test.
    * Makefile.am (TESTSUITE_AT): Update.
    * NEWS: Update.
    
    Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                  |   13 ++++++
 Makefile.am                |    3 +-
 NEWS                       |    1 +
 libltdl/config/ltmain.m4sh |    3 +-
 libltdl/m4/libtool.m4      |    3 +-
 tests/deplibs-mingw.at     |   93 ++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 113 insertions(+), 3 deletions(-)
 create mode 100644 tests/deplibs-mingw.at

diff --git a/ChangeLog b/ChangeLog
index 8445fbe..19873a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-28  Pierre Ossman  <ossman@ossman.lkpg.cendio.se>  (tiny change)
+            Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+	Fix deplibs check fallback for 64-bit Windows and Windows CE.
+	* libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD): Accept file formats
+	'pe-arm-wince' and 'pe-x86-64'.  Add note about consistency with ...
+	* libltdl/config/ltmain.m4sh (func_win32_libid): ... the respective
+	pattern here; sync pattern from the former.
+	* tests/deplibs-mingw.at (deplibs without file command): New
+	file, new test.
+	* Makefile.am (TESTSUITE_AT): Update.
+	* NEWS: Update.
+
 2010-02-24  Scott McCreary  <scottmc2@gmail.com>  (tiny change)
 
 	Update search path on Haiku for legacy system directory.
diff --git a/Makefile.am b/Makefile.am
index 29a639a..a7de46d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -504,7 +504,8 @@ TESTSUITE_AT	= tests/testsuite.at \
 		  tests/configure-iface.at \
 		  tests/stresstest.at \
 		  tests/cmdline_wrap.at \
-		  tests/darwin.at
+		  tests/darwin.at \
+		  tests/deplibs-mingw.at
 
 EXTRA_DIST     += $(srcdir)/$(TESTSUITE) $(TESTSUITE_AT) $(srcdir)/tests/package.m4
 
diff --git a/NEWS b/NEWS
index 61638fd..00ab5c1 100644
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,7 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, Libtool team:
     when using the compiler driver to link programs. Now "-Wc," is stripped
     just as it is when linking libraries through the compiler driver.
   - Symbol versioning works with the GNU gold linker now.
+  - Fixes for detection of shared library dependencies on MinGW systems.
 
 * Miscellaneous changes:
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 56b7497..8fcedc9 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2189,8 +2189,9 @@ func_win32_libid ()
     win32_libid_type="x86 archive import"
     ;;
   *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
       win32_nmres=`eval $NM -f posix -A $1 |
 	$SED -n -e '
 	    1,100{
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index b538fa6..f99e618 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3009,7 +3009,8 @@ mingw* | pw32*)
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    # 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_file_magic_cmd='$OBJDUMP -f'
   fi
   ;;
diff --git a/tests/deplibs-mingw.at b/tests/deplibs-mingw.at
new file mode 100644
index 0000000..68e8386
--- /dev/null
+++ b/tests/deplibs-mingw.at
@@ -0,0 +1,93 @@
+# deplibs-mingw.at --                         -*- Autotest -*-
+
+#   Copyright (C) 2010 Free Software Foundation, Inc.
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from  http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+####
+
+# Check that deplibs are detected correctly even if there is no `file'
+# command installed.
+
+AT_SETUP([deplibs without file command])
+AT_KEYWORDS([libtool])
+
+cwd=`pwd`
+instdir=$cwd/inst
+libdir=$instdir/lib
+bindir=$instdir/bin
+LDFLAGS="$LDFLAGS -no-undefined"
+
+mkdir inst inst/bin inst/lib
+
+AT_DATA([a.c],
+[[int a () { return 0; }
+]])
+AT_DATA([b.c],
+[[extern int a ();
+int b () { return a (); }
+]])
+
+for file in a.c b.c; do
+  $LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c $file
+done
+AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo -rpath $libdir],
+	 [], [ignore], [ignore])
+AT_CHECK([library_names= && . ./liba.la && if test -z "$library_names"; then exit 77; fi ],
+	 [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=install cp liba.la $libdir], [], [ignore], [ignore])
+AT_CHECK([$LIBTOOL --mode=clean rm -f liba.la], [], [ignore], [ignore])
+rm -f $libdir/liba.la
+
+# check once with `file' (if present) and once without, if on MinGW.
+for try in with-file without-file; do
+  AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libb.la b.lo -rpath $libdir ]dnl
+	   [-L$libdir -la],
+	   [], [ignore], [ignore])
+  AT_CHECK([library_names= && . ./libb.la && if test -z "$library_names"; then exit 99; fi ],
+	   [], [ignore], [ignore])
+
+  case $host_os in
+  mingw*)
+    if file /; then
+      mkdir bin new-libtool
+
+      cat >bin/file <<\EOF
+#! /bin/sh
+exit 1
+EOF
+      chmod +x bin/file
+      PATH=`pwd`/bin${PATH_SEPARATOR-:}$PATH
+      cd new-libtool
+      AT_CHECK(["$abs_top_srcdir"/configure $configure_options || exit 77],
+	       [], [ignore], [ignore])
+      cd ..
+      LIBTOOL=new-libtool/libtool
+      export LIBTOOL
+      # Check whether the generated script is usable; otherwise, skip.
+      AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o libunrelated.la a.lo -rpath $libdir] dnl
+	       [|| exit 77], [], [ignore], [ignore])
+    else
+      break;
+    fi;;
+  *)
+    break;;
+  esac
+done
+
+AT_CLEANUP


hooks/post-receive
-- 
GNU Libtool



From MAILER-DAEMON Sun Feb 28 08:52:39 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NljZX-0000r4-JU
	for mharc-libtool-commit@gnu.org; Sun, 28 Feb 2010 08:52:39 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NljZV-0000pp-Rl
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 08:52:37 -0500
Received: from [140.186.70.92] (port=33560 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NljZU-0000oF-9t
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 08:52:36 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NljZU-000247-1L
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 08:52:36 -0500
Received: from colonialone.fsf.org ([140.186.70.51]:34153
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NljZT-000243-W6
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 08:52:36 -0500
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NljZS-0003Un-L9
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 13:52:34 +0000
Received: from rwild by vcs-noshell.in.savannah.gnu.org with local (Exim 4.69)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1NljZS-0006Sy-GR
	for libtool-commit@gnu.org; Sun, 28 Feb 2010 13:52:34 +0000
From: "Ralf Wildenhues" <Ralf.Wildenhues@gmx.de>
To: libtool-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7efdc2482e01bade122656c13b53423ec49f59db
X-Git-Newrev: d5ca75c82dfb86fb66d69d6ff62ac16a5bdcc8e0
Message-Id: <E1NljZS-0006Sy-GR@vcs-noshell.in.savannah.gnu.org>
Date: Sun, 28 Feb 2010 13:52:34 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [SCM] GNU Libtool branch, master, updated. v2.2.6-190-gd5ca75c
X-BeenThere: libtool-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS commit notices for the GNU libtool shared library maintenance
	tool <libtool-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/libtool-commit>
List-Post: <mailto:libtool-commit@gnu.org>
List-Help: <mailto:libtool-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/libtool-commit>,
	<mailto:libtool-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 28 Feb 2010 13:52:38 -0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Libtool".

The branch, master has been updated
       via  d5ca75c82dfb86fb66d69d6ff62ac16a5bdcc8e0 (commit)
      from  7efdc2482e01bade122656c13b53423ec49f59db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d5ca75c82dfb86fb66d69d6ff62ac16a5bdcc8e0
Author: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Date:   Sun Feb 28 13:38:34 2010 +0100

    Detect Sun compiler suite with 'sun'-prefixed names.
    
    * libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LANG_CXX_CONFIG)
    (_LT_SYS_HIDDEN_LIBDEPS) [solaris]: Accept compiler names sunCC,
    sunf77, sunf90, sunf95 in addition to CC, f77, f90, f95.
    * NEWS: Update.
    Report by Vadim Zeitlin.
    
    Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    9 +++++++++
 NEWS                  |    1 +
 libltdl/m4/libtool.m4 |    8 ++++----
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 19873a1..0e5d92c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-02-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+	Detect Sun compiler suite with 'sun'-prefixed names.
+	* libltdl/m4/libtool.m4 (_LT_COMPILER_PIC, _LT_LANG_CXX_CONFIG)
+	(_LT_SYS_HIDDEN_LIBDEPS) [solaris]: Accept compiler names sunCC,
+	sunf77, sunf90, sunf95 in addition to CC, f77, f90, f95.
+	* NEWS: Update.
+	Report by Vadim Zeitlin.
+
 2010-02-28  Pierre Ossman  <ossman@ossman.lkpg.cendio.se>  (tiny change)
             Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
 
diff --git a/NEWS b/NEWS
index 00ab5c1..ac5a40c 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,7 @@ New in 2.2.8 2010-??-??: git version 2.2.7a, Libtool team:
     just as it is when linking libraries through the compiler driver.
   - Symbol versioning works with the GNU gold linker now.
   - Fixes for detection of shared library dependencies on MinGW systems.
+  - Fixed Sun compiler detection on Solaris with sunCC, sunf77 etc. names.
 
 * Miscellaneous changes:
 
diff --git a/libltdl/m4/libtool.m4 b/libltdl/m4/libtool.m4
index f99e618..677505d 100644
--- a/libltdl/m4/libtool.m4
+++ b/libltdl/m4/libtool.m4
@@ -3823,7 +3823,7 @@ m4_if([$1], [CXX], [
 	;;
       solaris*)
 	case $cc_basename in
-	  CC*)
+	  CC* | sunCC*)
 	    # 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'
@@ -4107,7 +4107,7 @@ m4_if([$1], [CXX], [
       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       case $cc_basename in
-      f77* | f90* | f95*)
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
       *)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
@@ -6255,7 +6255,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 
       solaris*)
         case $cc_basename in
-          CC*)
+          CC* | sunCC*)
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -6618,7 +6618,7 @@ linux*)
 
 solaris*)
   case $cc_basename in
-  CC*)
+  CC* | sunCC*)
     # The more standards-conforming stlport4 library is
     # incompatible with the Cstd library. Avoid specifying
     # it if it's in CXXFLAGS. Ignore libCrun as


hooks/post-receive
-- 
GNU Libtool



