Subversion Repositories Tewi

Rev

Rev 226 | Rev 249 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
215 nishi 1
#!/bin/sh
2
# $Id: bcc.sh 240 2024-10-03 05:54:55Z nishi $
3
# Wrapper for CL. VC6 sucks.
4
 
5
outfile="a.out"
6
dowhat=""
226 nishi 7
options="-I../VC6Compat -tWM -I$BORLAND/Include -L$BORLAND/Lib"
215 nishi 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
240 nishi 34
		if [ ! "$i" = "-lwsock32" ]; then
35
			libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib"
36
		fi
215 nishi 37
	elif [ "$dowhat" = "output" ]; then
38
		dowhat=""
39
		outfile="$i"
40
	elif [ "$dowhat" = "include" ]; then
41
		dowhat=""
42
		options="$options -I$i"
43
	elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then
44
		source="$source $i"
45
	fi
46
done
47
if [ "$obj" = "1" ]; then
48
	options="$options -o$outfile"
49
else
50
	options="$options -e$outfile"
51
fi
52
if [ ! "$libraries" = "" ]; then
53
	link="$libraries"
54
fi
55
construct="bcc32 $options $source $link"
56
echo "Run: $construct"
57
$construct