From 33457202ce09232486a4456bc90a07d19ed5537a Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Mon, 14 Feb 2000 00:19:18 +0000 Subject: zsh-workers/9701 --- Config/defs.mk.in | 3 +++ INSTALL | 17 +++++++++++++++-- Src/Makefile.in | 3 ++- Src/mkmodindex.sh | 7 +++++++ configure.in | 10 ++++++++++ 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/Config/defs.mk.in b/Config/defs.mk.in index f19a40b21..ea2115484 100644 --- a/Config/defs.mk.in +++ b/Config/defs.mk.in @@ -62,6 +62,9 @@ DLLD = @DLLD@ EXPOPT = @EXPOPT@ IMPOPT = @IMPOPT@ +# choose modules not to compile and install +OMIT_MODULES = @OMIT_MODULES@ + # utilities AWK = @AWK@ YODL = @YODL@ diff --git a/INSTALL b/INSTALL index b807c4abb..ef24ad690 100644 --- a/INSTALL +++ b/INSTALL @@ -59,8 +59,8 @@ is EPREFIX/lib/zsh/, where EPREFIX defaults to PREFIX unless given explicitly, and PREFIX defaults to /usr/local. See the end of this file for options to configure to change these. -Adding more modules -------------------- +Adding and removing modules +--------------------------- The zsh distribution contains several modules, in the Src/Builtins, Src/Modules and Src/Zle directories. If you have any additional zsh @@ -73,6 +73,18 @@ 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 ----------------------------------------------------- @@ -365,6 +377,7 @@ Features: fndir=directory # the directory where shell functions will go site-fndir=directory# the directory where site-specific functions can go function-subdirs # if functions will be installed into subdirectories + omit-modules=mod1,..# don't compile nor install the modules named mod1,... dynamic # allow dynamically loaded binary modules lfs # allow configure check for large files locale # allow use of locale library diff --git a/Src/Makefile.in b/Src/Makefile.in index b79299413..ebe708626 100644 --- a/Src/Makefile.in +++ b/Src/Makefile.in @@ -101,7 +101,8 @@ rm-modobjs-tmp: @CONFIG_MK@ Makemod modules.index prep: modules-bltin $(CONFIG_INCS) - ( cd $(sdir_top) && $(SHELL) $(subdir)/mkmodindex.sh $(subdir) ) \ + ( 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; \ diff --git a/Src/mkmodindex.sh b/Src/mkmodindex.sh index 75a7e43bc..1f0b8e3bd 100644 --- a/Src/mkmodindex.sh +++ b/Src/mkmodindex.sh @@ -8,6 +8,8 @@ echo "# module index generated by mkmodindex.sh" echo +omit_modules="`echo $OMIT_MODULES | sed 's/,/ /'`" + module_list=' ' while test $# -ne 0; do dir=$1 @@ -27,6 +29,11 @@ while test $# -ne 0; do echo >&2 " (ignoring duplicate)" continue ;; esac + case " $omit_modules " in *" $name "*) + echo >&2 "Module \`$name' found in \$OMIT_MODULES" + echo >&2 " (omitting it)" + continue + ;; esac module_list="$module_list$name " echo "modfile_$q_name=$modfile" eval "modfile_$q_name=\$modfile" diff --git a/configure.in b/configure.in index bc53d99bb..64e74b575 100644 --- a/configure.in +++ b/configure.in @@ -186,6 +186,16 @@ 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], -- cgit 1.4.1