OSDN Git Service

top level:
[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="${machine}"
14
15 case $machine in
16         i[34567]86-*-linux*)
17                 :
18                 ;;
19
20         *-*-sysv4*)
21                 fixincludes=fixinc.svr4
22                 ;;
23
24         i?86-*-sysv5* | \
25         i?86-*-udk* | \
26         i?86-*-solaris2.[0-4] | \
27         powerpcle-*-solaris2.[0-4] | \
28         sparc-*-solaris2.[0-4] )
29                 fixincludes=fixinc.svr4
30                 ;;
31
32         i?86-*-interix* | \
33         alpha-*-interix*)
34                 fixincludes=fixinc.interix
35                 ;;
36
37         *-*-netbsd* | \
38         alpha*-*-linux*libc1* | \
39         i?86-*-openbsd* | \
40         i?86-*-solaris2* | \
41         sparcv9-*-solaris2* | \
42         powerpcle-*-solaris2*  | \
43         sparc-*-solaris2* )
44                 fixincludes=fixinc.wrap
45                 ;;
46
47         alpha*-*-winnt* | \
48         i?86-*-winnt3*)
49                 fixincludes=fixinc.winnt
50                 ;;
51
52         i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
53                 fixincludes=fixinc.ptx
54                 ;;
55
56         alpha*-dec-vms* | \
57         arm-semi-aout | armel-semi-aout | \
58         arm-semi-aof | armel-semi-aof | \
59         arm-*-gnu* | \
60         c*-convex-* | \
61         hppa1.1-*-osf* | \
62         hppa1.0-*-osf* | \
63         hppa1.1-*-bsd* | \
64         hppa1.0-*-bsd* | \
65         hppa*-*-lites* | \
66         *-*-linux* | \
67         *-*-gnu* | \
68         i?86-moss-msdos* | i?86-*-moss* | \
69         i?86-*-osf1* | \
70         i?86-*-win32 | \
71         i?86-*-pe | i?86-*-cygwin* | \
72         i?86-*-mingw32* | \
73         i?86-*-uwin* | i?86-*-msdosdjgpp* | \
74         mips-sgi-irix5cross64 | \
75         powerpc-*-eabiaix* | \
76         powerpc-*-eabisim* | \
77         powerpc-*-eabi*    | \
78         powerpc-*-rtems*   | \
79         powerpcle-*-eabisim* | \
80         powerpcle-*-eabi*  | \
81         powerpcle-*-winnt* | \
82         powerpcle-*-pe | powerpcle-*-cygwin* | \
83         thumb-*-coff* | thumbel-*-coff* )
84                 fixincludes=
85                 ;;
86
87         *-sgi-irix*)
88                 fixincludes=fixinc.irix
89                 ;;
90 esac
91
92 #  IF there is no include fixing,
93 #  THEN create a no-op fixer and exit
94 #
95 if test -z "$fixincludes"
96 then
97     (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
98     chmod 755 ${target}
99     exit 0
100 fi
101
102 #  IF the fixer is supplied in our source directory,
103 #  THEN copy that into place
104 #
105 if test -f ${srcdir}/"${fixincludes}"
106 then
107     echo copying ${srcdir}/$fixincludes to ${target}
108     cp ${srcdir}/$fixincludes ${target}
109     chmod 755 ${target}
110     exit 0
111 fi
112
113 #  OK.  We gotta make the thing.
114 #
115 echo $MAKE SHELL=\"$SHELL\" install-bin
116
117 #  make and install either the binary or the default script
118 #
119 $MAKE SHELL="$SHELL" install-bin