[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Recompiling elisp files (Re: Taking over production of emacs20 package.)

>>"Christian" == Christian Lynbech <lynbech@daimi.aau.dk> writes:

Christian> I am not quite so pessimistic about the possibilities of
Christian> recompiling installed elisp files.

	Please, people, do download the sources for tm and compile a
 local copy before you display such unwarranted optimism ;-). Also, a
 look at hyperbole may be instructive. The top level directory for tm
 looks like this (ignore the CVS dir)
__> l /usr/local/src/Work/tm/
total 22
   1 ./               1 debian/          1 sinfo/           1 tm-mh-e/
   1 ../              1 emu/             1 tl/              1 tm-vm/
   1 CVS/             1 gnus-mime/       1 tm/
   6 README.en        1 mel/             1 tm-gnus/
   1 bitmap-mule/     1 mu/              1 tm-mail/

	I am including the Makefile in the tm/ subdirectory
 below. Running make in that directory triggers recusive makes in all
 sibling directories, and the make run is modified by elisp in several
 *-CONFIG files. 

Christian> I see three situations where makefile do special things in
Christian> order to compile elisp files:

Christian> 1) generating/editing .el files (gnats and tm are examples
Christian> of this) at build-time. This is not a problem since the
Christian> generated .el file is installed as part of the .deb file.

	Umm, hyperbole and tm both have multidirectory complex make
 relationships; and unless we ship the make files in the distribution
 (/usr/lib/emacs/site-lisp/tm/Makefile?), it is difficult indeed to
 compile them in a postinst hook (it can be done, at the expense of
 potentially having to re-craft the compiler on upstream upgrades). 

Christian> 2) .elc file is generated through other means than simple
Christian> compilation. VM (at least at some point) had the option to
Christian> concatenate all the little .elc files into one big .elc
Christian> file. But I am pretty sure that (unless something really
Christian> sick is going on in the .elc file generation) one would
Christian> always be able to use the little files instead, perhaps
Christian> with the appropriate amount of additional autoloads in the
Christian> site-start.d file.

	Debian does not use the concatenated elc files option; we do
 use the little files. But the little files are not generated in
 random order; 
BYTEOPTS = ./vm-byteopts.el
PRELOADS = -l $(BYTEOPTS) -l ./vm-message.el -l ./vm-misc.el -l ./vm-vars.el -l 
BATCHFLAGS = -batch -q -no-site-file
CORE = vm-message.el vm-misc.el vm-byteopts.el
    vm-delete.elc vm-digest.elc vm-easymenu.elc vm-edit.elc vm-folder.elc \
    vm-license.elc vm-mark.elc vm-menu.elc vm-message.elc \
    vm-delete.el vm-digest.el vm-easymenu.el vm-edit.el vm-folder.el \
    vm-license.el vm-mark.el vm-menu.el vm-message.el \
vm:     vm.elc

vm.elc: autoload

noautoload:     $(OBJECTS) tapestry.elc
        @echo "building vm.elc (with all modules included)..."
        @cat $(OBJECTS) tapestry.elc > vm.elc

autoload:       vm-autoload.elc $(OBJECTS) tapestry.elc
        @echo "building vm.elc (with all modules set to autoload)..."
        @echo "(require 'vm-startup)" > vm.elc
        @echo "(require 'vm-vars)" >> vm.elc
        @echo "(require 'vm-version)" >> vm.elc
        @echo "(require 'vm-autoload)" >> vm.elc

all:    vm.info vm

vm.info:        vm.texinfo
        @echo "making vm.info..."
        @$(EMACS) $(BATCHFLAGS) -insert vm.texinfo -l texinfmt -f texinfo-format
-buffer -f save-buffer

vm-autoload.elc:        $(SOURCES)
        @echo scanning sources to build autoload definitions...
        @echo "(provide 'vm-autoload)" > vm-autoload.el
        @$(EMACS) $(BATCHFLAGS) -l ./make-autoloads -f print-autoloads $(SOURCES
) >> vm-autoload.el
        @echo compiling vm-autoload.el...
        @$(EMACS) $(BATCHFLAGS) -l $(BYTEOPTS) -f batch-byte-compile vm-autoload

