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