1 |
#!/bin/sh |
#!/bin/sh |
2 |
# Copyright 1995 Free Software Foundation, Inc. |
# Copyright (C) 1995, 2000, 2003 Free Software Foundation, Inc. |
3 |
# François Pinard <pinard@iro.umontreal.ca>, 1995. |
# François Pinard <pinard@iro.umontreal.ca>, 1995. |
4 |
# |
# |
5 |
# This program is free software; you can redistribute it and/or modify |
# This program is free software; you can redistribute it and/or modify |
31 |
# they require or load-library one another. |
# they require or load-library one another. |
32 |
|
|
33 |
if test $# = 0; then |
if test $# = 0; then |
34 |
echo 1>&2 "No files given to $0" |
echo 1>&2 "No files given to $0" |
35 |
exit 1 |
exit 1 |
36 |
else |
fi |
|
if test -z "$EMACS" || test "$EMACS" = "t"; then |
|
|
# Value of "t" means we are running in a shell under Emacs. |
|
|
# Just assume Emacs is called "emacs". |
|
|
EMACS=emacs |
|
|
fi |
|
|
|
|
|
tempdir=elc.$$ |
|
|
mkdir $tempdir |
|
|
cp $* $tempdir |
|
|
cd $tempdir |
|
|
|
|
|
echo "(setq load-path (cons nil load-path))" > script |
|
|
$EMACS -batch -q -l script -f batch-byte-compile *.el |
|
|
mv *.elc .. |
|
37 |
|
|
38 |
cd .. |
if test -z "$EMACS" || test "$EMACS" = "t"; then |
39 |
rm -fr $tempdir |
# Value of "t" means we are running in a shell under Emacs. |
40 |
|
# Just assume Emacs is called "emacs". |
41 |
|
EMACS=emacs |
42 |
fi |
fi |
43 |
|
|
44 |
|
tempdir=elc.$$ |
45 |
|
|
46 |
|
# Cleanup the temporary directory on exit. |
47 |
|
trap 'status=$?; rm -rf "$tempdir" && exit $status' 0 |
48 |
|
trap '(exit $?); exit' 1 2 13 15 |
49 |
|
|
50 |
|
mkdir $tempdir |
51 |
|
cp "$@" $tempdir |
52 |
|
|
53 |
|
( |
54 |
|
cd $tempdir |
55 |
|
echo "(setq load-path (cons nil load-path))" > script |
56 |
|
$EMACS -batch -q -l script -f batch-byte-compile *.el || exit $? |
57 |
|
mv *.elc .. |
58 |
|
) || exit $? |
59 |
|
|
60 |
|
(exit 0); exit |