summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/xemacs-elisp-common.eclass74
-rw-r--r--eclass/xemacs-elisp.eclass4
2 files changed, 63 insertions, 15 deletions
diff --git a/eclass/xemacs-elisp-common.eclass b/eclass/xemacs-elisp-common.eclass
index d1e727b5c4d4..2ab58739c9e4 100644
--- a/eclass/xemacs-elisp-common.eclass
+++ b/eclass/xemacs-elisp-common.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp-common.eclass,v 1.2 2007/09/25 18:27:12 graaff Exp $
#
# Copyright 2007 Hans de Graaff <graaff@gentoo.org>
#
@@ -37,7 +37,13 @@
# An elisp file is compiled by the xemacs-elisp-compile() function
# defined here and simply takes the source files as arguments.
#
-# xemacs-elisp-compile *.el || die "xemacs-elisp-compile failed"
+# xemacs-elisp-compile *.el
+#
+# In the case of interdependent elisp files, you can use the
+# xemacs-elisp-comp() function which makes sure all files are
+# loadable.
+#
+# xemacs-elisp-comp *.el
#
# Function xemacs-elisp-make-autoload-file() can be used to generate a
# file with autoload definitions for the lisp functions. It takes a
@@ -49,14 +55,13 @@
# .SS
# src_install() usage:
#
-# The resulting compiled files (.elc) should be put in a subdirectory of
-# /usr/lib/xemacs/site-lisp/ which is named after the first argument
-# of elisp-install(). The following parameters are the files to be put in
-# that directory. Usually the subdirectory should be ${PN}, you can choose
-# something else, but remember to tell elisp-site-file-install() (see below)
-# the change, as it defaults to ${PN}.
+# The resulting compiled files (.elc) should be put in a subdirectory
+# of /usr/lib/xemacs/site-lisp/ which is named after the first
+# argument of xemacs-elisp-install(). The following parameters are
+# the files to be put in that directory. Usually the subdirectory
+# should be ${PN}, but you can choose something else.
#
-# elisp-install ${PN} *.el *.elc || die "elisp-install failed"
+# xemacs-elisp-install ${PN} *.el *.elc
#
@@ -67,10 +72,13 @@ XEMACS_BATCH_CLEAN="${XEMACS} --batch --no-site-file --no-init-file"
# @FUNCTION: xemacs-elisp-compile
# @USAGE: <list of elisp files>
# @DESCRIPTION:
-# Byte-compile elisp files with xemacs
+# Byte-compile elisp files with xemacs. This function will die when
+# there is a problem compiling the lisp files.
xemacs-elisp-compile () {
- ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
- xemacs-elisp-make-autoload-file "$@"
+ {
+ ${XEMACS_BATCH_CLEAN} -f batch-byte-compile "$@"
+ xemacs-elisp-make-autoload-file "$@"
+ } || die "Compile lisp files failed"
}
xemacs-elisp-make-autoload-file () {
@@ -85,7 +93,8 @@ xemacs-elisp-make-autoload-file () {
# @DESCRIPTION:
# Install elisp source and byte-compiled files. All files are installed
# in site-packages in their own directory, indicated by the first
-# argument to the function.
+# argument to the function. This function will die if there is a problem
+# installing the list files.
xemacs-elisp-install () {
local subdir="$1"
@@ -96,3 +105,42 @@ xemacs-elisp-install () {
doins "$@"
) || die "Installing lisp files failed"
}
+
+# @FUNCTION: xemacs-elisp-comp
+# @USAGE: <list of elisp files>
+# @DESCRIPTION:
+# Byte-compile interdependent XEmacs lisp files.
+# Originally taken from GNU autotools, but some configuration options
+# removed as they don't make sense with the current status of XEmacs
+# in Gentoo.
+
+xemacs-elisp-comp() {
+ # Copyright 1995 Free Software Foundation, Inc.
+ # François Pinard <pinard@iro.umontreal.ca>, 1995.
+ # This script byte-compiles all `.el' files which are part of its
+ # arguments, using XEmacs, and put the resulting `.elc' files into
+ # the current directory, so disregarding the original directories used
+ # in `.el' arguments.
+ #
+ # This script manages in such a way that all XEmacs LISP files to
+ # be compiled are made visible between themselves, in the event
+ # they require or load-library one another.
+
+ test $# -gt 0 || return 1
+
+ einfo "Compiling XEmacs Elisp files ..."
+
+ tempdir=elc.$$
+ mkdir ${tempdir}
+ cp "$@" ${tempdir}
+ pushd ${tempdir}
+
+ echo "(add-to-list 'load-path \"../\")" > script
+ ${XEMACS_BATCH_CLEAN} -l script -f batch-byte-compile *.el
+ local ret=$?
+ mv *.elc ..
+
+ popd
+ rm -fr ${tempdir}
+ return ${ret}
+}
diff --git a/eclass/xemacs-elisp.eclass b/eclass/xemacs-elisp.eclass
index bc5d693c2ac7..27a3e515b5ea 100644
--- a/eclass/xemacs-elisp.eclass
+++ b/eclass/xemacs-elisp.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v 1.1 2007/09/15 07:19:22 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xemacs-elisp.eclass,v 1.2 2007/09/25 18:27:12 graaff Exp $
#
# Copyright 2007 Hans de Graaff <graaff@gentoo.org>
#
@@ -45,7 +45,7 @@ xemacs-elisp_src_unpack() {
}
xemacs-elisp_src_compile() {
- xemacs-elisp-compile *.el || die "Compilation of lisp files failed"
+ xemacs-elisp-compile *.el
}
xemacs-elisp_src_install () {