]> code.delx.au - gnu-emacs/blob - make-dist
Distribute all ChangeLog files in lisp/.
[gnu-emacs] / make-dist
1 #!/bin/sh
2
3 #### make-dist: create an Emacs distribution tar file from the current
4 #### source tree. This basically creates a duplicate directory
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.
8
9 # Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2005
10 # Free Software Foundation, Inc.
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
16 # the Free Software Foundation; either version 2, or (at your option)
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
25 # along with GNU Emacs; see the file COPYING. If not, write to the
26 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 # Boston, MA 02111-1307, USA.
28
29 progname="$0"
30
31 ### Exit if a command fails.
32 #set -e
33
34 ### Print out each line we read, for debugging's sake.
35 #set -v
36
37 LANGUAGE=C
38 LC_ALL=C
39 LC_MESSAGES=
40 LANG=
41 export LANGUAGE LC_ALL LC_MESSAGES LANG
42
43 ## Don't restrict access to any files.
44 umask 0
45
46 update=yes
47 check=yes
48 clean_up=no
49 make_tar=no
50 newer=""
51
52 while [ $# -gt 0 ]; do
53 case "$1" in
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
58 ;;
59 ## This option tells make-dist to make a tar file.
60 "--tar" )
61 make_tar=yes
62 ;;
63 ## This option tells make-dist not to recompile or do analogous things.
64 "--no-update" )
65 update=no
66 ;;
67 ## This option says don't check for bad file names, etc.
68 "--no-check" )
69 check=no
70 ;;
71 ## This option tells make-dist to make the distribution normally, then
72 ## remove all files older than the given timestamp file. This is useful
73 ## for creating incremental or patch distributions.
74 "--newer")
75 newer="$2"
76 new_extension=".new"
77 shift
78 ;;
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 ;;
84
85 "--snapshot")
86 clean_up=yes
87 make_tar=yes
88 update=no
89 check=no
90 ;;
91
92 "--help")
93 echo "Usage: ${progname} [options]"
94 echo ""
95 echo " --clean-up delete staging directories when done"
96 echo " --compress use compress instead of gzip"
97 echo " --newer=TIME don't include files older than TIME"
98 echo " --no-check don't check for bad file names etc."
99 echo " --no-update don't recompile or do analogous things"
100 echo " --snapshot same as --clean-up --no-update --tar --no-check"
101 echo " --tar make a tar file"
102 echo ""
103 exit 0
104 ;;
105
106 * )
107 echo "${progname}: Unrecognized argument: $1" >&2
108 exit 1
109 ;;
110 esac
111 shift
112 done
113
114 ### Make sure we're running in the right place.
115 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
116 echo "${progname}: Can't find \`src/lisp.h' and \`lisp/version.el'." >&2
117 echo "${progname} must be run in the top directory of the Emacs" >&2
118 echo "distribution tree. cd to that directory and try again." >&2
119 exit 1
120 fi
121
122 ### Find where to run Emacs.
123 ### (We don't accept EMACS=t as an answer, since that probably only means
124 ### that the shell is running in an Emacs window.)
125 if [ $update = yes ];
126 then
127 unset EMACS_UNIBYTE
128 if [ -f src/emacs ];
129 then
130 EMACS=`pwd`/src/emacs
131 else
132 if [ "x$EMACS" = "x" -o "x$EMACS" = "xt" ];
133 then
134 echo You must specify the EMACS environment variable 2>&1
135 exit 1
136 fi
137 fi
138 fi
139
140 ### Find out which version of Emacs this is.
141 shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \
142 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
143 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
144 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
145 if [ ! "${version}" ]; then
146 echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
147 exit 1
148 fi
149
150 echo Version numbers are $version and $shortversion
151
152 if [ $update = yes ];
153 then
154 if grep -s "@set EMACSVER *${shortversion}" ./man/emacs.texi > /dev/null; then
155 true
156 else
157 echo "You must update the version number in \`./man/emacs.texi'"
158 sleep 5
159 fi
160 fi
161
162 ### Make sure we don't already have a directory emacs-${version}.
163
164 emacsname="emacs-${version}${new_extension}"
165
166 if [ -d ${emacsname} ]
167 then
168 echo Directory "${emacsname}" already exists >&2
169 exit 1
170 fi
171
172 ### Make sure the subdirectory is available.
173 tempparent="make-dist.tmp.$$"
174 if [ -d ${tempparent} ]; then
175 echo "${progname}: staging directory \`${tempparent}' already exists.
176 Perhaps a previous invocation of \`${progname}' failed to clean up after
177 itself. Check that directories whose names are of the form
178 \`make-dist.tmp.NNNNN' don't contain any important information, remove
179 them, and try again." >&2
180 exit 1
181 fi
182
183 ### Find where to run Emacs.
184 if [ $check = yes ];
185 then
186 ### Check for .elc files with no corresponding .el file.
187 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
188 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
189 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
190 leim/[a-z]*/[a-z]*.elc > /tmp/elc
191 bogosities="`comm -13 /tmp/el /tmp/elc`"
192 if [ "${bogosities}" != "" ]; then
193 echo "The following .elc files have no corresponding .el files:"
194 echo "${bogosities}"
195 fi
196 rm -f /tmp/el /tmp/elc
197
198 ### Check for .el files with no corresponding .elc file.
199 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
200 leim/[a-z]*/[a-z]*.el > /tmp/el
201 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
202 leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
203 losers="`comm -23 /tmp/el /tmp/elc`"
204 bogosities=
205 for file in $losers; do
206 if ! grep -q "no-byte-compile: t" $file; then
207 case $file in
208 site-init.el | site-load.el | site-start.el | default.el)
209 ;;
210 *)
211 bogosities="$file $bogosities"
212 ;;
213 esac
214 fi
215 done
216 if [ x"${bogosities}" != x"" ]; then
217 echo "The following .el files have no corresponding .elc files:"
218 echo "${bogosities}"
219 fi
220 rm -f /tmp/el /tmp/elc
221
222 ### Check for .el files that would overflow the 14-char limit if compiled.
223 long=`find lisp leim -name '[a-zA-Z0-9]??????????*.el' -print`
224 if [ "$long" != "" ]; then
225 echo "The following .el file names are too long:"
226 echo "$long"
227 fi
228 fi
229
230 ### Make sure configure is newer than configure.in.
231 if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then
232 echo "\`./configure.in' is newer than \`./configure'" >&2
233 echo "Running autoconf" >&2
234 autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; }
235 fi
236
237 ### Make sure src/config-in.stamp is newer than configure.in.
238 if [ "x`ls -t src/stamp-h.in configure.in | sed q`" != "xsrc/stamp-h.in" ]; then
239 echo "\`./configure.in' is newer than \`./src/stamp-h.in'" >&2
240 echo "Running autoheader" >&2
241 autoheader || { x=$?; echo Autoheader FAILED! >&2; exit $x; }
242 rm -f src/stamp-h.in
243 echo timestamp > src/stamp-h.in
244 fi
245
246 if [ $update = yes ];
247 then
248 echo "Updating Info files"
249 (cd man; make -f Makefile.in srcdir=. info)
250 (cd lispref; make -f Makefile.in srcdir=. info)
251 (cd lispintro; make -f Makefile.in SHELL=/bin/sh srcdir=. info VPATH=.)
252
253 echo "Updating finder, custom and autoload data"
254 (cd lisp; make updates EMACS="$EMACS")
255
256 if test -f leim/leim-list.el; then
257 echo "Updating leim-list.el"
258 (cd leim; make leim-list.el EMACS="$EMACS")
259 fi
260
261 echo "Recompiling Lisp files"
262 $EMACS -batch -f batch-byte-recompile-directory lisp leim
263 fi
264
265 echo "Making lisp/MANIFEST"
266
267 (cd lisp;
268 files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'`
269 for dir in [!=]*; do
270 if [ -d $dir ] && [ $dir != term ] && [ $dir != CVS ] && [ $dir != RCS ]
271 then
272 echo $dir
273 thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'`
274 files="$files $thisdir"
275 fi
276 done
277 for file in $files
278 do sed -n 's/^;;; //p; q' $file
279 done | sort > MANIFEST)
280
281 echo "Creating staging directory: \`${tempparent}'"
282
283 mkdir ${tempparent}
284 tempdir="${tempparent}/${emacsname}"
285
286 ### This trap ensures that the staging directory will be cleaned up even
287 ### when the script is interrupted in mid-career.
288 if [ "${clean_up}" = yes ]; then
289 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15
290 fi
291
292 echo "Creating top directory: \`${tempdir}'"
293 mkdir ${tempdir}
294
295 ### We copy in the top-level files before creating the subdirectories in
296 ### hopes that this will make the top-level files appear first in the
297 ### tar file; this means that people can start reading the INSTALL and
298 ### README while the rest of the tar file is still unpacking. Whoopee.
299 echo "Making links to top-level files"
300 ln AUTHORS FTP INSTALL README BUGS move-if-change ${tempdir}
301 ln ChangeLog Makefile.in configure configure.in ${tempdir}
302 ln config.bat make-dist update-subdirs vpath.sed ${tempdir}
303 ### Copy these files; they're cross-filesystem symlinks.
304 cp mkinstalldirs ${tempdir}
305 cp config.sub ${tempdir}
306 cp config.guess ${tempdir}
307 cp install-sh ${tempdir}
308
309 echo "Updating version number in README"
310 (cd ${tempdir}
311 awk \
312 '$1 " " $2 " " $3 " " $4 " " $5 == "This directory tree holds version" { $6 = version; print $0 }
313 $1 " " $2 " " $3 " " $4 " " $5 != "This directory tree holds version"' \
314 version=${version} README > tmp.README
315 mv -f tmp.README README)
316
317
318 echo "Creating subdirectories"
319 for subdir in lisp site-lisp lispref lispintro \
320 leim leim/CXTERM-DIC leim/MISC-DIC \
321 leim/SKK-DIC leim/ja-dic leim/quail \
322 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
323 nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
324 etc etc/e info man msdos vms mac mac/inc mac/inc/sys \
325 mac/src mac/Emacs.app mac/Emacs.app/Contents \
326 mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \
327 mac/Emacs.app/Contents/Resources/English.lproj
328 do
329 echo " ${tempdir}/${subdir}"
330 mkdir ${tempdir}/${subdir}
331 done
332
333 echo "Making links to \`lisp' and its subdirectories"
334 ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el.
335 (cd lisp
336 ln [a-zA-Z]*.el ../${tempdir}/lisp
337 ln [a-zA-Z]*.elc ../${tempdir}/lisp
338 ln [a-zA-Z]*.dat ../${tempdir}/lisp
339 for img in [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do
340 # If there are no images, the shell won't expand the pattern.
341 if [ -f $img ]; then
342 ln $img ../${tempdir}/lisp
343 fi
344 done
345 ## simula.el doesn't keep abbreviations in simula.defns any more.
346 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp
347 ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp
348 ln Makefile.in makefile.w32-in ../${tempdir}/lisp
349 test -f README && ln README ../${tempdir}/lisp
350 (cd ../${tempdir}/lisp
351 rm -f TAGS =*
352 rm -f ldefs-boot.el
353 rm -f site-init site-init.el site-init.elc
354 rm -f site-load site-load.el site-load.elc
355 rm -f site-start site-start.el site-start.elc
356 rm -f default default.el default.elc
357 )
358
359 ## Find all subdirs of lisp dir
360 for file in `find . -type d -print`; do
361 case $file in
362 . | .. | */Old | */CVS | */RCS | */=*)
363 ;;
364 *)
365 if [ -d $file ]; then
366 subdirs="$file $subdirs"
367 fi
368 ;;
369 esac
370 done
371
372 for file in $subdirs; do
373 echo " lisp/$file"
374 mkdir ../${tempdir}/lisp/$file
375 ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file
376 ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file
377 for img in $file/[a-zA-Z]*.xpm $file/[a-zA-Z]*.xbm $file/[a-zA-Z]*.pbm; do
378 if [ -f $img ]; then
379 ln $img ../${tempdir}/lisp/$file
380 fi
381 done
382 if [ -f $file/README ]; then
383 ln $file/README ../${tempdir}/lisp/$file
384 fi
385
386 if [ -f $file/ChangeLog ]; then
387 ln $file/ChangeLog ../${tempdir}/lisp/$file
388 for f in $file/ChangeLog.*[0-9]; do
389 if [ -f $f ]; then
390 ln $f ../${tempdir}/lisp/$file
391 fi
392 done
393 fi
394 done )
395
396 echo "Making links to \`leim' and its subdirectories"
397 ### Don't distribute TAGS, or =*.el files.
398 (cd leim
399 ln makefile.nt makefile.w32-in ../${tempdir}/leim
400 ln ChangeLog README ../${tempdir}/leim
401
402 ln CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
403 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
404 ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
405 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
406 ln Makefile.in ../${tempdir}/leim/Makefile.in
407 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
408 ## Lisp files that start with a capital are generated from TIT
409 ## dictionaries so we don't distribute them.
410 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
411 rm -f ../${tempdir}/leim/quail/quick-b5.*
412 rm -f ../${tempdir}/leim/quail/quick-cns.*
413 rm -f ../${tempdir}/leim/quail/tsang-b5.*
414 rm -f ../${tempdir}/leim/quail/tsang-cns.*
415
416 cd ../${tempdir}/leim
417 rm -f TAGS =* */=*)
418
419 echo "Making links to \`src'"
420 ### Don't distribute =*.[ch] files, or the configured versions of
421 ### config.in, paths.in, or Makefile.in, or TAGS.
422 (cd src
423 echo " (It is ok if ln fails in some cases.)"
424 ln [a-zA-Z]*.c ../${tempdir}/src
425 ln [a-zA-Z]*.h ../${tempdir}/src
426 ln [a-zA-Z]*.s ../${tempdir}/src
427 ln [a-zA-Z]*.in ../${tempdir}/src
428 ln [a-zA-Z]*.opt ../${tempdir}/src
429 ## If we ended up with a symlink, or if we did not get anything
430 ## due to a cross-device symlink, copy the file.
431 for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in [a-zA-Z]*.opt; do
432 if test -f ../${tempdir}/src/$file; then
433 # test -f appears to succeed for a symlink
434 if test -L ../${tempdir}/src/$file; then
435 rm ../${tempdir}/src/$file
436 cp -p $file ../${tempdir}/src
437 chmod a-w ../${tempdir}/src/$file
438 fi
439 else
440 rm ../${tempdir}/src/$file
441 cp -p $file ../${tempdir}/src
442 chmod a-w ../${tempdir}/src/$file
443 fi
444 done
445 ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src
446 ln makefile.nt makefile.w32-in ../${tempdir}/src
447 ln .gdbinit .dbxinit ../${tempdir}/src
448 cd ../${tempdir}/src
449 rm -f config.h epaths.h Makefile Makefile.c
450 rm -f =* TAGS)
451
452 echo "Making links to \`src/bitmaps'"
453 (cd src/bitmaps
454 ln README *.xbm ../../${tempdir}/src/bitmaps)
455
456 echo "Making links to \`src/m'"
457 (cd src/m
458 # We call files for miscellaneous input (to linker etc) .inp.
459 ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m)
460
461 echo "Making links to \`src/s'"
462 (cd src/s
463 ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
464
465 echo "Making links to \`lib-src'"
466 (cd lib-src
467 ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src
468 ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
469 ln grep-changelog rcs2log rcs-checkin makefile.nt ../${tempdir}/lib-src
470 ln makefile.w32-in ../${tempdir}/lib-src
471 ## If we ended up with a symlink, or if we did not get anything
472 ## due to a cross-device symlink, copy the file.
473 for file in [a-zA-Z]*.[chy]; do
474 if test -f ../${tempdir}/lib-src/$file; then
475 # test -f appears to succeed for a symlink
476 if test -L ../${tempdir}/lib-src/$file; then
477 rm ../${tempdir}/lib-src/$file
478 cp $file ../${tempdir}/lib-src
479 chmod a-w ../${tempdir}/lib-src/$file
480 fi
481 else
482 rm ../${tempdir}/lib-src/$file
483 cp $file ../${tempdir}/lib-src
484 chmod a-w ../${tempdir}/lib-src/$file
485 fi
486 done
487 cd ../${tempdir}/lib-src
488 rm -f Makefile.c
489 rm -f =* TAGS)
490
491 echo "Making links to \`nt'"
492 (cd nt
493 ln emacs.rc config.nt [a-z]*.c ../${tempdir}/nt
494 ln nmake.defs gmake.defs subdirs.el ../${tempdir}/nt
495 ln [a-z]*.bat [a-z]*.h makefile.def makefile.nt ../${tempdir}/nt
496 ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt)
497
498 echo "Making links to \`nt/inc'"
499 (cd nt/inc
500 ln [a-z]*.h ../../${tempdir}/nt/inc)
501
502 echo "Making links to \`nt/inc/sys'"
503 (cd nt/inc/sys
504 ln [a-z]*.h ../../../${tempdir}/nt/inc/sys)
505
506 echo "Making links to \`nt/inc/arpa'"
507 (cd nt/inc/arpa
508 ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa)
509
510 echo "Making links to \`nt/inc/netinet'"
511 (cd nt/inc/netinet
512 ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet)
513
514 echo "Making links to \`nt/icons'"
515 (cd nt/icons
516 ln [a-z]*.ico ../../${tempdir}/nt/icons
517 ln [a-z]*.cur ../../${tempdir}/nt/icons)
518
519 echo "Making links to \`mac'"
520 (cd mac
521 ln ChangeLog INSTALL README *.xml *.MPW ../${tempdir}/mac)
522
523 echo "Making links to \`mac/inc'"
524 (cd mac/inc
525 ln [a-z]*.h ../../${tempdir}/mac/inc)
526
527 echo "Making links to \`mac/inc/sys'"
528 (cd mac/inc/sys
529 ln [a-z]*.h ../../../${tempdir}/mac/inc/sys)
530
531 echo "Making links to \`mac/src'"
532 (cd mac/src
533 ln [a-z]*.c *.r ../../${tempdir}/mac/src)
534
535 echo "Making links to \`mac/Emacs.app/Contents'"
536 (cd mac/Emacs.app/Contents
537 ln Info.plist PkgInfo ../../../${tempdir}/mac/Emacs.app/Contents)
538
539 echo "Making links to \`mac/Emacs.app/Contents/Resources/English.lproj'"
540 (cd mac/Emacs.app/Contents/Resources/English.lproj
541 ln InfoPlist.strings ../../../../../${tempdir}/mac/Emacs.app/Contents/Resources/English.lproj)
542
543 echo "Making links to \`msdos'"
544 (cd msdos
545 ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos
546 ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos
547 cd ../${tempdir}/msdos
548 rm -f =*)
549
550 echo "Making links to \`oldXMenu'"
551 (cd oldXMenu
552 ln *.c *.h *.in ../${tempdir}/oldXMenu
553 ln README Imakefile ChangeLog ../${tempdir}/oldXMenu
554 ln compile.com descrip.mms ../${tempdir}/oldXMenu)
555
556 echo "Making links to \`lwlib'"
557 (cd lwlib
558 ln *.c *.h *.in ../${tempdir}/lwlib
559 ln README ChangeLog ../${tempdir}/lwlib)
560
561 echo "Making links to \`etc'"
562 ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or
563 ### tex litter.
564 ### Don't distribute gfdl.1, since no man page references it.
565 (cd etc
566 files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$'`
567 ln $files ../${tempdir}/etc
568 ## If we ended up with a symlink, or if we did not get anything
569 ## due to a cross-device symlink, copy the file.
570 for file in $files; do
571 if test -f ../${tempdir}/etc/$file; then
572 # test -f appears to succeed for a symlink
573 if test -L ../${tempdir}/etc/$file; then
574 rm ../${tempdir}/etc/$file
575 cp $file ../${tempdir}/etc
576 chmod a-w ../${tempdir}/etc/$file
577 fi
578 else
579 rm ../${tempdir}/etc/$file
580 cp $file ../${tempdir}/etc
581 chmod a-w ../${tempdir}/etc/$file
582 fi
583 done
584 cd ../${tempdir}/etc
585 rm -f fns*.el gfdl.1
586 rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core
587 rm -f TAGS)
588
589 echo "Making links to \`etc/e'"
590 (cd etc/e
591 ln `ls -d * | grep -v CVS | grep -v RCS` ../../${tempdir}/etc/e
592 cd ../../${tempdir}/etc/e
593 rm -f *~ \#*\# *,v =* core)
594
595 echo "Making links to \`info'"
596 # Don't distribute backups or autosaves.
597 (cd info
598 ln `find . -type f -print | grep -v CVS | grep -v RCS | grep -v cvsignore` ../${tempdir}/info
599 #ln [a-zA-Z]* ../${tempdir}/info
600 cd ../${tempdir}/info
601 # Avoid an error when expanding the wildcards later.
602 ln emacs dummy~ ; ln emacs \#dummy\#
603 rm -f *~ \#*\# core)
604
605 echo "Making links to \`man'"
606 (cd man
607 ln *.texi *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/man
608 test -f README && ln README ../${tempdir}/man
609 test -f Makefile.in && ln Makefile.in ../${tempdir}/man
610 ln ChangeLog ../${tempdir}/man
611 test -f split-man && ln split-man ../${tempdir}/man
612 cp texinfo.tex ../${tempdir}/man
613 cd ../${tempdir}/man
614 rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail
615 rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux)
616
617 echo "Making links to \`lispref'"
618 (cd lispref
619 ln `ls -1 *.texi` ../${tempdir}/lispref
620 ln *.aux *.cps *.fns *.kys *.vrs ../${tempdir}/lispref
621 ln *.txt *.el spellfile tindex.pl ../${tempdir}/lispref
622 test -f README && ln README ../${tempdir}/lispref
623 test -f Makefile.in && ln Makefile.in ../${tempdir}/lispref
624 ln ChangeLog ../${tempdir}/lispref
625 cd ../${tempdir}/lispref
626 rm -f \#*\# =* *~ core elisp-index* *.Z *.z xmail
627 rm -f elisp.?? *.log *.toc *.dvi *.oaux)
628
629 echo "Making links to \`lispintro'"
630 (cd lispintro
631 ln *.texi *.aux *.cps *.fns *.kys *.vrs *.eps ../${tempdir}/lispintro
632 test -f texinfo.tex && ln texinfo.tex ../${tempdir}/lispintro
633 test -f README && ln README ../${tempdir}/lispintro
634 test -f Makefile.in && ln Makefile.in ../${tempdir}/lispintro
635 ln ChangeLog ../${tempdir}/lispintro
636 cd ../${tempdir}/lispintro
637 rm -f \#*\# =* *~ core *.Z *.z xmail
638 rm -f emacs-lisp-intro.?? *.log *.toc *.dvi *.oaux)
639
640 echo "Making links to \`vms'"
641 (cd vms
642 test -f README && ln README ../${tempdir}/vms
643 cd ../${tempdir}/vms
644 rm -f *~)
645
646 ### It would be nice if they could all be symlinks to top-level copy, but
647 ### you're not supposed to have any symlinks in distribution tar files.
648 echo "Making sure copying notices are all copies of \`COPYING'"
649 for subdir in . etc info leim lib-src lisp lwlib mac msdos nt src; do
650 rm -f ${tempdir}/${subdir}/COPYING
651 cp COPYING ${tempdir}/${subdir}
652 done
653
654 #### Make sure that there aren't any hard links between files in the
655 #### distribution; people with afs can't deal with that. Okay,
656 #### actually we just re-copy anything with a link count greater
657 #### than two. (Yes, strictly greater than 2 is correct; since we
658 #### created these files by linking them in from the original tree,
659 #### they'll have exactly two links normally.)
660 ####
661 #### Commented out since it's not strictly necessary; it should suffice
662 #### to just break the link on alloca.c.
663 #echo "Breaking intra-tree links."
664 #find ${tempdir} ! -type d -links +2 \
665 # -exec cp -p {} $$ \; -exec rm -f {} \; -exec mv $$ {} \;
666 rm -f $tempdir/lib-src/alloca.c
667 cp $tempdir/src/alloca.c $tempdir/lib-src/alloca.c
668
669 if [ "${newer}" ]; then
670 echo "Removing files older than $newer"
671 ## We remove .elc files unconditionally, on the theory that anyone picking
672 ## up an incremental distribution already has a running Emacs to byte-compile
673 ## them with.
674 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \;
675 fi
676
677 if [ "${make_tar}" = yes ]; then
678 if [ "${default_gzip}" = "" ]; then
679 echo "Looking for gzip"
680 temppath=`echo $PATH | sed 's/^:/.:/
681 s/::/:.:/g
682 s/:$/:./
683 s/:/ /g'`
684 default_gzip=`(
685 for dir in ${temppath}; do
686 if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi
687 done
688 echo compress
689 )`
690 fi
691 case "${default_gzip}" in
692 compress* ) gzip_extension=.Z ;;
693 * ) gzip_extension=.gz ;;
694 esac
695 echo "Creating tar file"
696 (cd ${tempparent} ; tar cvf - ${emacsname} ) \
697 | ${default_gzip} \
698 > ${emacsname}.tar${gzip_extension}
699 fi
700
701 if [ "${clean_up}" = yes ]; then
702 echo "Cleaning up the staging directory"
703 rm -rf ${tempparent}
704 else
705 (cd ${tempparent}; mv ${emacsname} ..)
706 rm -rf ${tempparent}
707 fi
708
709 # arch-tag: 26e3eb50-a394-4ab2-82b2-d8e5af500de7
710 ### make-dist ends here