m4-patches
[Top][All Lists]
Advanced

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

Re: cygwin vs. --disable-static


From: Eric Blake
Subject: Re: cygwin vs. --disable-static
Date: Sat, 07 Oct 2006 11:10:45 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 10/3/2006 9:56 PM:
> So with that, I removed all the global variable exports from libm4, which
> allowed --disable-static to work on cygwin again.  It would be nice to see
> libtool patched, but at least this breaks the dependency on that.

Then I promptly went and broke this again, by adding a dependence of
modules/m4.c on the gnulib global exit_failure.

2006-10-07  Eric Blake  <address@hidden>

        * m4/m4module.h (m4_set_exit_failure): New prototype.
        * m4/utility.c (m4_set_exit_failure): New function.
        * modules/m4.c (m4exit): Use it to avoid yet another global
        variable export in libm4.

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFJ9+V84KuGfSFAYARAhyuAJ4/Hvl/aReQXxNRtuNlDvAhmr3QswCgjCJm
R+gT8bDzzAQOyu+NwFqeCcg=
=RYHL
-----END PGP SIGNATURE-----
Index: m4/m4module.h
===================================================================
RCS file: /sources/m4/m4/m4/m4module.h,v
retrieving revision 1.91
diff -u -p -r1.91 m4module.h
--- m4/m4module.h       4 Oct 2006 03:57:00 -0000       1.91
+++ m4/m4module.h       7 Oct 2006 17:08:48 -0000
@@ -120,6 +120,7 @@ extern void m4_warn_at_line  (m4 *, int,
 
 extern const char *    m4_get_program_name (void);
 extern void            m4_set_program_name (const char *);
+extern void            m4_set_exit_failure (int);
 
 
 /* --- CONTEXT MANAGEMENT --- */
Index: m4/utility.c
===================================================================
RCS file: /sources/m4/m4/m4/utility.c,v
retrieving revision 1.51
diff -u -p -r1.51 utility.c
--- m4/utility.c        6 Oct 2006 15:24:10 -0000       1.51
+++ m4/utility.c        7 Oct 2006 17:08:48 -0000
@@ -21,6 +21,8 @@
 #include <config.h>
 
 #include "m4private.h"
+
+#include "exitfail.h"
 #include "progname.h"
 #include "verror.h"
 #include "xvasprintf.h"
@@ -224,3 +226,12 @@ m4_set_program_name (const char *name)
 {
   set_program_name (name);
 }
+
+/* Wrap the gnulib exitfail module, to avoid exporting a global
+   variable from a library.  Set the exit status for use in gnulib
+   modules and atexit handlers.  */
+void
+m4_set_exit_failure (int status)
+{
+  exit_failure = status;
+}
Index: modules/m4.c
===================================================================
RCS file: /sources/m4/m4/modules/m4.c,v
retrieving revision 1.80
diff -u -p -r1.80 m4.c
--- modules/m4.c        6 Oct 2006 13:31:41 -0000       1.80
+++ modules/m4.c        7 Oct 2006 17:08:48 -0000
@@ -39,8 +39,6 @@
 #  include "m4private.h"
 #endif
 
-#include "exitfail.h"
-
 /* Rename exported symbols for dlpreload()ing.  */
 #define m4_export_table                m4_LTX_m4_export_table
 #define m4_builtin_table       m4_LTX_m4_builtin_table
@@ -719,7 +717,7 @@ M4BUILTIN_HANDLER (m4exit)
 
   /* Ensure that atexit handlers see correct nonzero status.  */
   if (exit_code != EXIT_SUCCESS)
-    exit_failure = exit_code;
+    m4_set_exit_failure (exit_code);
 
   /* Ensure any module exit callbacks are executed.  */
   m4__module_exit (context);

reply via email to

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