aboutsummaryrefslogtreecommitdiffstats
path: root/make-dist
diff options
context:
space:
mode:
authorJim Blandy1992-11-20 17:08:05 +0000
committerJim Blandy1992-11-20 17:08:05 +0000
commit76fb0a58b27db5dbcade1ec72b136dd064ac7ae6 (patch)
tree58f227fa571e7fd8c0dd3c8e7177cc9be3029f57 /make-dist
parentc809458b5564ffc0249ede48342b474865c4da4a (diff)
downloademacs-76fb0a58b27db5dbcade1ec72b136dd064ac7ae6.tar.gz
emacs-76fb0a58b27db5dbcade1ec72b136dd064ac7ae6.zip
* make-dist: Explain what's going on if config.sub and gmalloc.c
can't be linked. Place the code which copies them near the code which links the rest of the files around them.
Diffstat (limited to 'make-dist')
-rwxr-xr-xmake-dist146
1 files changed, 71 insertions, 75 deletions
diff --git a/make-dist b/make-dist
index 2ed61a3914f..5b7959e2c21 100755
--- a/make-dist
+++ b/make-dist
@@ -1,18 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2# 2
3# make-dist: create an Emacs distribution tar file from the current 3#### make-dist: create an Emacs distribution tar file from the current
4# source tree. This basically creates a duplicate directory 4#### source tree. This basically creates a duplicate directory
5# structure, and then hard links into it only those files that should 5#### structure, and then hard links into it only those files that should
6# be distributed. This means that if you add a file with an odd name, 6#### be distributed. This means that if you add a file with an odd name,
7# you should make sure that this script will include it. 7#### you should make sure that this script will include it.
8 8
9progname="$0" 9progname="$0"
10 10
11# Exit if a command fails. 11### Exit if a command fails.
12# set -e 12### set -e
13 13
14# Print out each line we read, for debugging's sake. 14### Print out each line we read, for debugging's sake.
15# set -v 15### set -v
16 16
17clean_up=yes 17clean_up=yes
18make_tar=yes 18make_tar=yes
@@ -20,21 +20,21 @@ newer=""
20 20
21while [ $# -gt 0 ]; do 21while [ $# -gt 0 ]; do
22 case "$1" in 22 case "$1" in
23 # This option tells make-dist not to delete the staging directory 23 ## This option tells make-dist not to delete the staging directory
24 # after it's done making the tar file. 24 ## after it's done making the tar file.
25 "--no-clean-up" ) 25 "--no-clean-up" )
26 clean_up=no 26 clean_up=no
27 ;; 27 ;;
28 # This option tells make-dist not to make a tar file. Since it's 28 ## This option tells make-dist not to make a tar file. Since it's
29 # rather pointless to build the whole staging directory and then 29 ## rather pointless to build the whole staging directory and then
30 # nuke it, using this option also selects '--no-clean-up'. 30 ## nuke it, using this option also selects '--no-clean-up'.
31 "--no-tar" ) 31 "--no-tar" )
32 make_tar=no 32 make_tar=no
33 clean_up=no 33 clean_up=no
34 ;; 34 ;;
35 # This option tells make-dist to make the distribution normally, then 35 ## This option tells make-dist to make the distribution normally, then
36 # remove all files newer than the given timestamp file. This is useful 36 ## remove all files newer than the given timestamp file. This is useful
37 # for creating incremental or patch distributions 37 ## for creating incremental or patch distributions
38 "--newer") 38 "--newer")
39 newer="$2" 39 newer="$2"
40 new_extension=".new" 40 new_extension=".new"
@@ -48,7 +48,7 @@ while [ $# -gt 0 ]; do
48 shift 48 shift
49done 49done
50 50
51# Make sure we're running in the right place. 51### Make sure we're running in the right place.
52if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then 52if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
53 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2 53 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2
54 echo "${progname} must be run in the top directory of the Emacs" >&2 54 echo "${progname} must be run in the top directory of the Emacs" >&2
@@ -56,7 +56,7 @@ if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
56 exit 1 56 exit 1
57fi 57fi
58 58
59# Find out which version of Emacs this is. 59### Find out which version of Emacs this is.
60version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ 60version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
61 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'` 61 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\)\..*$/\1/'`
62if [ ! "${version}" ]; then 62if [ ! "${version}" ]; then
@@ -64,7 +64,7 @@ if [ ! "${version}" ]; then
64 exit 1 64 exit 1
65fi 65fi
66 66
67# Make sure the subdirectory is available. 67### Make sure the subdirectory is available.
68tempparent="make-dist.tmp.$$" 68tempparent="make-dist.tmp.$$"
69if [ -d ${tempparent} ]; then 69if [ -d ${tempparent} ]; then
70 echo "${progname}: staging directory \`${tempparent}' already exists. 70 echo "${progname}: staging directory \`${tempparent}' already exists.
@@ -80,8 +80,8 @@ mkdir ${tempparent}
80emacsname="emacs-${version}${new_extension}" 80emacsname="emacs-${version}${new_extension}"
81tempdir="${tempparent}/${emacsname}" 81tempdir="${tempparent}/${emacsname}"
82 82
83# This trap ensures that the staging directory will be cleaned up even 83### This trap ensures that the staging directory will be cleaned up even
84# when the script is interrupted in mid-career. 84### when the script is interrupted in mid-career.
85if [ "${clean_up}" = yes ]; then 85if [ "${clean_up}" = yes ]; then
86 trap "echo 'Interrupted...cleaning up the staging directory.'; rm -rf ${tempparent}; exit 1" 1 2 15 86 trap "echo 'Interrupted...cleaning up the staging directory.'; rm -rf ${tempparent}; exit 1" 1 2 15
87fi 87fi
@@ -89,14 +89,22 @@ fi
89echo "Creating top directory: \`${tempdir}'" 89echo "Creating top directory: \`${tempdir}'"
90mkdir ${tempdir} 90mkdir ${tempdir}
91 91
92# We copy in the top-level files before creating the subdirectories in 92echo
93# hopes that this will make the top-level files appear first in the 93
94# tar file; this means that people can start reading the INSTALL and 94echo "Don't worry if `ln' complains that it can't make
95# README while the rest of the tar file is still unpacking. Whoopee. 95echo "cross-filesystem links for these files; we take care of them
96echo "later.
97
98### We copy in the top-level files before creating the subdirectories in
99### hopes that this will make the top-level files appear first in the
100### tar file; this means that people can start reading the INSTALL and
101### README while the rest of the tar file is still unpacking. Whoopee.
96echo "Making links to top-level files." 102echo "Making links to top-level files."
97ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README move-if-change ${tempdir} 103ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README move-if-change ${tempdir}
98ln ChangeLog Makefile.in build-install.in configure config.sub ${tempdir} 104ln ChangeLog Makefile.in build-install.in configure ${tempdir}
99ln make-dist ${tempdir} 105ln make-dist ${tempdir}
106### Copy config.sub; it's a cross-filesystem symlink.
107cp config.sub ${tempdir}
100 108
101echo "Creating subdirectories." 109echo "Creating subdirectories."
102for subdir in lisp lisp/term local-lisp external-lisp \ 110for subdir in lisp lisp/term local-lisp external-lisp \
@@ -106,12 +114,12 @@ for subdir in lisp lisp/term local-lisp external-lisp \
106done 114done
107 115
108echo "Making links to \`lisp'." 116echo "Making links to \`lisp'."
109# Don't distribute =*.el files, site-init.el, site-load.el, or default.el. 117### Don't distribute =*.el files, site-init.el, site-load.el, or default.el.
110(cd lisp 118(cd lisp
111 ln [a-zA-Z]*.el ../${tempdir}/lisp 119 ln [a-zA-Z]*.el ../${tempdir}/lisp
112 ln [a-zA-Z]*.elc ../${tempdir}/lisp 120 ln [a-zA-Z]*.elc ../${tempdir}/lisp
113 # simula.el doesn't keep abbreviations in simula.defns any more. 121 ## simula.el doesn't keep abbreviations in simula.defns any more.
114 # ln [a-zA-Z]*.defns ../${tempdir}/lisp 122 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp
115 ln ChangeLog README ../${tempdir}/lisp 123 ln ChangeLog README ../${tempdir}/lisp
116 cd ../${tempdir}/lisp 124 cd ../${tempdir}/lisp
117 rm -f site-init site-init.el site-init.elc 125 rm -f site-init site-init.el site-init.elc
@@ -119,24 +127,27 @@ echo "Making links to \`lisp'."
119 rm -f default default.el default.elc) 127 rm -f default default.el default.elc)
120 128
121echo "Making links to \`lisp/term'." 129echo "Making links to \`lisp/term'."
122# Don't distribute =*.el files. 130### Don't distribute =*.el files.
123(cd lisp/term 131(cd lisp/term
124 ln [a-zA-Z]*.el ../../${tempdir}/lisp/term 132 ln [a-zA-Z]*.el ../../${tempdir}/lisp/term
125 ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term 133 ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term
126 ln README ../../${tempdir}/lisp/term) 134 ln README ../../${tempdir}/lisp/term)
127 135
128echo "Making links to \`external-lisp'." 136echo "Making links to \`external-lisp'."
129# Don't distribute =*.el files. 137### Don't distribute =*.el files.
130(cd external-lisp 138(cd external-lisp
131 ln [a-zA-Z]*.el ../${tempdir}/external-lisp 139 ln [a-zA-Z]*.el ../${tempdir}/external-lisp
132 ln [a-zA-Z]*.elc ../${tempdir}/external-lisp 140 ln [a-zA-Z]*.elc ../${tempdir}/external-lisp
133 ln ChangeLog README ../${tempdir}/external-lisp) 141 ln ChangeLog README ../${tempdir}/external-lisp)
134 142
135echo "Making links to \`src'." 143echo "Making links to \`src'."
136# Don't distribute =*.[ch] files, or the configured versions of 144### Don't distribute =*.[ch] files, or the configured versions of
137# config.h.in, paths.h.in, or Makefile.in. 145### config.h.in, paths.h.in, or Makefile.in.
138(cd src 146(cd src
147 echo " (If we can't link gmalloc.c, that's okay.)"
139 ln [a-zA-Z]*.c ../${tempdir}/src 148 ln [a-zA-Z]*.c ../${tempdir}/src
149 ## Might be a symlink to a file on another filesystem.
150 cp gmalloc.c ../${tempdir}/src
140 ln [a-zA-Z]*.h ../${tempdir}/src 151 ln [a-zA-Z]*.h ../${tempdir}/src
141 ln [a-zA-Z]*.s ../${tempdir}/src 152 ln [a-zA-Z]*.s ../${tempdir}/src
142 ln README Makefile.in ymakefile ChangeLog config.h.in paths.h.in \ 153 ln README Makefile.in ymakefile ChangeLog config.h.in paths.h.in \
@@ -171,35 +182,35 @@ echo "Making links to \`oldXMenu'."
171 ln README Makefile Imakefile ChangeLog ../${tempdir}/oldXMenu) 182 ln README Makefile Imakefile ChangeLog ../${tempdir}/oldXMenu)
172 183
173echo "Making links to \`etc'." 184echo "Making links to \`etc'."
174# Don't distribute DOC files, backups, autosaves, or tex litter. 185### Don't distribute DOC files, backups, autosaves, or tex litter.
175(cd etc 186(cd etc
176 ln [0-9a-zA-Z]* ../${tempdir}/etc 187 ln [0-9a-zA-Z]* ../${tempdir}/etc
177 cd ../${tempdir}/etc 188 cd ../${tempdir}/etc
178 # Avoid an error when expanding the wildcards later. 189 ## Avoid an error when expanding the wildcards later.
179 for dummy in DOC-dummy dummy~ \#dummy\# dummy.dvi dummy.log; do 190 for dummy in DOC-dummy dummy~ \#dummy\# dummy.dvi dummy.log; do
180 ln MACHINES ${dummy} 191 ln MACHINES ${dummy}
181 done 192 done
182 rm -f DOC* *~ \#*\# *.dvi *.log core) 193 rm -f DOC* *~ \#*\# *.dvi *.log core)
183 194
184# For now, we comment these out, since I'm not changing them any. 195### For now, we comment these out, since I'm not changing them any.
185#!! echo "Making links to \`cpp'." 196###!! echo "Making links to \`cpp'."
186#!! (cd cpp 197###!! (cd cpp
187#!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp) 198###!! ln cccp.c cexp.y Makefile README ../${tempdir}/cpp)
188#!! 199###!!
189#!! echo "Making links to \`info'." 200###!! echo "Making links to \`info'."
190#!! # Don't distribute backups or autosaves. 201###!! # Don't distribute backups or autosaves.
191#!! (cd info 202###!! (cd info
192#!! ln [a-zA-Z]* ../${tempdir}/info 203###!! ln [a-zA-Z]* ../${tempdir}/info
193#!! cd ../${tempdir}/info 204###!! cd ../${tempdir}/info
194#!! # Avoid an error when expanding the wildcards later. 205###!! # Avoid an error when expanding the wildcards later.
195#!! ln emacs dummy~ ; ln emacs \#dummy\# 206###!! ln emacs dummy~ ; ln emacs \#dummy\#
196#!! rm -f *~ \#*\# core) 207###!! rm -f *~ \#*\# core)
197#!! 208###!!
198#!! echo "Making links to \`man'." 209###!! echo "Making links to \`man'."
199#!! (cd man 210###!! (cd man
200#!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man 211###!! ln *.tex *.texinfo *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man
201#!! ln *.c ../${tempdir}/man 212###!! ln *.c ../${tempdir}/man
202#!! ln ChangeLog Makefile README split-man ../${tempdir}/man) 213###!! ln ChangeLog Makefile README split-man ../${tempdir}/man)
203 214
204echo "Making links to \`shortnames'." 215echo "Making links to \`shortnames'."
205(cd shortnames 216(cd shortnames
@@ -212,21 +223,6 @@ echo "Making links to \`vms'."
212 cd ../${tempdir}/vms 223 cd ../${tempdir}/vms
213 rm -f *~) 224 rm -f *~)
214 225
215### On the GNU machines, these files are symbolic links to files on
216### another device, meaning that we can't make hard links to them in
217### the staging directory. I can't think of a better solution, so I
218### just have a special kludge here which knows exactly which files
219### this might happen to and copies them if they don't seem to have
220### been linked.
221echo "Making sure we got all the files that may be cross-device"
222echo "symbolic links."
223for file in ./config.sub ./src/gmalloc.c ; do
224 if [ ! -f ${tempdir}/${file} ] ; then
225 echo " \`${file}' was missed; copying it."
226 cp ${file} ${tempdir}/${file}
227 fi
228done
229
230echo "Making sure copying notices are all symlinks to \`etc/COPYING'." 226echo "Making sure copying notices are all symlinks to \`etc/COPYING'."
231rm -f ${tempdir}/etc/COPYING 227rm -f ${tempdir}/etc/COPYING
232cp etc/COPYING ${tempdir}/etc/COPYING 228cp etc/COPYING ${tempdir}/etc/COPYING
@@ -239,9 +235,9 @@ done
239 235
240if [ "${newer}" ]; then 236if [ "${newer}" ]; then
241 echo "Removing files older than $newer." 237 echo "Removing files older than $newer."
242 # We remove .elc files unconditionally, on the theory that anyone picking 238 ## We remove .elc files unconditionally, on the theory that anyone picking
243 # up an incremental distribution already has a running Emacs to byte-compile 239 ## up an incremental distribution already has a running Emacs to byte-compile
244 # them with. 240 ## them with.
245 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; 241 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \;
246fi 242fi
247 243
@@ -255,4 +251,4 @@ if [ "${clean_up}" = yes ]; then
255 rm -rf ${tempparent} 251 rm -rf ${tempparent}
256fi 252fi
257 253
258# make-dist ends here 254### make-dist ends here