mirror of
https://github.com/zsh-users/zsh
synced 2024-07-21 10:14:19 +00:00
13194: change in module configuration system
This commit is contained in:
parent
ad5f9584c1
commit
49a1ad7516
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2000-11-26 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
|
||||
|
||||
* 13194: INSTALL, configure.in, Config/defs.mk.in,
|
||||
Etc/zsh-development-guide, Src/.distfiles, Src/Makefile.in,
|
||||
Src/Makemod.in.in, Src/mkbltnmlst.sh, Src/mkmakemod.sh,
|
||||
Src/zsh.mdd, Src/Builtins/rlimits.mdd, Src/Builtins/sched.mdd,
|
||||
Src/Modules/cap.mdd, Src/Modules/clone.mdd,
|
||||
Src/Modules/example.mdd, Src/Modules/files.mdd,
|
||||
Src/Modules/mapfile.mdd, Src/Modules/mathfunc.mdd,
|
||||
Src/Modules/parameter.mdd, Src/Modules/stat.mdd,
|
||||
Src/Modules/zftp.mdd, Src/Modules/zprof.mdd, Src/Modules/zpty.mdd,
|
||||
Src/Modules/zutil.mdd, Src/Zle/compctl.mdd, Src/Zle/complete.mdd,
|
||||
Src/Zle/complist.mdd, Src/Zle/computil.mdd, Src/Zle/deltochar.mdd,
|
||||
Src/Zle/zle.mdd, Src/Zle/zleparameter.mdd: New module
|
||||
configuration system using file config.modules set up by
|
||||
configure.
|
||||
|
||||
2000-11-25 Bart Schaefer <schaefer@zsh.org>
|
||||
|
||||
* 13192: Completion/Core/compinit, Src/params.c: Turn off
|
||||
|
|
|
@ -63,9 +63,6 @@ DLLD = @DLLD@
|
|||
EXPOPT = @EXPOPT@
|
||||
IMPOPT = @IMPOPT@
|
||||
|
||||
# choose modules not to compile and install
|
||||
OMIT_MODULES = @OMIT_MODULES@
|
||||
|
||||
# utilities
|
||||
AWK = @AWK@
|
||||
YODL = @YODL@
|
||||
|
|
|
@ -7,7 +7,7 @@ This development takes place by mailing list. Check the META-FAQ for the
|
|||
various zsh mailing lists and how to subscribe to them. The development
|
||||
is very open and anyone is welcomed and encouraged to join and contribute.
|
||||
Because zsh is a very large package whose development can sometimes
|
||||
be very rapid, I kindly ask that people observe a few guidelines when
|
||||
be very rapid, we kindly ask that people observe a few guidelines when
|
||||
contributing patches and feedback to the mailing list. These guidelines
|
||||
are very simple and hopefully should make for a more orderly development
|
||||
of zsh.
|
||||
|
@ -181,6 +181,17 @@ sourced when zsh is built. To describe the module it can/should set the
|
|||
following shell variables:
|
||||
|
||||
- name name of the module
|
||||
- link `static', `dynamic' or `no', as described in INSTALL.
|
||||
May also be a command string, which will be run within
|
||||
configure and whose output is used to set the value
|
||||
of `link' in config.modules. This allows a
|
||||
system-specific choice of modules. For example,
|
||||
link='case $host in *-hpux*) echo dynamic; ;;
|
||||
*) echo no; ;; esac'
|
||||
- load `yes' or `no': whether the shell should include hooks
|
||||
for loading the module automatically as necessary.
|
||||
(This corresponds to an `L' in xmods.conf in the
|
||||
old mechanism.)
|
||||
- moddeps modules on which this module depends (default none)
|
||||
- nozshdep non-empty indicates no dependence on the `zsh/main'
|
||||
pseudo-module
|
||||
|
|
65
INSTALL
65
INSTALL
|
@ -66,53 +66,44 @@ The zsh distribution contains several modules, in the Src/Builtins,
|
|||
Src/Modules and Src/Zle directories. If you have any additional zsh
|
||||
modules that you wish to compile for this version of zsh, create another
|
||||
subdirectory of the Src directory and put them there. You can create
|
||||
as many extra subdirectory hierarchies as you need. The subdirectories
|
||||
must be actual directories; symbolic links will not work.
|
||||
as many extra subdirectories as you need, but currently configure will only
|
||||
search in immediate subdirectories of Src. The subdirectories must be
|
||||
actual directories; symbolic links will not work. You will then need to
|
||||
rerun configure; the easiest way is to run `config.status --recheck' from
|
||||
the top-level build directory which retains the existing configuration as
|
||||
much as possible.
|
||||
|
||||
If you wish to add or remove modules or module directories after you
|
||||
have already run make, then after adding or removing the modules run:
|
||||
make prep
|
||||
|
||||
You can also instruct the configuration process that a certain module
|
||||
should neither be compiled nor installed without modifying any files. To
|
||||
do this, give the argument `--enable-omit-modules=mod1,mod2,...' to
|
||||
configure. The module arguments are the full names of the modules,
|
||||
probably including the prefix `zsh/'. For example,
|
||||
`configure --enable-omit-modules=zsh/zpty,zsh/example' says that the
|
||||
modules zsh/zpty and zsh/example are not to be compiled nor installed.
|
||||
Note that it is up to you to make sure the modules in question are not going
|
||||
to be compiled into the main zsh binary, as described in the next section.
|
||||
It is unlikely you would want to omit any of the modules liable to be
|
||||
compiled in by default.
|
||||
|
||||
Controlling what is compiled into the main zsh binary
|
||||
-----------------------------------------------------
|
||||
The key to the module system is the file config.modules, created in the
|
||||
configuration process. Each module has a line in the file. It may be
|
||||
edited to change the following values for each module; be careful to retain
|
||||
the (strict) format for the file:
|
||||
link - `dynamic', if the module is to be dynamically linked -- meaningless
|
||||
if this is not available on your system.
|
||||
`static' if the module is to be linked directly into the executable.
|
||||
`no' if the module is not to be linked at all. In this case it will
|
||||
not even be compiled.
|
||||
load - `yes' if the module is to be visible to the user. This will make
|
||||
builtins, parameters etc. visible to the user without any need
|
||||
to use the zmodload builtin.
|
||||
`no' if an explicit zmodload command is to be required to load the
|
||||
utilities in the module. Note that this applies both to
|
||||
statically and dynamically linked modules.
|
||||
auto - `yes' if the entry is to be regenerated whenever configure is run.
|
||||
`no' if you wish to retain your hand-edited version.
|
||||
Do not edit the entry for the pseudo-module zsh/main, which is the main
|
||||
shell. After you have edited this file, run `make prep' in the Src
|
||||
subdirectory.
|
||||
|
||||
By default the complete, compctl, zle, computil, complist, sched, parameter,
|
||||
zleparameter and rlimits modules are compiled into non-dynamic zsh and no
|
||||
modules are compiled into the main binary if dynamic loading is available.
|
||||
This can be overridden by creating the file mymods.conf in the compilation
|
||||
directory (Src, unless you have told configure to use another directory)
|
||||
with the list of modules which are to be compiled into the main binary, one
|
||||
module name per line with no punctuation and no suffix. See the zshmodules
|
||||
manual page for the list of available modules.
|
||||
|
||||
Note that mymods.conf replaces the standard list of linked-in modules from
|
||||
Src/xmods.conf. If you wish to add to the standard list, copy the lines
|
||||
that begin with "L " from xmods.conf into mymods.conf and remove the "L "
|
||||
from each such line in mymods.conf. Then add the names of other modules
|
||||
that you want to link. Module names typically must begin with "zsh/";
|
||||
see the ".mdd" file for the module for the actual name. The modules must
|
||||
be listed in dependency order, e.g., "zsh/zle" must precede "zsh/complete",
|
||||
"zsh/complete" must precede "zsh/compctl", and similarly for any other
|
||||
dependencies.
|
||||
|
||||
Note that the modules depending on zle or complete (e.g.: complist and
|
||||
deltochar) cannot be loaded dynamically on systems which do not allow symbols
|
||||
in one dynamically loaded library to be visible from another; this is true,
|
||||
for example, of version 4 of SunOS. The most convenient workaround is to
|
||||
compile zle and complete into the base executable by including them in
|
||||
mymods.conf as described above.
|
||||
compile zle and complete into the base executable by setting their `link'
|
||||
entries in config.modules to `static' as described above.
|
||||
|
||||
Compiler Options or Using a Different Compiler
|
||||
----------------------------------------------
|
||||
|
|
|
@ -5,9 +5,9 @@ DISTFILES_SRC='
|
|||
ansi2knr.c modentry.c
|
||||
builtin.c compat.c cond.c exec.c glob.c hashtable.c hashtable.h
|
||||
hist.c init.c input.c jobs.c lex.c linklist.c loop.c main.c makepro.awk
|
||||
math.c mem.c mkbltnmlst.sh mkmakemod.sh mkmodindex.sh
|
||||
math.c mem.c mkbltnmlst.sh mkmakemod.sh
|
||||
module.c options.c params.c parse.c pattern.c prompt.c prototypes.h
|
||||
signals.c signals.h string.c subst.c system.h text.c utils.c
|
||||
watch.c xmods.conf zsh.h zsh.mdd ztype.h
|
||||
watch.c zsh.h zsh.mdd ztype.h
|
||||
zsh.rc zsh.ico
|
||||
'
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
name=zsh/rlimits
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
autobins="limit ulimit unlimit"
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/sched
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
autobins="sched"
|
||||
|
||||
objects="sched.o"
|
||||
|
|
|
@ -109,17 +109,7 @@ rm-modobjs-tmp:
|
|||
|
||||
@CONFIG_MK@
|
||||
|
||||
Makemod modules.index prep: modules-bltin $(CONFIG_INCS)
|
||||
( cd $(sdir_top) && OMIT_MODULES="$(OMIT_MODULES)" \
|
||||
$(SHELL) $(subdir)/mkmodindex.sh $(subdir) ) \
|
||||
> modules.index.tmp
|
||||
@if cmp -s modules.index.tmp modules.index; then \
|
||||
rm -f modules.index.tmp; \
|
||||
echo "\`modules.index' is up to date."; \
|
||||
else \
|
||||
mv -f modules.index.tmp modules.index; \
|
||||
echo "Updated \`modules.index'."; \
|
||||
fi
|
||||
Makemod prep: $(CONFIG_INCS) $(dir_top)/config.modules
|
||||
@case $(sdir_top) in \
|
||||
/*) top_srcdir=$(sdir_top) ;; \
|
||||
*) top_srcdir=$(subdir)/$(sdir_top) ;; \
|
||||
|
@ -140,21 +130,6 @@ FORCE:
|
|||
mymods.conf:
|
||||
@echo Linking with the standard modules.
|
||||
|
||||
modules-bltin:: mymods.conf
|
||||
@if test -f mymods.conf; then \
|
||||
echo cat mymods.conf \> $@; \
|
||||
cat mymods.conf > $@; \
|
||||
fi
|
||||
|
||||
modules-bltin:: $(dir_top)/config.status $(sdir)/xmods.conf
|
||||
if test -f mymods.conf; then \
|
||||
cat mymods.conf > $@; \
|
||||
elif test @D@ = N; then \
|
||||
sed -n '/L.* /{s/^.* //;p;}' < $(sdir)/xmods.conf > $@; \
|
||||
else \
|
||||
echo > $@; \
|
||||
fi
|
||||
|
||||
modules: $(@E@NTRYOBJ)
|
||||
|
||||
$(ENTRYOBJ): FORCE
|
||||
|
@ -228,14 +203,13 @@ mostlyclean-here:
|
|||
.PHONY: mostlyclean-here
|
||||
|
||||
clean-here:
|
||||
rm -f modules.index.tmp modules.stamp zsh$(EXEEXT) ansi2knr.o ansi2knr
|
||||
rm -f modules.stamp zsh$(EXEEXT) ansi2knr.o ansi2knr
|
||||
rm -f libzsh-*.$(DL_EXT)
|
||||
.PHONY: clean-here
|
||||
|
||||
distclean-here:
|
||||
rm -f TAGS tags
|
||||
rm -f modules.index modules-bltin
|
||||
rm -f Makefile mymods.conf
|
||||
rm -f Makefile
|
||||
.PHONY: distclean-here
|
||||
|
||||
mostlyclean: mostlyclean-modules
|
||||
|
@ -245,7 +219,7 @@ realclean: realclean-modules
|
|||
.PHONY: mostlyclean clean distclean realclean
|
||||
|
||||
# Don't remake Makemod just to delete things, even if it doesn't exist.
|
||||
mostlyclean-modules clean-modules distclean-modules realclean-modules: modules.index
|
||||
mostlyclean-modules clean-modules distclean-modules realclean-modules:
|
||||
if test -f Makemod; then \
|
||||
$(MAKE) -f Makemod $(MAKEDEFS) `echo $@ | sed 's/-modules//'`; \
|
||||
fi; \
|
||||
|
|
|
@ -177,7 +177,8 @@ $(makefile): $(makefile).in $(dir_top)/config.status
|
|||
cd $(dir_top) && \
|
||||
$(SHELL) $$top_srcdir/Src/mkmakemod.sh -m $(subdir) $(makefile)
|
||||
|
||||
$(makefile).in: $(sdir_src)/mkmakemod.sh $(sdir_src)/Makemod.in.in $(MDDS) $(dir_src)/modules-bltin
|
||||
$(makefile).in: $(sdir_src)/mkmakemod.sh $(sdir_src)/Makemod.in.in $(MDDS) \
|
||||
$(dir_top)/config.modules
|
||||
@case $(sdir_top) in \
|
||||
/*) top_srcdir=$(sdir_top) ;; \
|
||||
*) top_srcdir=$(subdir)/$(sdir_top) ;; \
|
||||
|
@ -188,5 +189,3 @@ $(makefile).in: $(sdir_src)/mkmakemod.sh $(sdir_src)/Makemod.in.in $(MDDS) $(dir
|
|||
cd $(dir_top) && \
|
||||
$(SHELL) $$top_srcdir/Src/mkmakemod.sh -i $(subdir) $(makefile)
|
||||
|
||||
$(dir_src)/modules-bltin:
|
||||
@cd $(dir_src) && $(MAKE) $(MAKEDEFS) modules-bltin
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/cap
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="cap getcap setcap"
|
||||
|
||||
objects="cap.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/clone
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="clone"
|
||||
|
||||
objects="clone.o"
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
name=zsh/example
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="example"
|
||||
|
||||
autoinfixconds="ex"
|
||||
autoprefixconds="len"
|
||||
autoparams="exint exstr exarr"
|
||||
automathfuncs="sum length"
|
||||
|
||||
objects="example.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
autobins="ln mkdir mv rm rmdir sync"
|
||||
name=zsh/files
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="chgrp chown ln mkdir mv rm rmdir sync"
|
||||
|
||||
objects="files.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/mapfile
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autoparams="mapfile"
|
||||
|
||||
objects="mapfile.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/mathfunc
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="mathfunc"
|
||||
|
||||
objects="mathfunc.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
autoparams="parameters commands functions options"
|
||||
name=zsh/parameter
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
autoparams="parameters commands functions dis_functions funcstack builtins dis_builtins reswords dis_reswords options modules dirstack history historywords jobtexts jobdirs jobstates nameddirs userdirs aliases dis_aliases galiases dis_galiases"
|
||||
|
||||
objects="parameter.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/stat
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="stat"
|
||||
|
||||
objects="stat.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/zftp
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="zftp"
|
||||
|
||||
objects="zftp.o"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
name=zsh/zprof
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="zprof"
|
||||
|
||||
objects="zprof.o"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
name=zsh/zpty
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
autobins="zpty"
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
name=zsh/zutil
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
moddeps="zsh/complete"
|
||||
|
||||
objects="zutil.o"
|
||||
|
||||
autobins="zformat zstyle"
|
||||
autobins="zformat zstyle zregexparse zparseopts"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
name=zsh/compctl
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
moddeps="zsh/complete zsh/zle"
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
name=zsh/complete
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
moddeps="zsh/zle"
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
moddeps="comp1 zle"
|
||||
name=zsh/complist
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
moddeps="zsh/complete zsh/zle"
|
||||
|
||||
objects="complist.o"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
name=zsh/computil
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
moddeps="zsh/complete zsh/zle"
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
moddeps="zle"
|
||||
name=zsh/deltochar
|
||||
link=dynamic
|
||||
load=no
|
||||
|
||||
moddeps="zsh/zle"
|
||||
|
||||
objects="deltochar.o"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
moddeps="comp1"
|
||||
name=zsh/zle
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
autobins="bindkey vared zle"
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
moddeps="zle"
|
||||
name=zsh/zleparameter
|
||||
link=either
|
||||
load=yes
|
||||
|
||||
autoparams="zlewidgets zlekeymaps"
|
||||
moddeps="zsh/zle"
|
||||
|
||||
autoparams="widgets keymaps"
|
||||
|
||||
objects="zleparameter.o"
|
||||
|
|
|
@ -4,50 +4,77 @@
|
|||
#
|
||||
# Written by Andrew Main
|
||||
#
|
||||
|
||||
srcdir=${srcdir-`echo $0|sed 's%/[^/][^/]*$%%'`}
|
||||
test "x$srcdir" = "x$0" && srcdir=.
|
||||
test "x$srcdir" = "x" && srcdir=.
|
||||
MODBINS=${MODBINS-modules-bltin}
|
||||
XMODCF=${XMODCF-$srcdir/xmods.conf}
|
||||
CFMOD=${CFMOD-$srcdir/../config.modules}
|
||||
|
||||
bin_mods=" zsh "`sed 's/^/ /;s/$/ /' $MODBINS`
|
||||
x_mods=`cat $XMODCF`
|
||||
. ./modules.index
|
||||
bin_mods="`grep ' link=static' $CFMOD | sed -e '/^#/d' \
|
||||
-e 's/ .*/ /' -e 's/^name=/ /'`"
|
||||
|
||||
x_mods="`grep ' load=yes' $CFMOD | sed -e '/^#/d' -e '/ link=no/d' \
|
||||
-e 's/ .*/ /' -e 's/^name=/ /'`"
|
||||
|
||||
trap "rm -f $1; exit 1" 1 2 15
|
||||
|
||||
exec > $1
|
||||
|
||||
echo "#ifdef DYNAMIC"
|
||||
for x_mod in $x_mods; do
|
||||
case $bin_mods in
|
||||
*" $x_mod "*) ;;
|
||||
*) echo "/* non-linked-in known module \`$x_mod' */"
|
||||
eval "loc=\$loc_$x_mod"
|
||||
unset moddeps autobins
|
||||
. $srcdir/../$loc/${x_mod}.mdd
|
||||
for bin in $autobins; do
|
||||
echo " add_autobin(\"$bin\", \"$x_mod\");"
|
||||
done
|
||||
for dep in $moddeps; do
|
||||
case $bin_mods in
|
||||
*" $dep "*)
|
||||
echo " /* depends on \`$dep' */" ;;
|
||||
*) echo " add_dep(\"$x_mod\", \"$dep\");" ;;
|
||||
esac
|
||||
done ;;
|
||||
modfile="`grep '^name='$x_mod' ' $CFMOD | sed -e 's/^.* modfile=//' \
|
||||
-e 's/ .*//'`"
|
||||
if test "x$modfile" = x; then
|
||||
echo >&2 "WARNING: no name for \`$x_mod' in $CFMOD (ignored)"
|
||||
continue
|
||||
fi
|
||||
case "$bin_mods" in
|
||||
*" $x_mod "*)
|
||||
echo "/* linked-in known module \`$x_mod' */"
|
||||
linked=yes
|
||||
;;
|
||||
*)
|
||||
echo "#ifdef DYNAMIC"
|
||||
echo "/* non-linked-in known module \`$x_mod' */"
|
||||
linked=no
|
||||
esac
|
||||
unset moddeps autobins autoinfixconds autoprefixconds autoparams
|
||||
unset automathfuncs
|
||||
. $srcdir/../$modfile
|
||||
for bin in $autobins; do
|
||||
echo " add_autobin(\"$bin\", \"$x_mod\");"
|
||||
done
|
||||
for cond in $autoinfixconds; do
|
||||
echo " add_autocond(\"$cond\", 1, \"$x_mod\");"
|
||||
done
|
||||
for cond in $autoprefixconds; do
|
||||
echo " add_autocond(\"$cond\", 0, \"$x_mod\");"
|
||||
done
|
||||
for param in $autoparams; do
|
||||
echo " add_autoparam(\"$param\", \"$x_mod\");"
|
||||
done
|
||||
for mfunc in $automathfuncs; do
|
||||
echo " add_automath(\"$mfunc\", \"$x_mod\");"
|
||||
done
|
||||
for dep in $moddeps; do
|
||||
echo " add_dep(\"$x_mod\", \"$dep\");"
|
||||
done
|
||||
test "x$linked" = xno && echo "#endif"
|
||||
done
|
||||
echo "#endif /* DYNAMIC */"
|
||||
|
||||
echo
|
||||
done_mods=" "
|
||||
for bin_mod in $bin_mods; do
|
||||
q_bin_mod=`echo $bin_mod | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
|
||||
modfile="`grep '^name='$bin_mod' ' $CFMOD | sed -e 's/^.* modfile=//' \
|
||||
-e 's/ .*//'`"
|
||||
echo "/* linked-in module \`$bin_mod' */"
|
||||
eval "loc=\$loc_$bin_mod"
|
||||
unset moddeps
|
||||
. $srcdir/../$loc/${bin_mod}.mdd
|
||||
. $srcdir/../$modfile
|
||||
for dep in $moddeps; do
|
||||
case $done_mods in
|
||||
# This assumes there are no circular dependencies in the builtin
|
||||
# modules. Better ordering of config.modules would be necessary
|
||||
# to enforce stricter dependency checking.
|
||||
case $bin_mods in
|
||||
*" $dep "*)
|
||||
echo " /* depends on \`$dep' */" ;;
|
||||
*) echo >&2 "ERROR: linked-in module \`$bin_mod' depends on \`$dep'"
|
||||
|
@ -55,6 +82,15 @@ for bin_mod in $bin_mods; do
|
|||
exit 1 ;;
|
||||
esac
|
||||
done
|
||||
echo " mod.nam = \"$bin_mod\"; boot_$bin_mod(&mod);"
|
||||
echo " {"
|
||||
echo " extern int setup_${q_bin_mod} _((Module));"
|
||||
echo " extern int boot_${q_bin_mod} _((Module));"
|
||||
echo " extern int cleanup_${q_bin_mod} _((Module));"
|
||||
echo " extern int finish_${q_bin_mod} _((Module));"
|
||||
echo
|
||||
echo " register_module(\"$bin_mod\","
|
||||
echo " setup_${q_bin_mod}, boot_${q_bin_mod},"
|
||||
echo " cleanup_${q_bin_mod}, finish_${q_bin_mod});"
|
||||
echo " }"
|
||||
done_mods="$done_mods$bin_mod "
|
||||
done
|
||||
|
|
|
@ -90,6 +90,8 @@ the_makefile=$2
|
|||
|
||||
if $first_stage; then
|
||||
|
||||
dir_top=`echo $the_subdir | sed 's,[^/][^/]*,..,g'`
|
||||
|
||||
trap "rm -f $the_subdir/${the_makefile}.in" 1 2 15
|
||||
echo "creating $the_subdir/${the_makefile}.in"
|
||||
exec 3>&1 >$the_subdir/${the_makefile}.in
|
||||
|
@ -99,12 +101,16 @@ if $first_stage; then
|
|||
echo "##### ===== DEFINITIONS ===== #####"
|
||||
echo
|
||||
echo "makefile = ${the_makefile}"
|
||||
echo "dir_top = "`echo $the_subdir | sed 's,[^/][^/]*,..,g'`
|
||||
echo "subdir = $the_subdir"
|
||||
echo "dir_top = ${dir_top}"
|
||||
echo "subdir = ${the_subdir}"
|
||||
echo
|
||||
|
||||
. Src/modules.index
|
||||
bin_mods=" zsh/main "`sed 's/^/ /;s/$/ /' Src/modules-bltin`
|
||||
bin_mods=`grep link=static ./config.modules | \
|
||||
sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`
|
||||
dyn_mods="`grep link=dynamic ./config.modules | \
|
||||
sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
|
||||
module_list="${bin_mods}${dyn_mods}"
|
||||
|
||||
if grep '%@D@%D%' config.status >/dev/null; then
|
||||
is_dynamic=true
|
||||
else
|
||||
|
@ -120,8 +126,8 @@ if $first_stage; then
|
|||
all_proto=
|
||||
lastsub=//
|
||||
for module in $module_list; do
|
||||
q_module=`echo $module | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
|
||||
eval "modfile=\$modfile_$q_module"
|
||||
modfile="`grep '^name='$module' ' ./config.modules | \
|
||||
sed -e 's/^.* modfile=//' -e 's/ .*//'`"
|
||||
case $modfile in
|
||||
$the_subdir/$lastsub/*) ;;
|
||||
$the_subdir/*/*)
|
||||
|
@ -194,9 +200,10 @@ if $first_stage; then
|
|||
imports=
|
||||
q_moddeps=
|
||||
for dep in $moddeps; do
|
||||
depfile="`grep '^name='$dep' ' ./config.modules | \
|
||||
sed -e 's/^.* modfile=//' -e 's/ .*//'`"
|
||||
q_dep=`echo $dep | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
|
||||
q_moddeps="$q_moddeps $q_dep"
|
||||
eval "depfile=\$modfile_$q_dep"
|
||||
eval `echo $depfile | sed 's,/\([^/]*\)\.mdd$,;depbase=\1,;s,^,loc=,'`
|
||||
case "$binmod" in
|
||||
*" $dep "* )
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# mkmodindex.sh: search for *.mdd files, and index the modules
|
||||
#
|
||||
# $@ = directories to search from
|
||||
#
|
||||
|
||||
echo "# module index generated by mkmodindex.sh"
|
||||
echo
|
||||
|
||||
module_list=' '
|
||||
while test $# -ne 0; do
|
||||
dir=$1
|
||||
shift
|
||||
( set $dir/*.mdd; test -f $1 ) || continue
|
||||
dosubs=false
|
||||
for mod in `echo '' $dir/*.mdd '' | sed 's, [^ ]*/, ,g;s,\.mdd , ,g'`; do
|
||||
case `echo "$mod@ $module_list " | sed 's,^.*[^_0-9A-Za-z].*@,@@,'` in
|
||||
@@*)
|
||||
echo >&2 "WARNING: illegally named module \`$mod' in $dir"
|
||||
echo >&2 " (ignoring it)"
|
||||
;;
|
||||
*@*" $mod "*)
|
||||
eval "loc=\$loc_$mod"
|
||||
echo >&2 "WARNING: module \`$mod' (in $loc) duplicated in $dir"
|
||||
echo >&2 " (ignoring duplicate)"
|
||||
dosubs=true
|
||||
;;
|
||||
*)
|
||||
module_list="$module_list$mod "
|
||||
echo "loc_$mod=$dir"
|
||||
eval "loc_$mod=\$dir"
|
||||
dosubs=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
$dosubs && set `echo $dir/*/. '' | sed 's,/\. , ,g'` "$@"
|
||||
done
|
||||
|
||||
echo
|
||||
echo $module_list | sed 's/^/module_list="/;s/$/"/'
|
||||
|
||||
exit 0
|
|
@ -1,10 +0,0 @@
|
|||
L zsh/rlimits
|
||||
L zsh/zle
|
||||
L zsh/complete
|
||||
L zsh/compctl
|
||||
L zsh/sched
|
||||
L zsh/complist
|
||||
L zsh/zutil
|
||||
L zsh/computil
|
||||
L zsh/parameter
|
||||
L zsh/zleparameter
|
36
Src/zsh.mdd
36
Src/zsh.mdd
|
@ -1,4 +1,7 @@
|
|||
name=zsh/main
|
||||
link=static
|
||||
load=yes
|
||||
# load=static should replace use of alwayslink
|
||||
|
||||
nozshdep=1
|
||||
alwayslink=1
|
||||
|
@ -57,24 +60,27 @@ zshpaths.h: Makemod $(CONFIG_INCS)
|
|||
echo "Updated \`zshpaths.h'." ; \
|
||||
fi
|
||||
|
||||
bltinmods.list: modules.stamp modules-bltin xmods.conf mkbltnmlst.sh
|
||||
srcdir='$(sdir)' MODBINS='modules-bltin' \
|
||||
XMODCF='$(sdir)/xmods.conf' $(SHELL) $(sdir)/mkbltnmlst.sh $@
|
||||
bltinmods.list: modules.stamp mkbltnmlst.sh $(dir_top)/config.modules
|
||||
srcdir='$(sdir)' CFMOD='$(dir_top)/config.modules' \
|
||||
$(SHELL) $(sdir)/mkbltnmlst.sh $@
|
||||
|
||||
zshxmods.h: modules-bltin xmods.conf
|
||||
zshxmods.h: $(dir_top)/config.modules
|
||||
@echo "Creating \`$@'."
|
||||
@( \
|
||||
binmods=`sed 's/^/ /;s/$$/ /' modules-bltin`; \
|
||||
for mod in `sed 's/^.* //' $(sdir_src)/xmods.conf`; do \
|
||||
q_mod=`echo $$mod | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`; \
|
||||
case $$binmods in \
|
||||
*" $$mod "*) \
|
||||
echo "#define LINKED_XMOD_$$q_mod 1" ;; \
|
||||
*) echo "#ifdef DYNAMIC"; \
|
||||
echo "# define UNLINKED_XMOD_$$q_mod 1"; \
|
||||
echo "#endif" ;; \
|
||||
esac; \
|
||||
done \
|
||||
for q_mod in `grep ' load=yes' $(dir_top)/config.modules | \
|
||||
grep ' link=static' | sed -e '/^#/d' -e 's/ .*//' \
|
||||
-e 's/^name=//' -e 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`; do \
|
||||
test x$q_mod = xzshQsmain && continue; \
|
||||
echo "#define LINKED_XMOD_$$q_mod 1"; \
|
||||
done; \
|
||||
for q_mod in `grep ' load=yes' $(dir_top)/config.modules | \
|
||||
grep ' link=dynamic' | sed -e '/^#/d' -e 's/ .*//' \
|
||||
-e 's/^name=//' -e 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`; do \
|
||||
test x$q_mod = x && continue; \
|
||||
echo "#ifdef DYNAMIC"; \
|
||||
echo "# define UNLINKED_XMOD_$$q_mod 1"; \
|
||||
echo "#endif"; \
|
||||
done; \
|
||||
) > $@
|
||||
|
||||
clean-here: clean.zsh
|
||||
|
|
91
configure.in
91
configure.in
|
@ -189,16 +189,6 @@ AC_ARG_ENABLE(dynamic,
|
|||
[ --disable-dynamic turn off dynamically loaded binary modules],
|
||||
[dynamic="$enableval"], [dynamic=yes])
|
||||
|
||||
dnl Do you want to disable a list of modules?
|
||||
dnl Unfortunately we can't give --disable-* a value, so we'll have
|
||||
dnl to do it as an `--enable-*', rather unnaturally.
|
||||
undefine([OMIT_MODULES])dnl
|
||||
AC_ARG_ENABLE(omit-modules,
|
||||
[ --enable-omit-modules give comma-separated list of modules to ignore],
|
||||
[OMIT_MODULES="$enableval"], [OMIT_MODULES=])
|
||||
|
||||
AC_SUBST(OMIT_MODULES)dnl
|
||||
|
||||
dnl Do you want to compile as K&R C.
|
||||
AC_ARG_ENABLE(ansi2knr,
|
||||
[ --enable-ansi2knr translate source to K&R C before compiling],
|
||||
|
@ -1713,6 +1703,87 @@ AC_SUBST(MOD_IMPORT_VARIABLE)dnl
|
|||
AC_SUBST(MOD_IMPORT_FUNCTION)dnl
|
||||
AC_SUBST(EXTRAZSHOBJS)dnl
|
||||
|
||||
# Generate config.modules. We look for *.mdd files in first and second
|
||||
# level subdirectories. Any existing line not containing 'auto=y' will be
|
||||
# retained, provided the .mdd file itself was found.
|
||||
CONFIG_MODULES=./config.modules
|
||||
echo "creating ${CONFIG_MODULES}"
|
||||
userlist=" "
|
||||
if test -f config.modules; then
|
||||
userlist=`sed -e '/^#/d' -e '/auto=y/d' -e 's/ .*/ /' -e 's/^name=/ /' \
|
||||
${CONFIG_MODULES}`
|
||||
mv ${CONFIG_MODULES} ${CONFIG_MODULES}.old
|
||||
fi
|
||||
(cd ${srcdir}
|
||||
echo "# Edit this file to change the way modules are loaded."
|
||||
echo "# The format is strict; do not break lines or add extra spaces."
|
||||
echo "#"
|
||||
echo "# Values of \`link' are \`static', \`dynamic' or \`no' to compile the"
|
||||
echo "# module into the shell, link it in at run time, or not use it at all."
|
||||
echo "# In the final case, no attempt will be made to compile it."
|
||||
echo "# Use \`static' or \`no' if you do not have dynamic loading."
|
||||
echo "#"
|
||||
echo "# Values of \`load' are \`yes' or \`no'; if yes, any builtins etc."
|
||||
echo "# provided by the module will be autoloaded by the main shell"
|
||||
echo "# (so long as \`link' is not set to \`no')."
|
||||
echo "#"
|
||||
echo "# Values of \`auto' are \`yes' or \`no'. configure sets the value to"
|
||||
echo "# \`yes'. If you set it by hand to \`no', the line will be retained"
|
||||
echo "# when the file is regenerated in future."
|
||||
echo "#"
|
||||
echo "# You will need to run \`config.status --recheck' if you add a new"
|
||||
echo "# module."
|
||||
echo "#"
|
||||
echo "# You should not change the values for the pseudo-module zsh/main,"
|
||||
echo "# which is the main shell."
|
||||
for modfile in */*.mdd */*/*.mdd; do
|
||||
name=
|
||||
link=
|
||||
load=
|
||||
. $modfile
|
||||
if test x$name != x -a x$link != x; then
|
||||
case $userlist in
|
||||
*" $name "*) # not autogenerated, keep original
|
||||
grep "^name=$name " ${CONFIG_MODULES}.old
|
||||
;;
|
||||
*) case $link in
|
||||
*\ *) eval 'link=`'$link'`'
|
||||
;;
|
||||
esac
|
||||
case "${load}" in
|
||||
y*) load=" load=yes"
|
||||
;;
|
||||
*) load=" load=no"
|
||||
;;
|
||||
esac
|
||||
case $link in
|
||||
static) echo "name=$name modfile=$modfile link=static auto=yes${load}"
|
||||
;;
|
||||
dynamic) if test $dynamic != no; then
|
||||
echo "name=$name modfile=$modfile link=dynamic\
|
||||
auto=yes${load}"
|
||||
else
|
||||
echo "name=$name modfile=$modfile link=no\
|
||||
auto=no load=no"
|
||||
fi
|
||||
;;
|
||||
either) if test $dynamic != no; then
|
||||
echo "name=$name modfile=$modfile link=dynamic\
|
||||
auto=yes${load}"
|
||||
else
|
||||
echo "name=$name modfile=$modfile link=static\
|
||||
auto=yes${load}"
|
||||
fi
|
||||
;;
|
||||
*) echo "name=$name modfile=$modfile link=no auto=yes load=no"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done) >${CONFIG_MODULES}
|
||||
rm -f ${CONFIG_MODULES}.old
|
||||
|
||||
CLEAN_MK="${srcdir}/Config/clean.mk"
|
||||
CONFIG_MK="${srcdir}/Config/config.mk"
|
||||
dnl defs.mk is in the build tree, not the source tree
|
||||
|
|
Loading…
Reference in a new issue