[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: 31-gary-m4_sysval-to-m4-module.patch
From: |
Gary V. Vaughan |
Subject: |
FYI: 31-gary-m4_sysval-to-m4-module.patch |
Date: |
Thu, 24 Jul 2003 15:24:34 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030718 |
Applied to HEAD.
--
())_. Gary V. Vaughan gary@(oranda.demon.co.uk|gnu.org)
( '/ Research Scientist http://www.oranda.demon.co.uk ,_())____
/ )= GNU Hacker http://www.gnu.org/software/libtool \' `&
`(_~)_ Tech' Author http://sources.redhat.com/autobook =`---d__/
Index: ChangeLog
from Gary V. Vaughan <address@hidden>
An experiment: There is loads of code in libm4 which should be in
the m4 module, but is also used by another module. Just because
some linkers won't cope with calls across dynamic runtime loaded
objects I initially left the code in libm4. It will tidy the
module api immensely if this code moves to the right place, I just
need to remember to invent a suitable calling mechanism at some
point. For now, only modules that are statically linked and
preloaded will get this treatment, so the only platforms that will
break are those that require all symbols to be resolved at link
time.
* TODO: Reminder that what I am doing could reduce portability
unless I do something more robust later.
* m4/m4module.h (m4_sysval): No longer exported from libm4.
* m4/utility.c (m4_sysval): No longer declared in libm4.
* modules/Makefile.am: Reformatting.
* modules/m4.c (m4_sysval): Declare it at place of use.
* modules/gnu.c (m4_sysval): Import it for use in esyscmd.
Index: TODO
===================================================================
RCS file: /cvsroot/m4/m4/TODO,v
retrieving revision 1.10
diff -u -p -u -r1.10 TODO
--- TODO 16 Jun 2003 10:43:44 -0000 1.10
+++ TODO 24 Jul 2003 11:37:19 -0000
@@ -102,6 +102,20 @@ for any of these ideas or if you have ot
asked to load a frozen file that requires versions of modules with
interface versions unsupported by the current release.
+ + Some liberties are take with preloaded modules using one another's
+ symbols. This only works (portably) because the modules that do it
+ (m4.so and gnu.so) are both statically linked into the core. Need to
+ investigate how this can be supported for any module, on platforms that
+ don't support backlinking. Maybe exporting symbol name/address pairs
+ into a table maintained by libm4, and only using module symbols through
+ that table in other modules.
+
+ + On a related note, modules should be able to declare that they require
+ other modules to be loaded before they can work -- and the module loader
+ should take care of that. Should such required modules be fully loaded
+ into the symbol table? Or merely loaded into memory so that the C level
+ code is callable?
+
+ Setting of the module search path within m4 scripts:
append(__modulepath__, `/some/modules/live/here')
Index: m4/m4module.h
===================================================================
RCS file: /cvsroot/m4/m4/m4/m4module.h,v
retrieving revision 1.58
diff -u -p -u -r1.58 m4module.h
--- m4/m4module.h 23 Jul 2003 16:20:50 -0000 1.58
+++ m4/m4module.h 24 Jul 2003 11:37:19 -0000
@@ -303,10 +303,6 @@ extern void m4_debug_message_prefix (m4
} } M4_STMT_END
-/* Exit code from last "syscmd" command. */
-extern int m4_sysval;
-
-
/* --- SYNTAX TABLE DEFINITIONS --- */
Index: m4/utility.c
===================================================================
RCS file: /cvsroot/m4/m4/m4/utility.c,v
retrieving revision 1.31
diff -u -p -u -r1.31 utility.c
--- m4/utility.c 23 Jul 2003 16:20:50 -0000 1.31
+++ m4/utility.c 24 Jul 2003 11:37:19 -0000
@@ -26,8 +26,6 @@
static int dumpdef_cmp (const void *s1, const void *s2);
-/* Exit code from last "syscmd" command. */
-int m4_sysval = 0;
/* Give friendly warnings if a builtin macro is passed an
Index: modules/Makefile.am
===================================================================
RCS file: /cvsroot/m4/m4/modules/Makefile.am,v
retrieving revision 1.18
diff -u -p -u -r1.18 Makefile.am
--- modules/Makefile.am 30 May 2003 15:13:32 -0000 1.18
+++ modules/Makefile.am 24 Jul 2003 11:37:19 -0000
@@ -40,9 +40,9 @@ if USE_GMP
pkglibexec_LTLIBRARIES += mpeval.la
endif
-gnu_la_SOURCES = gnu.c
+gnu_la_SOURCES = gnu.c
EXTRA_gnu_la_SOURCES = format.c
-gnu_la_LDFLAGS = -module
+gnu_la_LDFLAGS = -module
load_la_SOURCES = load.c
load_la_LDFLAGS = -module
@@ -78,4 +78,3 @@ time_la_LDFLAGS = -module
BUILT_SOURCES = perlxsi.c
perlxsi.c:
perl -MExtUtils::Embed -e xsinit -- -o perlxsi.c
-
Index: modules/gnu.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/gnu.c,v
retrieving revision 1.26
diff -u -p -u -r1.26 gnu.c
--- modules/gnu.c 23 Jul 2003 16:20:50 -0000 1.26
+++ modules/gnu.c 24 Jul 2003 11:37:19 -0000
@@ -503,6 +503,9 @@ M4BUILTIN_HANDLER (syncoutput)
/**
* esyscmd(SHELL-COMMAND)
**/
+
+extern int m4_sysval;
+
M4BUILTIN_HANDLER (esyscmd)
{
FILE *pin;
Index: modules/m4.c
===================================================================
RCS file: /cvsroot/m4/m4/modules/m4.c,v
retrieving revision 1.48
diff -u -p -u -r1.48 m4.c
--- modules/m4.c 23 Jul 2003 16:20:50 -0000 1.48
+++ modules/m4.c 24 Jul 2003 11:37:19 -0000
@@ -337,6 +337,10 @@ M4BUILTIN_HANDLER (defn)
/* This section contains macros to handle the builtins "syscmd"
and "sysval". */
+
+/* Exit code from last "syscmd" command (also used by gnu module). */
+int m4_sysval = 0;
+
M4BUILTIN_HANDLER (syscmd)
{
m4_debug_flush_files (context);
- FYI: 31-gary-m4_sysval-to-m4-module.patch,
Gary V. Vaughan <=