about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:27:25 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-12-01 15:27:25 +0000
commit26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030 (patch)
tree2f5410a217d359e4447acb8563b28ae560b31718
parent9ab8fed111413436683120ed3c13b59c745015e1 (diff)
downloadzsh-26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030.tar.gz
zsh-26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030.tar.xz
zsh-26cf7b8d50f1b7d9d0b9115018ef4dc8624b5030.zip
zsh-workers/8839
-rw-r--r--Src/.cvsignore2
-rw-r--r--Src/Builtins/.cvsignore2
-rw-r--r--Src/Makemod.in.in10
-rw-r--r--Src/Modules/.cvsignore2
-rw-r--r--Src/Zle/.cvsignore2
-rw-r--r--Src/Zle/compcore.c3
-rw-r--r--Src/Zle/compctl.c4
-rw-r--r--Src/Zle/complete.c3
-rw-r--r--Src/Zle/compmatch.c3
-rw-r--r--Src/Zle/compresult.c3
-rw-r--r--Src/makepro.awk48
-rw-r--r--Src/mkmakemod.sh23
-rw-r--r--Src/zsh.mdd6
13 files changed, 45 insertions, 66 deletions
diff --git a/Src/.cvsignore b/Src/.cvsignore
index 843b47168..bd828c33e 100644
--- a/Src/.cvsignore
+++ b/Src/.cvsignore
@@ -1,6 +1,8 @@
 Makefile
 Makemod.in Makemod
 [_a-zA-Z0-9]*.pro
+*.epro
+*.syms
 *.o
 *.o.c
 *.so
diff --git a/Src/Builtins/.cvsignore b/Src/Builtins/.cvsignore
index 00408dcd0..f0498cb30 100644
--- a/Src/Builtins/.cvsignore
+++ b/Src/Builtins/.cvsignore
@@ -2,6 +2,8 @@ Makefile
 Makefile.in
 so_locations
 *.pro
+*.epro
+*.syms
 *.o
 *.o.c
 *.so
diff --git a/Src/Makemod.in.in b/Src/Makemod.in.in
index 0ba2e217c..9aaa45308 100644
--- a/Src/Makemod.in.in
+++ b/Src/Makemod.in.in
@@ -58,7 +58,7 @@ KNROBJ=._foo_
 ANSIOBJ=.o
 ANSI_OBJ=._foo_
 
-.SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .pro
+.SUFFIXES: .c .$(DL_EXT) ..o .._foo_ .o ._foo_ .syms .pro .epro
 
 .c$(ANSI@U@OBJ):
 	$(COMPILE) -o $@ $<
@@ -78,9 +78,13 @@ ANSI_OBJ=._foo_
 	$(DLCOMPILE) -o $@ $@.c
 	rm -f $@.c
 
-.c.pro:
+.c.syms:
 	$(AWK) -f $(sdir_src)/makepro.awk $< $(subdir) > $@
 
+.syms.epro:
+	sed -n '/^E/{s/^E//;p;}' < $< > $@
+	sed -n '/^L/{s/^L//;p;}' < $< > `echo $@ | sed 's/\.epro$$/.pro/'`
+
 PROTODEPS = $(sdir_src)/makepro.awk
 
 # ========== DEPENDENCIES FOR BUILDING ==========
@@ -147,7 +151,7 @@ mostlyclean-here:
 	rm -f *.o *.$(DL_EXT)
 
 clean-here:
-	rm -f *.o.c *.pro *.mdh *.mdhi *.mdhs *.mdh.tmp
+	rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp
 
 distclean-here:
 	rm -f $(makefile) $(makefile).in
diff --git a/Src/Modules/.cvsignore b/Src/Modules/.cvsignore
index afeef6bff..9e8213045 100644
--- a/Src/Modules/.cvsignore
+++ b/Src/Modules/.cvsignore
@@ -2,6 +2,8 @@ Makefile
 Makefile.in
 so_locations
 *.pro
+*.epro
+*.syms
 *.o
 *.o.c
 *.so
diff --git a/Src/Zle/.cvsignore b/Src/Zle/.cvsignore
index b1ed9dede..2eff53649 100644
--- a/Src/Zle/.cvsignore
+++ b/Src/Zle/.cvsignore
@@ -2,6 +2,8 @@ Makefile
 Makefile.in
 so_locations
 *.pro
+*.epro
+*.syms
 *.o
 *.o.c
 *.so
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index d4561c469..f37bdef54 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -28,9 +28,6 @@
  */
 
 #include "complete.mdh"
-#define GLOBAL_PROTOTYPES
-#include "zle_tricky.pro"
-#undef GLOBAL_PROTOTYPES
 #include "compcore.pro"
 
 /* The last completion widget called. */
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index cb8f32a3a..d13bc2252 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -29,10 +29,6 @@
 
 #include "compctl.mdh"
 #include "compctl.pro"
