OSDN Git Service

* config.gcc (alpha*-dec-vms*): Change to alpha*-dec-*vms*
[pf3gnuchains/gcc-fork.git] / gcc / fixinc / mkfixinc.sh
1 #! /bin/sh
2
3 if [ $# -ne 2 ]
4 then
5   echo "Usage: $0 <build-mach-triplet> <target-mach-triplet>"
6   exit 1
7 fi
8
9 build=$1
10 machine=$2
11 target=../fixinc.sh
12
13 echo constructing ${target} for $machine to run on $build
14 fixincludes="${machine}"
15
16 # Choose one or two-process fix methodology.  Systems that cannot handle
17 # bi-directional pipes must use the twoprocess method.
18 #
19 case $build in
20         i?86-*-msdosdjgpp* | \
21         *-*-beos* )
22                 MAKE="${MAKE} TARGETS=twoprocess"
23                 CFLAGS="${CFLAGS} -DSEPARATE_FIX_PROC"
24                 ;;
25
26         vax-dec-bsd* )
27                 CFLAGS="${CFLAGS} -Dexit=xexit -Datexit=xatexit"
28                 MAKE="${MAKE} TARGETS=oneprocess"
29                 ;;
30
31         * )
32                 MAKE="${MAKE} TARGETS=oneprocess"
33                 ;;
34 esac
35
36 # Check for special fix rules for particular targets
37 case $machine in
38         *-*-sysv4* )
39                 fixincludes=fixinc.svr4
40                 ;;
41
42         i?86-*-interix* | \
43         alpha-*-interix*)
44                 fixincludes=fixinc.interix
45                 ;;
46
47         i?86-*-openbsd*)
48                 fixincludes=fixinc.wrap
49                 ;;
50
51         alpha*-*-winnt* | \
52         i?86-*-winnt3*)
53                 fixincludes=fixinc.winnt
54                 ;;
55
56         i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
57                 fixincludes=fixinc.ptx
58                 ;;
59
60         alpha*-dec-*vms* | \
61         arm-semi-aout | armel-semi-aout | \
62         arm-semi-aof | armel-semi-aof | \
63         c*-convex-* | \
64         hppa1.1-*-osf* | \
65         hppa1.0-*-osf* | \
66         hppa1.1-*-bsd* | \
67         hppa1.0-*-bsd* | \
68         hppa*-*-lites* | \
69         i?86-moss-msdos* | i?86-*-moss* | \
70         i?86-*-osf1* | \
71         i?86-*-win32 | \
72         i?86-*-pe | i?86-*-cygwin* | \
73         i?86-*-mingw32* | \
74         i?86-*-uwin* | \
75         mips-sgi-irix5cross64 | \
76         powerpc-*-eabiaix* | \
77         powerpc-*-eabisim* | \
78         powerpc-*-eabi*    | \
79         powerpc-*-rtems*   | \
80         powerpcle-*-eabisim* | \
81         powerpcle-*-eabi*  | \
82         powerpcle-*-winnt* | \
83         powerpcle-*-pe | powerpcle-*-cygwin* | \
84         thumb-*-coff* | thumbel-*-coff* )
85                 fixincludes=
86                 ;;
87 esac
88
89 #  IF there is no include fixing,
90 #  THEN create a no-op fixer and exit
91 #
92 if test -z "$fixincludes"
93 then
94     (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
95     chmod 755 ${target}
96     exit 0
97 fi
98
99 #  IF the fixer is supplied in our source directory,
100 #  THEN copy that into place
101 #
102 if test -f ${srcdir}/"${fixincludes}"
103 then
104     echo copying ${srcdir}/$fixincludes to ${target}
105     cp ${srcdir}/$fixincludes ${target}
106     chmod 755 ${target}
107     exit 0
108 fi
109
110 #  OK.  We gotta make the thing.
111 #  make and install either the binary or the default script
112
113 defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
114 cmd="$MAKE ${defs} install-bin"
115 echo $cmd
116 eval $cmd