* make-dist: Simplify creation of lisp/MANIFEST.
[bpt/emacs.git] / make-dist
CommitLineData
f7dbcf3c 1#!/bin/sh
baf81c55 2### make-dist: create an Emacs distribution tar file from current srcdir
76fb0a58 3
baf81c55
GM
4## Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
5## 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
f7dbcf3c 6
baf81c55 7## This file is part of GNU Emacs.
b33ba812 8
baf81c55
GM
9## GNU Emacs is free software: you can redistribute it and/or modify
10## it under the terms of the GNU General Public License as published by
11## the Free Software Foundation, either version 3 of the License, or
12## (at your option) any later version.
b33ba812 13
baf81c55
GM
14## GNU Emacs is distributed in the hope that it will be useful,
15## but WITHOUT ANY WARRANTY; without even the implied warranty of
16## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17## GNU General Public License for more details.
b33ba812 18
baf81c55
GM
19## You should have received a copy of the GNU General Public License
20## along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
b33ba812 21
baf81c55
GM
22### Commentary:
23
24## This basically creates a duplicate directory structure, and then
25## hard links into it only those files that should be distributed.
26## This means that if you add a file with an odd name, you should make
27## sure that this script will include it.
28
29### Code:
4c9c1174 30
f7dbcf3c
JB
31progname="$0"
32
76fb0a58 33### Exit if a command fails.
8c28d444 34#set -e
f7dbcf3c 35
76fb0a58 36### Print out each line we read, for debugging's sake.
8c28d444 37#set -v
f7dbcf3c 38
8df317a6
GM
39LANGUAGE=C
40LC_ALL=C
41LC_MESSAGES=
42LANG=
43export LANGUAGE LC_ALL LC_MESSAGES LANG
44
ccd57f4d 45## Don't restrict access to any files.
67ffab69
RS
46umask 0
47
c75cfabd 48update=yes
e4e1c623 49check=yes
f22edcea
RS
50clean_up=no
51make_tar=no
1260d6ba 52newer=""
f7dbcf3c
JB
53
54while [ $# -gt 0 ]; do
55 case "$1" in
f22edcea
RS
56 ## This option tells make-dist to delete the staging directory
57 ## when done. It is useless to use this unless you make a tar file.
58 "--clean-up" )
59 clean_up=yes
4746118a 60 ;;
f22edcea
RS
61 ## This option tells make-dist to make a tar file.
62 "--tar" )
63 make_tar=yes
f7dbcf3c 64 ;;
c75cfabd
RS
65 ## This option tells make-dist not to recompile or do analogous things.
66 "--no-update" )
67 update=no
68 ;;
e4e1c623
RS
69 ## This option says don't check for bad file names, etc.
70 "--no-check" )
71 check=no
72 ;;
76fb0a58 73 ## This option tells make-dist to make the distribution normally, then
7b9cd64c
ER
74 ## remove all files older than the given timestamp file. This is useful
75 ## for creating incremental or patch distributions.
1260d6ba 76 "--newer")
ef15f270
JB
77 newer="$2"
78 new_extension=".new"
1260d6ba
ER
79 shift
80 ;;
922ac4c5
JB
81 ## This option tells make-dist to use `compress' instead of gzip.
82 ## Normally, make-dist uses gzip whenever it is present.
83 "--compress")
84 default_gzip="compress"
85 ;;
37d6e313
RF
86 ## Same with bzip2.
87 "--bzip2")
88 default_gzip="bzip2"
89 ;;
ed398055
GM
90 ## Same with lzma.
91 "--lzma")
92 default_gzip="lzma"
93 ;;
2a714d4e
GM
94
95 "--snapshot")
96 clean_up=yes
97 make_tar=yes
98 update=no
99 check=no
100 ;;
101
102 "--help")
103 echo "Usage: ${progname} [options]"
104 echo ""
8772b5a8 105 echo " --bzip2 use bzip2 instead of gzip"
2a714d4e
GM
106 echo " --clean-up delete staging directories when done"
107 echo " --compress use compress instead of gzip"
8772b5a8 108 echo " --lzma use lzma instead of gzip"
2a714d4e
GM
109 echo " --newer=TIME don't include files older than TIME"
110 echo " --no-check don't check for bad file names etc."
111 echo " --no-update don't recompile or do analogous things"
112 echo " --snapshot same as --clean-up --no-update --tar --no-check"
113 echo " --tar make a tar file"
114 echo ""
115 exit 0
116 ;;
117
f7dbcf3c
JB
118 * )
119 echo "${progname}: Unrecognized argument: $1" >&2
120 exit 1
121 ;;
122 esac
123 shift
124done
125
76fb0a58 126### Make sure we're running in the right place.
c17e9c60
RF
127if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/subr.el ]; then
128 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/subr.el'." >&2
1260d6ba 129 echo "${progname} must be run in the top directory of the Emacs" >&2
0d122844 130 echo "distribution tree. cd to that directory and try again." >&2
f7dbcf3c
JB
131 exit 1
132fi
133
c75cfabd 134### Find where to run Emacs.
4b1aaa8b 135### (Accept only absolute file names.)
c75cfabd
RS
136if [ $update = yes ];
137then
59d05d2d 138 unset EMACS_UNIBYTE
c75cfabd
RS
139 if [ -f src/emacs ];
140 then
141 EMACS=`pwd`/src/emacs
142 else
4b1aaa8b
PE
143 case $EMACS in
144 /*) ;;
145 *)
146 if [ ! -f "$EMACS" ]; then
2906a94c 147 echo "$0: You must set the EMACS environment variable " \
4b1aaa8b
PE
148 "to an absolute file name." 2>&1
149 exit 1
150 fi;;
151 esac
c75cfabd
RS
152 fi
153fi
154
76fb0a58 155### Find out which version of Emacs this is.
c17e9c60 156shortversion=`grep 'char emacs_version' src/emacs.c \
47d105b0 157 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
c17e9c60 158version=`grep 'char emacs_version' src/emacs.c \
0e0186f1 159 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
f7dbcf3c 160if [ ! "${version}" ]; then
c17e9c60 161 echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2
f7dbcf3c
JB
162 exit 1
163fi
164
21764d60 165echo Version numbers are $version and $shortversion
47d105b0 166
c75cfabd
RS
167if [ $update = yes ];
168then
baf81c55 169 if grep -s "@set EMACSVER *${shortversion}" ./doc/emacs/emacsver.texi > /dev/null; then
c75cfabd
RS
170 true
171 else
baf81c55 172 echo "You must update the version number in \`./doc/emacs/emacsver.texi'"
c75cfabd
RS
173 sleep 5
174 fi
f753e9aa
JB
175fi
176
bb160193
RS
177### Make sure we don't already have a directory emacs-${version}.
178
179emacsname="emacs-${version}${new_extension}"
180
181if [ -d ${emacsname} ]
182then
183 echo Directory "${emacsname}" already exists >&2
184 exit 1
185fi
186
76fb0a58 187### Make sure the subdirectory is available.
1260d6ba 188tempparent="make-dist.tmp.$$"
f7dbcf3c 189if [ -d ${tempparent} ]; then
1260d6ba
ER
190 echo "${progname}: staging directory \`${tempparent}' already exists.
191Perhaps a previous invocation of \`${progname}' failed to clean up after
192itself. Check that directories whose names are of the form
193\`make-dist.tmp.NNNNN' don't contain any important information, remove
194them, and try again." >&2
f7dbcf3c
JB
195 exit 1
196fi
197
e4e1c623
RS
198### Find where to run Emacs.
199if [ $check = yes ];
200then
201 ### Check for .elc files with no corresponding .el file.
fb0797ca 202 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
7b1b676d
GM
203 lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
204 lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
5eea385d 205 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
fb0797ca 206 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
7b1b676d
GM
207 lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
208 lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.elc \
5eea385d 209 leim/[a-z]*/[a-z]*.elc > /tmp/elc
e4e1c623
RS
210 bogosities="`comm -13 /tmp/el /tmp/elc`"
211 if [ "${bogosities}" != "" ]; then
212 echo "The following .elc files have no corresponding .el files:"
213 echo "${bogosities}"
8615e792 214 fi
e4e1c623
RS
215 rm -f /tmp/el /tmp/elc
216
217 ### Check for .el files with no corresponding .elc file.
fb0797ca 218 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
7b1b676d
GM
219 lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
220 lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
33740d04 221 leim/[a-z]*/[a-z]*.el > /tmp/el
fb0797ca 222 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
7b1b676d
GM
223 lisp/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
224 lisp/[a-z]*/[a-z]*/[a-z]*/[a-zA-Z0-9]*.el \
33740d04 225 leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
e4e1c623
RS
226 losers="`comm -23 /tmp/el /tmp/elc`"
227 bogosities=
228 for file in $losers; do
33740d04 229 if ! grep -q "no-byte-compile: t" $file; then
e4e1c623
RS
230 case $file in
231 site-init.el | site-load.el | site-start.el | default.el)
232 ;;
e4e1c623
RS
233 *)
234 bogosities="$file $bogosities"
235 ;;
236 esac
237 fi
238 done
239 if [ x"${bogosities}" != x"" ]; then
240 echo "The following .el files have no corresponding .elc files:"
241 echo "${bogosities}"
242 fi
243 rm -f /tmp/el /tmp/elc
f5674423
KH
244fi
245
b4e84d5d 246### Make sure configure is newer than configure.in.
a8a8fcfa 247if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then
21764d60
KH
248 echo "\`./configure.in' is newer than \`./configure'" >&2
249 echo "Running autoconf" >&2
28335560 250 autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; }
b4e84d5d
JB
251fi
252
baf81c55 253### Make sure src/stamp-h.in is newer than configure.in.
a49eb675
AS
254if [ "x`ls -t src/stamp-h.in configure.in | sed q`" != "xsrc/stamp-h.in" ]; then
255 echo "\`./configure.in' is newer than \`./src/stamp-h.in'" >&2
256 echo "Running autoheader" >&2
257 autoheader || { x=$?; echo Autoheader FAILED! >&2; exit $x; }
258 rm -f src/stamp-h.in
259 echo timestamp > src/stamp-h.in
260fi
261
c75cfabd
RS
262if [ $update = yes ];
263then
264 echo "Updating Info files"
baf81c55
GM
265 (cd doc/emacs; make info)
266 (cd doc/misc; make info)
267 (cd doc/lispref; make info)
268 (cd doc/lispintro; make info)
980ab937 269
e888d449 270 echo "Updating finder, custom and autoload data"
59d05d2d 271 (cd lisp; make updates EMACS="$EMACS")
7cf45b04 272
5eea385d
GM
273 if test -f leim/leim-list.el; then
274 echo "Updating leim-list.el"
275 (cd leim; make leim-list.el EMACS="$EMACS")
276 fi
29c98ed3
RS
277
278 echo "Recompiling Lisp files"
29c98ed3 279 $EMACS -batch -f batch-byte-recompile-directory lisp leim
c75cfabd 280fi
0588a761 281
aa267dcf
GM
282## What is this file for? It goes in srcdir, not the tarfile.
283## Why does it exclude term/ ?
f07eebe0
KH
284echo "Making lisp/MANIFEST"
285
aa267dcf
GM
286files=`find lisp -type f -name '*.el'`
287for file in $files; do
288 case "$file" in
289 */subdirs.el|*/default.el|*/loaddefs.el|*/term/*) continue ;;
290 esac
291 sed -n 's/^;;; //p; q' $file
292done | sort > lisp/MANIFEST
f07eebe0 293
1260d6ba 294echo "Creating staging directory: \`${tempparent}'"
bb160193 295
f7dbcf3c 296mkdir ${tempparent}
f7dbcf3c
JB
297tempdir="${tempparent}/${emacsname}"
298
76fb0a58
JB
299### This trap ensures that the staging directory will be cleaned up even
300### when the script is interrupted in mid-career.
00c00348 301if [ "${clean_up}" = yes ]; then
21764d60 302 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15
00c00348
ER
303fi
304
1260d6ba 305echo "Creating top directory: \`${tempdir}'"
f7dbcf3c
JB
306mkdir ${tempdir}
307
76fb0a58
JB
308### We copy in the top-level files before creating the subdirectories in
309### hopes that this will make the top-level files appear first in the
310### tar file; this means that people can start reading the INSTALL and
311### README while the rest of the tar file is still unpacking. Whoopee.
21764d60 312echo "Making links to top-level files"
3ada8b66 313ln INSTALL README BUGS move-if-change ${tempdir}
bcea38a3 314ln ChangeLog Makefile.in configure configure.in ${tempdir}
b08ddfb4 315ln config.bat make-dist update-subdirs vpath.sed .dir-locals.el ${tempdir}
baf81c55 316ln mkinstalldirs config.sub config.guess install-sh ${tempdir}
f7dbcf3c 317
aa267dcf
GM
318## FIXME why do we bother doing this? set-version in admin/admin.el
319## does this, and more besides.
21764d60 320echo "Updating version number in README"
f753e9aa
JB
321(cd ${tempdir}
322 awk \
323 '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 }
324 $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \
325 version=${version} README > tmp.README
af559a4e 326 mv -f tmp.README README)
f753e9aa
JB
327
328
21764d60 329echo "Creating subdirectories"
d175b0ae 330for subdir in lisp site-lisp \
05494c29 331 leim leim/CXTERM-DIC leim/MISC-DIC \
ca111811 332 leim/SKK-DIC leim/ja-dic leim/quail \
c660c0a7 333 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
5ec8424f 334 nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
0bd50841 335 etc etc/charsets etc/e etc/gnus etc/nxml \
4e1fb954
GM
336 etc/images etc/images/custom etc/images/ezimage etc/images/gnus \
337 etc/images/gud etc/images/icons etc/images/icons/hicolor \
dc6150eb 338 etc/images/icons/hicolor/*x* etc/images/icons/hicolor/scalable \
10eae9dd 339 etc/images/icons/hicolor/*/apps etc/images/icons/hicolor/*/mimetypes \
9e13b2f4 340 etc/images/low-color etc/images/mail etc/images/mpc \
56bcdb80
GM
341 etc/images/smilies etc/images/smilies/grayscale \
342 etc/images/smilies/medium etc/images/tree-widget \
343 etc/images/tree-widget/default etc/images/tree-widget/folder \
baf81c55 344 etc/refcards etc/schema etc/srecode etc/tutorials info doc doc/emacs \
7c2fb837 345 doc/misc doc/man doc/lispref doc/lispintro m4 msdos \
2c369af7
GM
346 nextstep nextstep/Cocoa nextstep/Cocoa/Emacs.base \
347 nextstep/Cocoa/Emacs.base/Contents \
348 nextstep/Cocoa/Emacs.base/Contents/Resources \
349 nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj \
2c369af7
GM
350 nextstep/Cocoa/Emacs.xcodeproj \
351 nextstep/GNUstep \
352 nextstep/GNUstep/Emacs.base \
eeebcbb9 353 nextstep/GNUstep/Emacs.base/Resources
b3635775 354do
0da746de
GM
355 ## site-lisp for in-place installs (?).
356 [ "$subdir" = "site-lisp" ] || [ -d "$subdir" ] || \
357 echo "WARNING: $subdir not found, making anyway"
b3635775 358 echo " ${tempdir}/${subdir}"
f7dbcf3c
JB
359 mkdir ${tempdir}/${subdir}
360done
361
67ffab69 362echo "Making links to \`lisp' and its subdirectories"
baf81c55 363### Don't distribute site-init.el, site-load.el, or default.el.
f7dbcf3c
JB
364(cd lisp
365 ln [a-zA-Z]*.el ../${tempdir}/lisp
366 ln [a-zA-Z]*.elc ../${tempdir}/lisp
fb0797ca
LK
367 ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp
368 ln Makefile.in makefile.w32-in ../${tempdir}/lisp
baf81c55 369 ln README ../${tempdir}/lisp
67ffab69 370 (cd ../${tempdir}/lisp
67ffab69
RS
371 rm -f site-init site-init.el site-init.elc
372 rm -f site-load site-load.el site-load.elc
373 rm -f site-start site-start.el site-start.elc
374 rm -f default default.el default.elc
375 )
376
377 ## Find all subdirs of lisp dir
378 for file in `find . -type d -print`; do
379 case $file in
113ddd75 380 . | .. | */=*)
177c0ea7 381 ;;
67ffab69
RS
382 *)
383 if [ -d $file ]; then
384 subdirs="$file $subdirs"
385 fi
386 ;;
387 esac
388 done
389
390 for file in $subdirs; do
391 echo " lisp/$file"
3ada8b66 392 mkdir -p ../${tempdir}/lisp/$file
b3635775
GM
393 ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file
394 ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file
baf81c55
GM
395 ## calc/README.prev
396 for f in $file/README $file/ChangeLog $file/ChangeLog.*[0-9] \
c46e7097 397 $file/README.prev; do
baf81c55
GM
398 [ -f $f ] || continue
399 ln $f ../${tempdir}/lisp/$file
365949b7 400 done
67ffab69 401 done )
a78c106d 402
ca111811 403echo "Making links to \`leim' and its subdirectories"
91741841 404(cd leim
561bd1a1 405 ln makefile.w32-in ../${tempdir}/leim
ca111811 406 ln ChangeLog README ../${tempdir}/leim
4e1fb954 407 ln CXTERM-DIC/README CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
ca111811 408 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
4e1fb954 409 ln MISC-DIC/README MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
ca111811
EZ
410 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
411 ln Makefile.in ../${tempdir}/leim/Makefile.in
1d390bd8 412 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
4e1fb954
GM
413 ## Lisp files that start with a capital (also 4Corner.el) are
414 ## generated from TIT dictionaries so we don't distribute them.
ca111811
EZ
415 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
416 rm -f ../${tempdir}/leim/quail/quick-b5.*
417 rm -f ../${tempdir}/leim/quail/quick-cns.*
418 rm -f ../${tempdir}/leim/quail/tsang-b5.*
baf81c55 419 rm -f ../${tempdir}/leim/quail/tsang-cns.*)
91741841 420
21764d60 421echo "Making links to \`src'"
76fb0a58 422### Don't distribute =*.[ch] files, or the configured versions of
c3f1e1a9 423### config.in, paths.in, or Makefile.in, or TAGS.
f7dbcf3c 424(cd src
c75cfabd 425 echo " (It is ok if ln fails in some cases.)"
baf81c55 426 ln [a-zA-Z]*.[chm] ../${tempdir}/src
c75cfabd 427 ln [a-zA-Z]*.in ../${tempdir}/src
9d5cf9b6 428 ln [a-zA-Z]*.mk ../${tempdir}/src
c75cfabd 429 ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src
561bd1a1 430 ln makefile.w32-in ../${tempdir}/src
990ee059 431 ln .gdbinit .dbxinit ../${tempdir}/src
f7dbcf3c 432 cd ../${tempdir}/src
baf81c55 433 rm -f config.h epaths.h Makefile buildobj.h)
f7dbcf3c 434
21764d60 435echo "Making links to \`src/bitmaps'"
690eca32
JB
436(cd src/bitmaps
437 ln README *.xbm ../../${tempdir}/src/bitmaps)
438
21764d60 439echo "Making links to \`src/m'"
f7dbcf3c 440(cd src/m
521ee9b3 441 ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/m)
f7dbcf3c 442
21764d60 443echo "Making links to \`src/s'"
f7dbcf3c 444(cd src/s
77427171 445 ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
f7dbcf3c 446
21764d60 447echo "Making links to \`lib-src'"
f7dbcf3c 448(cd lib-src
aa267dcf 449 ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src
c3f1e1a9 450 ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
3fb78d1f 451 ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src
b3635775 452 ln makefile.w32-in ../${tempdir}/lib-src
1260d6ba 453 cd ../${tempdir}/lib-src
baf81c55 454 rm -f getopt.h)
f7dbcf3c 455
9eff9fe3
PE
456echo "Making links to \`m4'"
457(cd m4
458 ln *.m4 ../${tempdir}/m4)
459
21764d60 460echo "Making links to \`nt'"
391b3748 461(cd nt
baf81c55
GM
462 ln emacs.manifest emacs.rc emacsclient.rc config.nt ../${tempdir}/nt
463 ln emacs-src.tags nmake.defs gmake.defs subdirs.el ../${tempdir}/nt
464 ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt
465 ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt)
391b3748 466
21764d60 467echo "Making links to \`nt/inc'"
391b3748 468(cd nt/inc
77427171 469 ln [a-z]*.h ../../${tempdir}/nt/inc)
391b3748 470
21764d60 471echo "Making links to \`nt/inc/sys'"
391b3748 472(cd nt/inc/sys
77427171 473 ln [a-z]*.h ../../../${tempdir}/nt/inc/sys)
391b3748 474
e827bc37
RS
475echo "Making links to \`nt/inc/arpa'"
476(cd nt/inc/arpa
477 ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa)
478
479echo "Making links to \`nt/inc/netinet'"
480(cd nt/inc/netinet
481 ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet)
482
5ec8424f
GV
483echo "Making links to \`nt/icons'"
484(cd nt/icons
4e1fb954 485 ln README [a-z]*.ico ../../${tempdir}/nt/icons
d6dc647f 486 ln [a-z]*.cur ../../${tempdir}/nt/icons)
5ec8424f 487
21764d60 488echo "Making links to \`msdos'"
52d7b2e5 489(cd msdos
4e1fb954 490 ln ChangeLog INSTALL README emacs.ico emacs.pif ../${tempdir}/msdos
baf81c55 491 ln is_exec.c sigaction.c mainmake.v2 sed*.inp ../${tempdir}/msdos)
52d7b2e5 492
99cc1583 493## FIXME are DEV-NOTES and FOR-RELEASE appropriate?
2c369af7
GM
494echo "Making links to \`nextstep'"
495(cd nextstep
baf81c55 496 ln AUTHORS ChangeLog README INSTALL ../${tempdir}/nextstep)
2c369af7
GM
497
498echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents'"
499(cd nextstep/Cocoa/Emacs.base/Contents
500 ln Info.plist PkgInfo ../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents)
501
502echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources'"
503(cd nextstep/Cocoa/Emacs.base/Contents/Resources
5338a639 504 ln Credits.html *.icns ../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources)
2c369af7
GM
505
506echo "Making links to \`nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj'"
507(cd nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj
508 ln InfoPlist.strings ../../../../../../${tempdir}/nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj)
509
2c369af7
GM
510echo "Making links to \`nextstep/Cocoa/Emacs.xcodeproj'"
511(cd nextstep/Cocoa/Emacs.xcodeproj
512 ln project.pbxproj ../../../${tempdir}/nextstep/Cocoa/Emacs.xcodeproj)
513
514echo "Making links to \`nextstep/GNUstep/Emacs.base/Resources'"
515(cd nextstep/GNUstep/Emacs.base/Resources
5338a639 516 ln Emacs.desktop Info-gnustep.plist README emacs.tiff ../../../../${tempdir}/nextstep/GNUstep/Emacs.base/Resources )
2c369af7 517
21764d60 518echo "Making links to \`oldXMenu'"
f7dbcf3c 519(cd oldXMenu
baf81c55 520 ln *.[ch] *.in ../${tempdir}/oldXMenu
7c2fb837 521 ln README ChangeLog ../${tempdir}/oldXMenu)
f7dbcf3c 522
21764d60 523echo "Making links to \`lwlib'"
c660c0a7 524(cd lwlib
baf81c55 525 ln *.[ch] *.in ../${tempdir}/lwlib
ebb81677 526 ln README ChangeLog ../${tempdir}/lwlib)
c660c0a7 527
21764d60 528echo "Making links to \`etc'"
f7dbcf3c 529(cd etc
baf81c55
GM
530 for f in *; do
531 [ -f "$f" ] || continue
532 case "$f" in
533 DOC*) continue ;;
534 esac
535 ln $f ../${tempdir}/etc
536 done)
f7dbcf3c 537
baf81c55
GM
538for dir in etc/*/; do
539 case "$dir" in
540 etc/images/) continue ;;
541 esac
561c44e8
RF
542 echo "Making links to \`${dir}'"
543 (cd ${dir}
baf81c55 544 ln * ../../${tempdir}/${dir})
561c44e8 545done
f08ad882 546
36eaa68f
RF
547echo "Making links to \`etc/images'"
548(cd etc/images
2906a94c
GM
549 for f in *; do
550 [ -f "$f" ] || continue
2906a94c 551 ln $f ../../${tempdir}/etc/images
36eaa68f
RF
552 done)
553
baf81c55 554for dir in etc/images/*/; do
561bd1a1
EZ
555 echo "Making links to \`${dir}'"
556 (cd ${dir}
2906a94c
GM
557 for f in *; do
558 [ -f "$f" ] || continue
2906a94c
GM
559 ln $f ../../../${tempdir}/${dir}
560 done
561 )
561bd1a1
EZ
562done
563
baf81c55
GM
564for dir in etc/images/*/*/; do
565 case "$dir" in
566 etc/images/icons/hicolor/) continue ;;
567 esac
561c44e8
RF
568 echo "Making links to \`${dir}'"
569 (cd ${dir}
baf81c55 570 ln `ls -d *` ../../../../${tempdir}/${dir})
561c44e8
RF
571done
572
10eae9dd
GM
573for dir in etc/images/icons/hicolor/*/apps \
574 etc/images/icons/hicolor/*/mimetypes; do
d8981daf
GM
575 echo "Making links to \`${dir}'"
576 (cd ${dir}
113ddd75 577 ln `ls -d *` ../../../../../../${tempdir}/${dir}
baf81c55 578 cd ../../../../../../${tempdir}/${dir})
d8981daf
GM
579done
580
21764d60 581echo "Making links to \`info'"
66afa119 582(cd info
baf81c55
GM
583 ln `find . -type f -print` ../${tempdir}/info)
584
d175b0ae
RF
585echo "Making links to \`doc/emacs'"
586(cd doc/emacs
baf81c55 587 ln *.texi *.in makefile.w32-in ChangeLog* ../../${tempdir}/doc/emacs)
f7dbcf3c 588
d175b0ae
RF
589echo "Making links to \`doc/misc'"
590(cd doc/misc
baf81c55
GM
591 ln *.texi *.tex *.in makefile.w32-in gnus-news.el ChangeLog* ../../${tempdir}/doc/misc)
592
d175b0ae
RF
593echo "Making links to \`doc/lispref'"
594(cd doc/lispref
baf81c55 595 ln *.texi *.in makefile.w32-in README ChangeLog* ../../${tempdir}/doc/lispref
d175b0ae 596 ln *.txt *.el spellfile tindex.pl ../../${tempdir}/doc/lispref
baf81c55 597 ln two-volume.make ../../${tempdir}/doc/lispref)
1d951084 598
d175b0ae
RF
599echo "Making links to \`doc/lispintro'"
600(cd doc/lispintro
baf81c55
GM
601 ln *.texi *.in makefile.w32-in *.eps *.pdf ../../${tempdir}/doc/lispintro
602 ln README ChangeLog* ../../${tempdir}/doc/lispintro
603 cd ../../${tempdir}/doc/lispintro)
3716a206 604
d175b0ae
RF
605echo "Making links to \`doc/man'"
606(cd doc/man
baf81c55
GM
607 ln ChangeLog* *.1 ../../${tempdir}/doc/man
608 cd ../../${tempdir}/doc/man)
d175b0ae 609
6ab508db 610### It would be nice if they could all be symlinks to top-level copy, but
c87b230f 611### you're not supposed to have any symlinks in distribution tar files.
fd4bc580 612echo "Making sure copying notices are all copies of \`COPYING'"
9e2a2647 613for subdir in . etc info leim lib-src lisp lwlib msdos nt src; do
b37017c6 614 rm -f ${tempdir}/${subdir}/COPYING
fd4bc580 615 cp COPYING ${tempdir}/${subdir}
f7dbcf3c
JB
616done
617
1260d6ba 618if [ "${newer}" ]; then
21764d60 619 echo "Removing files older than $newer"
76fb0a58
JB
620 ## We remove .elc files unconditionally, on the theory that anyone picking
621 ## up an incremental distribution already has a running Emacs to byte-compile
622 ## them with.
1260d6ba
ER
623 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \;
624fi
625
baf81c55
GM
626## Don't distribute backups, autosaves, etc.
627echo "Removing unwanted files"
628find ${tempparent} \( -name '*~' -o -name '#*#' -o -name '.*ignore' -o -name '=*' -o -name 'TAGS' \) -exec rm -f {} \;
629
4746118a 630if [ "${make_tar}" = yes ]; then
922ac4c5 631 if [ "${default_gzip}" = "" ]; then
21764d60 632 echo "Looking for gzip"
922ac4c5
JB
633 temppath=`echo $PATH | sed 's/^:/.:/
634 s/::/:.:/g
635 s/:$/:./
636 s/:/ /g'`
637 default_gzip=`(
638 for dir in ${temppath}; do
639 if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi
640 done
641 echo compress
642 )`
643 fi
f395c83a 644 case "${default_gzip}" in
37d6e313 645 bzip2) gzip_extension=.bz2 ;;
f395c83a 646 compress* ) gzip_extension=.Z ;;
ed398055 647 lzma) gzip_extension=.lzma ;;
0dc610dd 648 * ) gzip_extension=.gz ;;
f395c83a 649 esac
ca111811 650 echo "Creating tar file"
f395c83a
JB
651 (cd ${tempparent} ; tar cvf - ${emacsname} ) \
652 | ${default_gzip} \
653 > ${emacsname}.tar${gzip_extension}
4746118a 654fi
f7dbcf3c 655
4746118a 656if [ "${clean_up}" = yes ]; then
21764d60 657 echo "Cleaning up the staging directory"
f395c83a 658 rm -rf ${tempparent}
bb160193 659else
ca111811 660 (cd ${tempparent}; mv ${emacsname} ..)
bb160193 661 rm -rf ${tempparent}
f7dbcf3c 662fi
00c00348 663
76fb0a58 664### make-dist ends here