Changeset 503 for trunk/src/gmake/config/compile
- Timestamp:
- Sep 15, 2006, 7:09:38 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/config/compile
-
Property svn:executable
set to
*
r151 r503 2 2 # Wrapper for compilers which do not understand `-c -o'. 3 3 4 scriptversion=200 3-11-09.004 scriptversion=2005-05-14.22 5 5 6 # Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.6 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. 7 7 # Written by Tom Tromey <tromey@cygnus.com>. 8 8 # … … 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software 21 # Foundation, Inc., 5 9 Temple Place - Suite 330, Boston, MA 02111-1307, USA.21 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 22 23 23 # As a special exception to the GNU General Public License, if you … … 48 48 Report bugs to <bug-automake@gnu.org>. 49 49 EOF 50 exit 050 exit $? 51 51 ;; 52 52 -v | --v*) 53 53 echo "compile $scriptversion" 54 exit 054 exit $? 55 55 ;; 56 56 esac 57 57 58 59 prog=$160 shift61 62 58 ofile= 63 59 cfile= 64 args= 65 while test $# -gt 0; do 66 case "$1" in 67 -o) 68 # configure might choose to run compile as `compile cc -o foo foo.c'. 69 # So we do something ugly here. 70 ofile=$2 71 shift 72 case "$ofile" in 73 *.o | *.obj) 74 ;; 75 *) 76 args="$args -o $ofile" 77 ofile= 78 ;; 79 esac 80 ;; 81 *.c) 82 cfile=$1 83 args="$args $1" 84 ;; 85 *) 86 args="$args $1" 87 ;; 88 esac 60 eat= 61 62 for arg 63 do 64 if test -n "$eat"; then 65 eat= 66 else 67 case $1 in 68 -o) 69 # configure might choose to run compile as `compile cc -o foo foo.c'. 70 # So we strip `-o arg' only if arg is an object. 71 eat=1 72 case $2 in 73 *.o | *.obj) 74 ofile=$2 75 ;; 76 *) 77 set x "$@" -o "$2" 78 shift 79 ;; 80 esac 81 ;; 82 *.c) 83 cfile=$1 84 set x "$@" "$1" 85 shift 86 ;; 87 *) 88 set x "$@" "$1" 89 shift 90 ;; 91 esac 92 fi 89 93 shift 90 94 done … … 96 100 # `.c' file was seen then we are probably linking. That is also 97 101 # ok. 98 exec "$ prog" $args102 exec "$@" 99 103 fi 100 104 101 105 # Name of file we expect compiler to create. 102 cofile=`echo $cfile| sed -e 's|^.*/||' -e 's/\.c$/.o/'`106 cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` 103 107 104 108 # Create the lock directory. … … 106 110 # that we are using for the .o file. Also, base the name on the expected 107 111 # object file name, since that is what matters with a parallel build. 108 lockdir=`echo $cofile| sed -e 's|[/.-]|_|g'`.d112 lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d 109 113 while true; do 110 if mkdir $lockdir >/dev/null 2>&1; then114 if mkdir "$lockdir" >/dev/null 2>&1; then 111 115 break 112 116 fi … … 114 118 done 115 119 # FIXME: race condition here if user kills between mkdir and trap. 116 trap "rmdir $lockdir; exit 1" 1 2 15120 trap "rmdir '$lockdir'; exit 1" 1 2 15 117 121 118 122 # Run the compile. 119 "$ prog" $args120 status=$?123 "$@" 124 ret=$? 121 125 122 126 if test -f "$cofile"; then 123 127 mv "$cofile" "$ofile" 128 elif test -f "${cofile}bj"; then 129 mv "${cofile}bj" "$ofile" 124 130 fi 125 131 126 rmdir $lockdir127 exit $ status132 rmdir "$lockdir" 133 exit $ret 128 134 129 135 # Local Variables: -
Property svn:executable
set to
Note:
See TracChangeset
for help on using the changeset viewer.