mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-30 07:10:58 +02:00
zsh-workers/8839
This commit is contained in:
parent
9ab8fed111
commit
26cf7b8d50
13 changed files with 45 additions and 66 deletions
|
@ -1,6 +1,8 @@
|
||||||
Makefile
|
Makefile
|
||||||
Makemod.in Makemod
|
Makemod.in Makemod
|
||||||
[_a-zA-Z0-9]*.pro
|
[_a-zA-Z0-9]*.pro
|
||||||
|
*.epro
|
||||||
|
*.syms
|
||||||
*.o
|
*.o
|
||||||
*.o.c
|
*.o.c
|
||||||
*.so
|
*.so
|
||||||
|
|
|
@ -2,6 +2,8 @@ Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
so_locations
|
so_locations
|
||||||
*.pro
|
*.pro
|
||||||
|
*.epro
|
||||||
|
*.syms
|
||||||
*.o
|
*.o
|
||||||
*.o.c
|
*.o.c
|
||||||
*.so
|
*.so
|
||||||
|
|
|
@ -58,7 +58,7 @@ KNROBJ=._foo_
|
||||||
ANSIOBJ=.o
|
ANSIOBJ=.o
|
||||||
ANSI_OBJ=._foo_
|
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):
|
.c$(ANSI@U@OBJ):
|
||||||
$(COMPILE) -o $@ $<
|
$(COMPILE) -o $@ $<
|
||||||
|
@ -78,9 +78,13 @@ ANSI_OBJ=._foo_
|
||||||
$(DLCOMPILE) -o $@ $@.c
|
$(DLCOMPILE) -o $@ $@.c
|
||||||
rm -f $@.c
|
rm -f $@.c
|
||||||
|
|
||||||
.c.pro:
|
.c.syms:
|
||||||
$(AWK) -f $(sdir_src)/makepro.awk $< $(subdir) > $@
|
$(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
|
PROTODEPS = $(sdir_src)/makepro.awk
|
||||||
|
|
||||||
# ========== DEPENDENCIES FOR BUILDING ==========
|
# ========== DEPENDENCIES FOR BUILDING ==========
|
||||||
|
@ -147,7 +151,7 @@ mostlyclean-here:
|
||||||
rm -f *.o *.$(DL_EXT)
|
rm -f *.o *.$(DL_EXT)
|
||||||
|
|
||||||
clean-here:
|
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:
|
distclean-here:
|
||||||
rm -f $(makefile) $(makefile).in
|
rm -f $(makefile) $(makefile).in
|
||||||
|
|
|
@ -2,6 +2,8 @@ Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
so_locations
|
so_locations
|
||||||
*.pro
|
*.pro
|
||||||
|
*.epro
|
||||||
|
*.syms
|
||||||
*.o
|
*.o
|
||||||
*.o.c
|
*.o.c
|
||||||
*.so
|
*.so
|
||||||
|
|
|
@ -2,6 +2,8 @@ Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
so_locations
|
so_locations
|
||||||
*.pro
|
*.pro
|
||||||
|
*.epro
|
||||||
|
*.syms
|
||||||
*.o
|
*.o
|
||||||
*.o.c
|
*.o.c
|
||||||
*.so
|
*.so
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "complete.mdh"
|
#include "complete.mdh"
|
||||||
#define GLOBAL_PROTOTYPES
|
|
||||||
#include "zle_tricky.pro"
|
|
||||||
#undef GLOBAL_PROTOTYPES
|
|
||||||
#include "compcore.pro"
|
#include "compcore.pro"
|
||||||
|
|
||||||
/* The last completion widget called. */
|
/* The last completion widget called. */
|
||||||
|
|
|
@ -29,10 +29,6 @@
|
||||||
|
|
||||||
#include "compctl.mdh"
|
#include "compctl.mdh"
|
||||||
#include "compctl.pro"
|
#include "compctl.pro"
|
||||||
#define GLOBAL_PROTOTYPES
|
|
||||||
#include "zle_tricky.pro"
|
|
||||||
#include "complete.pro"
|
|
||||||
#undef GLOBAL_PROTOTYPES
|
|
||||||
|
|
||||||
/* Default completion infos */
|
/* Default completion infos */
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "complete.mdh"
|
#include "complete.mdh"
|
||||||
#define GLOBAL_PROTOTYPES
|
|
||||||
#include "zle_tricky.pro"
|
|
||||||
#undef GLOBAL_PROTOTYPES
|
|
||||||
#include "complete.pro"
|
#include "complete.pro"
|
||||||
|
|
||||||
/* Global matcher. */
|
/* Global matcher. */
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "complete.mdh"
|
#include "complete.mdh"
|
||||||
#define GLOBAL_PROTOTYPES
|
|
||||||
#include "zle_tricky.pro"
|
|
||||||
#undef GLOBAL_PROTOTYPES
|
|
||||||
#include "compmatch.pro"
|
#include "compmatch.pro"
|
||||||
|
|
||||||
/* This compares two cpattern lists and returns non-zero if they are
|
/* This compares two cpattern lists and returns non-zero if they are
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "complete.mdh"
|
#include "complete.mdh"
|
||||||
#define GLOBAL_PROTOTYPES
|
|
||||||
#include "zle_tricky.pro"
|
|
||||||
#undef GLOBAL_PROTOTYPES
|
|
||||||
#include "compresult.pro"
|
#include "compresult.pro"
|
||||||
|
|
||||||
#define inststr(X) inststrlen((X),1,-1)
|
#define inststr(X) inststrlen((X),1,-1)
|
||||||
|
|
|
@ -18,13 +18,9 @@ BEGIN {
|
||||||
gsub(/\//, "_", name)
|
gsub(/\//, "_", name)
|
||||||
ARGC--
|
ARGC--
|
||||||
|
|
||||||
# `locals' is a list of local declarations, built up while global
|
printf "E#ifndef have_%s_globals\n", name
|
||||||
# declarations are output.
|
printf "E#define have_%s_globals\n", name
|
||||||
locals = ""
|
printf "E\n"
|
||||||
|
|
||||||
printf "#ifndef have_%s_globals\n", name
|
|
||||||
printf "#define have_%s_globals\n", name
|
|
||||||
printf "\n"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# all relevant declarations are preceded by "/**/" on a line by itself
|
# all relevant declarations are preceded by "/**/" on a line by itself
|
||||||
|
@ -43,8 +39,8 @@ BEGIN {
|
||||||
if (line == "" && $0 ~ /^[ \t]*#/) {
|
if (line == "" && $0 ~ /^[ \t]*#/) {
|
||||||
# Directly after the /**/ was a preprocessor line.
|
# Directly after the /**/ was a preprocessor line.
|
||||||
# Spit it out and re-start the outer loop.
|
# Spit it out and re-start the outer loop.
|
||||||
printf "%s\n", $0
|
printf "E%s\n", $0
|
||||||
locals = locals $0 "\n"
|
printf "L%s\n", $0
|
||||||
next
|
next
|
||||||
}
|
}
|
||||||
gsub(/\t/, " ")
|
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) +)*/)
|
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)
|
dtype = substr(line, 1, RLENGTH)
|
||||||
sub(/ *$/, "", dtype)
|
sub(/ *$/, "", dtype)
|
||||||
islocal = " " dtype " " ~ / static /
|
if(" " dtype " " ~ / static /)
|
||||||
|
locality = "L"
|
||||||
|
else
|
||||||
|
locality = "E"
|
||||||
line = substr(line, RLENGTH+1) ","
|
line = substr(line, RLENGTH+1) ","
|
||||||
# Handle each declarator.
|
# Handle each declarator.
|
||||||
output = ""
|
|
||||||
while(match(line, /^[^,]*,/)) {
|
while(match(line, /^[^,]*,/)) {
|
||||||
# Separate out the name from the declarator. Use "@+" and "@-"
|
# Separate out the name from the declarator. Use "@+" and "@-"
|
||||||
# to bracket the name within the declarator. Strip off any
|
# 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]+ *\)\) */) {
|
if(" " dtype " " ~ / int / && dcltor ~ / *@\+(boot|cleanup|setup|finish)_[_0-9A-Za-z]+@- *_\(\( *Module +[_0-9A-Za-z]+ *\)\) */) {
|
||||||
modtype = dnam
|
modtype = dnam
|
||||||
sub(/_.*$/, "", modtype)
|
sub(/_.*$/, "", modtype)
|
||||||
output = output "# if defined(DYNAMIC_NAME_CLASH_OK) && defined(MODULE)\n"
|
printf "%s# if defined(DYNAMIC_NAME_CLASH_OK) && defined(MODULE)\n", locality
|
||||||
output = output "# define " dnam " " modtype "_\n"
|
printf "%s# define " dnam " " modtype "_\n", locality
|
||||||
output = output "# endif\n"
|
printf "%s# endif\n", locality
|
||||||
}
|
}
|
||||||
|
|
||||||
# Format the declaration for output
|
# Format the declaration for output
|
||||||
dcl = dtype " " dcltor ";"
|
dcl = dtype " " dcltor ";"
|
||||||
if(!islocal)
|
if(locality ~ /E/)
|
||||||
dcl = "extern " dcl
|
dcl = "extern " dcl
|
||||||
gsub(/@[+-]/, "", dcl)
|
gsub(/@[+-]/, "", dcl)
|
||||||
gsub(/ +/, " ", dcl)
|
gsub(/ +/, " ", dcl)
|
||||||
while(match(dcl, /[^_0-9A-Za-z] ./) || match(dcl, /. [^_0-9A-Za-z]/))
|
while(match(dcl, /[^_0-9A-Za-z] ./) || match(dcl, /. [^_0-9A-Za-z]/))
|
||||||
dcl = substr(dcl, 1, RSTART) substr(dcl, RSTART+2)
|
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 {
|
END {
|
||||||
if(aborting)
|
if(aborting)
|
||||||
exit 1
|
exit 1
|
||||||
printf "\n"
|
printf "E\n"
|
||||||
printf "#endif /* !have_%s_globals */\n", name
|
printf "E#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"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
# autoparams parameters defined by the module, for autoloading
|
# autoparams parameters defined by the module, for autoloading
|
||||||
# automathfuncs math functions 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)
|
# 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)
|
# headers extra headers for this module (default none)
|
||||||
# hdrdeps extra headers on which the .mdh depends (default none)
|
# hdrdeps extra headers on which the .mdh depends (default none)
|
||||||
# otherincs extra headers that are included indirectly (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
|
# 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
|
# 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
|
# 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
|
# 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
|
# and $otherincs will be made up to date, but the .mdh file won't actually
|
||||||
# be rebuilt if those files change.
|
# be rebuilt if those files change.
|
||||||
#
|
#
|
||||||
|
@ -178,7 +178,7 @@ if $first_stage; then
|
||||||
test -n "${moddeps+set}" || moddeps=
|
test -n "${moddeps+set}" || moddeps=
|
||||||
test -n "$nozshdep" || moddeps="$moddeps zsh"
|
test -n "$nozshdep" || moddeps="$moddeps zsh"
|
||||||
test -n "${proto+set}" ||
|
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'`
|
dobjects=`echo $objects '' | sed 's,\.o ,..o ,g'`
|
||||||
modhdeps=
|
modhdeps=
|
||||||
|
@ -212,13 +212,14 @@ if $first_stage; then
|
||||||
echo
|
echo
|
||||||
echo "MODOBJS_${module} = $objects"
|
echo "MODOBJS_${module} = $objects"
|
||||||
echo "MODDOBJS_${module} = $dobjects \$(@E@NTRYOBJ)"
|
echo "MODDOBJS_${module} = $dobjects \$(@E@NTRYOBJ)"
|
||||||
echo "PROTO_${module} = $proto"
|
echo "SYMS_${module} = $proto"
|
||||||
echo "INCS_${module} = \$(PROTO_${module}) $otherincs"
|
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 "EXPIMP_${module} = $imports ${hasexport+\$(EXPOPT)\$(sdir)/$module.export}"
|
||||||
echo "NXPIMP_${module} ="
|
echo "NXPIMP_${module} ="
|
||||||
echo
|
echo
|
||||||
echo "proto.${module}: \$(PROTO_${module})"
|
echo "proto.${module}: \$(PRO_${module})"
|
||||||
echo "\$(PROTO_${module}): \$(PROTODEPS)"
|
echo "\$(SYMS_${module}): \$(PROTODEPS)"
|
||||||
echo
|
echo
|
||||||
echo "modobjs.${module}: \$(MODOBJS_${module})"
|
echo "modobjs.${module}: \$(MODOBJS_${module})"
|
||||||
echo " echo '' \$(MODOBJS_${module}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
|
echo " echo '' \$(MODOBJS_${module}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
|
||||||
|
@ -274,11 +275,9 @@ if $first_stage; then
|
||||||
echo " echo; \\"
|
echo " echo; \\"
|
||||||
fi
|
fi
|
||||||
if test -n "$proto"; then
|
if test -n "$proto"; then
|
||||||
echo " echo '# define GLOBAL_PROTOTYPES'; \\"
|
echo " for epro in \$(EPRO_${module}); do \\"
|
||||||
echo " for pro in \$(PROTO_${module}); do \\"
|
echo " echo '# include \"'\$\$epro'\"'; \\"
|
||||||
echo " echo '# include \"'\$\$pro'\"'; \\"
|
|
||||||
echo " done; \\"
|
echo " done; \\"
|
||||||
echo " echo '# undef GLOBAL_PROTOTYPES'; \\"
|
|
||||||
echo " echo; \\"
|
echo " echo; \\"
|
||||||
fi
|
fi
|
||||||
echo " echo '#endif /* !have_${module}_module */'; \\"
|
echo " echo '#endif /* !have_${module}_module */'; \\"
|
||||||
|
|
|
@ -80,9 +80,9 @@ clean.zsh:
|
||||||
rm -f sigcount.h signames.c bltinmods.list version.h zshpaths.h zshxmods.h
|
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.
|
# 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
|
$(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c
|
||||||
|
|
||||||
main.pro: $(PROTODEPS)
|
main.syms: $(PROTODEPS)
|
||||||
proto.zsh: main.pro
|
proto.zsh: main.epro
|
||||||
Make
|
Make
|
||||||
|
|
Loading…
Reference in a new issue