INIT.2014-12-24
[INIT.git] / src / cmd / INIT / cc.lynxos.i386
blobacd0d02d620f5acfb4f2a1f0e0c4a8759ca12a7c
1 : lynxos.i386 cc wrapper with -dynamic default : 2005-02-14 :
3 HOSTTYPE=lynxos.i386
5 case " $* " in
6 *" -dumpmachine "*) echo $HOSTTYPE; exit ;;
7 esac
9 cc=gcc
11 link=1
12 static=0
13 set . "$@" /../
14 while   :
15 do      shift
16         case $1 in
17         /../)   break ;;
18         esac
19         case $1 in
20         *.[cChHiI]|*.[cChHiI][pPxX][pPxX])
21                 set . -D__NO_INCLUDE_WARN__ -I/sys/include/kernel -I/sys/include/family/x86 "$@"
22                 shift
23                 break
24                 ;;
25         -o)     case $2 in
26                 /../)   ;;
27                 *)      x=$1
28                         shift
29                         set . "$@" "$x"
30                         shift
31                         ;;
32                 esac
33                 ;;
34         -static)static=1
35                 ;;
36         -l*)    case $static in
37                 0)      static=n
38                         set . -L/lib/shlib "$@"
39                         shift
40                         ;;
41                 esac
42                 ;;
43         -[cE])  link=0
44                 ;;
45         esac
46         x=$1
47         shift
48         set . "$@" "$x"
49 done
50 while   :
51 do      case $1 in
52         /../)   shift
53                 break
54                 ;;
55         -l*)    case $static in
56                 0)      static=n
57                         set . -L/lib/shlib "$@"
58                         shift
59                         ;;
60                 esac
61                 ;;
62         -[cE])  link=0
63                 ;;
64         esac
65         x=$1
66         shift
67         set . "$@" "$x"
68         shift
69 done
70 case $link:$static in
71 1:0)    static=n ;;   
72 esac
73 case $static in
74 n)      specs=/tmp/cc$$.specs
75         trap 'status=$?; rm -f $specs; exit $status' 0 1 2
76         echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs
77         $cc -specs=$specs "$@"
78         ;;
79 *)      $cc "$@"
80         ;;
81 esac