Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!LUCID.COM!lnz From: lnz@LUCID.COM (Leonard N. Zubkoff) Newsgroups: gnu.emacs Subject: Re: shared source question Message-ID: <8906050113.AA00300@atlantis> Date: 5 Jun 89 01:13:48 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 201 In reply to: My question is this, is it possible (or even a good thing?) to use *one* NFS mountable copy of the source tree (for any given version of emacs) and a master Makefile to generate all the needed executables, thereby saving 40+ meg of disc for each combination? If anyone has any experience, good or bad, with such a beast please reply be email (to: steve@cfht.hawaii.edu). I'll summarize if needed. I maintain GNU Emacs for eight different machine types here: Apollo 68020/68030, Apollo PRISM, sun3, sun4, sun386, sun2, vax-ultrix, and vax-4.3bsd. On the Apollo's, I can build a single compound executable (cmpexe) that can be run on both the 68020/68030 and PRISM based nodes, so users don't need to know what type of node they're using, and a single Emacs tree can be shared very easily. Unfortunately, the Suns and Vaxes do not support a notion of compound executables, so more work is required to share a common Emacs tree, but it is possible and I've been running such a system here for a couple of months without any problems. In order to share the same GNU Emacs tree across all our NFS'd Suns and Vaxes, and to have only a single executable which users need to know about, I've made "emacs" and all the other executables be shell scripts that indirect to the name of the executable concatenated to the machine type. The Sun "/bin/arch" command returns one of sun3, sun4, sun386, and sun2, so this part was easy. On the Vaxes I created "/bin/arch" as a shell script that just echoes "vax-ultrix" or "vax-4.3bsd" as appropriate. To allow easy building of the 6 NFS-shared Emacs's, I've developed a couple of simple shell scripts. First, copy "lisp/version.el" to "lisp/version.el-dist", and install the "etc/Makefile.x" reproduced below. Next, create your "config.h" files by naming them "config.h.", as in "config.h.sun3", "config.h.sun4", etc. Then, I just run the "build-common-emacs" script reproduced below. It in turn invokes a remote shell on the appropriate machines and runs the script "build-local-emacs". Be sure to change 18.54 below to whatever version you're using. Leonard N. Zubkoff Note: I keep the GNU Emacs tree as "/gnuemacs" on every machine, so the scripts below reflect that; you should modify them to refer to the location of your Emacs tree. Note: You probably want to munge "src/ymakefile" to skip the "inc-version" step, and then just manually edit "version.el-dist" before each full rebuild. With NFS, you must beware of removing the last link to any executable that's in use, as it may then kill the user's process when it tries to page in. ***** build-common-emacs ***** #! /bin/csh -f date echo "***** Installing Trampolines for Executables *****" set executables = (emacs etc/test-distrib etc/etags etc/ctags etc/loadst \ etc/make-docfile etc/digest-doc etc/sorted-doc \ etc/movemail etc/cvtmail etc/fakemail etc/yow etc/env \ etc/server etc/emacsclient etc/emacstool) foreach file ($executables) cat > $file < version.el) (cd src; rm -f config.h xmakefile; rm -f *.o; ln -s config.h.$machine config.h) (cd etc; make -f Makefile.x all $extra_programs) (cd src; make; mv xemacs ../emacs.x) rm -f etc/DOC lisp/version.el src/xmakefile src/*.o rm -f src/config.h src/temacs src/emacs-18.54.0.$machine set executables = (emacs etc/test-distrib etc/etags etc/ctags etc/loadst \ etc/make-docfile etc/digest-doc etc/sorted-doc \ etc/movemail etc/cvtmail etc/fakemail etc/yow etc/env \ etc/server etc/emacsclient $extra_executables) foreach file ($executables) mv $file.x $file.$machine end ***** etc/Makefile.x ***** # Modified on 1-May-89 by Leonard N. Zubkoff: # Changed CFLAGS from "-g" to "-O". # Build executables with name $file.x. CFLAGS= -O # For Xenix. Needed for movemail # LOADLIBES= -lx # For Iris 4d. Needed for loadst. # LOADLIBES = -lmld EXECUTABLES = test-distrib.x etags.x ctags.x loadst.x make-docfile.x \ digest-doc.x sorted-doc.x movemail.x cvtmail.x fakemail.x yow.x env.x \ server.x emacsclient.x all: ${EXECUTABLES} distclean: -rm -f ${EXECUTABLES} *~ \#* DOC* core # This justs verifies that the non-ASCII characters # in the file `testfile' have no been clobbered by # whatever means were used to copy and distribute Emacs. # If they were clobbered, all the .elc files were clobbered too. test-distrib.x: test-distrib.c $(CC) -o test-distrib.x test-distrib.c ./test-distrib.x etags.x: etags.c $(CC) -o etags.x ${CFLAGS} -DETAGS etags.c $(LOADLIBES) ctags.x: etags.c $(CC) -o ctags.x ${CFLAGS} -DCTAGS etags.c $(LOADLIBES) loadst.x: loadst.c ../src/config.h $(CC) -o loadst.x ${CFLAGS} loadst.c $(LOADLIBES) make-docfile.x: make-docfile.c $(CC) -o make-docfile.x ${CFLAGS} make-docfile.c $(LOADLIBES) digest-doc.x: digest-doc.c $(CC) -o digest-doc.x ${CFLAGS} digest-doc.c $(LOADLIBES) sorted-doc.x: sorted-doc.c $(CC) -o sorted-doc.x ${CFLAGS} sorted-doc.c $(LOADLIBES) # movemail.x: movemail.c ../src/config.h $(CC) -o movemail.x ${CFLAGS} movemail.c $(LOADLIBES) cvtmail.x: cvtmail.c $(CC) -o cvtmail.x ${CFLAGS} cvtmail.c $(LOADLIBES) fakemail.x: fakemail.c ../src/config.h $(CC) -o fakemail.x ${CFLAGS} fakemail.c $(LOADLIBES) yow.x: yow.c $(CC) -o yow.x ${CFLAGS} yow.c $(LOADLIBES) # this is silly -- just use emacs to edit this file! # (in any case this program doesn't preserve alphabetical ordering, # which is why I'm removing it) #addyow: addyow.c # $(CC) -o addyow.x ${CFLAGS} addyow.c env.x: env.c ../src/config.h $(CC) -o env.x -DEMACS ${CFLAGS} env.c $(LOADLIBES) server.x: server.c ../src/config.h $(CC) -o server.x ${CFLAGS} server.c $(LOADLIBES) emacsclient.x: emacsclient.c ../src/config.h $(CC) -o emacsclient.x ${CFLAGS} emacsclient.c $(LOADLIBES) # This one is NOT included in EXECUTABLES. # See ../src/ymakefile. emacstool.x: emacstool.c $(CC) emacstool.c -o emacstool.x -g -lsuntool -lsunwindow -lpixrect $(LOADLIBES)