diff options
Diffstat (limited to 'crypto/heimdal/compile')
-rwxr-xr-x | crypto/heimdal/compile | 105 |
1 files changed, 71 insertions, 34 deletions
diff --git a/crypto/heimdal/compile b/crypto/heimdal/compile index 9bb997a..a81e000 100755 --- a/crypto/heimdal/compile +++ b/crypto/heimdal/compile @@ -1,8 +1,9 @@ #! /bin/sh - # Wrapper for compilers which do not understand `-c -o'. -# Copyright 1999, 2000 Free Software Foundation, Inc. +scriptversion=2003-11-09.00 + +# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -24,9 +25,36 @@ # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. -# Usage: -# compile PROGRAM [ARGS]... -# `-o FOO.o' is removed from the args passed to the actual compile. +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit 0 + ;; + -v | --v*) + echo "compile $scriptversion" + exit 0 + ;; +esac + prog=$1 shift @@ -35,39 +63,39 @@ ofile= cfile= args= while test $# -gt 0; do - case "$1" in + case "$1" in -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we do something ugly here. - ofile=$2 - shift - case "$ofile" in + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we do something ugly here. + ofile=$2 + shift + case "$ofile" in *.o | *.obj) - ;; + ;; *) - args="$args -o $ofile" - ofile= - ;; - esac + args="$args -o $ofile" + ofile= + ;; + esac ;; *.c) - cfile=$1 - args="$args $1" - ;; + cfile=$1 + args="$args $1" + ;; *) - args="$args $1" - ;; - esac - shift + args="$args $1" + ;; + esac + shift done if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$prog" $args + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args fi # Name of file we expect compiler to create. @@ -79,10 +107,10 @@ cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do - if mkdir $lockdir > /dev/null 2>&1; then - break - fi - sleep 1 + if mkdir $lockdir > /dev/null 2>&1; then + break + fi + sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 @@ -92,8 +120,17 @@ trap "rmdir $lockdir; exit 1" 1 2 15 status=$? if test -f "$cofile"; then - mv "$cofile" "$ofile" + mv "$cofile" "$ofile" fi rmdir $lockdir exit $status + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: |