Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: static linking of modules



Zefram wrote:
> to allow multiple modules to be compiled in simultaneously.  There is a
> complication with this: the easiest way to do it was a messy backquoted
> sed in the standard compilation rules.  It would be nice to avoid this
> overhead for the majority of objects that have nothing to do with modules.

The patch below removes this overhead for normal files.  It also rewites
the bltinmods.list generation rule to use sed.  It adds a $(MODBINS)
(i.e. modules-bltin) target so that the pre-existence of this is not
necessary for compilation.

I wander how portable this .force suffix rule.  Agre you sure that it will
not cause problems?

One other not zsh related problem.  pgp-2.6.3i strips trailing spaces from
clearsig messages.  I know that the pgp checksum is made using the stripped
version but the output should contain these stripped spaces.  I'm just
telling you this since it may cause problems for others as well.  This
problem bit me a few times before and I realized just now what happened.
It also seems to me that some earlier pgp version did not have this problem
since I first noticed this problem quite recently.  The simpthom is that
the patch succeeds but blank lines added by the patch are missing.  There
is a slight possibility that some earlier patches from Zefram got into zsh
without such blank lines :-(.

Zoltan


*** Src/Makefile.in	1996/11/25 00:50:04	3.1.0.8
--- Src/Makefile.in	1996/11/25 00:53:16
***************
*** 90,97 ****
  ANSIDOBJ=$(@D@LEXT)
  ANSI_DOBJ=._bar_
  
- MODNAMEDEFS = `echo $@ | $(SED) 's,.*/,,;s,\([^.]*\)\..*,-Dmod_boot=mod_boot_\1 -Dmod_cleanup=mod_cleanup_\1,'`
- 
  .SUFFIXES:
  .SUFFIXES: .force
  .SUFFIXES: .c $(ANSI@U@DOBJ) $(KNR@U@DOBJ) $(ANSI@U@OBJ) $(KNR@U@OBJ) .pro
--- 90,95 ----
***************
*** 111,121 ****
  	rm -f $@.[oc]
  
  .c$(ANSI@U@OBJ):
! 	$(COMPILE) $(MODNAMEDEFS) -o $@ $<
  
  .c$(KNR@U@OBJ): ansi2knr
  	./ansi2knr $< > $@.c
! 	$(COMPILE) $(MODNAMEDEFS) -o $@ $@.c
  	rm -f $@.c
  
  .c.pro:
--- 109,119 ----
  	rm -f $@.[oc]
  
  .c$(ANSI@U@OBJ):
! 	$(COMPILE) -o $@ $<
  
  .c$(KNR@U@OBJ): ansi2knr
  	./ansi2knr $< > $@.c
! 	$(COMPILE) -o $@ $@.c
  	rm -f $@.c
  
  .c.pro:
***************
*** 214,233 ****
  init.o: bltinmods.list
  
  bltinmods.list: $(MODBINS)
! 	( for mod in `cat $(MODBINS)`; do \
! 	    echo "DOMOD(mod_boot_$$mod, mod_cleanup_$$mod)"; \
! 	done ) > $@
  
  $(PROTO): makepro.sed
  
! $(NSTMP).force:
  	dn=true; \
  	test -f $(NSTMP) || dn=false; \
  	echo > $(NSTMP).tmp; \
  	for mod in `cat $(MODBINS)`; do \
  	    obj=$(MODULE_DIR)/$$mod.o; \
  	    echo $${obj}:; \
! 	    $(MAKE) $(MAKEDEFS) $$obj; \
  	    echo $$obj >> $(NSTMP).tmp; \
  	    test $$obj -nt $(NSTMP) && dn=false; \
  	done; \
--- 212,232 ----
  init.o: bltinmods.list
  
  bltinmods.list: $(MODBINS)
! 	$(SED) -n 's/^\(.*\)$$/DOMOD(mod_boot_\1, mod_cleanup_\1)/p' $(MODBINS) > bltinmods.list
! 
! $(MODBINS):
! 	test -f $(MODBINS) || touch $(MODBINS)
  
  $(PROTO): makepro.sed
  
! $(NSTMP).force: $(MODBINS)
  	dn=true; \
  	test -f $(NSTMP) || dn=false; \
  	echo > $(NSTMP).tmp; \
  	for mod in `cat $(MODBINS)`; do \
  	    obj=$(MODULE_DIR)/$$mod.o; \
  	    echo $${obj}:; \
! 	    $(MAKE) $(MAKEDEFS) DEFS="$(DEFS) -Dmod_boot=mod_boot_$$mod -Dmod_cleanup=mod_cleanup_$$mod" $$obj; \
  	    echo $$obj >> $(NSTMP).tmp; \
  	    test $$obj -nt $(NSTMP) && dn=false; \
  	done; \



Messages sorted by: Reverse Date, Date, Thread, Author