Line | |
---|
1 | #!/bin/sh
|
---|
2 | # $Id: vc6.sh 212 2024-10-02 17:44:55Z nishi $
|
---|
3 | # Wrapper for CL. VC6 sucks.
|
---|
4 |
|
---|
5 | outfile="a.out"
|
---|
6 | dowhat=""
|
---|
7 | options="/I../VC6Compat"
|
---|
8 | obj=0
|
---|
9 | source=""
|
---|
10 | libraries=""
|
---|
11 | link=""
|
---|
12 |
|
---|
13 | for i in "$@"; do
|
---|
14 | if [ "$i" = "-o" ]; then
|
---|
15 | dowhat="output"
|
---|
16 | elif [ "$i" = "-I" ]; then
|
---|
17 | dowhat="include"
|
---|
18 | elif [ "$i" = "-c" ]; then
|
---|
19 | options="$options /c"
|
---|
20 | obj=1
|
---|
21 | elif [ "$i" = "-fPIC" ]; then
|
---|
22 | :
|
---|
23 | elif [ "$i" = "-g" ]; then
|
---|
24 | :
|
---|
25 | elif [ "$i" = "-std=c99" ]; then
|
---|
26 | :
|
---|
27 | elif [ "$i" = "-shared" ]; then
|
---|
28 | options="$options /LD"
|
---|
29 | elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then
|
---|
30 | options="$options /`echo "$i" | sed "s/^-//g"`"
|
---|
31 | elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then
|
---|
32 | libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
|
---|
33 | elif [ "$dowhat" = "output" ]; then
|
---|
34 | dowhat=""
|
---|
35 | outfile="$i"
|
---|
36 | elif [ "$dowhat" = "include" ]; then
|
---|
37 | dowhat=""
|
---|
38 | options="$options /I$i"
|
---|
39 | elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then
|
---|
40 | source="$source $i"
|
---|
41 | fi
|
---|
42 | done
|
---|
43 | if [ "$obj" = "1" ]; then
|
---|
44 | options="$options /Fo$outfile"
|
---|
45 | else
|
---|
46 | options="$options /Fe$outfile"
|
---|
47 | fi
|
---|
48 | if [ ! "$libraries" = "" ]; then
|
---|
49 | link="/link /nodefaultlib:libc $libraries"
|
---|
50 | fi
|
---|
51 | construct="cl /nologo $options $source $link"
|
---|
52 | echo "Run: $construct"
|
---|
53 | $construct
|
---|
Note:
See
TracBrowser
for help on using the repository browser.