Mercurial > hg > xemacs-beta
comparison lib-src/update-elc.sh @ 114:8619ce7e4c50 r20-1b9
Import from CVS: tag r20-1b9
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:21:54 +0200 |
parents | 48d667d6f17f |
children | 9f59509498e1 |
comparison
equal
deleted
inserted
replaced
113:2ec2fe4a4c89 | 114:8619ce7e4c50 |
---|---|
23 if test ! -d lisp/. ; then | 23 if test ! -d lisp/. ; then |
24 echo "$0: Cannot find the \"lisp\" directory." | 24 echo "$0: Cannot find the \"lisp\" directory." |
25 exit 1 | 25 exit 1 |
26 fi | 26 fi |
27 | 27 |
28 # Determine xemacs executable to use for compilation. | 28 EMACS="./src/xemacs" |
29 if test -n "$XEMACS" ; then | |
30 EMACS="$XEMACS" | |
31 elif test -x ./src/xemacs ; then | |
32 EMACS="./src/xemacs" | |
33 elif test -x "$EMACS" ; then | |
34 : | |
35 else | |
36 EMACS=xemacs | |
37 fi | |
38 case "$EMACS" in | |
39 */* ) : ;; # Pathname specified | |
40 *) # Need to find executable on PATH | |
41 for dir in `echo $PATH | sed 's/:/ /g'` ; do | |
42 if test -x "dir/xemacs" ; then | |
43 EMACS="$dir/$EMACS" | |
44 break | |
45 fi | |
46 done ;; | |
47 esac | |
48 # Canonicalize | |
49 EMACS=`cd \`dirname $EMACS\` ; pwd | sed 's:^/tmp_mnt::'`/`basename $EMACS` | |
50 export EMACS | 29 export EMACS |
51 | 30 |
52 echo "Recompiling in `pwd|sed 's:^/tmp_mnt::'`" | 31 echo " (using $EMACS)" |
53 echo " with $EMACS..." | 32 |
33 # fuckin' sysv, man... | |
34 if [ "`uname -r | sed 's/\(.\).*/\1/'`" -gt 4 ]; then | |
35 echon() | |
36 { | |
37 /bin/echo $* '\c' | |
38 } | |
39 else | |
40 echon() | |
41 { | |
42 echo -n $* | |
43 } | |
44 fi | |
45 | |
46 REAL=`cd \`dirname $EMACS\` ; pwd | sed 's|^/tmp_mnt||'`/`basename $EMACS` | |
47 BYTECOMP="$REAL -batch -q -no-site-file " | |
48 echo "Recompiling in `pwd|sed 's|^/tmp_mnt||'`" | |
49 echo " with $REAL..." | |
50 | |
51 $EMACS -batch -q -l `pwd`/lisp/prim/cleantree -f batch-remove-old-elc lisp | |
54 | 52 |
55 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o" | 53 prune_vc="( -name SCCS -o -name RCS -o -name CVS ) -prune -o" |
56 | |
57 $EMACS -batch -q -l `pwd`/lisp/prim/cleantree -f batch-remove-old-elc lisp | |
58 | 54 |
59 # $els is a list of all .el files | 55 # $els is a list of all .el files |
60 # $elcs is a list of all .elc files | 56 # $elcs is a list of all .elc files |
61 els=/tmp/update-elc-1.$$ elcs=/tmp/update-elc-2.$$ | 57 els=/tmp/update-elc-1.$$ elcs=/tmp/update-elc-2.$$ |
62 rm -f $els $elcs | 58 rm -f $els $elcs |
63 trap "rm -f $els $elcs" 0 1 2 3 15 | 59 trap "rm -f $els $elcs" 0 1 2 3 15 |
64 find lisp/. $prune_vc -name '*.el' -print | sort > $els | 60 find lisp/. $prune_vc -name '*.el' -print | sort > $els |
65 find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs | 61 find lisp/. $prune_vc -name '*.elc' -print | sed 's/elc$/el/' | sort > $elcs |
66 | 62 |
67 | 63 |
68 echo "Deleting .elc files without .el files..." | 64 echon "Deleting .elc files without .el files..." |
69 comm -13 $els $elcs | sed -e '\!/vm.el!d' -e 's/el$/elc/' | \ | 65 comm -13 $els $elcs | sed -e '\!/vm.el!d' -e 's/el$/elc/' | \ |
70 while read file ; do echo rm "$file" ; rm "$file" ; done | 66 while read file ; do echo rm "$file" ; rm "$file" ; done |
71 echo "Deleting .elc files without .el files... Done" | 67 echo done. |
72 | 68 |
73 | 69 |
74 # Compute patterns to ignore when searching for files | 70 # Compute patterns to ignore when searching for files |
75 ignore_dirs="its quail" # ### Not ported yet... | 71 ignore_dirs="quail" # ### Not ported yet... |
76 | 72 |
77 # Only use Mule XEmacs to compile Mule-specific elisp dirs | 73 # Only use Mule XEmacs to compile Mule-specific elisp dirs |
78 echo "Checking for Mule support..." | 74 echon "Checking for Mule support..." |
79 lisp_prog='(princ (featurep (quote mule)))' | 75 lisp_prog='(princ (featurep (quote mule)))' |
80 mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`" | 76 mule_p="`$EMACS -batch -no-site-file -eval \"$lisp_prog\"`" |
81 if test "$mule_p" = nil ; then | 77 if test "$mule_p" = nil ; then |
82 echo No | 78 echo No |
83 ignore_dirs="$ignore_dirs mule" | 79 ignore_dirs="$ignore_dirs its egg mule" |
84 elif test "$mule_p" = t; then | 80 elif test "$mule_p" = t; then |
85 echo Yes | 81 echo Yes |
86 else | 82 else |
87 echo "Error determining presence of mule support" | 83 echo "Error -- call Martin" |
88 exit 1; | 84 exit 1; |
89 fi | 85 fi |
90 | 86 |
91 # first recompile the byte-compiler, so that the other compiles take place | 87 # first recompile the byte-compiler, so that the other compiles take place |
92 # with the latest version (assuming we're compiling the lisp dir of the emacs | 88 # with the latest version (assuming we're compiling the lisp dir of the emacs |
93 # we're running, which might not be the case, but often is.) | 89 # we're running, which might not be the case, but often is.) |
94 echo "Checking the byte compiler..." | 90 echo "Checking the byte compiler..." |
95 BYTECOMP="$EMACS -batch -q -no-site-file -l bytecomp" | |
96 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp | 91 $BYTECOMP -f batch-byte-recompile-directory lisp/bytecomp |
97 | 92 |
98 # Byte-compile VM first, because other packages depend on it, | 93 # Byte-compile VM first, because other packages depend on it, |
99 # but it depends on nothing (Kyle is like that). | 94 # but it depends on nothing (Kyle is like that). |
100 ignore_dirs="$ignore_dirs vm" | 95 ignore_dirs="$ignore_dirs vm" |
101 echo "Compiling in lisp/vm"; | 96 echo "Compiling in lisp/vm"; |
102 (cd lisp/vm && ${MAKE:-make} EMACS=$EMACS autoload) | 97 (cd lisp/vm && ${MAKE:-make} EMACS=$REAL autoload) |
103 echo "lisp/vm done." | 98 echo "lisp/vm done." |
104 | 99 |
105 # Prepare for byte-compiling directories with directory-specific instructions | 100 # Prepare for byte-compiling directories with directory-specific instructions |
106 make_special_commands='' | 101 make_special_commands='' |
107 make_special () { | 102 make_special () { |
108 dir="$1"; shift; | 103 dir="$1"; shift; |
109 ignore_dirs="$ignore_dirs $dir" | 104 ignore_dirs="$ignore_dirs $dir" |
110 make_special_commands="$make_special_commands \ | 105 make_special_commands="$make_special_commands \ |
111 echo \"Compiling in lisp/$dir\"; \ | 106 echo \"Compiling in lisp/$dir\"; \ |
112 (cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$EMACS ${1+$*}); \ | 107 (cd \"lisp/$dir\" && ${MAKE:-make} EMACS=$REAL ${1+$*}); \ |
113 echo \"lisp/$dir done.\";" | 108 echo \"lisp/$dir done.\";" |
114 } | 109 } |
115 | 110 |
116 #make_special vm | 111 #make_special vm |
117 #make_special ediff elc | 112 #make_special ediff elc |
118 #make_special viper elc | 113 #make_special viper elc |
119 make_special efs | 114 make_special efs |
120 make_special gnus some | 115 make_special gnus some |
121 make_special w3 | 116 make_special w3 xemacs-w3 |
122 make_special hyperbole elc | 117 make_special hyperbole elc |
123 make_special oobr HYPB_ELC='' elc | 118 make_special oobr HYPB_ELC='' elc |
124 make_special eos -k # not stricly necessary... | 119 make_special eos -k # not stricly necessary... |
125 make_special ilisp elc | 120 make_special ilisp elc |
126 make_special auctex some | 121 make_special auctex some |