zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: omit modules from compilation and installation process
@ 2000-02-13 18:44 Peter Stephenson
  2000-02-14  1:16 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-02-13 18:44 UTC (permalink / raw)
  To: Zsh hackers list

This was easier than I'd expected.  Zefram, does this look right to you?
It seems to fit in quite naturally with the form of mkmodindex.sh.

Now you can give configure a comma-separated list of modules not to compile
nor install as --enable-omit-modules=zsh/example,zsh/zpty.  Having to use
the `enable' in front is a bit tacky, but as far as I can see there's no
way round it.  There's no restriction on what you can omit, so it requires
a bit of discretion on the part of the compiler.  I can foresee one of its
major uses will be to put instructions into Etc/MACHINES on the lines of
`the zsh/zpty module doesn't work on the Kray TWINNE, give configure the
argument --enable-omit-modules=zsh/zpty'.

I haven't allowed it to use patterns, which seems a bit dangerous, though
potentially if there are add-on modules from different `vendors' you might
want to do --enable-omit-modules="foo/*".

Index: INSTALL
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/INSTALL,v
retrieving revision 1.5
diff -u -r1.5 INSTALL
--- INSTALL	2000/01/20 19:47:34	1.5
+++ INSTALL	2000/02/13 18:30:55
@@ -59,8 +59,8 @@
 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 @@
 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 @@
      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
Index: configure.in
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/configure.in,v
retrieving revision 1.15
diff -u -r1.15 configure.in
--- configure.in	2000/01/20 19:47:34	1.15
+++ configure.in	2000/02/13 18:12:36
@@ -186,6 +186,16 @@
 [  --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],
Index: Config/defs.mk.in
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/Config/defs.mk.in,v
retrieving revision 1.5
diff -u -r1.5 defs.mk.in
--- Config/defs.mk.in	2000/01/20 19:47:34	1.5
+++ Config/defs.mk.in	2000/02/13 18:10:41
@@ -62,6 +62,9 @@
 EXPOPT          = @EXPOPT@
 IMPOPT          = @IMPOPT@
 
+# choose modules not to compile and install
+OMIT_MODULES    = @OMIT_MODULES@
+
 # utilities
 AWK             = @AWK@
 YODL            = @YODL@
Index: Src/Makefile.in
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/Src/Makefile.in,v
retrieving revision 1.11
diff -u -r1.11 Makefile.in
--- Src/Makefile.in	2000/01/04 22:04:35	1.11
+++ Src/Makefile.in	2000/02/13 18:16:11
@@ -101,7 +101,8 @@
 @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; \
Index: Src/mkmodindex.sh
===================================================================
RCS file: /home/pws/CVSROOT/projects/zsh/Src/mkmodindex.sh,v
retrieving revision 1.2
diff -u -r1.2 mkmodindex.sh
--- Src/mkmodindex.sh	1999/12/21 15:18:28	1.2
+++ Src/mkmodindex.sh	2000/02/13 18:22:47
@@ -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
@@ -25,6 +27,11 @@
 	    eval "omodfile=\$modfile_$q_name"
 	    echo >&2 "WARNING: module \`$name' (in $omodfile) duplicated in $modfile"
 	    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 "

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit modules from compilation and installation process
  2000-02-13 18:44 PATCH: omit modules from compilation and installation process Peter Stephenson
@ 2000-02-14  1:16 ` Bart Schaefer
  2000-02-14  7:14 ` Andrej Borsenkow
  2000-02-14 10:11 ` Zefram
  2 siblings, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2000-02-14  1:16 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list

On Feb 13,  6:44pm, Peter Stephenson wrote:
} Subject: PATCH: omit modules from compilation and installation process
}
} Now you can give configure a comma-separated list of modules not to compile
} nor install as --enable-omit-modules=zsh/example,zsh/zpty.

It'd be nice to have a configure switch to replace the mymods.conf file.

} Having to use the `enable' in front is a bit tacky, but as far as I
} can see there's no way round it.

Perhaps this could be combined with the mymods.conf remark above by having
a negation syntax:

	--enable-modules=zsh/stat,\!zsh/example,\!zsh/zpty

This would be merged with the mymods.conf file, which could also have the
`!' syntax added; of course the configure command line should win if both
are present.

} There's no restriction on what you can omit, so it requires a bit of
} discretion on the part of the compiler.

