INIT.2014-12-24
[INIT.git] / src / cmd / INIT / cc.lynxos.ppc
blob32738f289bbb59da9436215bc84214d4c2a35810
1 : lynxos.ppc cc wrapper with -mshared default : 2005-06-01 :
3 HOSTTYPE=lynxos.ppc
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/ppc "$@"
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         -mshared)
37                 static=n
38                 continue
39                 ;;
40         -l*)    case $static in
41                 0)      static=n
42                         set . -L/lib/shlib "$@"
43                         shift
44                         ;;
45                 esac
46                 ;;
47         -[cE])  link=0
48                 ;;
49         esac
50         x=$1
51         shift
52         set . "$@" "$x"
53 done
54 while   :
55 do      case $1 in
56         /../)   shift
57                 break
58                 ;;
59         -l*)    case $static in
60                 0)      static=n
61                         set . -L/lib/shlib "$@"
62                         shift
63                         ;;
64                 esac
65                 ;;
66         -[cE])  link=0
67                 ;;
68         esac
69         x=$1
70         shift
71         set . "$@" "$x"
72         shift
73 done
74 case $link:$static in
75 1:0)    static=n ;;   
76 esac
77 case $static in
78 n)      specs=/tmp/cc$$.specs
79         trap 'status=$?; rm -f $specs; exit $status' 0 1 2
80         echo '*link: %{shared:-shared} %{static:-static} %{mshared|shared: %{static: %eerror: -shared and -static may not be combined. }}' > $specs
81         $cc -specs=$specs -mshared "$@"
82         ;;
83 *)      $cc "$@"
84         ;;
85 esac