OSDN Git Service

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