OSDN Git Service

* fixinc/inclhack.def(stdio_va_list): This patch Removes a
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / mkfixinc.sh
1 #! /bin/sh
2
3 machine=$1
4 if [ -z "$machine" ]
5 then
6         echo No machine name given
7         exit 1
8 fi
9
10 target=../fixinc.sh
11
12 echo constructing ${target} for $machine
13 fixincludes="${target}"
14
15 case $machine in
16         i[34567]86-*-linux-gnu*)
17                 fixincludes=fixinc.x86-linux-gnu
18                 ;;
19
20         *-*-sysv4*)
21                 fixincludes=fixinc.svr4
22                 ;;
23
24         mips-dec-bsd*)
25                 :
26                 ;;
27
28         i[34567]86-*-sysv5* | \
29         i[34567]86-*-udk* | \
30         i[34567]86-*-solaris2.[0-4] | \
31         powerpcle-*-solaris2.[0-4] | \
32         sparc-*-solaris2.[0-4] )
33                 fixincludes=fixinc.svr4
34                 ;;
35
36         i[34567]86-*-interix* | \
37         alpha-*-interix*)
38                 fixincludes=fixinc.interix
39                 ;;
40
41         *-*-netbsd* | \
42         alpha*-*-linux-gnulibc1* | \
43         i[34567]86-*-openbsd* | \
44         i[34567]86-*-solaris2* | \
45         sparcv9-*-solaris2* | \
46         powerpcle-*-solaris2*  | \
47         sparc-*-solaris2* )
48                 fixincludes=fixinc.wrap
49                 ;;
50
51         alpha*-*-winnt* | \
52         i[34567]86-*-winnt3*)
53                 fixincludes=fixinc.winnt
54                 ;;
55
56         i[34567]86-sequent-ptx* | i[34567]86-sequent-sysv[34]*)
57                 fixincludes=fixinc.ptx
58                 ;;
59
60         i[34567]86-*-sco3.2v5* | \
61         i[34567]86-*-sco3.2v4*)
62                 fixincludes=fixinc.sco
63                 ;;
64
65         alpha*-*-linux-gnu* | \
66         alpha*-dec-vms* | \
67         arm-semi-aout | armel-semi-aout | \
68         arm-semi-aof | armel-semi-aof | \
69         arm-*-gnu* | \
70         c*-convex-* | \
71         hppa1.1-*-osf* | \
72         hppa1.0-*-osf* | \
73         hppa1.1-*-bsd* | \
74         hppa1.0-*-bsd* | \
75         hppa*-*-lites* | \
76         *-*-linux-gnu* | \
77         *-*-gnu* | \
78         i[34567]86-moss-msdos* | i[34567]86-*-moss* | \
79         i[34567]86-*-osf1* | \
80         i[34567]86-*-win32 | \
81         i[34567]86-*-pe | i[34567]86-*-cygwin* | \
82         i[34567]86-*-mingw32* | \
83         mips-sgi-irix5cross64 | \
84         powerpc-*-eabiaix* | \
85         powerpc-*-eabisim* | \
86         powerpc-*-eabi*    | \
87         powerpc-*-rtems*   | \
88         powerpcle-*-eabisim* | \
89         powerpcle-*-eabi*  | \
90         powerpcle-*-winnt* | \
91         powerpcle-*-pe | powerpcle-*-cygwin* | \
92         thumb-*-coff* | thumbel-*-coff* )
93                 fixincludes=
94                 ;;
95
96         *-sgi-irix*)
97                 fixincludes=fixinc.irix
98                 ;;
99 esac
100
101 #  IF there is no include fixing,
102 #  THEN create a no-op fixer and exit
103 #
104 if test -z "$fixincludes"
105 then
106     (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
107     chmod 755 ${target}
108     exit 0
109 fi
110
111 #  IF the fixer is supplied in our source directory,
112 #  THEN copy that into place
113 #
114 if test -f ${srcdir}/"${fixincludes}"
115 then
116     echo copying ${srcdir}/$fixincludes to ${target}
117     cp ${srcdir}/$fixincludes ${target}
118     chmod 755 ${target}
119     exit 0
120 fi
121
122 #  OK.  We gotta make the thing.
123 #
124 echo $MAKE SHELL=\"$SHELL\" install
125
126 #  make and install either the binary or the default script
127 #
128 $MAKE SHELL="$SHELL" install && chmod 755 ${target} && exit 0
129
130 #  Where is our inclhack script?  That is the backup
131 #  in case we are unable to make a working binary.
132 #
133 if test -f ./inclhack.sh
134 then
135     INCLHACK=./inclhack.sh
136 else
137     INCLHACK=${srcdir}/inclhack.sh
138 fi
139
140 echo Could not install binary fixincludes.
141 echo Installing shell script instead.
142
143 cp ${INCLHACK} ${target}
144 chmod 755 ${target}