I have been working today to figure out why XEmacs 21.5.12 intermittently
crashes as it tries to do post-dump update through update-elc-2.el. As a
result, I have put together the following script to make various
configurations easier to build. It also grabs the CVS files if you like.
Anyone who likes feel free to take it and abuse it. The configure section
probably needs tweaking for individual tastes:
-------- cut - here -------------
#!/bin/sh
#####################
# Free for any use. Written by r. d. royar and all-rights released.
# No Warranty. A simple shell script to automate some of the compilation
# and CVS of XEmacs.
#
# You need to edit the XX_BUILD functions to match your configure options.
# Environment variables:
# XEMACSPARENTDIR The parent directory of the XEmacs tree.
# XEMACSDIRNAME The root dir of the XEmacs tree.
# NEW_CC_PATH A complete search path for libs and the compiler
# in case XEmacs needs to compile with a different
# version. If this varible is not an empty string,
# the current path is saved and the path is set.
# to the value of NEW_CC_PATH.
# XEMACSPACKAGEPATH Full path to where you store your packages. I need
# this on my system for some reason. If you don't,
# edit the XX_BUILD functions to remove the reference.
# My email is robert(a)frinabulax.org should you need to contact me.
#####################
# Name of CVS package
XEmacsPackage="xemacs"
# Name of directory where the current XEmacs tree is stored
XEmacsDir="xemacs"
# Where packages are stored and later searched for
XEmacsPPath="/usr/local/sbin/xemacs/lib"
# The path to XEmacs' parent dirrctory (used for cd commands)
ParentPath="/usr/local/sbin"
# Default is to get the latest CVS (i.e. today)
When=`date +'%Y-%m-%d'`
# Default is to compile without debugging
What="nodebug"
# You will need to have run the initial CVS login command to set this up
CVSArgs="-z3 -d :pserver:cvs@cvs.xemacs.org:/pack/xemacscvs checkout"
# So build-report will contain compiler information
TELL_COMPILER=`(gcc --version|head -1)`
Run () {
if [ "${XEMACSPARENTDIR}" ]; then
ParentPath="${XEMACSPARENTDIR}"
fi
if [ "${NEW_CC_PATH}" ]; then
SAVED_PATH="${PATH}"
PATH="${NEW_CC_PATH}"
else
SAVED_PATH=""
fi
if [ "${XEMACSPACKAGEPATH}" ]; then
XEmacsPPath="${XEMACSPACKAGEPATH}"
fi
if [ "${XEMACSDIRNAME}" ]; then
XEmacsDir="${XEMACSDIRNAME}"
fi
if [ $# -gt 1 ]; then
What="$2"
if [ $# -gt 2 ]; then
When="$3"
fi
fi
case $1 in
version|v ) WHATVER ;;
cvs|C ) CVS ;;
config|c ) Config ${What} ;;
union|u ) Union ;;
reconfig|rf ) ReConfig ${What} ;;
erase|e ) Erase ${What} ;;
rebuild|rb ) ReBuild ${What} ;;
build|b ) Build ${What} ;;
clean|cl ) Clean ${What} ;;
realclean|rc ) RealClean ${What} ;;
optimized|o ) SP_Build "optimized" ;;
debug|d ) Debug "debug" ;;
check|ch ) Debug "check" ;;
fulldebug|fd ) Debug "debugcheck" ;;
report|rt ) SP_Build ${What} ;;
* ) Usage "$1" ;;
esac
}
BUILD () {
case $1 in
debugcheck ) DC_BUILD ;;
debug ) D_BUILD ;;
check ) C_BUILD ;;
union ) U_BUILD ;;
optimized ) O_BUILD ;;
* ) N_BUILD ;;
esac
}
DC_BUILD () {
XEMACSDEBUG="(setq stack-trace-on-error t)"
export XEMACSDEBUG
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=all --debug=yes --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-no-cpp-precomp -g' --pdump --with-ldap=no --with-xmu
}
D_BUILD () {
XEMACSDEBUG="(setq stack-trace-on-error t)"
export XEMACSDEBUG
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=none --debug=yes --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-no-cpp-precomp -g' --pdump --with-ldap=no --with-xmu
}
C_BUILD () {
XEMACSDEBUG="(setq stack-trace-on-error t)"
export XEMACSDEBUG
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=all --debug=no --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-g -no-cpp-precomp' --pdump --with-ldap=no --with-xmu
}
U_BUILD () {
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=none --debug=no --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-g -no-cpp-precomp' --pdump --with-ldap=no --use-union-type --with-xmu
}
O_BUILD () {
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=none --debug=no --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-g -O3 -no-cpp-precomp' --pdump --with-ldap=no --with-xmu
}
N_BUILD () {
./configure --with-mule --with-widgets=athena --with-xfs --with-dialogs=athena \
--error-checking=none --debug=no --package-path=${XEmacsPPath} \
--prefix=${ParentPath}/${XEmacsDir} --with-prefix --with-sound=noesd \
'--cflags=-g -no-cpp-precomp' --pdump --with-ldap=no --with-xmu
}
WHATVER () {
echo Requested ${When}
echo -n "CVS Version is " && grep "xemacs_extra_name="
${ParentPath}/${XEmacsDir}/version.sh | cut -c 26-33
}
Build () {
Config $1
make
}
ReBuild () {
ReConfig $1
make
}
CVS () {
local SDIR=${PWD}
cd ${ParentPath}
cvs ${CVSArgs} -D ${When} -d ${XEmacsPackage} ${XEmacsDir}
WHATVER
cd ${SDIR}
return
}
Config () {
local SDIR=${PWD}
CVS
cd ${XEmacsDir}
BUILD $1
cd ${SDIR}
return
}
ReConfig () {
local SDIR=${PWD}
WHATVER
cd ${ParentPath}/${XEmacsDir}
BUILD $1
cd ${SDIR}
return
}
SP_Build () {
local SDIR=${PWD}
cd ${ParentPath}/${XEmacsDir}
make realclean
rm -fv lisp/*.elc
rm -fv lisp/mule/*.elc
rm -fv lisp/term/*.elc
rm -f xemacs-make-all.err
Config $1
make 2>&1 | tee -a xemacs-make-all.err
make check 2>&1 | tee xemacs-make-check.err
chmod +w Installation
if [ "${TELL_COMPILER}" ] ; then
printf "\nPATH: %s\nCompiler: %s\n" "${PATH}"
"${TELL_COMPILER}" >>Installation
fi
chmod -w Installation
cd ${SDIR}
return
}
Debug () {
local SDIR=${PWD}
cd ${ParentPath}/${XEmacsDir}
make realclean
rm -fv lisp/*.elc
rm -fv lisp/mule/*.elc
rm -fv lisp/term/*.elc
WHATVER
BUILD $1
ulimit -c 32228
make 2>&1 | tee -a xemacs-make-all.err
make check 2>&1 | tee -a xemacs-make-check.err
cd ${SDIR}
return
}
Clean () {
local SDIR=${PWD}
cd ${ParentPath}/${XEmacsDir}
make clean
Build $1
cd ${SDIR}
return
}
RealClean () {
local SDIR=${PWD}
cd ${ParentPath}/${XEmacsDir}
make realclean
rm -fv lisp/*.elc
rm -fv lisp/mule/*.elc
rm -fv lisp/term/*.elc
Build $1
cd ${SDIR}
return
}
Erase () {
local SDIR=${PWD}
cd ${ParentPath}/${XEmacsDir}
make realclean
rm -fv lisp/*.el
rm -fv lisp/mule/*.el
rm -fv lisp/term/*.el
rm -fv src/*.c
RealClean $1
cd ${SDIR}
return
}
Usage () {
if [ "$1" != "" ]; then
echo "$0 : $1 is not a valid argument."
fi
echo "Usage (relative position of option, what, when is required):"
echo " makemacs option [what TYPE] [when YYYY-MM-DD]"
echo " options:"
echo " version which CVS version of XEmacs is installed?"
echo " cvs get new files only."
echo " config cvs and run config."
echo " build config and build."
echo " clean clean and build."
echo " realclean clean and rebuild everything."
echo " erase delete all lisp and C files, then CVS and
rebuild."
echo " reconfig run config (no CVS)."
echo " rebuild reconfig and build."
echo " check realclean and build with error checking (no
CVS)."
echo " debug realclean and build with debug=yes (no
CVS)."
echo " fulldebug source-level full debug version (no CVS)."
echo " optimize CVS normal build with -O3 (no CVS)."
echo " union full build with union type and no debug."
echo " report CVS full build with build-report files."
echo " TYPES:"
echo " nodebug turn off error checking and debugging."
echo " debugcheck turn on debug and error checking."
echo " debug turn on debugging."
echo " check turn on error checking."
echo " union compile --with-union-type."
echo " optimized turn on -O3."
echo "Examples:"
echo " makemacs rebuild nodebug"
echo " makemacs config debug 2003-06-16"
echo "If date other than most recent is desired, then TYPE must be
included."
}
Run $*
if [ "${SAVED_PATH}" ]; then
PATH="${SAVED_PATH}"
fi