vm-delete.elc:  vm-delete.el $(CORE)
        @echo compiling vm-delete.el...
        @$(EMACS) $(BATCHFLAGS) $(PRELOADS) -f batch-byte-compile vm-delete.el

vm-digest.elc:  vm-digest.el $(CORE)
        @echo compiling vm-digest.el...
        @$(EMACS) $(BATCHFLAGS) $(PRELOADS) -f batch-byte-compile vm-digest.el

	the SOurces change from time to time.

Christian> 3) specific order of compilation is required. The problem
Christian> here is (as I remember) mainly with macro
Christian> expansion. Different solutions exists. Requiring the
Christian> maintainer to extract a canonical compilation order from
Christian> the build process is one (should then be handed to the
Christian> elisp service handler). Fixing the source is another (if
Christian> all files has the correct set of `requires', the
Christian> bytecompiler should be able to figure out the rest on it
Christian> self). A simple hack that probably would work quite a long
Christian> bit of the way would be to sort the set of .el files
Christian> according to the timestamps of the existing .elc and the
Christian> compile in that order, though this certainly is less than
Christian> robust.

	I do not wish to rewrite/fix all these packages; I'd be happy
 to pass along any patches to upstream authors.

Christian> Does anybody know of a concrete example where recompiling a
Christian> set of installed .el files in some specific (say
Christian> alphabetic) order will fail? Gnus in the emacs distribution
Christian> used to have this problem, I seem to remember, but it does
Christian> not seem to be a problem in 19.34 (I maintain emacs under
Christian> CVS which by default ignores .elc files and thus want to
Christian> recompile lisp/).

	Quassia Gnus, vm, tm, bbdb, w3, hyperbole, .... (need I go
 further?). The problem maybe masked for red gnus if an older version
 of the el/elc files is installed in the standard path; I do not think
 that bbdb and hyperbole compile with older versions.

 "@a{1..4}"; Randal Schwartz <merlyn@iwarp.intel.com> 1 Feb 90
 22:28:58 GMT
Manoj Srivastava  <srivasta@acm.org> <http://www.datasync.com/%7Esrivasta/>
Key C7261095 fingerprint = CB D9 F4 12 68 07 E4 05  CC 2D 27 12 1D F5 E8 6E

# $Id: Makefile,v 7.45 1997/01/10 15:42:29 morioka Exp morioka $

VERSION = 7.106

SHELL	= /bin/sh
MAKE	= make
CC	= gcc
RM	= /bin/rm -f
CP	= /bin/cp -p
EMACS	= emacs

BINS	= src/ol2 src/decode-b
GOMI	= $(BINS) mime-setup.el mime-setup.el~ \#mime-setup.el\# *.elc \
		.gnus-compile* *~
FLAGS   = -batch -q -no-site-file

PREFIX	= ../debian/tmp/usr
EXEC_PREFIX = ../debian/tmp/usr

TM_FILES = tm/README.en tm/ChangeLog \
		tm/Makefile tm/TM-MK tm/TM-ELS tm/TM-CFG \
		tm/tm-def.el \
		tm/tm-eword.el tm/tm-ew-d.el tm/tm-ew-e.el \
		tm/tm-view.el tm/tm-parse.el \
		tm/tm-text.el tm/tm-image.el \
		tm/tm-play.el tm/tm-partial.el tm/tm-pgp.el \
		tm/tm-ftp.el tm/tm-latex.el tm/tm-html.el tm/tm-file.el \
		tm/tm-tar.el \
		tm/tm-bbdb.el \
		tm/tm-edit*.el tm/signature.el \
		tm/tm-setup.el tm/mime-setup.el.in \
		tm/sc-setup.el \
		tm/methods/tm* tm/methods/ChangeLog \
		tm/src/*.c \
		tm/doc/*.sgml tm/doc/*.texi tm/doc/*.info \
		tm/doc/Makefile tm/doc/*.ol tm/doc/*.tex \
		tm/old-logs/*.en tm/old-logs/*.ja

TM_MH_E_FILES =	tm-mh-e/Makefile tm-mh-e/mk-tmh tm-mh-e/TMH-ELS \
		tm-mh-e/*.el tm-mh-e/ChangeLog \
		tm-mh-e/*.sgml tm-mh-e/*.texi tm-mh-e/*.info

GNUS_MIME_FILES = gnus-mime/Makefile gnus-mime/*-path \
		gnus-mime/Gnus-MIME-* gnus-mime/*.el \
		gnus-mime/*.sgml gnus-mime/*.texi gnus-mime/*.info \

TM_GNUS_FILES =	tm-gnus/Makefile tm-gnus/*-path tm-gnus/mk-tgnus \
		tm-gnus/TGNUS-ELS tm-gnus/*.el tm-gnus/ChangeLog \
		tm-gnus/*.ol tm-gnus/*.texi tm-gnus/*.info tm-gnus/*.tex

TM_MAIL_FILES = tm-mail/TMAIL-ELS tm-mail/*.el tm-mail/ChangeLog

TM_VM_FILES =	tm-vm/TM-VM-ELS tm-vm/*.el tm-vm/*.texi tm-vm/*.info \


MEL_FILES =	mel/Makefile mel/MEL-MK mel/MEL-CFG mel/MEL-ELS \
		mel/*.el mel/ChangeLog

MU_FILES =	mu/MU-ELS mu/*.el mu/ChangeLog

TL_FILES =	tl/README.en tl/Makefile tl/mk-tl tl/TL-ELS \
		tl/*.el tl/ChangeLog

BITMAP_FILES =	bitmap-mule/BITMAP-* bitmap-mule/Makefile \
		bitmap-mule/*.el bitmap-mule/*.bdf \
		bitmap-mule/README.* bitmap-mule/ChangeLog

EMU_FILES =	emu/EMU-ELS emu/*.el emu/ChangeLog

SINFO_FILES =	sinfo/SINFO-* sinfo/Makefile \
		sinfo/*.dtd sinfo/*.el sinfo/*-mapping sinfo/ChangeLog


	$(EMACS) $(FLAGS) -l TM-MK -f compile-tm $(PREFIX) $(EXEC_PREFIX)
#	$(SHELL) .gnus-compile

install-elc:	elc
	$(EMACS) $(FLAGS) -l TM-MK -f install-tm $(PREFIX) $(EXEC_PREFIX)

all:	$(UTILS) $(DVI) elc

src/ol2:	src/ol2.c
	$(CC) $(CFLAGS) src/ol2.c -o src/ol2

src/decode-b:	src/decode-b.c
	$(CC) $(CFLAGS) src/decode-b.c -o src/decode-b

tex:	ol2
	cd doc; $(MAKE) tex

dvi:	ol2
	cd doc; $(MAKE) dvi

ps:	ol2
	cd doc; $(MAKE) ps

install:	$(UTILS) methods install-elc install-execs

execs:	$(UTILS)

	$(EMACS) $(FLAGS) -l TM-MK -f install-execs $(PREFIX) $(EXEC_PREFIX)

	$(EMACS) $(FLAGS) -l TM-MK -f update-xemacs-source

	-$(RM) $(GOMI)
	-cd doc   && $(MAKE) clean
	-cd gnus  && $(MAKE) clean
	-cd mh-e  && $(MAKE) clean
	cd ../mel && $(MAKE) clean

	cd doc; $(MAKE) tex
	cd ..; gtar cvf tm-$(VERSION).tar $(FILES)
	-cd ..; mkdir tm-$(VERSION)
	cp ../tm-oomori/README.?? ../tm-$(VERSION)
	cd ../tm-$(VERSION); gtar xvf ../tm-$(VERSION).tar
	cd ..; gtar cvzf tm-$(VERSION).tar.gz tm-$(VERSION)
	cd ..; $(RM) -r tm-$(VERSION); rm tm-$(VERSION).tar

	cd ..; mv tm$(VERSION).tar.gz /pub/GNU/elisp/mime/beta/
	-cd /pub/GNU/elisp/mime/beta/ ; rm tm-oomori-current.tar.gz
	cd /pub/GNU/elisp/mime/beta/ ; ln -s tm$(VERSION).tar.gz tm-oomori-current.tar.gz

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: