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