-#define GLOBAL_PROTOTYPES
-#include "zle_tricky.pro"
-#include "complete.pro"
-#undef GLOBAL_PROTOTYPES
 
 /* Default completion infos */
  
diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c
index 1841514a1..55a6e68f2 100644
--- a/Src/Zle/complete.c
+++ b/Src/Zle/complete.c
@@ -28,9 +28,6 @@
  */
 
 #include "complete.mdh"
-#define GLOBAL_PROTOTYPES
-#include "zle_tricky.pro"
-#undef GLOBAL_PROTOTYPES
 #include "complete.pro"
 
 /* Global matcher. */
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index c3b4c9eae..d29595d62 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -28,9 +28,6 @@
  */
 
 #include "complete.mdh"
-#define GLOBAL_PROTOTYPES
-#include "zle_tricky.pro"
-#undef GLOBAL_PROTOTYPES
 #include "compmatch.pro"
 
 /* This compares two cpattern lists and returns non-zero if they are
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index b3c8bdd4f..c68657d79 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -28,9 +28,6 @@
  */
 
 #include "complete.mdh"
-#define GLOBAL_PROTOTYPES
-#include "zle_tricky.pro"
-#undef GLOBAL_PROTOTYPES
 #include "compresult.pro"
 
 #define inststr(X) inststrlen((X),1,-1)
