(calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
[emacs.git] / make-dist
bloba455fefb3bada682805e89779f5e5b9a29f3fc46
1 #!/bin/sh
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.
9 # Copyright (C) 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
10 # 2006, 2007, 2008 Free Software Foundation, Inc.
12 # This file is part of GNU Emacs.
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 3, or (at your option)
17 # any later version.
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.
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., 51 Franklin Street, Fifth Floor,
27 # Boston, MA 02110-1301, USA.
29 progname="$0"
31 ### Exit if a command fails.
32 #set -e
34 ### Print out each line we read, for debugging's sake.
35 #set -v
37 LANGUAGE=C
38 LC_ALL=C
39 LC_MESSAGES=
40 LANG=
41 export LANGUAGE LC_ALL LC_MESSAGES LANG
43 ## Don't restrict access to any files.
44 umask 0
46 update=yes
47 check=yes
48 clean_up=no
49 make_tar=no
50 newer=""
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
59 ## This option tells make-dist to make a tar file.
60 "--tar" )
61 make_tar=yes
63 ## This option tells make-dist not to recompile or do analogous things.
64 "--no-update" )
65 update=no
67 ## This option says don't check for bad file names, etc.
68 "--no-check" )
69 check=no
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
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"
84 ## Same with bzip2.
85 "--bzip2")
86 default_gzip="bzip2"
88 ## Same with lzma.
89 "--lzma")
90 default_gzip="lzma"
93 "--snapshot")
94 clean_up=yes
95 make_tar=yes
96 update=no
97 check=no
100 "--help")
101 echo "Usage: ${progname} [options]"
102 echo ""
103 echo " --bzip2 use bzip2 instead of gzip"
104 echo " --clean-up delete staging directories when done"
105 echo " --compress use compress instead of gzip"
106 echo " --lzma use lzma instead of gzip"
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
117 echo "${progname}: Unrecognized argument: $1" >&2
118 exit 1
120 esac
121 shift
122 done
124 ### Make sure we're running in the right place.
125 if [ ! -d src -o ! -f src/lisp.h -o ! -d lisp -o ! -f lisp/version.el ]; then
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
128 echo "distribution tree. cd to that directory and try again." >&2
129 exit 1
132 ### Find where to run Emacs.
133 ### (Accept only absolute file names.)
134 if [ $update = yes ];
135 then
136 unset EMACS_UNIBYTE
137 if [ -f src/emacs ];
138 then
139 EMACS=`pwd`/src/emacs
140 else
141 case $EMACS in
142 /*) ;;
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
153 ### Find out which version of Emacs this is.
154 shortversion=`grep 'defconst[ ]*emacs-version' lisp/version.el \
155 | sed -e 's/^.*"\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
156 version=`grep 'defconst[ ]*emacs-version' lisp/version.el \
157 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
158 if [ ! "${version}" ]; then
159 echo "${progname}: can't find current Emacs version in \`./lisp/version.el'" >&2
160 exit 1
163 echo Version numbers are $version and $shortversion
165 if [ $update = yes ];
166 then
167 if grep -s "@set EMACSVER *${shortversion}" ./doc/emacs/emacs.texi > /dev/null; then
168 true
169 else
170 echo "You must update the version number in \`./doc/emacs/emacs.texi'"
171 sleep 5
175 ### Make sure we don't already have a directory emacs-${version}.
177 emacsname="emacs-${version}${new_extension}"
179 if [ -d ${emacsname} ]
180 then
181 echo Directory "${emacsname}" already exists >&2
182 exit 1
185 ### Make sure the subdirectory is available.
186 tempparent="make-dist.tmp.$$"
187 if [ -d ${tempparent} ]; then
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
193 exit 1
196 ### Find where to run Emacs.
197 if [ $check = yes ];
198 then
199 ### Check for .elc files with no corresponding .el file.
200 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
201 leim/[a-z]*/[a-z]*.el | sed 's/\.el$/.elc/' > /tmp/el
202 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
203 leim/[a-z]*/[a-z]*.elc > /tmp/elc
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}"
209 rm -f /tmp/el /tmp/elc
211 ### Check for .el files with no corresponding .elc file.
212 ls -1 lisp/[a-zA-Z]*.el lisp/[a-z]*/[a-zA-Z0-9]*.el \
213 leim/[a-z]*/[a-z]*.el > /tmp/el
214 ls -1 lisp/[a-zA-Z]*.elc lisp/[a-z]*/[a-zA-Z0-9]*.elc \
215 leim/[a-z]*/[a-z]*.elc | sed 's/\.elc$/.el/' > /tmp/elc
216 losers="`comm -23 /tmp/el /tmp/elc`"
217 bogosities=
218 for file in $losers; do
219 if ! grep -q "no-byte-compile: t" $file; then
220 case $file in
221 site-init.el | site-load.el | site-start.el | default.el)
224 bogosities="$file $bogosities"
226 esac
228 done
229 if [ x"${bogosities}" != x"" ]; then
230 echo "The following .el files have no corresponding .elc files:"
231 echo "${bogosities}"
233 rm -f /tmp/el /tmp/elc
236 ### Make sure configure is newer than configure.in.
237 if [ "x`ls -t configure configure.in | sed q`" != "xconfigure" ]; then
238 echo "\`./configure.in' is newer than \`./configure'" >&2
239 echo "Running autoconf" >&2
240 autoconf || { x=$?; echo Autoconf FAILED! >&2; exit $x; }
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
252 if [ $update = yes ];
253 then
254 echo "Updating Info files"
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=.)
260 echo "Updating finder, custom and autoload data"
261 (cd lisp; make updates EMACS="$EMACS")
263 if test -f leim/leim-list.el; then
264 echo "Updating leim-list.el"
265 (cd leim; make leim-list.el EMACS="$EMACS")
268 echo "Recompiling Lisp files"
269 $EMACS -batch -f batch-byte-recompile-directory lisp leim
272 echo "Making lisp/MANIFEST"
274 (cd lisp;
275 files=`echo [!=]*.el | sed -e 's/ subdirs.el / /' -e 's/ default.el / /'`
276 for dir in [!=]*; do
277 if [ -d $dir ] && [ $dir != term ] && [ $dir != CVS ] && [ $dir != RCS ]
278 then
279 echo $dir
280 thisdir=`echo $dir/[!=]*.el | sed -e 's/ subdirs.el / /'`
281 files="$files $thisdir"
283 done
284 for file in $files
285 do sed -n 's/^;;; //p; q' $file
286 done | sort > MANIFEST)
288 echo "Creating staging directory: \`${tempparent}'"
290 mkdir ${tempparent}
291 tempdir="${tempparent}/${emacsname}"
293 ### This trap ensures that the staging directory will be cleaned up even
294 ### when the script is interrupted in mid-career.
295 if [ "${clean_up}" = yes ]; then
296 trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15
299 echo "Creating top directory: \`${tempdir}'"
300 mkdir ${tempdir}
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.
306 echo "Making links to top-level files"
307 ln INSTALL README BUGS move-if-change ${tempdir}
308 ln ChangeLog Makefile.in configure configure.in ${tempdir}
309 ln config.bat make-dist update-subdirs vpath.sed ${tempdir}
310 ### Copy these files; they're cross-filesystem symlinks.
311 cp mkinstalldirs ${tempdir}
312 cp config.sub ${tempdir}
313 cp config.guess ${tempdir}
314 cp install-sh ${tempdir}
316 echo "Updating version number in README"
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
322 mv -f tmp.README README)
325 echo "Creating subdirectories"
326 for subdir in lisp site-lisp \
327 leim leim/CXTERM-DIC leim/MISC-DIC \
328 leim/SKK-DIC leim/ja-dic leim/quail \
329 src src/m src/s src/bitmaps lib-src oldXMenu lwlib \
330 nt nt/inc nt/inc/sys nt/inc/arpa nt/inc/netinet nt/icons \
331 etc etc/charsets etc/e etc/gnus etc/nxml \
332 etc/images etc/images/ezimage etc/images/gnus etc/images/gud \
333 etc/images/icons etc/images/icons/hicolor \
334 etc/images/icons/hicolor/*x* etc/images/icons/hicolor/scalable \
335 etc/images/icons/hicolor/*/apps etc/images/icons/hicolor/*/mimetypes \
336 etc/images/low-color etc/images/mail \
337 etc/images/smilies etc/images/smilies/grayscale \
338 etc/images/smilies/medium etc/images/tree-widget \
339 etc/images/tree-widget/default etc/images/tree-widget/folder \
340 etc/refcards etc/schema etc/tutorials info doc doc/emacs \
341 doc/misc doc/man doc/lispref doc/lispintro m4 msdos vms mac \
342 mac/src mac/Emacs.app mac/Emacs.app/Contents \
343 mac/Emacs.app/Contents/MacOS mac/Emacs.app/Contents/Resources \
344 mac/Emacs.app/Contents/Resources/English.lproj
346 echo " ${tempdir}/${subdir}"
347 mkdir ${tempdir}/${subdir}
348 done
350 echo "Making links to \`lisp' and its subdirectories"
351 ### Don't distribute TAGS, =*.el files, site-init.el, site-load.el, or default.el.
352 (cd lisp
353 ln [a-zA-Z]*.el ../${tempdir}/lisp
354 ln [a-zA-Z]*.elc ../${tempdir}/lisp
355 ln [a-zA-Z]*.dat ../${tempdir}/lisp
356 for img in [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do
357 # If there are no images, the shell won't expand the pattern.
358 if [ -f $img ]; then
359 ln $img ../${tempdir}/lisp
361 done
362 ## simula.el doesn't keep abbreviations in simula.defns any more.
363 ## ln [a-zA-Z]*.defns ../${tempdir}/lisp
364 ln ChangeLog ChangeLog.*[0-9] ../${tempdir}/lisp
365 ln Makefile.in makefile.w32-in ../${tempdir}/lisp
366 test -f README && ln README ../${tempdir}/lisp
367 (cd ../${tempdir}/lisp
368 rm -f TAGS =*
369 rm -f site-init site-init.el site-init.elc
370 rm -f site-load site-load.el site-load.elc
371 rm -f site-start site-start.el site-start.elc
372 rm -f default default.el default.elc
375 ## Find all subdirs of lisp dir
376 for file in `find . -type d -print`; do
377 case $file in
378 . | .. | */Old | */CVS | */RCS | */=*)
381 if [ -d $file ]; then
382 subdirs="$file $subdirs"
385 esac
386 done
388 for file in $subdirs; do
389 echo " lisp/$file"
390 mkdir -p ../${tempdir}/lisp/$file
391 ln $file/[a-zA-Z0-9]*.el ../${tempdir}/lisp/$file
392 ln $file/[a-zA-Z0-9]*.elc ../${tempdir}/lisp/$file
393 for img in $file/[a-zA-Z]*.xpm $file/[a-zA-Z]*.xbm $file/[a-zA-Z]*.pbm; do
394 if [ -f $img ]; then
395 ln $img ../${tempdir}/lisp/$file
397 done
398 if [ -f $file/README ]; then
399 ln $file/README ../${tempdir}/lisp/$file
402 if [ -f $file/ChangeLog ]; then
403 ln $file/ChangeLog ../${tempdir}/lisp/$file
404 for f in $file/ChangeLog.*[0-9]; do
405 if [ -f $f ]; then
406 ln $f ../${tempdir}/lisp/$file
408 done
410 done )
412 echo "Making links to \`leim' and its subdirectories"
413 ### Don't distribute TAGS, or =*.el files.
414 (cd leim
415 ln makefile.w32-in ../${tempdir}/leim
416 ln ChangeLog README ../${tempdir}/leim
418 ln CXTERM-DIC/*.tit ../${tempdir}/leim/CXTERM-DIC
419 ln SKK-DIC/README SKK-DIC/SKK-JISYO.L ../${tempdir}/leim/SKK-DIC
420 ln MISC-DIC/*.* ../${tempdir}/leim/MISC-DIC
421 ln ja-dic/*.el ja-dic/*.elc ../${tempdir}/leim/ja-dic
422 ln Makefile.in ../${tempdir}/leim/Makefile.in
423 ln leim-ext.el ../${tempdir}/leim/leim-ext.el
424 ## Lisp files that start with a capital are generated from TIT
425 ## dictionaries so we don't distribute them.
426 ln quail/[a-z]*.el quail/[a-z]*.elc ../${tempdir}/leim/quail
427 rm -f ../${tempdir}/leim/quail/quick-b5.*
428 rm -f ../${tempdir}/leim/quail/quick-cns.*
429 rm -f ../${tempdir}/leim/quail/tsang-b5.*
430 rm -f ../${tempdir}/leim/quail/tsang-cns.*
432 cd ../${tempdir}/leim
433 rm -f TAGS =* */=*)
435 echo "Making links to \`src'"
436 ### Don't distribute =*.[ch] files, or the configured versions of
437 ### config.in, paths.in, or Makefile.in, or TAGS.
438 (cd src
439 echo " (It is ok if ln fails in some cases.)"
440 ln [a-zA-Z]*.c ../${tempdir}/src
441 ln [a-zA-Z]*.h ../${tempdir}/src
442 ln [a-zA-Z]*.s ../${tempdir}/src
443 ln [a-zA-Z]*.in ../${tempdir}/src
444 ln [a-zA-Z]*.opt ../${tempdir}/src
445 ## If we ended up with a symlink, or if we did not get anything
446 ## due to a cross-device symlink, copy the file.
447 for file in [a-zA-Z]*.[hcs] [a-zA-Z]*.in [a-zA-Z]*.opt; do
448 if test -f ../${tempdir}/src/$file; then
449 # test -f appears to succeed for a symlink
450 if test -L ../${tempdir}/src/$file; then
451 rm ../${tempdir}/src/$file
452 cp -p $file ../${tempdir}/src
453 chmod a-w ../${tempdir}/src/$file
455 else
456 rm ../${tempdir}/src/$file
457 cp -p $file ../${tempdir}/src
458 chmod a-w ../${tempdir}/src/$file
460 done
461 ln README ChangeLog ChangeLog.*[0-9] ../${tempdir}/src
462 ln makefile.w32-in ../${tempdir}/src
463 ln .gdbinit .dbxinit ../${tempdir}/src
464 cd ../${tempdir}/src
465 rm -f config.h epaths.h Makefile Makefile.c
466 rm -f =* TAGS)
468 echo "Making links to \`src/bitmaps'"
469 (cd src/bitmaps
470 ln README *.xbm ../../${tempdir}/src/bitmaps)
472 echo "Making links to \`src/m'"
473 (cd src/m
474 # We call files for miscellaneous input (to linker etc) .inp.
475 ln README [a-zA-Z0-9]*.h *.inp ../../${tempdir}/src/m)
477 echo "Making links to \`src/s'"
478 (cd src/s
479 ln README [a-zA-Z0-9]*.h ../../${tempdir}/src/s)
481 echo "Making links to \`lib-src'"
482 (cd lib-src
483 ln [a-zA-Z]*.[chy] ../${tempdir}/lib-src
484 ln ChangeLog Makefile.in README testfile vcdiff ../${tempdir}/lib-src
485 ln grep-changelog rcs2log rcs-checkin ../${tempdir}/lib-src
486 ln makefile.w32-in ../${tempdir}/lib-src
487 ## If we ended up with a symlink, or if we did not get anything
488 ## due to a cross-device symlink, copy the file.
489 for file in [a-zA-Z]*.[chy]; do
490 if test -f ../${tempdir}/lib-src/$file; then
491 # test -f appears to succeed for a symlink
492 if test -L ../${tempdir}/lib-src/$file; then
493 rm ../${tempdir}/lib-src/$file
494 cp $file ../${tempdir}/lib-src
495 chmod a-w ../${tempdir}/lib-src/$file
497 else
498 rm ../${tempdir}/lib-src/$file
499 cp $file ../${tempdir}/lib-src
500 chmod a-w ../${tempdir}/lib-src/$file
502 done
503 cd ../${tempdir}/lib-src
504 rm -f Makefile.c
505 rm -f getopt.h
506 rm -f =* TAGS)
508 echo "Making links to \`m4'"
509 (cd m4
510 ln *.m4 ../${tempdir}/m4)
512 echo "Making links to \`nt'"
513 (cd nt
514 ln emacs.manifest emacs.rc config.nt [a-z]*.c ../${tempdir}/nt
515 ln nmake.defs gmake.defs subdirs.el ../${tempdir}/nt
516 ln [a-z]*.bat [a-z]*.h ../${tempdir}/nt
517 ln ChangeLog INSTALL README makefile.w32-in ../${tempdir}/nt)
519 echo "Making links to \`nt/inc'"
520 (cd nt/inc
521 ln [a-z]*.h ../../${tempdir}/nt/inc)
523 echo "Making links to \`nt/inc/sys'"
524 (cd nt/inc/sys
525 ln [a-z]*.h ../../../${tempdir}/nt/inc/sys)
527 echo "Making links to \`nt/inc/arpa'"
528 (cd nt/inc/arpa
529 ln [a-z]*.h ../../../${tempdir}/nt/inc/arpa)
531 echo "Making links to \`nt/inc/netinet'"
532 (cd nt/inc/netinet
533 ln [a-z]*.h ../../../${tempdir}/nt/inc/netinet)
535 echo "Making links to \`nt/icons'"
536 (cd nt/icons
537 ln [a-z]*.ico ../../${tempdir}/nt/icons
538 ln [a-z]*.cur ../../${tempdir}/nt/icons)
540 echo "Making links to \`mac'"
541 (cd mac
542 ln ChangeLog INSTALL README make-package ../${tempdir}/mac)
544 echo "Making links to \`mac/src'"
545 (cd mac/src
546 ln [a-z]*.c *.r ../../${tempdir}/mac/src)
548 echo "Making links to \`mac/Emacs.app/Contents'"
549 (cd mac/Emacs.app/Contents
550 ln Info.plist PkgInfo ../../../${tempdir}/mac/Emacs.app/Contents)
552 echo "Making links to \`mac/Emacs.app/Contents/Resources'"
553 (cd mac/Emacs.app/Contents/Resources
554 ln Emacs.icns ../../../../${tempdir}/mac/Emacs.app/Contents/Resources)
556 echo "Making links to \`mac/Emacs.app/Contents/Resources/English.lproj'"
557 (cd mac/Emacs.app/Contents/Resources/English.lproj
558 ln InfoPlist.strings ../../../../../${tempdir}/mac/Emacs.app/Contents/Resources/English.lproj)
560 echo "Making links to \`msdos'"
561 (cd msdos
562 ln ChangeLog emacs.ico emacs.pif ../${tempdir}/msdos
563 ln is_exec.c sigaction.c mainmake mainmake.v2 sed*.inp ../${tempdir}/msdos
564 cd ../${tempdir}/msdos
565 rm -f =*)
567 echo "Making links to \`oldXMenu'"
568 (cd oldXMenu
569 ln *.c *.h *.in ../${tempdir}/oldXMenu
570 ln README ChangeLog ../${tempdir}/oldXMenu
571 ln compile.com descrip.mms ../${tempdir}/oldXMenu)
573 echo "Making links to \`lwlib'"
574 (cd lwlib
575 ln *.c *.h *.in ../${tempdir}/lwlib
576 ln README ChangeLog ../${tempdir}/lwlib)
578 echo "Making links to \`etc'"
579 ### Don't distribute = files, TAGS, DOC files, backups, autosaves, or
580 ### tex litter.
581 (cd etc
582 files=`ls -d * | grep -v CVS | grep -v RCS | grep -v 'Old' | grep -v '^e$' \
583 | grep -v '^charsets$' | grep -v '^gnus$' | grep -v '^images$' | grep -v '^nxml$' \
584 | grep -v '^refcards$' | grep -v '^tutorials$'| grep -v '^schema$'`
585 ln $files ../${tempdir}/etc
586 ## If we ended up with a symlink, or if we did not get anything
587 ## due to a cross-device symlink, copy the file.
588 for file in $files; do
589 if test -f ../${tempdir}/etc/$file; then
590 # test -f appears to succeed for a symlink
591 if test -L ../${tempdir}/etc/$file; then
592 rm ../${tempdir}/etc/$file
593 cp $file ../${tempdir}/etc
594 chmod a-w ../${tempdir}/etc/$file
596 else
597 rm ../${tempdir}/etc/$file
598 cp $file ../${tempdir}/etc
599 chmod a-w ../${tempdir}/etc/$file
601 done
602 cd ../${tempdir}/etc
603 rm -f fns*.el
604 rm -f DOC* *~ \#*\# *.dvi *.log *.orig *.rej *,v =* core
605 rm -f TAGS)
607 for dir in etc/charsets etc/e etc/gnus etc/nxml etc/tutorials etc/refcards etc/schema ; do
608 echo "Making links to \`${dir}'"
609 (cd ${dir}
610 ln `ls -d * | grep -v CVS | grep -v RCS` ../../${tempdir}/${dir}
611 cd ../../${tempdir}/${dir}
612 rm -f *~ \#*\# *,v =* core)
613 done
615 echo "Making links to \`etc/images'"
616 (cd etc/images
617 for img in README [a-zA-Z]*.xpm [a-zA-Z]*.xbm [a-zA-Z]*.pbm; do
618 if [ -f $img ]; then
619 ln $img ../../${tempdir}/etc/images
621 done)
623 for dir in etc/images/ezimage etc/images/gnus etc/images/gud etc/images/icons \
624 etc/images/low-color etc/images/mail etc/images/smilies ; do
625 echo "Making links to \`${dir}'"
626 (cd ${dir}
627 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../${tempdir}/${dir}
628 cd ../../../${tempdir}/${dir}
629 rm -f *~ \#*\# *,v =* core)
630 done
632 for dir in etc/images/tree-widget/default etc/images/tree-widget/folder \
633 etc/images/smilies/grayscale etc/images/smilies/medium; do
634 echo "Making links to \`${dir}'"
635 (cd ${dir}
636 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../${tempdir}/${dir}
637 cd ../../../../${tempdir}/${dir}
638 rm -f *~ \#*\# *,v =* core)
639 done
641 for dir in etc/images/icons/hicolor/*/apps \
642 etc/images/icons/hicolor/*/mimetypes; do
643 echo "Making links to \`${dir}'"
644 (cd ${dir}
645 ln `ls -d * | grep -v CVS | grep -v RCS` ../../../../../../${tempdir}/${dir}
646 cd ../../../../../../${tempdir}/${dir}
647 rm -f *~ \#*\# *,v =* core)
648 done
650 echo "Making links to \`info'"
651 # Don't distribute backups or autosaves.
652 (cd info
653 ln `find . -type f -print | grep -v CVS | grep -v RCS | grep -v cvsignore` ../${tempdir}/info
654 #ln [a-zA-Z]* ../${tempdir}/info
655 cd ../${tempdir}/info
656 # Avoid an error when expanding the wildcards later.
657 ln emacs dummy~ ; ln emacs \#dummy\#
658 rm -f *~ \#*\# core)
660 echo "Making links to \`doc/emacs'"
661 (cd doc/emacs
662 ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/emacs
663 ln makefile.w32-in ../../${tempdir}/doc/emacs
664 test -f README && ln README ../../${tempdir}/doc/emacs
665 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/emacs
666 ln ChangeLog ../../${tempdir}/doc/emacs
667 cp texinfo.tex ../../${tempdir}/doc/emacs
668 cd ../../${tempdir}/doc/emacs
669 rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail
670 rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux)
672 echo "Making links to \`doc/misc'"
673 (cd doc/misc
674 ln *.texi *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/misc
675 ln makefile.w32-in ../../${tempdir}/doc/misc
676 test -f README && ln README ../../${tempdir}/doc/misc
677 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/misc
678 ln ChangeLog ../../${tempdir}/doc/misc
679 cp texinfo.tex ../../${tempdir}/doc/misc
680 cd ../../${tempdir}/doc/misc
681 rm -f \#*\# =* *~ core emacs-index* *.Z *.z xmail
682 rm -f emacs.?? termcap.?? gdb.?? *.log *.toc *.dvi *.oaux)
684 echo "Making links to \`doc/lispref'"
685 (cd doc/lispref
686 ln `ls -1 *.texi` ../../${tempdir}/doc/lispref
687 ln *.aux *.cps *.fns *.kys *.vrs ../../${tempdir}/doc/lispref
688 ln *.txt *.el spellfile tindex.pl ../../${tempdir}/doc/lispref
689 ln makefile.w32-in ../../${tempdir}/doc/lispref
690 test -f README && ln README ../../${tempdir}/doc/lispref
691 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispref
692 ln ChangeLog ../../${tempdir}/doc/lispref
693 cd ../../${tempdir}/doc/lispref
694 rm -f \#*\# =* *~ core elisp-index* *.Z *.z xmail
695 rm -f elisp.?? *.log *.toc *.dvi *.oaux)
697 echo "Making links to \`doc/lispintro'"
698 (cd doc/lispintro
699 ln *.texi *.aux *.cps *.fns *.kys *.vrs *.eps ../../${tempdir}/doc/lispintro
700 ln makefile.w32-in ../../${tempdir}/doc/lispintro
701 test -f texinfo.tex && ln texinfo.tex ../../${tempdir}/doc/lispintro
702 test -f README && ln README ../../${tempdir}/doc/lispintro
703 test -f Makefile.in && ln Makefile.in ../../${tempdir}/doc/lispintro
704 ln ChangeLog ../../${tempdir}/doc/lispintro
705 cd ../../${tempdir}/doc/lispintro
706 rm -f \#*\# =* *~ core *.Z *.z xmail
707 rm -f emacs-lisp-intro.?? *.log *.toc *.dvi *.oaux)
709 echo "Making links to \`doc/man'"
710 (cd doc/man
711 ln *.1 ../../${tempdir}/doc/man)
713 echo "Making links to \`vms'"
714 (cd vms
715 test -f README && ln README ../${tempdir}/vms
716 cd ../${tempdir}/vms
717 rm -f *~)
719 ### It would be nice if they could all be symlinks to top-level copy, but
720 ### you're not supposed to have any symlinks in distribution tar files.
721 echo "Making sure copying notices are all copies of \`COPYING'"
722 for subdir in . etc info leim lib-src lisp lwlib mac msdos nt src; do
723 rm -f ${tempdir}/${subdir}/COPYING
724 cp COPYING ${tempdir}/${subdir}
725 done
727 if [ "${newer}" ]; then
728 echo "Removing files older than $newer"
729 ## We remove .elc files unconditionally, on the theory that anyone picking
730 ## up an incremental distribution already has a running Emacs to byte-compile
731 ## them with.
732 find ${tempparent} \( -name '*.elc' -o ! -newer ${newer} \) -exec rm -f {} \;
735 if [ "${make_tar}" = yes ]; then
736 if [ "${default_gzip}" = "" ]; then
737 echo "Looking for gzip"
738 temppath=`echo $PATH | sed 's/^:/.:/
739 s/::/:.:/g
740 s/:$/:./
741 s/:/ /g'`
742 default_gzip=`(
743 for dir in ${temppath}; do
744 if [ -f ${dir}/gzip ]; then echo 'gzip --best'; exit 0; fi
745 done
746 echo compress
749 case "${default_gzip}" in
750 bzip2) gzip_extension=.bz2 ;;
751 compress* ) gzip_extension=.Z ;;
752 lzma) gzip_extension=.lzma ;;
753 * ) gzip_extension=.gz ;;
754 esac
755 echo "Creating tar file"
756 (cd ${tempparent} ; tar cvf - ${emacsname} ) \
757 | ${default_gzip} \
758 > ${emacsname}.tar${gzip_extension}
761 if [ "${clean_up}" = yes ]; then
762 echo "Cleaning up the staging directory"
763 rm -rf ${tempparent}
764 else
765 (cd ${tempparent}; mv ${emacsname} ..)
766 rm -rf ${tempparent}
769 # arch-tag: 26e3eb50-a394-4ab2-82b2-d8e5af500de7
770 ### make-dist ends here