Subversion Repositories Tewi

Rev

Rev 249 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
212 nishi 1
#!/bin/sh
2
# $Id: vc4mips.sh 400 2024-11-03 05:19:42Z nishi $
3
# Wrapper for CL. VC6 sucks.
4
 
5
outfile="a.out"
6
dowhat=""
400 nishi 7
options="/I../VC6Compat /D_NTSDK /Ddouble=long /DNEED_DIRECT"
212 nishi 8
obj=0
249 nishi 9
win=0
212 nishi 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"
249 nishi 30
	elif [ "$i" = "-mwindows" ]; then
31
		win=1
212 nishi 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
249 nishi 35
		if [ "$i" = "-luser32" ]; then
36
			libraries="$libraries gdi32.lib"
37
		fi
212 nishi 38
		libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
39
	elif [ "$dowhat" = "output" ]; then
40
		dowhat=""
41
		outfile="$i"
42
	elif [ "$dowhat" = "include" ]; then
43
		dowhat=""
44
		options="$options /I$i"
45
	elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then
46
		source="$source $i"
47
	fi
48
done
49
if [ "$obj" = "1" ]; then
50
	options="$options /Fo$outfile"
51
else
52
	options="$options /Fe$outfile"
53
fi
54
if [ ! "$libraries" = "" ]; then
55
	link="/link /nodefaultlib:libc $libraries"
56
fi
249 nishi 57
if [ "$obj" = "0" ]; then
58
	if [ "$win" = "1" ]; then
59
		link="$link /SUBSYSTEM:windows"
60
	fi
61
fi
400 nishi 62
construct="clmips /nologo $options $source $link"
212 nishi 63
echo "Run: $construct"
64
$construct