Subversion Repositories Tewi

Rev

Rev 222 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 222 Rev 249
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
# $Id: vc6.sh 222 2024-10-03 03:09:40Z nishi $
2
# $Id: vc6.sh 249 2024-10-03 20:59:55Z nishi $
3
# Wrapper for CL. VC6 sucks.
3
# Wrapper for CL. VC6 sucks.
4
 
4
 
5
outfile="a.out"
5
outfile="a.out"
6
dowhat=""
6
dowhat=""
7
options="/I../VC6Compat"
7
options="/I../VC6Compat"
8
obj=0
8
obj=0
-
 
9
win=0
9
source=""
10
source=""
10
libraries=""
11
libraries=""
11
link=""
12
link=""
12
 
13
 
13
for i in "$@"; do
14
for i in "$@"; do
Line 24... Line 25...
24
		:
25
		:
25
	elif [ "$i" = "-std=c99" ]; then
26
	elif [ "$i" = "-std=c99" ]; then
26
		:
27
		:
27
	elif [ "$i" = "-shared" ]; then
28
	elif [ "$i" = "-shared" ]; then
28
		options="$options /LD"
29
		options="$options /LD"
-
 
30
	elif [ "$i" = "-mwindows" ]; then
-
 
31
		win=1
29
	elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then
32
	elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then
30
		options="$options /`echo "$i" | sed "s/^-//g"`"
33
		options="$options /`echo "$i" | sed "s/^-//g"`"
31
	elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then
34
	elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then
-
 
35
		if [ "$i" = "-luser32" ]; then
-
 
36
			libraries="$libraries gdi32.lib"
-
 
37
		fi
32
		libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
38
		libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
33
	elif [ "$dowhat" = "output" ]; then
39
	elif [ "$dowhat" = "output" ]; then
34
		dowhat=""
40
		dowhat=""
35
		outfile="$i"
41
		outfile="$i"
36
	elif [ "$dowhat" = "include" ]; then
42
	elif [ "$dowhat" = "include" ]; then
Line 46... Line 52...
46
	options="$options /Fe$outfile"
52
	options="$options /Fe$outfile"
47
fi
53
fi
48
if [ ! "$libraries" = "" ]; then
54
if [ ! "$libraries" = "" ]; then
49
	link="/link /nodefaultlib:libc $libraries"
55
	link="/link /nodefaultlib:libc $libraries"
50
fi
56
fi
-
 
57
if [ "$obj" = "0" ]; then
-
 
58
	if [ "$win" = "1" ]; then
-
 
59
		link="$link /SUBSYSTEM:windows"
-
 
60
	fi
-
 
61
fi
51
construct="cl /nologo $options $source $link"
62
construct="cl /nologo $options $source $link"
52
echo "Run: $construct"
63
echo "Run: $construct"
53
$construct
64
$construct