I'll say.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: PATCH: omit modules from compilation and installation process
  2000-02-13 18:44 PATCH: omit modules from compilation and installation process Peter Stephenson
  2000-02-14  1:16 ` Bart Schaefer
@ 2000-02-14  7:14 ` Andrej Borsenkow
  2000-02-14 19:10   ` Peter Stephenson
  2000-02-14 10:11 ` Zefram
  2 siblings, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2000-02-14  7:14 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list

> Now you can give configure a comma-separated list of modules not
> to compile
> nor install as --enable-omit-modules=zsh/example,zsh/zpty.  Having to use
> the `enable' in front is a bit tacky, but as far as I can see there's no
> way round it.

Ahem ... what's wrong with --(disable|enable)-modules=... ?

Is it usable for static compilation as well?  Will it completely replace
defaults? Probably, meta keywords like

--enable-modules=all
--enable-modules=default,zsh/zpty

would be useful (but, may be, for static case only).

/andrej


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit modules from compilation and installation process
  2000-02-13 18:44 PATCH: omit modules from compilation and installation process Peter Stephenson
  2000-02-14  1:16 ` Bart Schaefer
  2000-02-14  7:14 ` Andrej Borsenkow
@ 2000-02-14 10:11 ` Zefram
  2 siblings, 0 replies; 5+ messages in thread
From: Zefram @ 2000-02-14 10:11 UTC (permalink / raw)
  To: Peter Stephenson; +Cc: Zsh hackers list

Looks good as far as it goes.  Except:

>+omit_modules="`echo $OMIT_MODULES | sed 's/,/ /'`"

should be:

  omit_modules="`echo $OMIT_MODULES | sed 's/,/ /g'`"

-zefram

--- Src/mkmodindex.sh	1999/12/21 15:18:28	1.2
+++ Src/mkmodindex.sh	2000/02/13 18:22:47
@@ -11,1 +11,1 @@
-omit_modules="`echo $OMIT_MODULES | sed 's/,/ /'`"
+omit_modules="`echo $OMIT_MODULES | sed 's/,/ /g'`"


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PATCH: omit modules from compilation and installation process
  2000-02-14  7:14 ` Andrej Borsenkow
@ 2000-02-14 19:10   ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-02-14 19:10 UTC (permalink / raw)
  To: Zsh hackers list

"Andrej Borsenkow" wrote:
> > Now you can give configure a comma-separated list of modules not
> > to compile
> > nor install as --enable-omit-modules=zsh/example,zsh/zpty.  Having to use
> > the `enable' in front is a bit tacky, but as far as I can see there's no
> > way round it.
> 
> Ahem ... what's wrong with --(disable|enable)-modules=... ?

--disable-modules is a synonym for --enable-modules=no, it doesn't take
arguments.  The nearest possibility is Bart's suggestion for using some
kind of negation symbol.

> Is it usable for static compilation as well?  Will it completely replace
> defaults? Probably, meta keywords like
> 
> --enable-modules=all
> --enable-modules=default,zsh/zpty
> 
> would be useful (but, may be, for static case only).

The first question is what Bart was addressing.  Something along those
lines should presumably be possible, but I think it might be a bit
confusing to overload just the one switch.  I might suggest keeping
--enable-omit-modules as it is and having --enable-builtin-modules=... to do
what you (and Bart) are suggesting.  Then it ought to be possible to have
"all" (build in all the modules there are, phew), and possible "default"
in the manner you suggest.  This is a little harder than
--enable-omit-modules, but probably not too bad.

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2000-02-14 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-13 18:44 PATCH: omit modules from compilation and installation process Peter Stephenson
2000-02-14  1:16 ` Bart Schaefer
2000-02-14  7:14 ` Andrej Borsenkow
2000-02-14 19:10   ` Peter Stephenson
2000-02-14 10:11 ` Zefram

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).