build-ins.in 2.08 KB
Newer Older
Jim Blandy's avatar
Jim Blandy committed
1
#!/bin/sh -x
Jim Blandy's avatar
Jim Blandy committed
2 3 4 5 6 7 8 9
#
#Shell script for building and installing Emacs.

# Where to install all of Emacs's data files - the lisp code,
# documentation tree, and the architecture-dependent and -independent
# libaries.  The default definitions for the variables below are
# expressed in terms of this one, so you may not need to change them.
# set LIBROOT=/usr/local/lib/emacs-19.0
Jim Blandy's avatar
Jim Blandy committed
10
LIBROOT=/u/src/emacs/19.0
Jim Blandy's avatar
Jim Blandy committed
11 12 13 14 15 16

# Emacs will search this path to find its elisp files.  This should be
# a colon-separated list of directories.  Strictly speaking, all the
# elisp files should go under DATADIR (below), since both elisp source
# and compiled elisp are completely portable, but it's traditional to
# give the lisp files their own subdirectory.
Jim Blandy's avatar
Jim Blandy committed
17
LISPPATH=/u/src/emacs/19.0/lisp
Jim Blandy's avatar
Jim Blandy committed
18 19 20

# Emacs will look here for its architecture-independent files (like
# the tutorial and the zippy database).
Jim Blandy's avatar
Jim Blandy committed
21
DATADIR=/u/src/emacs/19.0/share-lib
Jim Blandy's avatar
Jim Blandy committed
22 23 24

# Emacs will look here for its architecture-dependent files, like
# executables for its utilities.
Jim Blandy's avatar
Jim Blandy committed
25
LIBDIR=/u/src/emacs/19.0/arch-lib
Jim Blandy's avatar
Jim Blandy committed
26 27 28 29

# The locking directory, where the Emacs locking code keeps track of
# which files are currently being edited.
# set LOCKDIR=${LIBROOT}/lock
Jim Blandy's avatar
Jim Blandy committed
30
LOCKDIR=/u/src/emacs/19.0/lock
Jim Blandy's avatar
Jim Blandy committed
31 32 33

# This is where build-install should place the binaries people will
# want to run directly (like etags and Emacs itself).
Jim Blandy's avatar
Jim Blandy committed
34
BINDIR=/usr/local/bin
Jim Blandy's avatar
Jim Blandy committed
35 36

/bin/sed < src/paths.h-dist > src/paths.h			\
Jim Blandy's avatar
Jim Blandy committed
37 38 39 40
-e 's;\(#.*PATH_LOADSEARCH\).*$;\1 "'${LISPPATH}'";'		\
-e 's;\(#.*PATH_EXEC\).*$;\1 "'${LIBDIR}'";'			\
-e 's;\(#.*PATH_DATA\).*$;\1 "'${DATADIR}'";'			\
-e 's;\(#.*LOCK\).*$;\1 "'${LOCKDIR}'/";'
Jim Blandy's avatar
Jim Blandy committed
41 42 43 44

(cd lib-src; make) || exit 1
(cd src; make) || exit 1

Jim Blandy's avatar
Jim Blandy committed
45
if [ `pwd` != `(cd ${LIBROOT}; pwd)` ]; then
Jim Blandy's avatar
Jim Blandy committed
46
  mv `pwd` ${LIBROOT}
Jim Blandy's avatar
Jim Blandy committed
47
  if [ $? != '0' ]; then
Jim Blandy's avatar
Jim Blandy committed
48 49 50
    mkdir ${LIBROOT}
    echo mv `pwd` to ${LIBROOT} failed--using tar to copy.
    tar cf - . | (cd ${LIBROOT}; umask 0; tar xf -)
Jim Blandy's avatar
Jim Blandy committed
51
    if [ $? != '0' ]; then
Jim Blandy's avatar
Jim Blandy committed
52 53
      echo tar-copying `pwd` to ${LIBROOT} failed.
      exit 1
Jim Blandy's avatar
Jim Blandy committed
54 55 56
    fi
  fi
fi
Jim Blandy's avatar
Jim Blandy committed
57

Jim Blandy's avatar
Jim Blandy committed
58
cp ${LIBROOT}/etc/[ce]tags ${BINDIR}
Jim Blandy's avatar
Jim Blandy committed
59 60
mv ${LIBROOT}/src/xemacs ${BINDIR}/emacs
rm ${LIBROOT}/src/temacs
Jim Blandy's avatar
Jim Blandy committed
61
chmod 777 ${BINDIR}/[ce]tags ${BINDIR}/emacs