diff --git a/Src/makepro.awk b/Src/makepro.awk
index ee302eada..98167fcad 100644
--- a/Src/makepro.awk
+++ b/Src/makepro.awk
@@ -18,13 +18,9 @@ BEGIN {
     gsub(/\//, "_", name)
     ARGC--
 
-    # `locals' is a list of local declarations, built up while global
-    # declarations are output.
-    locals = ""
-
-    printf "#ifndef have_%s_globals\n", name
-    printf "#define have_%s_globals\n", name
-    printf "\n"
+    printf "E#ifndef have_%s_globals\n", name
+    printf "E#define have_%s_globals\n", name
+    printf "E\n"
 }
 
 # all relevant declarations are preceded by "/**/" on a line by itself
@@ -43,8 +39,8 @@ BEGIN {
 	if (line == "" && $0 ~ /^[ \t]*#/) {
             # Directly after the /**/ was a preprocessor line.
             # Spit it out and re-start the outer loop.
-	    printf "%s\n", $0
-	    locals = locals $0 "\n"
+	    printf "E%s\n", $0
+	    printf "L%s\n", $0
 	    next
 	}
 	gsub(/\t/, " ")
@@ -84,10 +80,12 @@ BEGIN {
     match(line, /^((const|enum|static|struct|union) +)*([_0-9A-Za-z]+ +|((char|double|float|int|long|short|unsigned|void) +)+)((const|static) +)*/)
     dtype = substr(line, 1, RLENGTH)
     sub(/ *$/, "", dtype)
-    islocal = " " dtype " " ~ / static /
+    if(" " dtype " " ~ / static /)
+	locality = "L"
+    else
+	locality = "E"
     line = substr(line, RLENGTH+1) ","
     # Handle each declarator.
-    output = ""
     while(match(line, /^[^,]*,/)) {
 	# Separate out the name from the declarator.  Use "@+" and "@-"
 	# to bracket the name within the declarator.  Strip off any
@@ -114,40 +112,26 @@ BEGIN {
 	if(" " dtype " " ~ / int / && dcltor ~ / *@\+(boot|cleanup|setup|finish)_[_0-9A-Za-z]+@- *_\(\( *Module +[_0-9A-Za-z]+ *\)\) */) {
 	    modtype = dnam
 	    sub(/_.*$/, "", modtype)
-	    output = output "# if defined(DYNAMIC_NAME_CLASH_OK) && defined(MODULE)\n"
-	    output = output "#  define " dnam " " modtype "_\n"
-	    output = output "# endif\n"
+	    printf "%s# if defined(DYNAMIC_NAME_CLASH_OK) && defined(MODULE)\n", locality
+	    printf "%s#  define " dnam " " modtype "_\n", locality
+	    printf "%s# endif\n", locality
 	}
 
 	# Format the declaration for output
 	dcl = dtype " " dcltor ";"
-	if(!islocal)
+	if(locality ~ /E/)
 	    dcl = "extern " dcl
 	gsub(/@[+-]/, "", dcl)
 	gsub(/ +/, " ", dcl)
 	while(match(dcl, /[^_0-9A-Za-z] ./) || match(dcl, /. [^_0-9A-Za-z]/))
 	    dcl = substr(dcl, 1, RSTART) substr(dcl, RSTART+2)
-	output = output dcl "\n"
+	printf "%s%s\n", locality, dcl
     }
-
-    # Output global declarations now, but save up locals until the end.
-    if(islocal)
-	locals = locals output
-    else
-	printf "%s", output
 }
 
 END {
     if(aborting)
 	exit 1
-    printf "\n"
-    printf "#endif /* !have_%s_globals */\n", name
-    if(locals != "") {
-	printf "\n"
-	printf "#ifndef GLOBAL_PROTOTYPES\n"
-	printf "\n"
-	print locals
-	printf "\n"
-	printf "#endif /* !GLOBAL_PROTOTYPES */\n"
-    }
+    printf "E\n"
+    printf "E#endif /* !have_%s_globals */\n", name
 }
diff --git a/Src/mkmakemod.sh b/Src/mkmakemod.sh
index 9584474a9..eaf7026e5 100644
--- a/Src/mkmakemod.sh
+++ b/Src/mkmakemod.sh
@@ -27,7 +27,7 @@
 #   autoparams      parameters defined by the module, for autoloading
 #   automathfuncs   math functions defined by the module, for autoloading
 #   objects         .o files making up this module (*must* be defined)
-#   proto           .pro files for this module (default generated from $objects)
+#   proto           .syms files for this module (default generated from $objects)
 #   headers         extra headers for this module (default none)
 #   hdrdeps         extra headers on which the .mdh depends (default none)
 #   otherincs       extra headers that are included indirectly (default none)
@@ -39,9 +39,9 @@
 # For each module in also knows how to build a .mdh file.  Each source file
 # should #include the .mdh file for the module it is a part of.  The .mdh
 # file #includes the .mdh files for any module dependencies, then each of
-# $headers, and then each of $proto (for global declarations).  It will
+# $headers, and then each .epro (for global declarations).  It will
 # be recreated if any of the dependency .mdh files changes, or if any of
-# $headers or $hdrdeps changes.  When anything depends on it, all of $proto
+# $headers or $hdrdeps changes.  When anything depends on it, all the .epros
 # and $otherincs will be made up to date, but the .mdh file won't actually
 # be rebuilt if those files change.
 #
@@ -178,7 +178,7 @@ if $first_stage; then
 	test -n "${moddeps+set}" || moddeps=
 	test -n "$nozshdep" || moddeps="$moddeps zsh"
 	test -n "${proto+set}" ||
-	    proto=`echo $objects '' | sed 's,\.o ,.pro ,g'`
+	    proto=`echo $objects '' | sed 's,\.o ,.syms ,g'`
 
 	dobjects=`echo $objects '' | sed 's,\.o ,..o ,g'`
 	modhdeps=
@@ -212,13 +212,14 @@ if $first_stage; then
 	echo
 	echo "MODOBJS_${module} = $objects"
 	echo "MODDOBJS_${module} = $dobjects \$(@E@NTRYOBJ)"
-	echo "PROTO_${module} = $proto"
-	echo "INCS_${module} = \$(PROTO_${module}) $otherincs"
+	echo "SYMS_${module} = $proto"
+	echo "EPRO_${module} = "`echo $proto '' | sed 's,\.syms ,.epro ,g'`
+	echo "INCS_${module} = \$(EPRO_${module}) $otherincs"
 	echo "EXPIMP_${module} = $imports ${hasexport+\$(EXPOPT)\$(sdir)/$module.export}"
 	echo "NXPIMP_${module} ="
 	echo
-	echo "proto.${module}: \$(PROTO_${module})"
-	echo "\$(PROTO_${module}): \$(PROTODEPS)"
+	echo "proto.${module}: \$(PRO_${module})"
+	echo "\$(SYMS_${module}): \$(PROTODEPS)"
 	echo
 	echo "modobjs.${module}: \$(MODOBJS_${module})"
 	echo "	echo '' \$(MODOBJS_${module}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
@@ -274,11 +275,9 @@ if $first_stage; then
 	    echo "	    echo; \\"
 	fi
 	if test -n "$proto"; then
-	    echo "	    echo '# define GLOBAL_PROTOTYPES'; \\"
-	    echo "	    for pro in \$(PROTO_${module}); do \\"
-	    echo "		echo '# include \"'\$\$pro'\"'; \\"
+	    echo "	    for epro in \$(EPRO_${module}); do \\"
+	    echo "		echo '# include \"'\$\$epro'\"'; \\"
 	    echo "	    done; \\"
-	    echo "	    echo '# undef GLOBAL_PROTOTYPES'; \\"
 	    echo "	    echo; \\"
 	fi
 	echo "	    echo '#endif /* !have_${module}_module */'; \\"
diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 08289ef8f..61672611b 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -80,9 +80,9 @@ clean.zsh:
 	rm -f sigcount.h signames.c bltinmods.list version.h zshpaths.h zshxmods.h
 
 # This is not properly part of this module, but it is built as if it were.
-main.o: main.c zsh.mdh main.pro
+main.o: main.c zsh.mdh main.epro
 	$(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c
 
-main.pro: $(PROTODEPS)
-proto.zsh: main.pro
+main.syms: $(PROTODEPS)
+proto.zsh: main.epro
 Make