From 85f59630d86f7ac17f7fab129d0a758c684f6557 Mon Sep 17 00:00:00 2001 From: Kelley Cook Date: Thu, 23 Sep 2004 01:21:50 +0000 Subject: config.guess: New upstream version 2004-09-23 Kelley Cook * config.guess: New upstream version * compile, depcomp, install-sh, ylwrap: Likewise. From-SVN: r87914 --- compile | 84 ++++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 40 deletions(-) (limited to 'compile') diff --git a/compile b/compile index a81e000ae1a..80b645b015f 100644 --- a/compile +++ b/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. -scriptversion=2003-11-09.00 +scriptversion=2004-09-10.20 -# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -55,37 +55,41 @@ EOF ;; esac - -prog=$1 -shift - ofile= cfile= -args= -while test $# -gt 0; do - 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 - *.o | *.obj) - ;; - *) - args="$args -o $ofile" - ofile= - ;; - esac - ;; - *.c) - cfile=$1 - args="$args $1" - ;; - *) - args="$args $1" - ;; - esac +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi shift done @@ -95,36 +99,36 @@ if test -z "$ofile" || test -z "$cfile"; then # 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 + exec "$@" fi # Name of file we expect compiler to create. -cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. -lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do - if mkdir $lockdir > /dev/null 2>&1; then + 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 +trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. -"$prog" $args -status=$? +"$@" +ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi -rmdir $lockdir -exit $status +rmdir "$lockdir" +exit $ret # Local Variables: # mode: shell-script -- cgit v1.2.3