Anonymous avatar Anonymous committed 1960129

try again to commit recent package changes

Comments (0)

Files changed (7)

+2001-02-24  Ben Wing  <ben@xemacs.org>
+
+	* package-clean.el:
+	New file, based on update-elc-2.el.
+	
+	* Local.rules.template:
+	* Local.rules.template (symlink):
+	* Local.rules.template (XEMACS):
+	* Local.rules.template (BUILD_WITHOUT_MULE):
+	* Local.rules.template (XEMACS_NATIVE_NT):
+	* Local.rules.template (XEMACS_NATIVE_NT_NEEDS_EXTRA_QUOTING):
+	* Local.rules.template (XEMACS_STAGING):
+	* Local.rules.template (MULE_STAGING):
+	* Local.rules.template (XEMACS_PACKAGES):
+	* Local.rules.template (MULE_PACKAGES):
+	Rearrange so that most-commonly-needed-to-change options are first
+	and add appropriate comments.  Change defaults for XEMACS_STAGING
+	and MULE_STAGING to conform to what XEmacs expects for a package
+	tree.  Change defaults for XEMACS_PACKAGES and MULE_PACKAGES so
+	that everything will by default be installed.  Add
+	XEMACS_NATIVE_NT_NEEDS_EXTRA_QUOTING to conditionalize out no
+	longer needed MS Windows quoting changes.
+	
+	* Makefile (all):
+	* Makefile (all-bytecompile):
+	* Makefile (elcclean):
+	* Makefile (World):
+	* Makefile (install):
+	* Makefile (just-install):
+	Complete the list of phony targets.  Add target just-install to
+	just install, not byte-compile.  Add target elcclean to
+	remove out-of-date and orphaned .elc files to avoid
+	compile errors when upgrading, and use it in all:.  Rename
+	INSTALL_TARGETS to JUST_INSTALL_TARGETS and conditionalize
+	appropriately on BUILD_WITHOUT_MULE.
+	
+	* XEmacs.rules:
+	* XEmacs.rules (PWD):
+	* XEmacs.rules (elcclean):
+	* XEmacs.rules (pkg_tar):
+	Add elcclean target (not currently used by default).  Clean up MS
+	Windows comments.  Conditionalize extra MS Windows quoting on
+	XEMACS_NATIVE_NT_NEEDS_EXTRA_QUOTING, since it breaks things under
+	newer Cygwins.
+	
+	* iterate.rules (ELCCLEAN_TARGETS):
+	* iterate.rules (INSTALL_TARGETS):
+	* iterate.rules (distclean):
+	* iterate.rules (elcclean):
+	Add targets for elcclean and install to work recursively.
+	
+	* package-compile.el (stack-trace-on-error):
+	Turn on by default for better error tracking.
+
 2001-02-20  Martin Buchholz  <martin@xemacs.org>
 
 	* INSTALL: cvs update -Pd and other INSTALL corrections.

Local.rules.template

 # the full / rooted path to the directory where this "Local.rules"
 # makefile is supposed to be.  Don't override it here.
 
+###################### Begin settings that commonly need to be changed
+
 # `t' or `nil' - When `t', a symlink tree will be built for running a
 # live CVS checkout.  Requires GNU `cp', and that you configure your
 # XEmacs to use ${STAGING} in the package-path.  Create the tree with
 #
 symlink = 
 
-# Stuff to install.
+# Path to XEmacs to use for byte compilation.
+#
+# (Double-quote path under native MS Windows if there are embedded spaces.)
+XEMACS = xemacs
 
-# XEmacs packages to install. 'make bindist' doesn't look at this, it's
-# used by 'make install'.
-#
-# The format for this is: dir/pkg1 dir/pkg2...
-# e.g. libs/xemacs-base comm/bbdb
-XEMACS_PACKAGES =
-#
-# Where to stage or install the packages, or where the symlink tree will go.
-#
-XEMACS_STAGING = ${XEMACS_PACKAGES_BASE}/../Packages
-#
-# APA: Name of package index file
-#
-PACKAGE_INDEX = package-index
 # Should we build the mule package?  Set to 't' if you do not have/want Mule.
 #
 BUILD_WITHOUT_MULE =
 
-# Mule packages to install.  'make bindist' doesn't look at this, it's
-# used by 'make install'.
-#
-# The format for this is: dir/pkg1 dir/pkg2...
-# e.g. mule/mule-base mule/skk
-MULE_PACKAGES =
-#
-# Where to install them
-#
-MULE_STAGING = ${XEMACS_PACKAGES_BASE}/../Mule-Packages
-
-# Path to XEmacs to use for byte compilation.
-#
-# APA: Double-quote path to protect possibly embedded SPACEs on WindowsNT.
-XEMACS = xemacs
-
-# APA: XEmacs native NT currently (2000-06-23) has shortcomings we
-# need to temporarily work around.
 # Following test, which would be performed by every makefile
 # including XEmacs.rules, slows down the make process terribly
 # according to
 #
 # Therefore this has become a make variable instead:
 #
