Commit | Line | Data |
---|---|---|
f8026fd8 | 1 | #!/bin/sh -x |
86a5659e JB |
2 | # |
3 | #Shell script for building and installing Emacs. | |
4 | ||
5 | # Where to install all of Emacs's data files - the lisp code, | |
6 | # documentation tree, and the architecture-dependent and -independent | |
7 | # libaries. The default definitions for the variables below are | |
8 | # expressed in terms of this one, so you may not need to change them. | |
9 | # set LIBROOT=/usr/local/lib/emacs-19.0 | |
36a8c287 | 10 | LIBROOT=/usr/local/emacs |
86a5659e JB |
11 | |
12 | # Emacs will search this path to find its elisp files. This should be | |
13 | # a colon-separated list of directories. Strictly speaking, all the | |
14 | # elisp files should go under DATADIR (below), since both elisp source | |
15 | # and compiled elisp are completely portable, but it's traditional to | |
16 | # give the lisp files their own subdirectory. | |
36a8c287 | 17 | LISPPATH=/usr/local/emacs/local-lisp:/usr/local/emacs/lisp |
86a5659e JB |
18 | |
19 | # Emacs will look here for its architecture-independent files (like | |
20 | # the tutorial and the zippy database). | |
36a8c287 | 21 | DATADIR=/usr/local/emacs/share-lib |
86a5659e JB |
22 | |
23 | # Emacs will look here for its architecture-dependent files, like | |
24 | # executables for its utilities. | |
36a8c287 | 25 | LIBDIR=/usr/local/emacs/arch-lib |
86a5659e JB |
26 | |
27 | # The locking directory, where the Emacs locking code keeps track of | |
28 | # which files are currently being edited. | |
29 | # set LOCKDIR=${LIBROOT}/lock | |
36a8c287 | 30 | LOCKDIR=/usr/local/emacs/lock |
86a5659e JB |
31 | |
32 | # This is where build-install should place the binaries people will | |
33 | # want to run directly (like etags and Emacs itself). | |
f8026fd8 | 34 | BINDIR=/usr/local/bin |
86a5659e JB |
35 | |
36 | /bin/sed < src/paths.h-dist > src/paths.h \ | |
f8026fd8 JB |
37 | -e 's;\(#.*PATH_LOADSEARCH\).*$;\1 "'${LISPPATH}'";' \ |
38 | -e 's;\(#.*PATH_EXEC\).*$;\1 "'${LIBDIR}'";' \ | |
39 | -e 's;\(#.*PATH_DATA\).*$;\1 "'${DATADIR}'";' \ | |
40 | -e 's;\(#.*LOCK\).*$;\1 "'${LOCKDIR}'/";' | |
86a5659e JB |
41 | |
42 | (cd lib-src; make) || exit 1 | |
43 | (cd src; make) || exit 1 | |
44 | ||
f8026fd8 | 45 | if [ `pwd` != `(cd ${LIBROOT}; pwd)` ]; then |
86a5659e | 46 | mv `pwd` ${LIBROOT} |
f8026fd8 | 47 | if [ $? != '0' ]; then |
86a5659e JB |
48 | mkdir ${LIBROOT} |
49 | echo mv `pwd` to ${LIBROOT} failed--using tar to copy. | |
50 | tar cf - . | (cd ${LIBROOT}; umask 0; tar xf -) | |
f8026fd8 | 51 | if [ $? != '0' ]; then |
86a5659e JB |
52 | echo tar-copying `pwd` to ${LIBROOT} failed. |
53 | exit 1 | |
f8026fd8 JB |
54 | fi |
55 | fi | |
56 | fi | |
86a5659e | 57 | |
f8026fd8 | 58 | cp ${LIBROOT}/etc/[ce]tags ${BINDIR} |
86a5659e JB |
59 | mv ${LIBROOT}/src/xemacs ${BINDIR}/emacs |
60 | rm ${LIBROOT}/src/temacs | |
f8026fd8 | 61 | chmod 777 ${BINDIR}/[ce]tags ${BINDIR}/emacs |