OSDN Git Service

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