-# Set XEMACS_NATIVE_NT to 't' if you are building on Microsoft Windows.
+# Set XEMACS_NATIVE_NT to 't' if you are building using a native
+# Microsoft Windows version of XEmacs (not a Cygwin-built version).
+# NOTE: You still need the Cygwin environment to build the packages!
+# This only concerns how XEmacs itself was built.
 XEMACS_NATIVE_NT =
 
+# XEmacs native MS Windows needs this quoting of command-line
+# arguments due to basic differences in the handling of command-line
+# arguments in Unix and MS Windows.
+#### not any more, as of Cygwin 1.1.8-2 (Feb 2001) -- ben
+# set this to 't' if you get errors under MS Windows without it.
+XEMACS_NATIVE_NT_NEEDS_EXTRA_QUOTING =
+
+#
+# Where to stage or install the non-Mule packages, or where the
+# symlink tree will go.
+#
+XEMACS_STAGING = ${XEMACS_PACKAGES_BASE}/../xemacs-packages
+
+#
+# Where to stage or install the Mule packages, or where the
+# symlink tree will go.
+#
+MULE_STAGING = ${XEMACS_PACKAGES_BASE}/../mule-packages
+
+# XEmacs packages or groups of packages to install. 'make bindist'
+# doesn't look at this, it's used by 'make install'.
+#
+# The format for this is: dir/pkg1 dir/pkg2...
+# e.g. libs/xemacs-base comm/bbdb
+XEMACS_PACKAGES = comm games libs oa os prog wp
+
+# Mule packages or groups of packages to install.  'make bindist'
+# doesn't look at this, it's used by 'make install'.
+#
+# The format for this is: dir/pkg1 dir/pkg2...
+# e.g. mule/mule-base mule/skk
+MULE_PACKAGES = mule
+
+###################### End settings that commonly need to be changed
+
+PACKAGE_INDEX = package-index
+
 # See: Makefile and XEmacs.rules to see how $(XEMACS_STAGING),
 # $(MULE_STAGING), and $(STAGING) are used.
 #
 SUBDIRS += mule
 endif
 
-.PHONY: all all-bytecompile bindist clean distclean install autoloads
+.PHONY: all all-bytecompile autoloads bytecompile bindist-real bindist clean distclean elcclean World install just-install
 
 # 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) 
+ELCCLEAN_TARGETS= $(SUBDIRS:=/elcclean.target)
+JUST_INSTALL_TARGETS = $(XEMACS_PACKAGES:=/XEMACS.install)
+ifeq ($(BUILD_WITHOUT_MULE),)
+JUST_INSTALL_TARGETS += $(MULE_PACKAGES:=/MULE.install)
+endif
 
 # At some point we might have dependencies here...
 
 %.install:
 	[ -d $(*D) ] && $(MAKE) $(MFLAGS) -C $(*D) STAGING=$($(*F:=_STAGING)) install
 
-all-bytecompile: autoloads bytecompile
+all-bytecompile: elcclean autoloads bytecompile
 
 autoloads: $(AUTOLOADS_TARGETS)
 
 
 distclean: $(DISTCLEAN_TARGETS)
 
+elcclean:
+	$(XEMACS) $(VANILLA) -batch -l package-clean.el
+
 World: distclean install
 
-install: all $(INSTALL_TARGETS)
+install: all just-install
 
+just-install: $(JUST_INSTALL_TARGETS)
+
+
-# Configuration constants for building XEmacs packages
+# Common Makefile material for package Makefiles
 # Copyright (C) 1997 Free Software Foundation Inc.
 
 # This file is part of XEmacs.
 %.info: %.texi
 	$(MAKEINFO) $(MAKEINFO_FLAGS) -o $@ $<
 
-# APA: XEmacs native NT currently (2000-06-23) has shortcomings we
-# need to temporarily work around.
 ifeq ($(XEMACS_NATIVE_NT),t)
-# APA: Convert UNIX-path (containing output of `pwd') to windows-path,
-# so that XEmacs native NT can handle it.
+# Convert UNIX-path (containing output of `pwd') to windows-path, so
+# that XEmacs native NT can handle it.
 PACKAGE_COMPILE = \
 "$(shell cygpath --windows $(XEMACS_PACKAGES_BASE)/package-compile.el)"
+PACKAGE_CLEAN = \
+"$(shell cygpath --windows $(XEMACS_PACKAGES_BASE)/package-clean.el)"
 else
 PACKAGE_COMPILE = $(XEMACS_PACKAGES_BASE)/package-compile.el
+PACKAGE_CLEAN = $(XEMACS_PACKAGES_BASE)/package-clean.el
 endif
 
 %.elc: %.el
 		$(AUTOLOAD_PATH)/custom-load.el package-info \
 		$(AUTOLOAD_PATH)/_pkg.el
 
