-
Notifications
You must be signed in to change notification settings - Fork 2
/
wrapper.sh
executable file
·84 lines (83 loc) · 1.24 KB
/
wrapper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh
SED=/bin/sed
if test -z "$SED" ; then
SED=sed
fi
Xsed="$SED -e s/^X//"
if test $# -gt 0 ; then
optarg=
args=
for arg in $* ; do
case $arg in
--mode=CC)
;;
--mode=*) optarg=`echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'`
args="$args $arg"
;;
*)
args="$args $arg"
;;
esac
done
if test -z "$optarg" ; then
optarg=CC
fi
case $optarg in
CC)
jump=false
for i in $args ; do
case $i in
-M*)
jump=true
;;
-*)
;;
*)
if [ "$jump" = "false" ] ; then
srcfile=$i
fi
jump=false
;;
esac
done
echo " [Compiling $srcfile]"
gcc $args
exit $?;
;;
compile)
next=false
for i in $args ; do
case $i in
-o)
next=false
;;
-*)
;;
*)
if [ "$next" = "true" ] ; then
break;
fi
next=true
;;
esac
done
echo " [Compiling $i]"
;;
relink | link)
next=false
for i in $args ; do
if [ "$next" != "false" ]; then
break;
fi
if [ "$i" = "-o" ]; then
next=true
fi
done
echo " [Linking $i]"
;;
*)
echo " [Othering $args]"
;;
esac
/bin/sh /opt/lilacsrc/libtool --silent $args
fi