Subversion Repositories Tewi

Rev

Rev 222 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
215 nishi 1
#!/bin/sh
2
# $Id: bcc.sh 215 2024-10-02 19:24:43Z nishi $
3
# Wrapper for CL. VC6 sucks.
4
 
5
outfile="a.out"
6
dowhat=""
7
options="-I../VC6Compat -tWM"
8
obj=0
9
source=""
10
libraries=""
11
link=""
12
shared=0
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 -tWD"
30
		shared=1
31
	elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then
32
		options="$options -`echo "$i" | sed "s/^-//g"`"
33
	elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then
34
		libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
35
	elif [ "$dowhat" = "output" ]; then
36
		dowhat=""
37
		outfile="$i"
38
	elif [ "$dowhat" = "include" ]; then
39
		dowhat=""
40
		options="$options -I$i"
41
	elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then
42
		source="$source $i"
43
	fi
44
done
45
if [ "$obj" = "1" ]; then
46
	options="$options -o$outfile"
47
else
48
	options="$options -e$outfile"
49
fi
50
if [ ! "$libraries" = "" ]; then
51
	link="$libraries"
52
fi
53
construct="bcc32 $options $source $link"
54
echo "Run: $construct"
55
$construct