Blame build-aux/elisp-comp

Packit 47b4ca
#!/bin/sh
Packit 47b4ca
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
Packit 47b4ca
Packit 47b4ca
scriptversion=2010-02-06.18; # UTC
Packit 47b4ca
Packit 47b4ca
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1995.
Packit 47b4ca
#
Packit 47b4ca
# This program is free software; you can redistribute it and/or modify
Packit 47b4ca
# it under the terms of the GNU General Public License as published by
Packit 47b4ca
# the Free Software Foundation; either version 2, or (at your option)
Packit 47b4ca
# any later version.
Packit 47b4ca
#
Packit 47b4ca
# This program is distributed in the hope that it will be useful,
Packit 47b4ca
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47b4ca
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 47b4ca
# GNU General Public License for more details.
Packit 47b4ca
#
Packit 47b4ca
# You should have received a copy of the GNU General Public License
Packit 47b4ca
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 47b4ca
Packit 47b4ca
# As a special exception to the GNU General Public License, if you
Packit 47b4ca
# distribute this file as part of a program that contains a
Packit 47b4ca
# configuration script generated by Autoconf, you may include it under
Packit 47b4ca
# the same distribution terms that you use for the rest of that program.
Packit 47b4ca
Packit 47b4ca
# This file is maintained in Automake, please report
Packit 47b4ca
# bugs to <bug-automake@gnu.org> or send patches to
Packit 47b4ca
# <automake-patches@gnu.org>.
Packit 47b4ca
Packit 47b4ca
case $1 in
Packit 47b4ca
  '')
Packit 47b4ca
     echo "$0: No files.  Try '$0 --help' for more information." 1>&2
Packit 47b4ca
     exit 1;
Packit 47b4ca
     ;;
Packit 47b4ca
  -h | --h*)
Packit 47b4ca
    cat <<\EOF
Packit 47b4ca
Usage: elisp-comp [--help] [--version] FILES...
Packit 47b4ca
Packit 47b4ca
This script byte-compiles all '.el' files listed as FILES using GNU
Packit 47b4ca
Emacs, and put the resulting '.elc' files into the current directory,
Packit 47b4ca
so disregarding the original directories used in '.el' arguments.
Packit 47b4ca
Packit 47b4ca
This script manages in such a way that all Emacs LISP files to
Packit 47b4ca
be compiled are made visible between themselves, in the event
Packit 47b4ca
they require or load-library one another.
Packit 47b4ca
Packit 47b4ca
Report bugs to <bug-automake@gnu.org>.
Packit 47b4ca
EOF
Packit 47b4ca
    exit $?
Packit 47b4ca
    ;;
Packit 47b4ca
  -v | --v*)
Packit 47b4ca
    echo "elisp-comp $scriptversion"
Packit 47b4ca
    exit $?
Packit 47b4ca
    ;;
Packit 47b4ca
esac
Packit 47b4ca
Packit 47b4ca
if test -z "$EMACS" || test "$EMACS" = "t"; then
Packit 47b4ca
  # Value of "t" means we are running in a shell under Emacs.
Packit 47b4ca
  # Just assume Emacs is called "emacs".
Packit 47b4ca
  EMACS=emacs
Packit 47b4ca
fi
Packit 47b4ca
Packit 47b4ca
tempdir=elc.$$
Packit 47b4ca
Packit 47b4ca
# Cleanup the temporary directory on exit.
Packit 47b4ca
trap 'ret=$?; rm -rf "$tempdir" && exit $ret' 0
Packit 47b4ca
do_exit='(exit $ret); exit $ret'
Packit 47b4ca
trap "ret=129; $do_exit" 1
Packit 47b4ca
trap "ret=130; $do_exit" 2
Packit 47b4ca
trap "ret=141; $do_exit" 13
Packit 47b4ca
trap "ret=143; $do_exit" 15
Packit 47b4ca
Packit 47b4ca
mkdir $tempdir
Packit 47b4ca
cp "$@" $tempdir
Packit 47b4ca
Packit 47b4ca
(
Packit 47b4ca
  cd $tempdir
Packit 47b4ca
  echo "(setq load-path (cons nil load-path))" > script
Packit 47b4ca
  $EMACS -batch -q -l script -f batch-byte-compile *.el || exit $?
Packit 47b4ca
  mv *.elc ..
Packit 47b4ca
) || exit $?
Packit 47b4ca
Packit 47b4ca
(exit 0); exit 0
Packit 47b4ca
Packit 47b4ca
# Local Variables:
Packit 47b4ca
# mode: shell-script
Packit 47b4ca
# sh-indentation: 2
Packit 47b4ca
# eval: (add-hook 'write-file-hooks 'time-stamp)
Packit 47b4ca
# time-stamp-start: "scriptversion="
Packit 47b4ca
# time-stamp-format: "%:y-%02m-%02d.%02H"
Packit 47b4ca
# time-stamp-time-zone: "UTC"
Packit 47b4ca
# time-stamp-end: "; # UTC"
Packit 47b4ca
# End: