* decl2.c (pending_statics_used): Make it a macro.
[official-gcc.git] / gcc / fixinc / mkfixinc.sh
blobae0dbbd074cc6e5744a79db40d9a07760c68275f
1 #! /bin/sh
3 machine=$1
4 if [ -z "$machine" ]
5 then
6 echo No machine name given
7 exit 1
8 fi
10 target=../fixinc.sh
12 echo constructing ${target} for $machine
13 fixincludes="${target}"
15 case $machine in
16 i[34567]86-*-linux-gnu*)
20 *-*-sysv4*)
21 fixincludes=fixinc.svr4
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
32 i[34567]86-*-interix* | \
33 alpha-*-interix*)
34 fixincludes=fixinc.interix
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
47 alpha*-*-winnt* | \
48 i[34567]86-*-winnt3*)
49 fixincludes=fixinc.winnt
52 i[34567]86-sequent-ptx* | i[34567]86-sequent-sysv[34]*)
53 fixincludes=fixinc.ptx
56 i[34567]86-*-sco3.2v5* | \
57 i[34567]86-*-sco3.2v4*)
58 fixincludes=fixinc.sco
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=
92 *-sgi-irix*)
93 fixincludes=fixinc.irix
95 esac
97 # IF there is no include fixing,
98 # THEN create a no-op fixer and exit
100 if test -z "$fixincludes"
101 then
102 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
103 chmod 755 ${target}
104 exit 0
107 # IF the fixer is supplied in our source directory,
108 # THEN copy that into place
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
118 # OK. We gotta make the thing.
120 echo $MAKE SHELL=\"$SHELL\" install
122 # make and install either the binary or the default script
124 $MAKE SHELL="$SHELL" install && chmod 755 ${target} && exit 0
126 # Where is our inclhack script? That is the backup
127 # in case we are unable to make a working binary.
129 if test -f ./inclhack.sh
130 then
131 INCLHACK=./inclhack.sh
132 else
133 INCLHACK=${srcdir}/inclhack.sh
136 echo Could not install binary fixincludes.
137 echo Installing shell script instead.
139 cp ${INCLHACK} ${target}
140 chmod 755 ${target}