Commit | Line | Data |
---|---|---|
f7dbcf3c | 1 | #!/bin/sh |
76fb0a58 JB |
2 | |
3 | #### make-dist: create an Emacs distribution tar file from the current | |
1d650ff1 | 4 | #### source tree. This basically creates a duplicate directory |
76fb0a58 JB |
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, | |
7 | #### you should make sure that this script will include it. | |
f7dbcf3c | 8 | |
4c9c1174 KH |
9 | # Copyright (C) 1995 Free Software Foundation, Inc. |
10 | # | |
11 | # This file is part of GNU Emacs. | |
12 | # | |
13 | # GNU Emacs is free software; you can redistribute it and/or modify | |
14 | # it under the terms of the GNU General Public License as published by | |
15 | # the Free Software Foundation; either version 2, or (at your option) | |
16 | # any later version. | |
17 | # | |
18 | # GNU Emacs is distributed in the hope that it will be useful, | |
19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | # GNU General Public License for more details. | |
22 | # | |
23 | # You should have received a copy of the GNU General Public License | |
24 | # along with GNU Emacs; see the file COPYING. If not, write to | |
25 | # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
26 | ||
f7dbcf3c JB |
27 | progname="$0" |
28 | ||
76fb0a58 JB |
29 | ### Exit if a command fails. |
30 | ### set -e | |
f7dbcf3c | 31 | |
76fb0a58 JB |
32 | ### Print out each line we read, for debugging's sake. |
33 | ### set -v | |
f7dbcf3c | 34 | |
f22edcea RS |
35 | clean_up=no |
36 | make_tar=no | |
1260d6ba | 37 | newer="" |
f7dbcf3c JB |
38 | |
39 | while [ $# -gt 0 ]; do | |
40 | case "$1" in | |
f22edcea RS |
41 | ## This option tells make-dist to delete the staging directory |
42 | ## when done. It is useless to use this unless you make a tar file. | |
43 | "--clean-up" ) | |
44 | clean_up=yes | |
4746118a | 45 | ;; |
f22edcea RS |
46 | ## This option tells make-dist to make a tar file. |
47 | "--tar" ) | |
48 | make_tar=yes | |
f7dbcf3c | 49 | ;; |
76fb0a58 | 50 | ## This option tells make-dist to make the distribution normally, then |
7b9cd64c ER |
51 | ## remove all files older than the given timestamp file. This is useful |
52 | ## for creating incremental or patch distributions. | |
1260d6ba | 53 | "--newer") |
ef15f270 JB |
54 | newer="$2" |
55 | new_extension=".new" | |
1260d6ba ER |
56 | shift |
57 | ;; | |
922ac4c5 JB |
58 | ## This option tells make-dist to use `compress' instead of gzip. |
59 | ## Normally, make-dist uses gzip whenever it is present. | |
60 | "--compress") | |
61 | default_gzip="compress" | |
62 | ;; | |
f7dbcf3c JB |
63 | * ) |
64 | echo "${progname}: Unrecognized argument: $1" >&2 | |
65 | exit 1 | |
66 | ;; | |
67 | esac | |
68 | shift | |
69 | done | |
70 | ||
76fb0a58 | 71 | ### Make sure we're running in the right place. |
f7dbcf3c | 72 | if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then |
1260d6ba ER |
73 | echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2 |
74 | echo "${progname} must be run in the top directory of the Emacs" >&2 | |
0d122844 | 75 | echo "distribution tree. cd to that directory and try again." >&2 |
f7dbcf3c JB |
76 | exit 1 |
77 | fi | |
78 | ||
76fb0a58 | 79 | ### Find out which version of Emacs this is. |
0e0186f1 | 80 | shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
47d105b0 | 81 | | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'` |
0e0186f1 RS |
82 | version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
83 | | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` | |
f7dbcf3c | 84 | if [ ! "${version}" ]; then |
21764d60 | 85 | echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2 |
f7dbcf3c JB |
86 | exit 1 |
87 | fi | |
88 | ||
21764d60 | 89 | echo Version numbers are $version and $shortversion |
47d105b0 | 90 | |
0e0186f1 | 91 | if grep -s "GNU Emacs version ${shortversion}" ./man/emacs.texi > /dev/null; then |
f753e9aa JB |
92 | true |
93 | else | |
94 | echo "You must update the version number in \`./man/emacs.texi'" | |
7b7a9d23 | 95 | sleep 5 |
f753e9aa JB |
96 | fi |
97 | ||
bb160193 RS |
98 | ### Make sure we don't already have a directory emacs-${version}. |
99 | ||
100 | emacsname="emacs-${version}${new_extension}" | |
101 | ||
102 | if [ -d ${emacsname} ] | |
103 | then | |
104 | echo Directory "${emacsname}" already exists >&2 | |
105 | exit 1 | |
106 | fi | |
107 | ||
76fb0a58 | 108 | ### Make sure the subdirectory is available. |
1260d6ba | 109 | tempparent="make-dist.tmp.$$" |
f7dbcf3c | 110 | if [ -d ${tempparent} ]; then |
1260d6ba ER |
111 | echo "${progname}: staging directory \`${tempparent}' already exists. |
112 | Perhaps a previous invocation of \`${progname}' failed to clean up after | |
113 | itself. Check that directories whose names are of the form | |
114 | \`make-dist.tmp.NNNNN' don't contain any important information, remove | |
115 | them, and try again." >&2 | |
f7dbcf3c JB |
116 | exit 1 |
117 | fi | |
118 | ||
9f7602fd JB |
119 | ### Check for .elc files with no corresponding .el file. |
120 | ls -1 lisp/*.el | sed 's/\.el$/.elc/' > /tmp/el | |
121 | ls -1 lisp/*.elc > /tmp/elc | |
254e10d8 JB |
122 | bogosities="`comm -13 /tmp/el /tmp/elc`" |
123 | if [ "${bogosities}" != "" ]; then | |
124 | echo "The following .elc files have no corresponding .el files:" | |
125 | echo "${bogosities}" | |
126 | fi | |
8f731fcc | 127 | rm -f /tmp/el /tmp/elc |
9f7602fd | 128 | |
f5674423 | 129 | ### Check for .el files that would overflow the 14-char limit if compiled. |
544174d9 | 130 | long=`find lisp -name '[a-zA-Z0-9]??????????*.el' -print` |
f5674423 KH |
131 | if [ "$long" != "" ]; then |
132 | echo "The following .el file names are too long:" | |
133 | echo "$long" | |
134 | fi | |
135 | ||
b4e84d5d JB |
136 | ### Make sure configure is newer than configure.in. |
137 | if [ "x`ls -t configure configure.in | head -1`" != "xconfigure" ]; then | |
21764d60 KH |
138 | echo "\`./configure.in' is newer than \`./configure'" >&2 |
139 | echo "Running autoconf" >&2 | |
28335560 | 140 | autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; } |
b4e84d5d JB |
141 | fi |
142 | ||
21764d60 | 143 | echo "Updating Info files" |
980ab937 RS |
144 | |
145 | (cd man; make info) | |
146 | ||
21764d60 | 147 | echo "Updating finder-inf.el" |
0588a761 | 148 | |
811b0ac3 | 149 | (cd lisp; ../src/emacs -batch -l finder -f finder-compile-keywords-make-dist) |
21764d60 KH |
150 | |
151 | echo "Recompiling Lisp files" | |
152 | ||
153 | src/emacs -batch -f batch-byte-recompile-directory lisp | |
154 | ||
155 | echo "Updating autoloads" | |
156 | ||
157 | src/emacs -batch -f batch-update-autoloads lisp | |
0588a761 | 158 | |
f07eebe0 KH |
159 | echo "Making lisp/MANIFEST" |
160 | ||
ce200cf3 | 161 | (cd lisp; head -1 [!=]*.el | grep '^;' | sed -e 's/;;; //' > MANIFEST) |
f07eebe0 | 162 | |
1260d6ba | 163 | echo "Creating staging directory: \`${tempparent}'" |
bb160193 | 164 | |
f7dbcf3c | 165 | mkdir ${tempparent} |
f7dbcf3c JB |
166 | tempdir="${tempparent}/${emacsname}" |
167 | ||
76fb0a58 JB |
168 | ### This trap ensures that the staging directory will be cleaned up even |
169 | ### when the script is interrupted in mid-career. | |
00c00348 | 170 | if [ "${clean_up}" = yes ]; then |
21764d60 | 171 | trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15 |
00c00348 ER |
172 | fi |
173 | ||
1260d6ba | 174 | echo "Creating top directory: \`${tempdir}'" |
f7dbcf3c JB |
175 | mkdir ${tempdir} |
176 | ||
76fb0a58 JB |
177 | ### We copy in the top-level files before creating the subdirectories in |
178 | ### hopes that this will make the top-level files appear first in the | |
179 | ### tar file; this means that people can start reading the INSTALL and | |
180 | ### README while the rest of the tar file is still unpacking. Whoopee. | |
21764d60 | 181 | echo "Making links to top-level files" |
525336b7 | 182 | ln GETTING.GNU.SOFTWARE INSTALL PROBLEMS README BUGS move-if-change ${tempdir} |
ac4eff2d | 183 | ln ChangeLog Makefile.in configure configure.in ${tempdir} |
6f8b09f3 | 184 | ln config.bat make-dist update-subdirs vpath.sed ${tempdir} |
bb160193 | 185 | ### Copy these files; they're cross-filesystem symlinks. |
a4888c88 | 186 | cp mkinstalldirs ${tempdir} |
76fb0a58 | 187 | cp config.sub ${tempdir} |
2ed56345 | 188 | cp config.guess ${tempdir} |
bb160193 | 189 | cp install.sh ${tempdir} |
f7dbcf3c | 190 | |
21764d60 | 191 | echo "Updating version number in README" |
f753e9aa JB |
192 | (cd ${tempdir} |
193 | awk \ | |
194 | '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 } | |
195 | $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \ | |
196 | version=${version} README > tmp.README | |
197 | mv tmp.README README) | |
198 | ||
199 | ||
21764d60 | 200 | echo "Creating subdirectories" |
82a82d48 | 201 | for subdir in lisp lisp/term site-lisp \ |
c660c0a7 | 202 | src src/m src/s src/bitmaps lib-src oldXMenu lwlib \ |
e827bc37 | 203 | nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet \ |
8e583b5d | 204 | etc etc/e lock cpp info man msdos vms; do |
f7dbcf3c JB |
205 | mkdir ${tempdir}/${subdir} |
206 | done | |
207 | ||
21764d60 | 208 | echo "Making links to \`lisp'" |
7b9cd64c | 209 | ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el. |
f7dbcf3c JB |
210 | (cd lisp |
211 | ln [a-zA-Z]*.el ../${tempdir}/lisp | |
212 | ln [a-zA-Z]*.elc ../${tempdir}/lisp | |
8d2197ac | 213 | ln [a-zA-Z]*.dat ../${tempdir}/lisp |
76fb0a58 JB |
214 | ## simula.el doesn't keep abbreviations in simula.defns any more. |
215 | ## ln [a-zA-Z]*.defns ../${tempdir}/lisp | |
3f7b30bf | 216 | ln ChangeLog Makefile makefile.nt ChangeLog.? README ../${tempdir}/lisp |
f7dbcf3c | 217 | cd ../${tempdir}/lisp |
7b9cd64c | 218 | rm -f TAGS =* |
db1e13f0 | 219 | rm -f subdirs.el |
f7dbcf3c | 220 | rm -f site-init site-init.el site-init.elc |
ef15f270 | 221 | rm -f site-load site-load.el site-load.elc |
da0e2548 | 222 | rm -f site-start site-start.el site-start.elc |
ef15f270 | 223 | rm -f default default.el default.elc) |
f7dbcf3c | 224 | |
21764d60 | 225 | #echo "Making links to \`lisp/calc-2.02'" |
56c31c87 RS |
226 | #### Don't distribute =*.el files, TAGS or backups. |
227 | #(cd lisp/calc-2.02 | |
228 | # ln [a-zA-Z]*.el ../../${tempdir}/lisp/calc-2.02 | |
229 | # ln [a-zA-Z]*.elc ../../${tempdir}/lisp/calc-2.02 | |
230 | # ln calc.info* calc.texinfo calc-refcard.* ../../${tempdir}/lisp/calc-2.02 | |
231 | # ln INSTALL Makefile README README.prev ../../${tempdir}/lisp/calc-2.02 | |
232 | # cd ../../${tempdir}/lisp/calc-2.02 | |
233 | # rm -f *~ TAGS) | |
fda4e8f6 | 234 | |
21764d60 | 235 | echo "Making links to \`lisp/term'" |
7b9cd64c | 236 | ### Don't distribute =*.el files or TAGS. |
f7dbcf3c JB |
237 | (cd lisp/term |
238 | ln [a-zA-Z]*.el ../../${tempdir}/lisp/term | |
239 | ln [a-zA-Z]*.elc ../../${tempdir}/lisp/term | |
3e1fc5a7 | 240 | ln README ../../${tempdir}/lisp/term |
7b9cd64c | 241 | rm -f =* TAGS) |
f7dbcf3c | 242 | |
21764d60 | 243 | echo "Making links to \`src'" |
76fb0a58 | 244 | ### Don't distribute =*.[ch] files, or the configured versions of |
c3f1e1a9 | 245 | ### config.in, paths.in, or Makefile.in, or TAGS. |
f7dbcf3c | 246 | (cd src |
76fb0a58 | 247 | echo " (If we can't link gmalloc.c, that's okay.)" |
f7dbcf3c | 248 | ln [a-zA-Z]*.c ../${tempdir}/src |
76fb0a58 | 249 | ## Might be a symlink to a file on another filesystem. |
39d6eb8e | 250 | test -f ../${tempdir}/src/gmalloc.c || cp gmalloc.c ../${tempdir}/src |
f7dbcf3c JB |
251 | ln [a-zA-Z]*.h ../${tempdir}/src |
252 | ln [a-zA-Z]*.s ../${tempdir}/src | |
c3f1e1a9 | 253 | ln README Makefile.in ChangeLog ChangeLog.? config.in paths.in \ |
f7dbcf3c | 254 | ../${tempdir}/src |
7355fc33 | 255 | ln makefile.nt ../${tempdir}/src |
990ee059 | 256 | ln .gdbinit .dbxinit ../${tempdir}/src |
6f95b621 | 257 | ln *.opt vms-pp.trans ../${tempdir}/src |
f7dbcf3c | 258 | cd ../${tempdir}/src |
a6903f09 | 259 | rm -f config.h paths.h Makefile Makefile.c |
7b9cd64c | 260 | rm -f =* TAGS) |
f7dbcf3c | 261 | |
21764d60 | 262 | echo "Making links to \`src/bitmaps'" |
690eca32 JB |
263 | (cd src/bitmaps |
264 | ln README *.xbm ../../${tempdir}/src/bitmaps) | |
265 | ||
21764d60 | 266 | echo "Making links to \`src/m'" |
f7dbcf3c | 267 | (cd src/m |
facbb78e RS |
268 | # We call files for miscellaneous input (to linker etc) .inp. |
269 | ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m) | |
f7dbcf3c | 270 | |
21764d60 | 271 | echo "Making links to \`src/s'" |
f7dbcf3c | 272 | (cd src/s |
77427171 | 273 | ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s) |
f7dbcf3c | 274 | |
21764d60 | 275 | echo "Making links to \`lib-src'" |
f7dbcf3c | 276 | (cd lib-src |
375f1bd7 | 277 | ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src |
c3f1e1a9 | 278 | ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src |
391b3748 | 279 | ln emacs.csh rcs2log rcs-checkin makefile.nt ../${tempdir}/lib-src |
1260d6ba | 280 | cd ../${tempdir}/lib-src |
a6903f09 | 281 | rm -f getdate.tab.c y.tab.c y.tab.h Makefile.c |
7b9cd64c | 282 | rm -f =* TAGS) |
f7dbcf3c | 283 | |
21764d60 | 284 | echo "Making links to \`nt'" |
391b3748 | 285 | (cd nt |
e827bc37 | 286 | ln emacs.ico emacs.rc config.nt [a-z]*.in [a-z]*.c ../${tempdir}/nt |
b47cc08a | 287 | ln [a-z]*.bat [a-z]*.h makefile.def makefile.nt ../${tempdir}/nt |
3bb3cfe7 | 288 | ln TODO ChangeLog INSTALL README ../${tempdir}/nt) |
391b3748 | 289 | |
21764d60 | 290 | echo "Making links to \`nt/inc'" |
391b3748 | 291 | (cd nt/inc |
77427171 | 292 | ln [a-z]*.h ../../${tempdir}/nt/inc) |
391b3748 | 293 | |
21764d60 | 294 | echo "Making links to \`nt/inc/sys'" |
391b3748 | 295 | (cd nt/inc/sys |
77427171 | 296 | ln [a-z]*.h ../../../${tempdir}/nt/inc/sys) |
391b3748 | 297 | |
e827bc37 RS |
298 | echo "Making links to \`nt/inc/arpa'" |
299 | (cd nt/inc/arpa | |
300 | ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa) | |
301 | ||
302 | echo "Making links to \`nt/inc/netinet'" | |
303 | (cd nt/inc/netinet | |
304 | ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet) | |
305 | ||
21764d60 | 306 | echo "Making links to \`msdos'" |
52d7b2e5 RS |
307 | (cd msdos |
308 | ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos | |
ae57f69d | 309 | ln mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos |
52d7b2e5 RS |
310 | cd ../${tempdir}/msdos |
311 | rm -f =*) | |
312 | ||
21764d60 | 313 | echo "Making links to \`oldXMenu'" |
f7dbcf3c | 314 | (cd oldXMenu |
8bdbf9ed | 315 | ln *.c *.h *.in ../${tempdir}/oldXMenu |
df1ec566 | 316 | ln README Imakefile ChangeLog ../${tempdir}/oldXMenu |
f395c83a | 317 | ln compile.com descrip.mms ../${tempdir}/oldXMenu) |
f7dbcf3c | 318 | |
21764d60 | 319 | echo "Making links to \`lwlib'" |
c660c0a7 RS |
320 | (cd lwlib |
321 | ln *.c *.h *.in ../${tempdir}/lwlib | |
72e7e784 KH |
322 | ln README Imakefile ChangeLog ../${tempdir}/lwlib |
323 | cd ../${tempdir}/lwlib | |
324 | rm -f lwlib-Xol*) | |
c660c0a7 | 325 | |
21764d60 | 326 | echo "Making links to \`etc'" |
f395c83a JB |
327 | ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or |
328 | ### tex litter. | |
f7dbcf3c | 329 | (cd etc |
375f1bd7 | 330 | ln `ls -d * | grep -v 'RCS' | grep -v 'Old' | grep -v '^e$'` ../${tempdir}/etc |
f7dbcf3c | 331 | cd ../${tempdir}/etc |
23a58692 | 332 | rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core |
f395c83a | 333 | rm -f TAGS) |
f7dbcf3c | 334 | |
21764d60 | 335 | echo "Making links to \`etc/e'" |
f08ad882 | 336 | (cd etc/e |
375f1bd7 | 337 | ln `ls -d * | grep -v 'RCS'` ../../${tempdir}/etc/e |
a6903f09 | 338 | cd ../../${tempdir}/etc/e |
375f1bd7 | 339 | rm -f *~ \#*\# *,v =* core) |
f08ad882 | 340 | |
21764d60 | 341 | echo "Making links to \`cpp'" |
fda4e8f6 JB |
342 | (cd cpp |
343 | ln cccp.c cexp.y Makefile README ../${tempdir}/cpp) | |
344 | ||
21764d60 | 345 | echo "Making links to \`info'" |
66afa119 RS |
346 | # Don't distribute backups or autosaves. |
347 | (cd info | |
348 | ln [a-zA-Z]* ../${tempdir}/info | |
349 | cd ../${tempdir}/info | |
350 | # Avoid an error when expanding the wildcards later. | |
351 | ln emacs dummy~ ; ln emacs \#dummy\# | |
352 | rm -f *~ \#*\# core) | |
fda4e8f6 | 353 | |
21764d60 | 354 | echo "Making links to \`man'" |
fda4e8f6 | 355 | (cd man |
298c8970 | 356 | ln *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man |
5e808bc0 | 357 | test -f README && ln README ../${tempdir}/man |
f08ad882 | 358 | test -f Makefile.in && ln Makefile.in ../${tempdir}/man |
56c31c87 | 359 | ln ChangeLog split-man ../${tempdir}/man |
375f1bd7 | 360 | cp texinfo.tex ../${tempdir}/man |
4f8cc93a | 361 | cd ../${tempdir}/man |
56c31c87 RS |
362 | rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail |
363 | rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux) | |
f7dbcf3c | 364 | |
21764d60 | 365 | echo "Making links to \`vms'" |
40eef465 JB |
366 | (cd vms |
367 | ln [0-9a-zA-Z]* ../${tempdir}/vms | |
368 | cd ../${tempdir}/vms | |
369 | rm -f *~) | |
370 | ||
c87b230f JB |
371 | ### It would be nice if they could all be symlinks to etc's copy, but |
372 | ### you're not supposed to have any symlinks in distribution tar files. | |
21764d60 | 373 | echo "Making sure copying notices are all copies of \`etc/COPYING'" |
1260d6ba ER |
374 | rm -f ${tempdir}/etc/COPYING |
375 | cp etc/COPYING ${tempdir}/etc/COPYING | |
8e583b5d | 376 | for subdir in lisp src lib-src info msdos; do |
f7dbcf3c JB |
377 | if [ -f ${tempdir}/${subdir}/COPYING ]; then |
378 | rm ${tempdir}/${subdir}/COPYING | |
379 | fi | |
96858c42 | 380 | cp etc/COPYING ${tempdir}/${subdir} |
f7dbcf3c JB |
381 | done |
382 | ||
5b8def65 JB |
383 | #### Make sure that there aren't any hard links between files in the |
384 | #### distribution; people with afs can't deal with that. Okay, | |
385 | #### actually we just re-copy anything with a link count greater | |
375f1bd7 KH |
386 | #### than two. (Yes, strictly greater than 2 is correct; since we |
387 | #### created these files by linking them in from the original tree, | |
388 | #### they'll have exactly two links normally.) | |
bb7e0f81 | 389 | #### |
908ff139 | 390 | #### Commented out since it's not strictly necessary; it should suffice |
bb7e0f81 | 391 | #### to just break the link on alloca.c. |
9b23a6c7 RS |
392 | #echo "Breaking intra-tree links." |
393 | #find ${tempdir} ! -type d -links +2 \ | |
394 | # -exec cp -p {} $$ \; -exec rm -f {} \; -exec mv $$ {} \; | |
bb7e0f81 KH |
395 | rm -f $tempdir/lib-src/alloca.c |
396 | cp $tempdir/src/alloca.c $tempdir/lib-src/alloca.c | |
5b8def65 | 397 | |
1260d6ba | 398 | if [ "${newer}" ]; then |
21764d60 | 399 | echo "Removing files older than $newer" |
76fb0a58 JB |
400 | ## We remove .elc files unconditionally, on the theory that anyone picking |
401 | ## up an incremental distribution already has a running Emacs to byte-compile | |
402 | ## them with. | |
1260d6ba ER |
403 | find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; |
404 | fi | |
405 | ||
4746118a | 406 | if [ "${make_tar}" = yes ]; then |
922ac4c5 | 407 | if [ "${default_gzip}" = "" ]; then |
21764d60 | 408 | echo "Looking for gzip" |
922ac4c5 JB |
409 | temppath=`echo $PATH | sed 's/^:/.:/ |
410 | s/::/:.:/g | |
411 | s/:$/:./ | |
412 | s/:/ /g'` | |
413 | default_gzip=`( | |
414 | for dir in ${temppath}; do | |
415 | if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi | |
416 | done | |
417 | echo compress | |
418 | )` | |
419 | fi | |
f395c83a JB |
420 | case "${default_gzip}" in |
421 | compress* ) gzip_extension=.Z ;; | |
0dc610dd | 422 | * ) gzip_extension=.gz ;; |
f395c83a | 423 | esac |
21764d60 | 424 | echo "Creating tar file" |
f395c83a JB |
425 | (cd ${tempparent} ; tar cvf - ${emacsname} ) \ |
426 | | ${default_gzip} \ | |
427 | > ${emacsname}.tar${gzip_extension} | |
4746118a | 428 | fi |
f7dbcf3c | 429 | |
4746118a | 430 | if [ "${clean_up}" = yes ]; then |
21764d60 | 431 | echo "Cleaning up the staging directory" |
f395c83a | 432 | rm -rf ${tempparent} |
bb160193 RS |
433 | else |
434 | (cd ${tempparent}; mv ${emacsname} ..) | |
435 | rm -rf ${tempparent} | |
f7dbcf3c | 436 | fi |
00c00348 | 437 | |
76fb0a58 | 438 | ### make-dist ends here |