Commits

youngs  committed a633982

Patches from Jan, Steve T & myself

  • Participants
  • Parent commits 040574c

Comments (0)

Files changed (6)

+2001-01-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
+	* package-compile.el (Step 1): Use paths-load-path-depth when
+	defined, otherwise paths-core-load-path-depth.
+
+2001-01-19  Steve Youngs  <youngs@xemacs.org>
+
+	* iterate.rules: Add a Local Variables to set mode to Makefile.
+
+	* INSTALL: New file.
+
+	* Local.rules.template: Use 'cp -af' and 'cp --force --recursive --symlink'.
+
+2000-12-06  Jan Vroonhof  <jan@xemacs.org>
+
+	* Makefile: Use makefile targets for looping instead of shell loops.
+	Makes build more robust.
+	comm/Makefile: ditto.
+	games/Makefile: ditto
+	libs/Makefile: ditto
+	mule/Makefile: ditto
+	oa/Makefile: ditto
+	os/Mafefile: ditto
+	prog/Makefile: ditto
+	wp/Makefile: ditto
+
 2001-01-11  Steve Youngs  <youngs@xemacs.org>
 
 	* Makefile: Proper GNU Makefile quoting. eg change ($(foo),'') to 
+                                             -*- Outline -*- 
+This file covers building and installing XEmacs Package from CVS
+source.
+
+IMPORTANT:
+=========
+	You MUST create a 'Local.rules' file in the toplevel build
+	directory.  (see below for the format of this file)
+
+
+* Building:
+-----------
+** Building Quickstart:
+
+	(1) Create a 'Local.rules' file in the toplevel directory and
+	    edit it to suit your needs.  There is a
+	    'Local.rules.template' in the toplevel directory which you
+	    can copy.
+
+	(2) Regardless of the type of build you decide upon, it's
+	    probably a good idea to run 'make autoloads' from the
+	    toplevel directory. 
+
+	(3) Run either 'make install' or 'make bindist' (not both).
+
+	    'make install' builds the packages and installs them into
+	    the $STAGING directory (see Local.rules format below).  It
+	    doesn't create package binary tarballs.
+
+	    'make bindist' builds the packages and creates package
+	    binary tarballs and a 'package-index' file in $STAGING
+
+** Building a Single Package:
+
+	All you need to do is run the make from the package's
+	directory.  Say, for example, you want to build the bbdb
+	package: 
+	  	- cd ./comm/bbdb
+		- make install or bindist
+
+	You can build a category of packages just as easily.  For
+	example, if you want to build all the packages in ./libs
+		- cd ./libs
+		- make install or bindist
+
+** Building Sumo Packages:
+
+	Get the script 'BuildSumo' that is in the xemacs-builds module
+	at cvs.xemacs.org.
+
+* Installing:
+-------------
+** Installing after a 'make install'
+
+	I know that sounds odd, but if you set $XEMACS_STAGING and
+	$MULE_STAGING to anything other than
+	<emacs-roots>/lib/xemacs/xemacs-packages and
+	<emacs-roots>/lib/xemacs/mule-packages respectively, you will
+	need to either copy, move or symlink.
+
+		- mkdir /usr/local/lib/xemacs/xemacs-packages
+		- mkdir /usr/local/lib/xemacs/mule-packages
+		- cd /usr/local/lib/xemacs/xemacs-packages
+		- cp -a /path/to/$XEMACS_STAGING/* ./
+		- cd ../mule-packages
+		- cp -a /path/to/$MULE_STAGING/* ./
+		- restart XEmacs.
+
+** Installing after a 'make bindist'
+
+	M-x pui-add-install-directory 
+		- enter the value of $XEMACS_STAGING
+	M-x package-get-update-base 
+		- enter '$XEMACS_STAGING/package-index'
+	M-x pui-list-packages
+		- select the packages you want to install
+		- hit 'x' to install
+	Restart XEmacs.
+
+** Installing - running "in place"
+
+	You can't run XEmacs packages from the CVS source tree because
+	the hierarchy is not what XEmacs expects.  But you can come
+	close to a "running in place" install.
+
+	Set the following in 'Local.rules':
+
+	   - symlink = t
+	   - XEMACS_STAGING = /usr/local/lib/xemacs/xemacs-packages
+	   - MULE_STAGING = /usr/local/lib/xemacs/mule-packages
+
+	And then run 'make install'.
+
+	This will build the packages and install them via symlinks to
+	the normal XEmacs package directories.
+
+* Local.rules format:
+---------------------
+
+These are the variables in 'Local.rules' that you will need to
+address. 
+
+	symlink = 
+		Set this to 't' if you want to do a "run in place".
+		Setting this doesn't work well with 'make bindist'
+
+	XEMACS_PACKAGES =
+		This is where you set the normal packages that you
+		want to install. eg:
+			XEMACS_PACKAGES = libs/xemacs-base comm/bbdb
+
+	XEMACS_STAGING = ${XEMACS_PACKAGES_BASE}/../Packages
+		Set this to where you want normal packages to be
+		installed to.
+
+	PACKAGE_INDEX = package-index
+		If you want the package-index file to have a different
+		name, change this.
+
+	BUILD_WITHOUT_MULE =
+		Building from CVS defaults to building the Mule
+		packages.  Set this to 't' if you don't want/have Mule
+
+	MULE_PACKAGES =
+		Same as for 'XEMACS_PACKAGES' except you list the Mule
+		packages you want to install here. eg:
+			MULE_PACKAGES = mule/mule-base mule/skk
+
+	MULE_STAGING = ${XEMACS_PACKAGES_BASE}/../Mule-Packages
+		Set this to where you want Mule packages installed
+		to.  Note:  'make bindist' does not use this variable.
+
+	XEMACS = xemacs
+		If your XEmacs isn't in your path, change this.
+
+	XEMACS_NATIVE_NT =
+		Set this to 't' if you are building on WinNT.
+
+	INSTALL = install -c
+		The path to your BSD compatible install program.
+
+	TAR = tar
+		The path to your tar program
+
+	BZIP2 =
+		If you want bzip2 tarballs, set this.
+
+	MAKEINFO = makeinfo
+		The path to your makeinfo program

File Local.rules.template

 ifneq ('$(symlink)','t')
  # path to GNU cp, use the latter if no GNU cp is available.
  #
- RCOPY = cp -a
+ RCOPY = cp -af
  # RCOPY = cp -pR
 else
  # This next one is for running in-place from a CVS checkout.
  #
- RCOPY = cp --recursive --symbolic-link
+ RCOPY = cp --force --recursive --symbolic-link
 endif
 #
 # Local Variables:
 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 # Boston, MA 02111-1307, USA.
 
+# 
 SUBDIRS = libs comm games prog wp os oa
 
 # Use a Local.rules file to specify what you wish to have installed
 XEMACS_PACKAGES_BASE := $(shell pwd)
 
-
 all:: all-bytecompile
 
 include Local.rules.mk
 SUBDIRS += mule
 endif
 
-all-bytecompile:
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} autoloads; \
-	done
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} bytecompile; \
-	done
-
-
 .PHONY: all all-bytecompile bindist clean distclean install autoloads
 
-autoloads:
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} autoloads; \
-	done
+# The toplevel has slightly different rules so we do not use iterate.rules
+# directly
+ 
+ALL_TARGETS= $(SUBDIRS:=/all.target)
+AUTOLOADS_TARGETS= $(SUBDIRS:=/autoloads.target)
+BYTECOMPILE_TARGETS= $(SUBDIRS:=/bytecompile.target)
+BINDIST_TARGETS= $(SUBDIRS:=/bindist.target)
+CLEAN_TARGETS= $(SUBDIRS:=/clean.target)
+DISTCLEAN_TARGETS= $(SUBDIRS:=/distclean.target)
+INSTALL_TARGETS = $(XEMACS_PACKAGES:=/XEMACS.install) $(MULE_PACKAGES:=/MULE.install) 
+
+# At some point we might have dependencies here...
+
+%.target:
+	[ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) $(*F)
+
+%.install:
+	[ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) STAGING=$($(*F:=_STAGING)) install
+
+all-bytecompile: autoloads bytecompile
+
+autoloads: $(AUTOLOADS_TARGETS)
+
+bytecompile: $(BYTECOMPILE_TARGETS)
+
+bindist-real: $(BINDIST_TARGETS)
+
+bindist: autoloads bindist-real
+
+clean: $(CLEAN_TARGETS)
+
+distclean: $(DISTCLEAN_TARGETS)
 
 World: distclean install
 
-install: all
-ifneq ('$(MULE_PACKAGES)','')
-	for dir in $(MULE_PACKAGES); do \
-		$(MAKE) STAGING=$(MULE_STAGING) $(MFLAGS) -C $${dir} install; \
-	done
-endif
-ifneq ('$(XEMACS_PACKAGES)','')
-	for dir in $(XEMACS_PACKAGES); do \
-		$(MAKE) STAGING=$(XEMACS_STAGING) $(MFLAGS) -C $${dir} install; \
-	done
-endif
+install: all $(INSTALL_TARGETS)
 
-bindist:
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} autoloads; \
-	done
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} bindist; \
-	done
-
-clean:
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} clean; \
-	done
-
-distclean:
-	for dir in $(SUBDIRS); do \
-		$(MAKE) $(MFLAGS) -C $${dir} distclean; \
-	done

File iterate.rules

 
 distclean: $(DISTCLEAN_TARGETS)
 
+# Local Variables:
+# mode: Makefile
+# end:

File package-compile.el

 
 (let* ((roots (paths-find-emacs-roots invocation-directory
 				      invocation-name))
-       (lisp-directory (paths-find-lisp-directory roots)))
+       (lisp-directory (paths-find-lisp-directory roots))
+       (depth (cond
+	       ;; #### All hail Mr. Preprocessor!
+	       ;; OK, OK, his code is under development; FIXME when it's done.
+	       ((boundp 'paths-load-path-depth) ; XEmacs 21.1
+		paths-load-path-depth)
+	       ((boundp 'paths-core-load-path-depth) ; XEmacs > 21.2.41
+		paths-core-load-path-depth)
+	       (t (error "Somebody has been messing with paths-find-*!")))))
   (setq load-path (paths-find-recursive-load-path (list lisp-directory)
-						  paths-load-path-depth)))
+						  depth)))
 
 (load (expand-file-name "auto-autoloads" (car load-path)))