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 | |
e4e1c623 | 9 | # Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc. |
4c9c1174 KH |
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 | |
1fb87c77 KH |
24 | # along with GNU Emacs; see the file COPYING. If not, write to the |
25 | # Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
26 | # Boston, MA 02111-1307, USA. | |
4c9c1174 | 27 | |
f7dbcf3c JB |
28 | progname="$0" |
29 | ||
76fb0a58 JB |
30 | ### Exit if a command fails. |
31 | ### set -e | |
f7dbcf3c | 32 | |
76fb0a58 JB |
33 | ### Print out each line we read, for debugging's sake. |
34 | ### set -v | |
f7dbcf3c | 35 | |
ccd57f4d | 36 | ## Don't restrict access to any files. |
67ffab69 RS |
37 | umask 0 |
38 | ||
c75cfabd | 39 | update=yes |
e4e1c623 | 40 | check=yes |
f22edcea RS |
41 | clean_up=no |
42 | make_tar=no | |
1260d6ba | 43 | newer="" |
f7dbcf3c JB |
44 | |
45 | while [ $# -gt 0 ]; do | |
46 | case "$1" in | |
f22edcea RS |
47 | ## This option tells make-dist to delete the staging directory |
48 | ## when done. It is useless to use this unless you make a tar file. | |
49 | "--clean-up" ) | |
50 | clean_up=yes | |
4746118a | 51 | ;; |
f22edcea RS |
52 | ## This option tells make-dist to make a tar file. |
53 | "--tar" ) | |
54 | make_tar=yes | |
f7dbcf3c | 55 | ;; |
c75cfabd RS |
56 | ## This option tells make-dist not to recompile or do analogous things. |
57 | "--no-update" ) | |
58 | update=no | |
59 | ;; | |
e4e1c623 RS |
60 | ## This option says don't check for bad file names, etc. |
61 | "--no-check" ) | |
62 | check=no | |
63 | ;; | |
76fb0a58 | 64 | ## This option tells make-dist to make the distribution normally, then |
7b9cd64c ER |
65 | ## remove all files older than the given timestamp file. This is useful |
66 | ## for creating incremental or patch distributions. | |
1260d6ba | 67 | "--newer") |
ef15f270 JB |
68 | newer="$2" |
69 | new_extension=".new" | |
1260d6ba ER |
70 | shift |
71 | ;; | |
922ac4c5 JB |
72 | ## This option tells make-dist to use `compress' instead of gzip. |
73 | ## Normally, make-dist uses gzip whenever it is present. | |
74 | "--compress") | |
75 | default_gzip="compress" | |
76 | ;; | |
f7dbcf3c JB |
77 | * ) |
78 | echo "${progname}: Unrecognized argument: $1" >&2 | |
79 | exit 1 | |
80 | ;; | |
81 | esac | |
82 | shift | |
83 | done | |
84 | ||
76fb0a58 | 85 | ### Make sure we're running in the right place. |
f7dbcf3c | 86 | if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then |
1260d6ba ER |
87 | echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2 |
88 | echo "${progname} must be run in the top directory of the Emacs" >&2 | |
0d122844 | 89 | echo "distribution tree. cd to that directory and try again." >&2 |
f7dbcf3c JB |
90 | exit 1 |
91 | fi | |
92 | ||
c75cfabd | 93 | ### Find where to run Emacs. |
fcea5346 KH |
94 | ### (We don't accept EMACS=t as an answer, since that probably only means |
95 | ### that the shell is running in an Emacs window.) | |
c75cfabd RS |
96 | if [ $update = yes ]; |
97 | then | |
98 | if [ -f src/emacs ]; | |
99 | then | |
100 | EMACS=`pwd`/src/emacs | |
101 | else | |
fcea5346 | 102 | if [ "x$EMACS" = "x" -o "x$EMACS" = "xt" ]; |
c75cfabd RS |
103 | then |
104 | echo You must specify the EMACS environment variable 2>&1 | |
105 | exit 1 | |
106 | fi | |
107 | fi | |
108 | fi | |
109 | ||
76fb0a58 | 110 | ### Find out which version of Emacs this is. |
0e0186f1 | 111 | shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
47d105b0 | 112 | | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'` |
0e0186f1 RS |
113 | version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
114 | | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` | |
f7dbcf3c | 115 | if [ ! "${version}" ]; then |
21764d60 | 116 | echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2 |
f7dbcf3c JB |
117 | exit 1 |
118 | fi | |
119 | ||
21764d60 | 120 | echo Version numbers are $version and $shortversion |
47d105b0 | 121 | |
c75cfabd RS |
122 | if [ $update = yes ]; |
123 | then | |
124 | if grep -s "GNU Emacs version ${shortversion}" ./man/emacs.texi > /dev/null; then | |
125 | true | |
126 | else | |
127 | echo "You must update the version number in \`./man/emacs.texi'" | |
128 | sleep 5 | |
129 | fi | |
f753e9aa JB |
130 | fi |
131 | ||
bb160193 RS |
132 | ### Make sure we don't already have a directory emacs-${version}. |
133 | ||
134 | emacsname="emacs-${version}${new_extension}" | |
135 | ||
136 | if [ -d ${emacsname} ] | |
137 | then | |
138 | echo Directory "${emacsname}" already exists >&2 | |
139 | exit 1 | |
140 | fi | |
141 | ||
76fb0a58 | 142 | ### Make sure the subdirectory is available. |
1260d6ba | 143 | tempparent="make-dist.tmp.$$" |
f7dbcf3c | 144 | if [ -d ${tempparent} ]; then |
1260d6ba ER |
145 | echo "${progname}: staging directory \`${tempparent}' already exists. |
146 | Perhaps a previous invocation of \`${progname}' failed to clean up after | |
147 | itself. Check that directories whose names are of the form | |
148 | \`make-dist.tmp.NNNNN' don't contain any important information, remove | |
149 | them, and try again." >&2 | |
f7dbcf3c JB |
150 | exit 1 |
151 | fi | |
152 | ||
e4e1c623 RS |
153 | ### Find where to run Emacs. |
154 | if [ $check = yes ]; | |
155 | then | |
156 | ### Check for .elc files with no corresponding .el file. | |
157 | ls -1 lisp/[a-z]*.el lisp/[a-z]*/[a-z]*.el \ | |
158 | leim/[a-z]*.el leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el | |
159 | ls -1 lisp/[a-z]*.elc lisp/[a-z]*/[a-z]*.elc \ | |
160 | leim/[a-z]*.elc leim/[a-z]*/[a-z]*.elc > /tmp/elc | |
161 | bogosities="`comm -13 /tmp/el /tmp/elc`" | |
162 | if [ "${bogosities}" != "" ]; then | |
163 | echo "The following .elc files have no corresponding .el files:" | |
164 | echo "${bogosities}" | |
8615e792 | 165 | fi |
e4e1c623 RS |
166 | rm -f /tmp/el /tmp/elc |
167 | ||
168 | ### Check for .el files with no corresponding .elc file. | |
3985f85d RS |
169 | (cd lisp; ls -1 [a-z]*.el [a-z]*/[a-z]*.el ; \ |
170 | cd ../leim; ls -1 [a-z]*.el [a-z]*/[a-z]*.el) > /tmp/el | |
171 | (cd lisp; ls -1 [a-z]*.elc [a-z]*/[a-z]*.elc; \ | |
172 | cd ../leim; ls -1 [a-z]*.elc [a-z]*/[a-z]*.elc) | sed 's/\.elc$/.el/' > /tmp/elc | |
e4e1c623 RS |
173 | losers="`comm -23 /tmp/el /tmp/elc`" |
174 | bogosities= | |
175 | for file in $losers; do | |
176 | file1=`echo $file | sed -e "s|.*/||"` | |
177 | if ! grep -q "dontcompilefiles:.* $file1\($\| \)" lisp/Makefile; then | |
178 | case $file in | |
179 | site-init.el | site-load.el | site-start.el | default.el) | |
180 | ;; | |
181 | term/*) | |
182 | ;; | |
183 | *) | |
184 | bogosities="$file $bogosities" | |
185 | ;; | |
186 | esac | |
187 | fi | |
188 | done | |
189 | if [ x"${bogosities}" != x"" ]; then | |
190 | echo "The following .el files have no corresponding .elc files:" | |
191 | echo "${bogosities}" | |
192 | fi | |
193 | rm -f /tmp/el /tmp/elc | |
8615e792 | 194 | |
e4e1c623 RS |
195 | ### Check for .el files that would overflow the 14-char limit if compiled. |
196 | long=`find lisp leim -name '[a-zA-Z0-9]??????????*.el' -print` | |
197 | if [ "$long" != "" ]; then | |
198 | echo "The following .el file names are too long:" | |
199 | echo "$long" | |
200 | fi | |
f5674423 KH |
201 | fi |
202 | ||
b4e84d5d JB |
203 | ### Make sure configure is newer than configure.in. |
204 | if [ "x`ls -t configure configure.in | head -1`" != "xconfigure" ]; then | |
21764d60 KH |
205 | echo "\`./configure.in' is newer than \`./configure'" >&2 |
206 | echo "Running autoconf" >&2 | |
28335560 | 207 | autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; } |
b4e84d5d JB |
208 | fi |
209 | ||
c75cfabd RS |
210 | if [ $update = yes ]; |
211 | then | |
212 | echo "Updating Info files" | |
980ab937 | 213 | |
870cfc55 | 214 | (cd man; make -f Makefile.in srcdir=. info) |
980ab937 | 215 | |
e888d449 | 216 | echo "Updating finder, custom and autoload data" |
4f23c692 | 217 | |
7cf45b04 RS |
218 | (cd lisp; make updates EMACS=$EMACS) |
219 | ||
220 | echo "Updating leim-list.el" | |
221 | ||
222 | (cd leim; make leim-list.el EMACS=$EMACS) | |
29c98ed3 RS |
223 | |
224 | echo "Recompiling Lisp files" | |
225 | ||
226 | $EMACS -batch -f batch-byte-recompile-directory lisp leim | |
c75cfabd | 227 | fi |
0588a761 | 228 | |
f07eebe0 KH |
229 | echo "Making lisp/MANIFEST" |
230 | ||
73494596 RS |
231 | (cd lisp; |
232 | files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'` | |
233 | for dir in [!=]*; do | |
234 | if [ -d $dir ] && [ $dir != term ] && [ $dir != RCS ]; then | |
235 | echo $dir | |
236 | thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'` | |
237 | files="$files $thisdir" | |
238 | fi | |
239 | done | |
240 | head -1 $files | grep '^;' | sed -e 's/;;; //' | sort > MANIFEST) | |
f07eebe0 | 241 | |
1260d6ba | 242 | echo "Creating staging directory: \`${tempparent}'" |
bb160193 | 243 | |
f7dbcf3c | 244 | mkdir ${tempparent} |
f7dbcf3c JB |
245 | tempdir="${tempparent}/${emacsname}" |
246 | ||
76fb0a58 JB |
247 | ### This trap ensures that the staging directory will be cleaned up even |
248 | ### when the script is interrupted in mid-career. | |
00c00348 | 249 | if [ "${clean_up}" = yes ]; then |
21764d60 | 250 | trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15 |
00c00348 ER |
251 | fi |
252 | ||
1260d6ba | 253 | echo "Creating top directory: \`${tempdir}'" |
f7dbcf3c JB |
254 | mkdir ${tempdir} |
255 | ||
76fb0a58 JB |
256 | ### We copy in the top-level files before creating the subdirectories in |
257 | ### hopes that this will make the top-level files appear first in the | |
258 | ### tar file; this means that people can start reading the INSTALL and | |
259 | ### README while the rest of the tar file is still unpacking. Whoopee. | |
21764d60 | 260 | echo "Making links to top-level files" |
94a13fbf | 261 | ln GETTING.GNU.SOFTWARE INSTALL README BUGS move-if-change ${tempdir} |
ac4eff2d | 262 | ln ChangeLog Makefile.in configure configure.in ${tempdir} |
6f8b09f3 | 263 | ln config.bat make-dist update-subdirs vpath.sed ${tempdir} |
bb160193 | 264 | ### Copy these files; they're cross-filesystem symlinks. |
a4888c88 | 265 | cp mkinstalldirs ${tempdir} |
76fb0a58 | 266 | cp config.sub ${tempdir} |
2ed56345 | 267 | cp config.guess ${tempdir} |
bb160193 | 268 | cp install.sh ${tempdir} |
f7dbcf3c | 269 | |
21764d60 | 270 | echo "Updating version number in README" |
f753e9aa JB |
271 | (cd ${tempdir} |
272 | awk \ | |
273 | '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 } | |
274 | $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \ | |
275 | version=${version} README > tmp.README | |
af559a4e | 276 | mv -f tmp.README README) |
f753e9aa JB |
277 | |
278 | ||
21764d60 | 279 | echo "Creating subdirectories" |
91741841 | 280 | for subdir in lisp site-lisp leim real-leim real-leim/CXTERM-DIC \ |
5f8d02be | 281 | real-leim/SKK-DIC real-leim/skk real-leim/quail \ |
c660c0a7 | 282 | src src/m src/s src/bitmaps lib-src oldXMenu lwlib \ |
5ec8424f | 283 | nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ |
e4e1c623 | 284 | etc etc/e lock info man msdos vms; do |
f7dbcf3c JB |
285 | mkdir ${tempdir}/${subdir} |
286 | done | |
287 | ||
91741841 RS |
288 | echo "Initializing \`leim' subdirectory" |
289 | cp leim-Makefile.in ${tempdir}/leim/Makefile.in | |
290 | ||
67ffab69 | 291 | echo "Making links to \`lisp' and its subdirectories" |
7b9cd64c | 292 | ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el. |
f7dbcf3c JB |
293 | (cd lisp |
294 | ln [a-zA-Z]*.el ../${tempdir}/lisp | |
295 | ln [a-zA-Z]*.elc ../${tempdir}/lisp | |
8d2197ac | 296 | ln [a-zA-Z]*.dat ../${tempdir}/lisp |
76fb0a58 JB |
297 | ## simula.el doesn't keep abbreviations in simula.defns any more. |
298 | ## ln [a-zA-Z]*.defns ../${tempdir}/lisp | |
3f7b30bf | 299 | ln ChangeLog Makefile makefile.nt ChangeLog.? README ../${tempdir}/lisp |
67ffab69 RS |
300 | (cd ../${tempdir}/lisp |
301 | rm -f TAGS =* | |
302 | rm -f site-init site-init.el site-init.elc | |
303 | rm -f site-load site-load.el site-load.elc | |
304 | rm -f site-start site-start.el site-start.elc | |
305 | rm -f default default.el default.elc | |
306 | ) | |
307 | ||
308 | ## Find all subdirs of lisp dir | |
309 | for file in `find . -type d -print`; do | |
310 | case $file in | |
762d80d1 | 311 | . | .. | */Old | */RCS | */=*) |
67ffab69 RS |
312 | ;; |
313 | *) | |
314 | if [ -d $file ]; then | |
315 | subdirs="$file $subdirs" | |
316 | fi | |
317 | ;; | |
318 | esac | |
319 | done | |
320 | ||
321 | for file in $subdirs; do | |
322 | echo " lisp/$file" | |
323 | mkdir ../${tempdir}/lisp/$file | |
324 | ln $file/[a-zA-Z]*.el ../${tempdir}/lisp/$file | |
325 | ln $file/[a-zA-Z]*.elc ../${tempdir}/lisp/$file | |
326 | if [ -f $file/README ]; then | |
327 | ln $file/README ../${tempdir}/lisp/$file | |
328 | fi | |
67ffab69 | 329 | done ) |
a78c106d | 330 | |
91741841 RS |
331 | echo "Making links to \`leim' and its subdirectories for the LEIM distribution" |
332 | ### Don't distribute TAGS, or =*.el files. | |
333 | (cd leim | |
334 | ln Makefile.in makefile.nt ../${tempdir}/real-leim | |
9089d8d7 | 335 | ln ChangeLog README ../${tempdir}/real-leim |
91741841 RS |
336 | |
337 | ln CXTERM-DIC/*.tit ../${tempdir}/real-leim/CXTERM-DIC | |
5f8d02be | 338 | ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/real-leim/SKK-DIC |
91741841 RS |
339 | ln skk/*.el skk/*.elc ../${tempdir}/real-leim/skk |
340 | ln quail/*.el quail/*.elc ../${tempdir}/real-leim/quail | |
341 | ||
342 | cd ../${tempdir}/real-leim | |
343 | rm -f TAGS =* */=*) | |
344 | ||
345 | ### Move the real-leim directory outside of Emacs proper. | |
65fda17c RS |
346 | (cd ${tempparent} |
347 | mkdir ${emacsname}-leim | |
348 | mkdir ${emacsname}-leim/${emacsname} | |
349 | mv ${emacsname}/real-leim ${emacsname}-leim/${emacsname}/leim) | |
91741841 | 350 | |
21764d60 | 351 | echo "Making links to \`src'" |
76fb0a58 | 352 | ### Don't distribute =*.[ch] files, or the configured versions of |
c3f1e1a9 | 353 | ### config.in, paths.in, or Makefile.in, or TAGS. |
f7dbcf3c | 354 | (cd src |
c75cfabd | 355 | echo " (It is ok if ln fails in some cases.)" |
f7dbcf3c JB |
356 | ln [a-zA-Z]*.c ../${tempdir}/src |
357 | ln [a-zA-Z]*.h ../${tempdir}/src | |
358 | ln [a-zA-Z]*.s ../${tempdir}/src | |
c75cfabd RS |
359 | ln [a-zA-Z]*.in ../${tempdir}/src |
360 | ln [a-zA-Z]*.opt ../${tempdir}/src | |
361 | ## If we ended up with a symlink, or if we did not get anything | |
362 | ## due to a cross-device symlink, copy the file. | |
363 | for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in [a-zA-Z]*.opt; do | |
364 | if test -f ../${tempdir}/src/$file; then | |
365 | # test -f appears to succeed for a symlink | |
366 | if test -L ../${tempdir}/src/$file; then | |
367 | rm ../${tempdir}/src/$file | |
62dfdaf0 | 368 | cp -p $file ../${tempdir}/src |
c75cfabd RS |
369 | chmod a-w ../${tempdir}/src/$file |
370 | fi | |
371 | else | |
372 | rm ../${tempdir}/src/$file | |
62dfdaf0 | 373 | cp -p $file ../${tempdir}/src |
c75cfabd RS |
374 | chmod a-w ../${tempdir}/src/$file |
375 | fi | |
376 | done | |
377 | ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src | |
378 | ln makefile.nt vms-pp.trans ../${tempdir}/src | |
990ee059 | 379 | ln .gdbinit .dbxinit ../${tempdir}/src |
f7dbcf3c | 380 | cd ../${tempdir}/src |
a6903f09 | 381 | rm -f config.h paths.h Makefile Makefile.c |
7b9cd64c | 382 | rm -f =* TAGS) |
f7dbcf3c | 383 | |
21764d60 | 384 | echo "Making links to \`src/bitmaps'" |
690eca32 JB |
385 | (cd src/bitmaps |
386 | ln README *.xbm ../../${tempdir}/src/bitmaps) | |
387 | ||
21764d60 | 388 | echo "Making links to \`src/m'" |
f7dbcf3c | 389 | (cd src/m |
facbb78e RS |
390 | # We call files for miscellaneous input (to linker etc) .inp. |
391 | ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m) | |
f7dbcf3c | 392 | |
21764d60 | 393 | echo "Making links to \`src/s'" |
f7dbcf3c | 394 | (cd src/s |
77427171 | 395 | ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s) |
f7dbcf3c | 396 | |
21764d60 | 397 | echo "Making links to \`lib-src'" |
f7dbcf3c | 398 | (cd lib-src |
375f1bd7 | 399 | ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src |
c3f1e1a9 | 400 | ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src |
391b3748 | 401 | ln emacs.csh rcs2log rcs-checkin makefile.nt ../${tempdir}/lib-src |
c75cfabd RS |
402 | ## If we ended up with a symlink, or if we did not get anything |
403 | ## due to a cross-device symlink, copy the file. | |
404 | for file in [a-zA-Z]*.[chy]; do | |
405 | if test -f ../${tempdir}/lib-src/$file; then | |
406 | # test -f appears to succeed for a symlink | |
407 | if test -L ../${tempdir}/lib-src/$file; then | |
408 | rm ../${tempdir}/lib-src/$file | |
409 | cp $file ../${tempdir}/lib-src | |
410 | chmod a-w ../${tempdir}/lib-src/$file | |
411 | fi | |
412 | else | |
413 | rm ../${tempdir}/lib-src/$file | |
414 | cp $file ../${tempdir}/lib-src | |
415 | chmod a-w ../${tempdir}/lib-src/$file | |
416 | fi | |
417 | done | |
1260d6ba | 418 | cd ../${tempdir}/lib-src |
c75cfabd | 419 | rm -f Makefile.c |
7b9cd64c | 420 | rm -f =* TAGS) |
f7dbcf3c | 421 | |
21764d60 | 422 | echo "Making links to \`nt'" |
391b3748 | 423 | (cd nt |
e827bc37 | 424 | ln emacs.ico emacs.rc config.nt [a-z]*.in [a-z]*.c ../${tempdir}/nt |
b47cc08a | 425 | ln [a-z]*.bat [a-z]*.h makefile.def makefile.nt ../${tempdir}/nt |
3bb3cfe7 | 426 | ln TODO ChangeLog INSTALL README ../${tempdir}/nt) |
391b3748 | 427 | |
21764d60 | 428 | echo "Making links to \`nt/inc'" |
391b3748 | 429 | (cd nt/inc |
77427171 | 430 | ln [a-z]*.h ../../${tempdir}/nt/inc) |
391b3748 | 431 | |
21764d60 | 432 | echo "Making links to \`nt/inc/sys'" |
391b3748 | 433 | (cd nt/inc/sys |
77427171 | 434 | ln [a-z]*.h ../../../${tempdir}/nt/inc/sys) |
391b3748 | 435 | |
e827bc37 RS |
436 | echo "Making links to \`nt/inc/arpa'" |
437 | (cd nt/inc/arpa | |
438 | ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa) | |
439 | ||
440 | echo "Making links to \`nt/inc/netinet'" | |
441 | (cd nt/inc/netinet | |
442 | ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet) | |
443 | ||
5ec8424f GV |
444 | echo "Making links to \`nt/icons'" |
445 | (cd nt/icons | |
91978d00 | 446 | ln [a-z]*.ico ../../${tempdir}/nt/icons) |
5ec8424f | 447 | |
21764d60 | 448 | echo "Making links to \`msdos'" |
52d7b2e5 RS |
449 | (cd msdos |
450 | ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos | |
7fd85d56 | 451 | ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos |
52d7b2e5 RS |
452 | cd ../${tempdir}/msdos |
453 | rm -f =*) | |
454 | ||
21764d60 | 455 | echo "Making links to \`oldXMenu'" |
f7dbcf3c | 456 | (cd oldXMenu |
8bdbf9ed | 457 | ln *.c *.h *.in ../${tempdir}/oldXMenu |
df1ec566 | 458 | ln README Imakefile ChangeLog ../${tempdir}/oldXMenu |
f395c83a | 459 | ln compile.com descrip.mms ../${tempdir}/oldXMenu) |
f7dbcf3c | 460 | |
21764d60 | 461 | echo "Making links to \`lwlib'" |
c660c0a7 RS |
462 | (cd lwlib |
463 | ln *.c *.h *.in ../${tempdir}/lwlib | |
72e7e784 KH |
464 | ln README Imakefile ChangeLog ../${tempdir}/lwlib |
465 | cd ../${tempdir}/lwlib | |
466 | rm -f lwlib-Xol*) | |
c660c0a7 | 467 | |
21764d60 | 468 | echo "Making links to \`etc'" |
f395c83a JB |
469 | ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or |
470 | ### tex litter. | |
f7dbcf3c | 471 | (cd etc |
7a6ee7ae RS |
472 | files=`ls -d * | grep -v 'RCS' | grep -v 'Old' | grep -v '^e$'` |
473 | ln $files ../${tempdir}/etc | |
98d4c1d0 RS |
474 | ## If we ended up with a symlink, or if we did not get anything |
475 | ## due to a cross-device symlink, copy the file. | |
7a6ee7ae | 476 | for file in $files; do |
98d4c1d0 RS |
477 | if test -f ../${tempdir}/etc/$file; then |
478 | # test -f appears to succeed for a symlink | |
479 | if test -L ../${tempdir}/etc/$file; then | |
480 | rm ../${tempdir}/etc/$file | |
481 | cp $file ../${tempdir}/etc | |
482 | chmod a-w ../${tempdir}/etc/$file | |
483 | fi | |
484 | else | |
485 | rm ../${tempdir}/etc/$file | |
486 | cp $file ../${tempdir}/etc | |
487 | chmod a-w ../${tempdir}/etc/$file | |
488 | fi | |
489 | done | |
f7dbcf3c | 490 | cd ../${tempdir}/etc |
ebd32d7b | 491 | rm -f fns*.el |
23a58692 | 492 | rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core |
f395c83a | 493 | rm -f TAGS) |
f7dbcf3c | 494 | |
21764d60 | 495 | echo "Making links to \`etc/e'" |
f08ad882 | 496 | (cd etc/e |
375f1bd7 | 497 | ln `ls -d * | grep -v 'RCS'` ../../${tempdir}/etc/e |
a6903f09 | 498 | cd ../../${tempdir}/etc/e |
375f1bd7 | 499 | rm -f *~ \#*\# *,v =* core) |
f08ad882 | 500 | |
21764d60 | 501 | echo "Making links to \`info'" |
66afa119 RS |
502 | # Don't distribute backups or autosaves. |
503 | (cd info | |
504 | ln [a-zA-Z]* ../${tempdir}/info | |
505 | cd ../${tempdir}/info | |
506 | # Avoid an error when expanding the wildcards later. | |
507 | ln emacs dummy~ ; ln emacs \#dummy\# | |
508 | rm -f *~ \#*\# core) | |
fda4e8f6 | 509 | |
21764d60 | 510 | echo "Making links to \`man'" |
fda4e8f6 | 511 | (cd man |
298c8970 | 512 | ln *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man |
5e808bc0 | 513 | test -f README && ln README ../${tempdir}/man |
f08ad882 | 514 | test -f Makefile.in && ln Makefile.in ../${tempdir}/man |
56c31c87 | 515 | ln ChangeLog split-man ../${tempdir}/man |
375f1bd7 | 516 | cp texinfo.tex ../${tempdir}/man |
4f8cc93a | 517 | cd ../${tempdir}/man |
56c31c87 RS |
518 | rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail |
519 | rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux) | |
f7dbcf3c | 520 | |
21764d60 | 521 | echo "Making links to \`vms'" |
40eef465 JB |
522 | (cd vms |
523 | ln [0-9a-zA-Z]* ../${tempdir}/vms | |
524 | cd ../${tempdir}/vms | |
525 | rm -f *~) | |
526 | ||
c87b230f JB |
527 | ### It would be nice if they could all be symlinks to etc's copy, but |
528 | ### you're not supposed to have any symlinks in distribution tar files. | |
21764d60 | 529 | echo "Making sure copying notices are all copies of \`etc/COPYING'" |
1260d6ba ER |
530 | rm -f ${tempdir}/etc/COPYING |
531 | cp etc/COPYING ${tempdir}/etc/COPYING | |
8e583b5d | 532 | for subdir in lisp src lib-src info msdos; do |
f7dbcf3c JB |
533 | if [ -f ${tempdir}/${subdir}/COPYING ]; then |
534 | rm ${tempdir}/${subdir}/COPYING | |
535 | fi | |
96858c42 | 536 | cp etc/COPYING ${tempdir}/${subdir} |
f7dbcf3c JB |
537 | done |
538 | ||
5b8def65 JB |
539 | #### Make sure that there aren't any hard links between files in the |
540 | #### distribution; people with afs can't deal with that. Okay, | |
541 | #### actually we just re-copy anything with a link count greater | |
375f1bd7 KH |
542 | #### than two. (Yes, strictly greater than 2 is correct; since we |
543 | #### created these files by linking them in from the original tree, | |
544 | #### they'll have exactly two links normally.) | |
bb7e0f81 | 545 | #### |
908ff139 | 546 | #### Commented out since it's not strictly necessary; it should suffice |
bb7e0f81 | 547 | #### to just break the link on alloca.c. |
9b23a6c7 RS |
548 | #echo "Breaking intra-tree links." |
549 | #find ${tempdir} ! -type d -links +2 \ | |
550 | # -exec cp -p {} $$ \; -exec rm -f {} \; -exec mv $$ {} \; | |
bb7e0f81 KH |
551 | rm -f $tempdir/lib-src/alloca.c |
552 | cp $tempdir/src/alloca.c $tempdir/lib-src/alloca.c | |
5b8def65 | 553 | |
1260d6ba | 554 | if [ "${newer}" ]; then |
21764d60 | 555 | echo "Removing files older than $newer" |
76fb0a58 JB |
556 | ## We remove .elc files unconditionally, on the theory that anyone picking |
557 | ## up an incremental distribution already has a running Emacs to byte-compile | |
558 | ## them with. | |
1260d6ba ER |
559 | find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; |
560 | fi | |
561 | ||
4746118a | 562 | if [ "${make_tar}" = yes ]; then |
922ac4c5 | 563 | if [ "${default_gzip}" = "" ]; then |
21764d60 | 564 | echo "Looking for gzip" |
922ac4c5 JB |
565 | temppath=`echo $PATH | sed 's/^:/.:/ |
566 | s/::/:.:/g | |
567 | s/:$/:./ | |
568 | s/:/ /g'` | |
569 | default_gzip=`( | |
570 | for dir in ${temppath}; do | |
571 | if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi | |
572 | done | |
573 | echo compress | |
574 | )` | |
575 | fi | |
f395c83a JB |
576 | case "${default_gzip}" in |
577 | compress* ) gzip_extension=.Z ;; | |
0dc610dd | 578 | * ) gzip_extension=.gz ;; |
f395c83a | 579 | esac |
91741841 | 580 | echo "Creating tar files" |
f395c83a JB |
581 | (cd ${tempparent} ; tar cvf - ${emacsname} ) \ |
582 | | ${default_gzip} \ | |
583 | > ${emacsname}.tar${gzip_extension} | |
65fda17c | 584 | (cd ${tempparent}/${emacsname}-leim ; tar cvf - ${emacsname} ) \ |
91741841 RS |
585 | | ${default_gzip} \ |
586 | > ${emacsname}-leim.tar${gzip_extension} | |
4746118a | 587 | fi |
f7dbcf3c | 588 | |
4746118a | 589 | if [ "${clean_up}" = yes ]; then |
21764d60 | 590 | echo "Cleaning up the staging directory" |
f395c83a | 591 | rm -rf ${tempparent} |
bb160193 | 592 | else |
91741841 | 593 | (cd ${tempparent}; mv ${emacsname} ${emacsname}-leim ..) |
bb160193 | 594 | rm -rf ${tempparent} |
f7dbcf3c | 595 | fi |
00c00348 | 596 | |
76fb0a58 | 597 | ### make-dist ends here |