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 | |
e91081eb | 9 | # Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, |
37d6e313 | 10 | # 2006, 2007, 2008 Free Software Foundation, Inc. |
4c9c1174 KH |
11 | # |
12 | # This file is part of GNU Emacs. | |
13 | # | |
14 | # GNU Emacs is free software; you can redistribute it and/or modify | |
15 | # it under the terms of the GNU General Public License as published by | |
e5086daf | 16 | # the Free Software Foundation; either version 3, or (at your option) |
4c9c1174 KH |
17 | # any later version. |
18 | # | |
19 | # GNU Emacs is distributed in the hope that it will be useful, | |
20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | # GNU General Public License for more details. | |
23 | # | |
24 | # You should have received a copy of the GNU General Public License | |
1fb87c77 | 25 | # along with GNU Emacs; see the file COPYING. If not, write to the |
0d07bc90 LK |
26 | # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 | # Boston, MA 02110-1301, USA. | |
4c9c1174 | 28 | |
f7dbcf3c JB |
29 | progname="$0" |
30 | ||
76fb0a58 | 31 | ### Exit if a command fails. |
8c28d444 | 32 | #set -e |
f7dbcf3c | 33 | |
76fb0a58 | 34 | ### Print out each line we read, for debugging's sake. |
8c28d444 | 35 | #set -v |
f7dbcf3c | 36 | |
8df317a6 GM |
37 | LANGUAGE=C |
38 | LC_ALL=C | |
39 | LC_MESSAGES= | |
40 | LANG= | |
41 | export LANGUAGE LC_ALL LC_MESSAGES LANG | |
42 | ||
ccd57f4d | 43 | ## Don't restrict access to any files. |
67ffab69 RS |
44 | umask 0 |
45 | ||
c75cfabd | 46 | update=yes |
e4e1c623 | 47 | check=yes |
f22edcea RS |
48 | clean_up=no |
49 | make_tar=no | |
1260d6ba | 50 | newer="" |
f7dbcf3c JB |
51 | |
52 | while [ $# -gt 0 ]; do | |
53 | case "$1" in | |
f22edcea RS |
54 | ## This option tells make-dist to delete the staging directory |
55 | ## when done. It is useless to use this unless you make a tar file. | |
56 | "--clean-up" ) | |
57 | clean_up=yes | |
4746118a | 58 | ;; |
f22edcea RS |
59 | ## This option tells make-dist to make a tar file. |
60 | "--tar" ) | |
61 | make_tar=yes | |
f7dbcf3c | 62 | ;; |
c75cfabd RS |
63 | ## This option tells make-dist not to recompile or do analogous things. |
64 | "--no-update" ) | |
65 | update=no | |
66 | ;; | |
e4e1c623 RS |
67 | ## This option says don't check for bad file names, etc. |
68 | "--no-check" ) | |
69 | check=no | |
70 | ;; | |
76fb0a58 | 71 | ## This option tells make-dist to make the distribution normally, then |
7b9cd64c ER |
72 | ## remove all files older than the given timestamp file. This is useful |
73 | ## for creating incremental or patch distributions. | |
1260d6ba | 74 | "--newer") |
ef15f270 JB |
75 | newer="$2" |
76 | new_extension=".new" | |
1260d6ba ER |
77 | shift |
78 | ;; | |
922ac4c5 JB |
79 | ## This option tells make-dist to use `compress' instead of gzip. |
80 | ## Normally, make-dist uses gzip whenever it is present. | |
81 | "--compress") | |
82 | default_gzip="compress" | |
83 | ;; | |
37d6e313 RF |
84 | ## Same with bzip2. |
85 | "--bzip2") | |
86 | default_gzip="bzip2" | |
87 | ;; | |
ed398055 GM |
88 | ## Same with lzma. |
89 | "--lzma") | |
90 | default_gzip="lzma" | |
91 | ;; | |
2a714d4e GM |
92 | |
93 | "--snapshot") | |
94 | clean_up=yes | |
95 | make_tar=yes | |
96 | update=no | |
97 | check=no | |
98 | ;; | |
99 | ||
100 | "--help") | |
101 | echo "Usage: ${progname} [options]" | |
102 | echo "" | |
8772b5a8 | 103 | echo " --bzip2 use bzip2 instead of gzip" |
2a714d4e GM |
104 | echo " --clean-up delete staging directories when done" |
105 | echo " --compress use compress instead of gzip" | |
8772b5a8 | 106 | echo " --lzma use lzma instead of gzip" |
2a714d4e GM |
107 | echo " --newer=TIME don't include files older than TIME" |
108 | echo " --no-check don't check for bad file names etc." | |
109 | echo " --no-update don't recompile or do analogous things" | |
110 | echo " --snapshot same as --clean-up --no-update --tar --no-check" | |
111 | echo " --tar make a tar file" | |
112 | echo "" | |
113 | exit 0 | |
114 | ;; | |
115 | ||
f7dbcf3c JB |
116 | * ) |
117 | echo "${progname}: Unrecognized argument: $1" >&2 | |
118 | exit 1 | |
119 | ;; | |
120 | esac | |
121 | shift | |
122 | done | |
123 | ||
76fb0a58 | 124 | ### Make sure we're running in the right place. |
f7dbcf3c | 125 | if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then |
1260d6ba ER |
126 | echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2 |
127 | echo "${progname} must be run in the top directory of the Emacs" >&2 | |
0d122844 | 128 | echo "distribution tree. cd to that directory and try again." >&2 |
f7dbcf3c JB |
129 | exit 1 |
130 | fi | |
131 | ||
c75cfabd | 132 | ### Find where to run Emacs. |
4b1aaa8b | 133 | ### (Accept only absolute file names.) |
c75cfabd RS |
134 | if [ $update = yes ]; |
135 | then | |
59d05d2d | 136 | unset EMACS_UNIBYTE |
c75cfabd RS |
137 | if [ -f src/emacs ]; |
138 | then | |
139 | EMACS=`pwd`/src/emacs | |
140 | else | |
4b1aaa8b PE |
141 | case $EMACS in |
142 | /*) ;; | |
143 | *) | |
144 | if [ ! -f "$EMACS" ]; then | |
145 | echo "$0: You must specify the EMACS environment variable " \ | |
146 | "to an absolute file name." 2>&1 | |
147 | exit 1 | |
148 | fi;; | |
149 | esac | |
c75cfabd RS |
150 | fi |
151 | fi | |
152 | ||
76fb0a58 | 153 | ### Find out which version of Emacs this is. |
0e0186f1 | 154 | shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
47d105b0 | 155 | | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'` |
0e0186f1 RS |
156 | version=`grep 'defconst[ ]*emacs-version' lisp/version.el \ |
157 | | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` | |
f7dbcf3c | 158 | if [ ! "${version}" ]; then |
21764d60 | 159 | echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2 |
f7dbcf3c JB |
160 | exit 1 |
161 | fi | |
162 | ||
21764d60 | 163 | echo Version numbers are $version and $shortversion |
47d105b0 | 164 | |
c75cfabd RS |
165 | if [ $update = yes ]; |
166 | then | |
d175b0ae | 167 | if grep -s "@set EMACSVER *${shortversion}" ./doc/emacs/emacs.texi > /dev/null; then |
c75cfabd RS |
168 | true |
169 | else | |
d175b0ae | 170 | echo "You must update the version number in \`./doc/emacs/emacs.texi'" |
c75cfabd RS |
171 | sleep 5 |
172 | fi | |
f753e9aa JB |
173 | fi |
174 | ||
bb160193 RS |
175 | ### Make sure we don't already have a directory emacs-${version}. |
176 | ||
177 | emacsname="emacs-${version}${new_extension}" | |
178 | ||
179 | if [ -d ${emacsname} ] | |
180 | then | |
181 | echo Directory "${emacsname}" already exists >&2 | |
182 | exit 1 | |
183 | fi | |
184 | ||
76fb0a58 | 185 | ### Make sure the subdirectory is available. |
1260d6ba | 186 | tempparent="make-dist.tmp.$$" |
f7dbcf3c | 187 | if [ -d ${tempparent} ]; then |
1260d6ba ER |
188 | echo "${progname}: staging directory \`${tempparent}' already exists. |
189 | Perhaps a previous invocation of \`${progname}' failed to clean up after | |
190 | itself. Check that directories whose names are of the form | |
191 | \`make-dist.tmp.NNNNN' don't contain any important information, remove | |
192 | them, and try again." >&2 | |
f7dbcf3c JB |
193 | exit 1 |
194 | fi | |
195 | ||
e4e1c623 RS |
196 | ### Find where to run Emacs. |
197 | if [ $check = yes ]; | |
198 | then | |
199 | ### Check for .elc files with no corresponding .el file. | |
fb0797ca | 200 | ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \ |
5eea385d | 201 | leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el |
fb0797ca | 202 | ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \ |
5eea385d | 203 | leim/[a-z]*/[a-z]*.elc > /tmp/elc |
e4e1c623 RS |
204 | bogosities="`comm -13 /tmp/el /tmp/elc`" |
205 | if [ "${bogosities}" != "" ]; then | |
206 | echo "The following .elc files have no corresponding .el files:" | |
207 | echo "${bogosities}" | |
8615e792 | 208 | fi |
e4e1c623 RS |
209 | rm -f /tmp/el /tmp/elc |
210 | ||
211 | ### Check for .el files with no corresponding .elc file. | |
fb0797ca | 212 | ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \ |
33740d04 | 213 | leim/[a-z]*/[a-z]*.el > /tmp/el |
fb0797ca | 214 | ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \ |
33740d04 | 215 | leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc |
e4e1c623 RS |
216 | losers="`comm -23 /tmp/el /tmp/elc`" |
217 | bogosities= | |
218 | for file in $losers; do | |
33740d04 | 219 | if ! grep -q "no-byte-compile: t" $file; then |
e4e1c623 RS |
220 | case $file in |
221 | site-init.el | site-load.el | site-start.el | default.el) | |
222 | ;; | |
e4e1c623 RS |
223 | *) |
224 | bogosities="$file $bogosities" | |
225 | ;; | |
226 | esac | |
227 | fi | |
228 | done | |
229 | if [ x"${bogosities}" != x"" ]; then | |
230 | echo "The following .el files have no corresponding .elc files:" | |
231 | echo "${bogosities}" | |
232 | fi | |
233 | rm -f /tmp/el /tmp/elc | |
f5674423 KH |
234 | fi |
235 | ||
b4e84d5d | 236 | ### Make sure configure is newer than configure.in. |
a8a8fcfa | 237 | if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then |
21764d60 KH |
238 | echo "\`./configure.in' is newer than \`./configure'" >&2 |
239 | echo "Running autoconf" >&2 | |
28335560 | 240 | autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; } |
b4e84d5d JB |
241 | fi |
242 | ||
a49eb675 AS |
243 | ### Make sure src/config-in.stamp is newer than configure.in. |
244 | if [ "x`ls -t src/stamp-h.in configure.in | sed q`" != "xsrc/stamp-h.in" ]; then | |
245 | echo "\`./configure.in' is newer than \`./src/stamp-h.in'" >&2 | |
246 | echo "Running autoheader" >&2 | |
247 | autoheader || { x=$?; echo Autoheader FAILED! >&2; exit $x; } | |
248 | rm -f src/stamp-h.in | |
249 | echo timestamp > src/stamp-h.in | |
250 | fi | |
251 | ||
c75cfabd RS |
252 | if [ $update = yes ]; |
253 | then | |
254 | echo "Updating Info files" | |
d175b0ae RF |
255 | (cd doc/emacs; make -f Makefile.in srcdir=. info) |
256 | (cd doc/misc; make -f Makefile.in srcdir=. info) | |
257 | (cd doc/lispref; make -f Makefile.in srcdir=. info) | |
258 | (cd doc/lispintro; make -f Makefile.in SHELL=/bin/sh srcdir=. info VPATH=.) | |
980ab937 | 259 | |
e888d449 | 260 | echo "Updating finder, custom and autoload data" |
59d05d2d | 261 | (cd lisp; make updates EMACS="$EMACS") |
7cf45b04 | 262 | |
5eea385d GM |
263 | if test -f leim/leim-list.el; then |
264 | echo "Updating leim-list.el" | |
265 | (cd leim; make leim-list.el EMACS="$EMACS") | |
266 | fi | |
29c98ed3 RS |
267 | |
268 | echo "Recompiling Lisp files" | |
29c98ed3 | 269 | $EMACS -batch -f batch-byte-recompile-directory lisp leim |
c75cfabd | 270 | fi |
0588a761 | 271 | |
f07eebe0 KH |
272 | echo "Making lisp/MANIFEST" |
273 | ||
73494596 RS |
274 | (cd lisp; |
275 | files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'` | |
276 | for dir in [!=]*; do | |
5eea385d GM |
277 | if [ -d $dir ] && [ $dir != term ] && [ $dir != CVS ] && [ $dir != RCS ] |
278 | then | |
73494596 RS |
279 | echo $dir |
280 | thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'` | |
281 | files="$files $thisdir" | |
282 | fi | |
283 | done | |
a8a8fcfa PE |
284 | for file in $files |
285 | do sed -n 's/^;;; //p; q' $file | |
286 | done | sort > MANIFEST) | |
f07eebe0 | 287 | |
1260d6ba | 288 | echo "Creating staging directory: \`${tempparent}'" |
bb160193 | 289 | |
f7dbcf3c | 290 | mkdir ${tempparent} |
f7dbcf3c JB |
291 | tempdir="${tempparent}/${emacsname}" |
292 | ||
76fb0a58 JB |
293 | ### This trap ensures that the staging directory will be cleaned up even |
294 | ### when the script is interrupted in mid-career. | |
00c00348 | 295 | if [ "${clean_up}" = yes ]; then |
21764d60 | 296 | trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15 |
00c00348 ER |
297 | fi |
298 | ||
1260d6ba | 299 | echo "Creating top directory: \`${tempdir}'" |
f7dbcf3c JB |
300 | mkdir ${tempdir} |
301 | ||
76fb0a58 JB |
302 | ### We copy in the top-level files before creating the subdirectories in |
303 | ### hopes that this will make the top-level files appear first in the | |
304 | ### tar file; this means that people can start reading the INSTALL and | |
305 | ### README while the rest of the tar file is still unpacking. Whoopee. | |
21764d60 | 306 | echo "Making links to top-level files" |
3ada8b66 | 307 | ln INSTALL README BUGS move-if-change ${tempdir} |
bcea38a3 | 308 | ln ChangeLog Makefile.in configure configure.in ${tempdir} |
6f8b09f3 | 309 | ln config.bat make-dist update-subdirs vpath.sed ${tempdir} |
bb160193 | 310 | ### Copy these files; they're cross-filesystem symlinks. |
a4888c88 | 311 | cp mkinstalldirs ${tempdir} |
76fb0a58 | 312 | cp config.sub ${tempdir} |
2ed56345 | 313 | cp config.guess ${tempdir} |
dc7717ab | 314 | cp install-sh ${tempdir} |
f7dbcf3c | 315 | |
21764d60 | 316 | echo "Updating version number in README" |
f753e9aa JB |
317 | (cd ${tempdir} |
318 | awk \ | |
319 | '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 } | |
320 | $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \ | |
321 | version=${version} README > tmp.README | |
af559a4e | 322 | mv -f tmp.README README) |
f753e9aa JB |
323 | |
324 | ||
21764d60 | 325 | echo "Creating subdirectories" |
d175b0ae | 326 | for subdir in lisp site-lisp \ |
05494c29 | 327 | leim leim/CXTERM-DIC leim/MISC-DIC \ |
ca111811 | 328 | leim/SKK-DIC leim/ja-dic leim/quail \ |
c660c0a7 | 329 | src src/m src/s src/bitmaps lib-src oldXMenu lwlib \ |
5ec8424f | 330 | nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \ |
0bd50841 | 331 | etc etc/charsets etc/e etc/gnus etc/nxml \ |
ffda926c | 332 | etc/images etc/images/ezimage etc/images/gnus etc/images/gud \ |
d8981daf GM |
333 | etc/images/icons etc/images/icons/hicolor \ |
334 | etc/images/icons/hicolor/*x* etc/images/icons/hicolor/*x*/apps \ | |
335 | etc/images/low-color etc/images/mail \ | |
56bcdb80 GM |
336 | etc/images/smilies etc/images/smilies/grayscale \ |
337 | etc/images/smilies/medium etc/images/tree-widget \ | |
338 | etc/images/tree-widget/default etc/images/tree-widget/folder \ | |
3ada8b66 RF |
339 | etc/refcards etc/schema etc/tutorials info doc doc/emacs \ |
340 | doc/misc doc/man doc/lispref doc/lispintro m4 msdos vms mac \ | |
c0bc7978 | 341 | mac/src mac/Emacs.app mac/Emacs.app/Contents \ |
e0f712ba AC |
342 | mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \ |
343 | mac/Emacs.app/Contents/Resources/English.lproj | |
b3635775 GM |
344 | do |
345 | echo " ${tempdir}/${subdir}" | |
f7dbcf3c JB |
346 | mkdir ${tempdir}/${subdir} |
347 | done | |
348 | ||
67ffab69 | 349 | echo "Making links to \`lisp' and its subdirectories" |
7b9cd64c | 350 | ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el. |
f7dbcf3c JB |
351 | (cd lisp |
352 | ln [a-zA-Z]*.el ../${tempdir}/lisp | |
353 | ln [a-zA-Z]*.elc ../${tempdir}/lisp | |
8d2197ac | 354 | ln [a-zA-Z]*.dat ../${tempdir}/lisp |
a1363c1d | 355 | for img in [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do |
365949b7 GM |
356 | # If there are no images, the shell won't expand the pattern. |
357 | if [ -f $img ]; then | |
358 | ln $img ../${tempdir}/lisp | |
359 | fi | |
360 | done | |
76fb0a58 JB |
361 | ## simula.el doesn't keep abbreviations in simula.defns any more. |
362 | ## ln [a-zA-Z]*.defns ../${tempdir}/lisp | |
fb0797ca LK |
363 | ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp |
364 | ln Makefile.in makefile.w32-in ../${tempdir}/lisp | |
5eea385d | 365 | test -f README && ln README ../${tempdir}/lisp |
67ffab69 RS |
366 | (cd ../${tempdir}/lisp |
367 | rm -f TAGS =* | |
368 | rm -f site-init site-init.el site-init.elc | |
369 | rm -f site-load site-load.el site-load.elc | |
370 | rm -f site-start site-start.el site-start.elc | |
371 | rm -f default default.el default.elc | |
372 | ) | |
373 | ||
374 | ## Find all subdirs of lisp dir | |
375 | for file in `find . -type d -print`; do | |
376 | case $file in | |
5eea385d | 377 | . | .. | */Old | */CVS | */RCS | */=*) |
177c0ea7 | 378 | ;; |
67ffab69 RS |
379 | *) |
380 | if [ -d $file ]; then | |
381 | subdirs="$file $subdirs" | |
382 | fi | |
383 | ;; | |
384 | esac | |
385 | done | |
386 | ||
387 | for file in $subdirs; do | |
388 | echo " lisp/$file" | |
3ada8b66 | 389 | mkdir -p ../${tempdir}/lisp/$file |
b3635775 GM |
390 | ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file |
391 | ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file | |
392 | for img in $file/[a-zA-Z]*.xpm $file/[a-zA-Z]*.xbm $file/[a-zA-Z]*.pbm; do | |
365949b7 GM |
393 | if [ -f $img ]; then |
394 | ln $img ../${tempdir}/lisp/$file | |
395 | fi | |
396 | done | |
67ffab69 RS |
397 | if [ -f $file/README ]; then |
398 | ln $file/README ../${tempdir}/lisp/$file | |
399 | fi | |
b3635775 | 400 | |
dcf3ff7f RS |
401 | if [ -f $file/ChangeLog ]; then |
402 | ln $file/ChangeLog ../${tempdir}/lisp/$file | |
fb0797ca | 403 | for f in $file/ChangeLog.*[0-9]; do |
b3635775 GM |
404 | if [ -f $f ]; then |
405 | ln $f ../${tempdir}/lisp/$file | |
406 | fi | |
407 | done | |
dcf3ff7f | 408 | fi |
67ffab69 | 409 | done ) |
a78c106d | 410 | |
ca111811 | 411 | echo "Making links to \`leim' and its subdirectories" |
91741841 RS |
412 | ### Don't distribute TAGS, or =*.el files. |
413 | (cd leim | |
561bd1a1 | 414 | ln makefile.w32-in ../${tempdir}/leim |
ca111811 EZ |
415 | ln ChangeLog README ../${tempdir}/leim |
416 | ||
417 | ln CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC | |
418 | ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC | |
419 | ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC | |
420 | ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic | |
421 | ln Makefile.in ../${tempdir}/leim/Makefile.in | |
1d390bd8 | 422 | ln leim-ext.el ../${tempdir}/leim/leim-ext.el |
fb0797ca LK |
423 | ## Lisp files that start with a capital are generated from TIT |
424 | ## dictionaries so we don't distribute them. | |
ca111811 EZ |
425 | ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail |
426 | rm -f ../${tempdir}/leim/quail/quick-b5.* | |
427 | rm -f ../${tempdir}/leim/quail/quick-cns.* | |
428 | rm -f ../${tempdir}/leim/quail/tsang-b5.* | |
429 | rm -f ../${tempdir}/leim/quail/tsang-cns.* | |
430 | ||
431 | cd ../${tempdir}/leim | |
91741841 RS |
432 | rm -f TAGS =* */=*) |
433 | ||
21764d60 | 434 | echo "Making links to \`src'" |
76fb0a58 | 435 | ### Don't distribute =*.[ch] files, or the configured versions of |
c3f1e1a9 | 436 | ### config.in, paths.in, or Makefile.in, or TAGS. |
f7dbcf3c | 437 | (cd src |
c75cfabd | 438 | echo " (It is ok if ln fails in some cases.)" |
f7dbcf3c JB |
439 | ln [a-zA-Z]*.c ../${tempdir}/src |
440 | ln [a-zA-Z]*.h ../${tempdir}/src | |
441 | ln [a-zA-Z]*.s ../${tempdir}/src | |
c75cfabd RS |
442 | ln [a-zA-Z]*.in ../${tempdir}/src |
443 | ln [a-zA-Z]*.opt ../${tempdir}/src | |
444 | ## If we ended up with a symlink, or if we did not get anything | |
445 | ## due to a cross-device symlink, copy the file. | |
446 | for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in [a-zA-Z]*.opt; do | |
447 | if test -f ../${tempdir}/src/$file; then | |
448 | # test -f appears to succeed for a symlink | |
449 | if test -L ../${tempdir}/src/$file; then | |
450 | rm ../${tempdir}/src/$file | |
62dfdaf0 | 451 | cp -p $file ../${tempdir}/src |
c75cfabd RS |
452 | chmod a-w ../${tempdir}/src/$file |
453 | fi | |
454 | else | |
455 | rm ../${tempdir}/src/$file | |
62dfdaf0 | 456 | cp -p $file ../${tempdir}/src |
c75cfabd RS |
457 | chmod a-w ../${tempdir}/src/$file |
458 | fi | |
459 | done | |
460 | ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src | |
561bd1a1 | 461 | ln makefile.w32-in ../${tempdir}/src |
990ee059 | 462 | ln .gdbinit .dbxinit ../${tempdir}/src |
f7dbcf3c | 463 | cd ../${tempdir}/src |
8c28d444 | 464 | rm -f config.h epaths.h Makefile Makefile.c |
7b9cd64c | 465 | rm -f =* TAGS) |
f7dbcf3c | 466 | |
21764d60 | 467 | echo "Making links to \`src/bitmaps'" |
690eca32 JB |
468 | (cd src/bitmaps |
469 | ln README *.xbm ../../${tempdir}/src/bitmaps) | |
470 | ||
21764d60 | 471 | echo "Making links to \`src/m'" |
f7dbcf3c | 472 | (cd src/m |
facbb78e RS |
473 | # We call files for miscellaneous input (to linker etc) .inp. |
474 | ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m) | |
f7dbcf3c | 475 | |
21764d60 | 476 | echo "Making links to \`src/s'" |
f7dbcf3c | 477 | (cd src/s |
77427171 | 478 | ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s) |
f7dbcf3c | 479 | |
21764d60 | 480 | echo "Making links to \`lib-src'" |
f7dbcf3c | 481 | (cd lib-src |
375f1bd7 | 482 | ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src |
c3f1e1a9 | 483 | ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src |
561bd1a1 | 484 | ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src |
b3635775 | 485 | ln makefile.w32-in ../${tempdir}/lib-src |
c75cfabd RS |
486 | ## If we ended up with a symlink, or if we did not get anything |
487 | ## due to a cross-device symlink, copy the file. | |
488 | for file in [a-zA-Z]*.[chy]; do | |
489 | if test -f ../${tempdir}/lib-src/$file; then | |
490 | # test -f appears to succeed for a symlink | |
491 | if test -L ../${tempdir}/lib-src/$file; then | |
492 | rm ../${tempdir}/lib-src/$file | |
493 | cp $file ../${tempdir}/lib-src | |
494 | chmod a-w ../${tempdir}/lib-src/$file | |
495 | fi | |
496 | else | |
497 | rm ../${tempdir}/lib-src/$file | |
498 | cp $file ../${tempdir}/lib-src | |
499 | chmod a-w ../${tempdir}/lib-src/$file | |
500 | fi | |
501 | done | |
1260d6ba | 502 | cd ../${tempdir}/lib-src |
c75cfabd | 503 | rm -f Makefile.c |
9eff9fe3 | 504 | rm -f getopt.h |
7b9cd64c | 505 | rm -f =* TAGS) |
f7dbcf3c | 506 | |
9eff9fe3 PE |
507 | echo "Making links to \`m4'" |
508 | (cd m4 | |
509 | ln *.m4 ../${tempdir}/m4) | |
510 | ||
21764d60 | 511 | echo "Making links to \`nt'" |
391b3748 | 512 | (cd nt |
a695ae76 | 513 | ln emacs.manifest emacs.rc config.nt [a-z]*.c ../${tempdir}/nt |
bcea38a3 | 514 | ln nmake.defs gmake.defs subdirs.el ../${tempdir}/nt |
561bd1a1 | 515 | ln [a-z]*.bat [a-z]*.h ../${tempdir}/nt |
bcea38a3 | 516 | ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt) |
391b3748 | 517 | |
21764d60 | 518 | echo "Making links to \`nt/inc'" |
391b3748 | 519 | (cd nt/inc |
77427171 | 520 | ln [a-z]*.h ../../${tempdir}/nt/inc) |
391b3748 | 521 | |
21764d60 | 522 | echo "Making links to \`nt/inc/sys'" |
391b3748 | 523 | (cd nt/inc/sys |
77427171 | 524 | ln [a-z]*.h ../../../${tempdir}/nt/inc/sys) |
391b3748 | 525 | |
e827bc37 RS |
526 | echo "Making links to \`nt/inc/arpa'" |
527 | (cd nt/inc/arpa | |
528 | ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa) | |
529 | ||
530 | echo "Making links to \`nt/inc/netinet'" | |
531 | (cd nt/inc/netinet | |
532 | ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet) | |
533 | ||
5ec8424f GV |
534 | echo "Making links to \`nt/icons'" |
535 | (cd nt/icons | |
d6dc647f JR |
536 | ln [a-z]*.ico ../../${tempdir}/nt/icons |
537 | ln [a-z]*.cur ../../${tempdir}/nt/icons) | |
5ec8424f | 538 | |
b3635775 GM |
539 | echo "Making links to \`mac'" |
540 | (cd mac | |
c0bc7978 | 541 | ln ChangeLog INSTALL README make-package ../${tempdir}/mac) |
b3635775 GM |
542 | |
543 | echo "Making links to \`mac/src'" | |
544 | (cd mac/src | |
545 | ln [a-z]*.c *.r ../../${tempdir}/mac/src) | |
546 | ||
e0f712ba AC |
547 | echo "Making links to \`mac/Emacs.app/Contents'" |
548 | (cd mac/Emacs.app/Contents | |
549 | ln Info.plist PkgInfo ../../../${tempdir}/mac/Emacs.app/Contents) | |
550 | ||
e278f0fe YM |
551 | echo "Making links to \`mac/Emacs.app/Contents/Resources'" |
552 | (cd mac/Emacs.app/Contents/Resources | |
553 | ln Emacs.icns ../../../../${tempdir}/mac/Emacs.app/Contents/Resources) | |
554 | ||
e0f712ba AC |
555 | echo "Making links to \`mac/Emacs.app/Contents/Resources/English.lproj'" |
556 | (cd mac/Emacs.app/Contents/Resources/English.lproj | |
557 | ln InfoPlist.strings ../../../../../${tempdir}/mac/Emacs.app/Contents/Resources/English.lproj) | |
177c0ea7 | 558 | |
21764d60 | 559 | echo "Making links to \`msdos'" |
52d7b2e5 RS |
560 | (cd msdos |
561 | ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos | |
7fd85d56 | 562 | ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos |
52d7b2e5 RS |
563 | cd ../${tempdir}/msdos |
564 | rm -f =*) | |
565 | ||
21764d60 | 566 | echo "Making links to \`oldXMenu'" |
f7dbcf3c | 567 | (cd oldXMenu |
8bdbf9ed | 568 | ln *.c *.h *.in ../${tempdir}/oldXMenu |
10b9fe32 | 569 | ln README ChangeLog ../${tempdir}/oldXMenu |
f395c83a | 570 | ln compile.com descrip.mms ../${tempdir}/oldXMenu) |
f7dbcf3c | 571 | |
21764d60 | 572 | echo "Making links to \`lwlib'" |
c660c0a7 RS |
573 | (cd lwlib |
574 | ln *.c *.h *.in ../${tempdir}/lwlib | |
ebb81677 | 575 | ln README ChangeLog ../${tempdir}/lwlib) |
c660c0a7 | 576 | |
21764d60 | 577 | echo "Making links to \`etc'" |
f395c83a JB |
578 | ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or |
579 | ### tex litter. | |
f7dbcf3c | 580 | (cd etc |
561bd1a1 | 581 | files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$' \ |
0bd50841 | 582 | | grep -v '^charsets$' | grep -v '^gnus$' | grep -v '^images$' | grep -v '^nxml$' \ |
916447e4 | 583 | | grep -v '^refcards$' | grep -v '^tutorials$'| grep -v '^schema$'` |
7a6ee7ae | 584 | ln $files ../${tempdir}/etc |
98d4c1d0 RS |
585 | ## If we ended up with a symlink, or if we did not get anything |
586 | ## due to a cross-device symlink, copy the file. | |
7a6ee7ae | 587 | for file in $files; do |
98d4c1d0 RS |
588 | if test -f ../${tempdir}/etc/$file; then |
589 | # test -f appears to succeed for a symlink | |
590 | if test -L ../${tempdir}/etc/$file; then | |
591 | rm ../${tempdir}/etc/$file | |
592 | cp $file ../${tempdir}/etc | |
593 | chmod a-w ../${tempdir}/etc/$file | |
594 | fi | |
595 | else | |
596 | rm ../${tempdir}/etc/$file | |
597 | cp $file ../${tempdir}/etc | |
598 | chmod a-w ../${tempdir}/etc/$file | |
599 | fi | |
600 | done | |
f7dbcf3c | 601 | cd ../${tempdir}/etc |
d175b0ae | 602 | rm -f fns*.el |
23a58692 | 603 | rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core |
f395c83a | 604 | rm -f TAGS) |
f7dbcf3c | 605 | |
0bd50841 | 606 | for dir in etc/charsets etc/e etc/gnus etc/nxml etc/tutorials etc/refcards etc/schema ; do |
561c44e8 RF |
607 | echo "Making links to \`${dir}'" |
608 | (cd ${dir} | |
609 | ln `ls -d * | grep -v CVS | grep -v RCS` ../../${tempdir}/${dir} | |
610 | cd ../../${tempdir}/${dir} | |
611 | rm -f *~ \#*\# *,v =* core) | |
612 | done | |
f08ad882 | 613 | |
36eaa68f RF |
614 | echo "Making links to \`etc/images'" |
615 | (cd etc/images | |
10b9fe32 | 616 | for img in README [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do |
36eaa68f RF |
617 | if [ -f $img ]; then |
618 | ln $img ../../${tempdir}/etc/images | |
619 | fi | |
620 | done) | |
621 | ||
ad7a98ae | 622 | for dir in etc/images/ezimage etc/images/gnus etc/images/gud etc/images/icons \ |
561c44e8 | 623 | etc/images/low-color etc/images/mail etc/images/smilies ; do |
561bd1a1 EZ |
624 | echo "Making links to \`${dir}'" |
625 | (cd ${dir} | |
626 | ln `ls -d * | grep -v CVS | grep -v RCS` ../../../${tempdir}/${dir} | |
627 | cd ../../../${tempdir}/${dir} | |
628 | rm -f *~ \#*\# *,v =* core) | |
629 | done | |
630 | ||
56bcdb80 | 631 | for dir in etc/images/tree-widget/default etc/images/tree-widget/folder \ |
d8981daf | 632 | etc/images/smilies/grayscale etc/images/smilies/medium; do |
561c44e8 RF |
633 | echo "Making links to \`${dir}'" |
634 | (cd ${dir} | |
635 | ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../${tempdir}/${dir} | |
636 | cd ../../../../${tempdir}/${dir} | |
637 | rm -f *~ \#*\# *,v =* core) | |
638 | done | |
639 | ||
d8981daf GM |
640 | for dir in etc/images/icons/hicolor/*x*/apps ; do |
641 | echo "Making links to \`${dir}'" | |
642 | (cd ${dir} | |
643 | ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../../../${tempdir}/${dir} | |
644 | cd ../../../../../../${tempdir}/${dir} | |
645 | rm -f *~ \#*\# *,v =* core) | |
646 | done | |
647 | ||
21764d60 | 648 | echo "Making links to \`info'" |
66afa119 RS |
649 | # Don't distribute backups or autosaves. |
650 | (cd info | |
b3635775 | 651 | ln `find . -type f -print | grep -v CVS | grep -v RCS | grep -v cvsignore` ../${tempdir}/info |
5eea385d | 652 | #ln [a-zA-Z]* ../${tempdir}/info |
66afa119 RS |
653 | cd ../${tempdir}/info |
654 | # Avoid an error when expanding the wildcards later. | |
655 | ln emacs dummy~ ; ln emacs \#dummy\# | |
656 | rm -f *~ \#*\# core) | |
fda4e8f6 | 657 | |
d175b0ae RF |
658 | echo "Making links to \`doc/emacs'" |
659 | (cd doc/emacs | |
660 | ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/emacs | |
661 | ln makefile.w32-in ../../${tempdir}/doc/emacs | |
662 | test -f README && ln README ../../${tempdir}/doc/emacs | |
663 | test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/emacs | |
664 | ln ChangeLog ../../${tempdir}/doc/emacs | |
665 | cp texinfo.tex ../../${tempdir}/doc/emacs | |
666 | cd ../../${tempdir}/doc/emacs | |
56c31c87 RS |
667 | rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail |
668 | rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux) | |
f7dbcf3c | 669 | |
d175b0ae RF |
670 | echo "Making links to \`doc/misc'" |
671 | (cd doc/misc | |
672 | ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/misc | |
673 | ln makefile.w32-in ../../${tempdir}/doc/misc | |
674 | test -f README && ln README ../../${tempdir}/doc/misc | |
675 | test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/misc | |
676 | ln ChangeLog ../../${tempdir}/doc/misc | |
677 | cp texinfo.tex ../../${tempdir}/doc/misc | |
678 | cd ../../${tempdir}/doc/misc | |
679 | rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail | |
680 | rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux) | |
681 | ||
682 | echo "Making links to \`doc/lispref'" | |
683 | (cd doc/lispref | |
684 | ln `ls -1 *.texi` ../../${tempdir}/doc/lispref | |
685 | ln *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/lispref | |
686 | ln *.txt *.el spellfile tindex.pl ../../${tempdir}/doc/lispref | |
687 | ln makefile.w32-in ../../${tempdir}/doc/lispref | |
688 | test -f README && ln README ../../${tempdir}/doc/lispref | |
689 | test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispref | |
690 | ln ChangeLog ../../${tempdir}/doc/lispref | |
691 | cd ../../${tempdir}/doc/lispref | |
1d951084 EZ |
692 | rm -f \#*\# =* *~ core elisp-index* *.Z *.z xmail |
693 | rm -f elisp.?? *.log *.toc *.dvi *.oaux) | |
694 | ||
d175b0ae RF |
695 | echo "Making links to \`doc/lispintro'" |
696 | (cd doc/lispintro | |
697 | ln *.texi *.aux *.cps *.fns *.kys *.vrs *.eps ../../${tempdir}/doc/lispintro | |
698 | ln makefile.w32-in ../../${tempdir}/doc/lispintro | |
699 | test -f texinfo.tex && ln texinfo.tex ../../${tempdir}/doc/lispintro | |
700 | test -f README && ln README ../../${tempdir}/doc/lispintro | |
701 | test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispintro | |
702 | ln ChangeLog ../../${tempdir}/doc/lispintro | |
703 | cd ../../${tempdir}/doc/lispintro | |
3716a206 EZ |
704 | rm -f \#*\# =* *~ core *.Z *.z xmail |
705 | rm -f emacs-lisp-intro.?? *.log *.toc *.dvi *.oaux) | |
706 | ||
d175b0ae RF |
707 | echo "Making links to \`doc/man'" |
708 | (cd doc/man | |
31d0fa8c | 709 | ln *.1 ../../${tempdir}/doc/man) |
d175b0ae | 710 | |
21764d60 | 711 | echo "Making links to \`vms'" |
40eef465 | 712 | (cd vms |
5eea385d | 713 | test -f README && ln README ../${tempdir}/vms |
40eef465 JB |
714 | cd ../${tempdir}/vms |
715 | rm -f *~) | |
716 | ||
6ab508db | 717 | ### It would be nice if they could all be symlinks to top-level copy, but |
c87b230f | 718 | ### you're not supposed to have any symlinks in distribution tar files. |
fd4bc580 | 719 | echo "Making sure copying notices are all copies of \`COPYING'" |
860484dd | 720 | for subdir in . etc info leim lib-src lisp lwlib mac msdos nt src; do |
b37017c6 | 721 | rm -f ${tempdir}/${subdir}/COPYING |
fd4bc580 | 722 | cp COPYING ${tempdir}/${subdir} |
f7dbcf3c JB |
723 | done |
724 | ||
1260d6ba | 725 | if [ "${newer}" ]; then |
21764d60 | 726 | echo "Removing files older than $newer" |
76fb0a58 JB |
727 | ## We remove .elc files unconditionally, on the theory that anyone picking |
728 | ## up an incremental distribution already has a running Emacs to byte-compile | |
729 | ## them with. | |
1260d6ba ER |
730 | find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \; |
731 | fi | |
732 | ||
4746118a | 733 | if [ "${make_tar}" = yes ]; then |
922ac4c5 | 734 | if [ "${default_gzip}" = "" ]; then |
21764d60 | 735 | echo "Looking for gzip" |
922ac4c5 JB |
736 | temppath=`echo $PATH | sed 's/^:/.:/ |
737 | s/::/:.:/g | |
738 | s/:$/:./ | |
739 | s/:/ /g'` | |
740 | default_gzip=`( | |
741 | for dir in ${temppath}; do | |
742 | if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi | |
743 | done | |
744 | echo compress | |
745 | )` | |
746 | fi | |
f395c83a | 747 | case "${default_gzip}" in |
37d6e313 | 748 | bzip2) gzip_extension=.bz2 ;; |
f395c83a | 749 | compress* ) gzip_extension=.Z ;; |
ed398055 | 750 | lzma) gzip_extension=.lzma ;; |
0dc610dd | 751 | * ) gzip_extension=.gz ;; |
f395c83a | 752 | esac |
ca111811 | 753 | echo "Creating tar file" |
f395c83a JB |
754 | (cd ${tempparent} ; tar cvf - ${emacsname} ) \ |
755 | | ${default_gzip} \ | |
756 | > ${emacsname}.tar${gzip_extension} | |
4746118a | 757 | fi |
f7dbcf3c | 758 | |
4746118a | 759 | if [ "${clean_up}" = yes ]; then |
21764d60 | 760 | echo "Cleaning up the staging directory" |
f395c83a | 761 | rm -rf ${tempparent} |
bb160193 | 762 | else |
ca111811 | 763 | (cd ${tempparent}; mv ${emacsname} ..) |
bb160193 | 764 | rm -rf ${tempparent} |
f7dbcf3c | 765 | fi |
00c00348 | 766 | |
ab5796a9 | 767 | # arch-tag: 26e3eb50-a394-4ab2-82b2-d8e5af500de7 |
76fb0a58 | 768 | ### make-dist ends here |