3 # Wrapper for compilers which do not understand `-c -o'.
5 # Copyright 1999, 2000 Free Software Foundation, Inc.
6 # Written by Tom Tromey <tromey@cygnus.com>.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 # compile PROGRAM [ARGS]...
24 # `-o FOO.o' is removed from the args passed to the actual compile.
32 while test $# -gt 0; do
50 echo "compile: no \`-o' option seen" 1>&2
55 echo "compile: no \`.c' file seen" 1>&2
59 # Name of file we expect compiler to create.
60 cofile
=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
62 # Create the lock directory.
63 lockdir
=`echo $ofile | sed -e 's|/|_|g'`
65 if mkdir
$lockdir > /dev
/null
2>&1; then
70 # FIXME: race condition here if user kills between mkdir and trap.
71 trap "rmdir $lockdir; exit 1" 1 2 15
77 if test -f "$cofile"; then