root/1.8.3/tags/p5rc1/utils/clwrapper.sh

Revision 805, 1.0 KB (checked in by shawnw, 21 months ago)

Added utils/README.txt and did some utils/* cleanup

  • Property svn:executable set to *
Line 
1#!/bin/sh
2# A wrapper we use in the win32 build
3#
4
5outfile=""
6while test $# -gt 0; do
7    case "x$1" in
8    x) shift; args="$args ''";;
9    x-) shift; cat >_$$.c; args="$args _$$.c"; nukefiles=_$$.c;;
10    x-o)
11        shift
12        case "x$1" in
13        x*.o) args="$args /Fo$1";;
14        xnetmud) outfile="/out:PennMUSH.exe";;
15        x*) outfile="/out:$1.exe";;
16        esac
17        shift
18        ;;
19    x-c) shift; args="$args /c";;
20    x-E) shift; args="$args /E";;
21    x-D*) args="$args `echo $1 | sed 's/^-/\//'`"; shift;;
22    x-I*) args="$args `echo $1 | sed 's/^-/\//'`"; shift;;
23    x-L*) libsearch="$libsearch `echo $1 | sed 's/^-L//'`"; shift;;
24    x-l*)
25        f="`echo $1 | sed 's/^-l//'`"
26        for dir in . $libsearch; do
27            test -f $dir/$f && args="$args $dir/$f"
28        done
29        shift;;
30    x*) args="$args $1"; shift;;
31    esac
32done
33
34case "x$outfile $args" in
35x/out:*/link*) args="$args $outfile";;
36x/out:*) args="$args /link $outfile";;
37x*) args="$args $outfile";;
38esac
39
40echo "Translated to: cl /nologo $args"
41cl /nologo $args
42retcode=$?
43
44case "x$nukefiles" in
45 x) nukefiles="";;
46 x*) rm $nukefiles;;
47esac
48
49exit $retcode
Note: See TracBrowser for help on using the browser.