1 |
#!/bin/sh |
2 |
# $Id: vc4arm.sh 416 2024-11-19 07:54:58Z nishi $ |
3 |
# Wrapper for CL. VC6 sucks. |
4 |
|
5 |
outfile="a.out" |
6 |
dowhat="" |
7 |
options="/I../WCECompat /I../VC6Compat /D_NTSDK /Ddouble=long /DNEED_DIRECT /DARM /D_ARM_ /D_M_ARM /DARMV4I /D_ARMV4I_ /DWINCE /DUNICODE" |
8 |
obj=0 |
9 |
win=0 |
10 |
source="" |
11 |
libraries="" |
12 |
link="" |
13 |
|
14 |
for i in "$@"; do |
15 |
if [ "$i" = "-o" ]; then |
16 |
dowhat="output" |
17 |
elif [ "$i" = "-I" ]; then |
18 |
dowhat="include" |
19 |
elif [ "$i" = "-c" ]; then |
20 |
options="$options /c" |
21 |
obj=1 |
22 |
elif [ "$i" = "-fPIC" ]; then |
23 |
: |
24 |
elif [ "$i" = "-g" ]; then |
25 |
: |
26 |
elif [ "$i" = "-std=c99" ]; then |
27 |
: |
28 |
elif [ "$i" = "-shared" ]; then |
29 |
options="$options /LD" |
30 |
elif [ "$i" = "-mwindows" ]; then |
31 |
win=1 |
32 |
elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then |
33 |
options="$options /`echo "$i" | sed "s/^-//g"`" |
34 |
elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then |
35 |
if [ "$i" = "-luser32" ]; then |
36 |
libraries="$libraries gdi32.lib" |
37 |
fi |
38 |
if [ "$i" = "-lws2_32" ]; then |
39 |
libraries="$libraries ws2.lib" |
40 |
else |
41 |
libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib" |
42 |
fi |
43 |
elif [ "$dowhat" = "output" ]; then |
44 |
dowhat="" |
45 |
outfile="$i" |
46 |
elif [ "$dowhat" = "include" ]; then |
47 |
dowhat="" |
48 |
options="$options /I$i" |
49 |
elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then |
50 |
source="$source $i" |
51 |
fi |
52 |
done |
53 |
if [ "$obj" = "1" ]; then |
54 |
options="$options /Fo$outfile" |
55 |
else |
56 |
options="$options /Fe$outfile" |
57 |
fi |
58 |
if [ ! "$libraries" = "" ]; then |
59 |
link="/link /subsystem:windowsce $libraries /libpath:../WCECompat wcecompat.lib" |
60 |
else |
61 |
link="/link /subsystem:windowsce" |
62 |
fi |
63 |
if [ "$obj" = "0" ]; then |
64 |
if [ "$win" = "1" ]; then |
65 |
link="$link /SUBSYSTEM:windowsce" |
66 |
fi |
67 |
fi |
68 |
construct="clarm /nologo $options $source $link" |
69 |
echo "Run: $construct" |
70 |
$construct |