summaryrefslogtreecommitdiff
path: root/build-ins.in
blob: 778c8221e7817504acea179d48d0bceba5ed897f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh -x
#
#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
LIBROOT=/home/gd/gnu/emacs

# 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.
LISPPATH=/home/gd/gnu/emacs/local-lisp:/home/gd/gnu/emacs/lisp

# Emacs will look here for its architecture-independent files (like
# the tutorial and the zippy database).
DATADIR=/home/gd/gnu/emacs/etc

# Emacs will look here for its architecture-dependent files, like
# executables for its utilities.
LIBDIR=/home/gd/gnu/emacs/arch-lib

# The locking directory, where the Emacs locking code keeps track of
# which files are currently being edited.
# set LOCKDIR=${LIBROOT}/lock
LOCKDIR=/home/gd/gnu/emacs/lock

# This is where build-install should place the binaries people will
# want to run directly (like etags and Emacs itself).
BINDIR=/usr/local/bin

/bin/sed < src/paths.h-dist > src/paths.h			\
-e 's;\(#.*PATH_LOADSEARCH\).*$;\1 "'${LISPPATH}'";'		\
-e 's;\(#.*PATH_EXEC\).*$;\1 "'${LIBDIR}'";'			\
-e 's;\(#.*PATH_DATA\).*$;\1 "'${DATADIR}'";'			\
-e 's;\(#.*LOCK\).*$;\1 "'${LOCKDIR}'/";'

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

if [ `pwd` != `(cd ${LIBROOT}; pwd)` ]; then
  mv `pwd` ${LIBROOT}
  if [ $? != '0' ]; then
    mkdir ${LIBROOT}
    echo mv `pwd` to ${LIBROOT} failed--using tar to copy.
    tar cf - . | (cd ${LIBROOT}; umask 0; tar xf -)
    if [ $? != '0' ]; then
      echo tar-copying `pwd` to ${LIBROOT} failed.
      exit 1
    fi
  fi
fi

cp ${LIBROOT}/etc/[ce]tags ${BINDIR}
mv ${LIBROOT}/src/xemacs ${BINDIR}/emacs
rm ${LIBROOT}/src/temacs
chmod 777 ${BINDIR}/[ce]tags ${BINDIR}/emacs