]> gcc.gnu.org Git - gcc.git/blame - gcc/fixinc/mkfixinc.sh
Merge from fixincl-branch
[gcc.git] / gcc / fixinc / mkfixinc.sh
CommitLineData
0083c904
BK
1#! /bin/sh
2
3machine=$1
4if [ -z "$machine" ]
5then
6 echo No machine name given
7 exit 1
8fi
9
1f414ac4
BK
10target=../fixinc.sh
11
12echo constructing ${target} for $machine
13fixincludes="${target}"
0083c904
BK
14
15case $machine in
16 *-*-gnu*)
17 fixincludes=
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 *-*-netbsd* | \
37 alpha*-*-linux-gnulibc1* | \
38 i[34567]86-*-freebsd* | \
39 i[34567]86-*-netbsd* | i[34567]86-*-openbsd* | \
40 i[34567]86-*-solaris2* | \
41 sparcv9-*-solaris2* | \
42 powerpcle-*-solaris2* | \
43 sparc-*-solaris2* )
44 fixincludes=fixinc.wrap
45 ;;
46
47 alpha*-*-winnt* | \
48 i[34567]86-*-winnt3*)
49 fixincludes=fixinc.winnt
50 ;;
51
52 i[34567]86-sequent-ptx* | i[34567]86-sequent-sysv[34]*)
53 fixincludes=fixinc.ptx
54 ;;
55
56 i[34567]86-dg-dgux* | \
57 m88k-dg-dgux*)
58 fixincludes=fixinc.dgux
59 ;;
60
61 i[34567]86-*-sco3.2v5* | \
62 i[34567]86-*-sco3.2v4*)
63 fixincludes=fixinc.sco
64 ;;
65
66 alpha*-*-linux-gnu* | \
67 alpha*-dec-vms* | \
68 arm-semi-aout | armel-semi-aout | \
69 arm-semi-aof | armel-semi-aof | \
70 arm-*-linux-gnuaout* | \
71 c*-convex-* | \
72 hppa1.1-*-osf* | \
73 hppa1.0-*-osf* | \
74 hppa1.1-*-bsd* | \
75 hppa1.0-*-bsd* | \
76 hppa*-*-lites* | \
77 *-*-linux-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-*-cygwin32 | \
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-*-cygwin32 | \
92 thumb-*-coff* | thumbel-*-coff* )
93 fixincludes=
94 ;;
95
6d567568 96 i[34567]86-*-linux-gnulibc1 | \
44768aae
VM
97 i[34567]86-*-linux-gnuaout* | \
98 i[34567]86-*-linux-gnuoldld* | \
99 i[34567]86-*-linux-gnu*)
6d567568
VM
100 fixincludes=fixinc.x86-linux-gnu
101 ;;
102
0083c904
BK
103 *-sgi-irix*)
104 fixincludes=fixinc.irix
105 ;;
106esac
107
1f414ac4
BK
108# IF there is no include fixing,
109# THEN create a no-op fixer and exit
110#
0083c904
BK
111if test -z "$fixincludes"
112then
1f414ac4 113 cat > ${target} <<- _EOF_
0083c904
BK
114 #! /bin/sh
115 exit 0
116 _EOF_
117 exit 0
118fi
119
1f414ac4
BK
120# IF the fixer is supplied in our source directory,
121# THEN copy that into place
122#
123if test -f ${srcdir}/"${fixincludes}"
0083c904 124then
1f414ac4
BK
125 echo copying ${srcdir}/$fixincludes to ${target}
126 cp ${srcdir}/$fixincludes ${target}
0083c904
BK
127 exit 0
128fi
129
1f414ac4
BK
130# OK. We gotta make the thing.
131#
132echo $MAKE SHELL=\"$SHELL\" install
133
134# make and install either the binary or the default script
135#
136$MAKE SHELL="$SHELL" install && exit 0
137
138# Where is our inclhack script? That is the backup
139# in case we are unable to make a working binary.
140#
141if test -f ./inclhack.sh
142then
143 INCLHACK=./inclhack.sh
144else
145 INCLHACK=${srcdir}/inclhack.sh
146fi
147
148echo Could not install binary fixincludes.
149echo Installing shell script instead.
150
151cp ${INCLHACK} ${target}
This page took 0.117739 seconds and 5 git commands to generate.