-# APA: XEmacs native NT currently (2000-06-23) has shortcomings we
-# need to temporarily work around.
-ifeq ($(XEMACS_NATIVE_NT),t)
-# APA: XEmacs native NT currently needs this quoting of
-# command-line-rguments.
+elcclean:
+	$(XEMACS) $(VANILLA) -batch -l $(PACKAGE_CLEAN)
+
+# XEmacs native MS Windows needs this quoting of command-line
+# arguments due to basic differences in the handling of command-line
+# arguments in Unix and MS Windows.
+#### not any more, as of Cygwin 1.1.8-2 (Feb 2001) -- ben
+ifeq ($(XEMACS_NATIVE_NT_NEEDS_EXTRA_QUOTING),t)
 AUTOLOAD_PACKAGE_NAME = (setq autoload-package-name \\\"$(PACKAGE)\\\")
 else
 AUTOLOAD_PACKAGE_NAME = (setq autoload-package-name \"$(PACKAGE)\")
 
 pkg_tar = $(STAGING)/$(PACKAGE)-$(VERSION)-pkg.tar
 
-# APA: XEmacs native NT currently (2000-06-23) has shortcomings we
-# need to temporarily work around.
 ifeq ($(XEMACS_NATIVE_NT),t)
-# APA: Convert UNIX-path (containing output of `pwd') to windows-path,
+# Convert UNIX-path (containing output of `pwd') to windows-path,
 # so that XEmacs native NT can handle it.
 PKG_TAR_GZ = "$(shell cygpath --windows $(pkg_tar)).gz"
 PACKAGE_INFO = "$(shell cygpath --windows $(STAGING)/$(PACKAGE_INDEX))"
 BINDIST_TARGETS= $(PACKAGES:=/bindist.target)
 CLEAN_TARGETS= $(PACKAGES:=/clean.target)
 DISTCLEAN_TARGETS= $(PACKAGES:=/distclean.target)
+ELCCLEAN_TARGETS= $(PACKAGES:=/elcclean.target)
+INSTALL_TARGETS= $(PACKAGES:=/install.target)
 
-.PHONY: all autoloads bytecompile bindist clean distclean
+.PHONY: all autoloads bytecompile bindist clean distclean elcclean install
 
 # At some point we might have dependencies here..
 
 
 distclean: $(DISTCLEAN_TARGETS)
 
+elcclean: $(ELCCLEAN_TARGETS)
+
+install: $(INSTALL_TARGETS)
+
 # Local Variables:
 # mode: Makefile
 # end:
+;;; package-clean.el --- Remove bogus .elc files in package tree
+
+;; Copyright (C) 1997 by Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001 Ben Wing.
+
+;; Author: Ben Wing <ben@xemacs.org>, based on cleantree.el by
+;;         Steven L Baur <steve@xemacs.org>
+
+;; This file is part of XEmacs.
+
+;; XEmacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; XEmacs is distributed in the hope that it will be useful, but
+;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;; General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with XEmacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; Synched up with: Not in FSF
+
+;;; Commentary:
+
+;; This is meant to be called -batch at the beginning of package-tree
+;; compilation (i.e. `make' from the top of the package tree) and
+;; removes out-of-date and orphaned .elc files.
+
+;;; Code:
+
+(setq stack-trace-on-error t)
+
+(when (interactive-p)
+  (error "package-clean may only be used with -batch"))
+
+(defvar package-clean-ignored-dirs
+  `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule"))))
+
+(defvar package-clean-ignored-files
+  ;; note: entries here are regexps
+  '())
+
+(defun package-clean-do-it (dir)
+  ;; Stage 1.
+  ;; Remove out-of-date elcs
+  (let ((files (directory-files dir t "\\.el$"))
+	file file-c)
+    (while (setq file (car files))
+      (setq files (cdr files))
+      (setq file-c (concat file "c"))
+      (when (and (file-exists-p file-c)
+		 (file-newer-than-file-p file file-c))
+	(message "Removing out-of-date %s" file-c)
+	(delete-file file-c))))
+  ;; Remove elcs without corresponding el
+  (let ((files (directory-files dir t "\\.elc$"))
+	file file-c)
+    (while (setq file-c (car files))
+      (setq files (cdr files))
+      (setq file (replace-in-string file-c "c$" ""))
+      (when (and (file-exists-p file-c)
+		 (not (file-exists-p file)))
+	(message "Removing %s; no corresponding .el" file-c)
+	(delete-file file-c))))
+
+  ;; We descend recursively
+  (let ((dirs (directory-files dir t nil t))
+	dir)
+    (while (setq dir (pop dirs))
+      (when (and (not (member (file-name-nondirectory dir)
+			      package-clean-ignored-dirs))
+		 (file-directory-p dir))
+	(package-clean-do-it dir)))))
+
+(message "Removing old or spurious .elcs in directory tree `%s'..."
+	 (expand-file-name "."))
+(package-clean-do-it ".")
+(message "Removing old or spurious .elcs in directory tree `%s'...done"
+	 (expand-file-name "."))
+

package-compile.el

 
 ;;; Code:
 
-;; (setq stack-trace-on-error t)
+(setq stack-trace-on-error t)
 
 (when (interactive-p)
   (error "package-compile may only be used with -batch"))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.