2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / fixinc / mkfixinc.sh
bloba3700ccb2669b8cfa6e36eb7fe9b5446bddd4667
1 #! /bin/sh
3 if [ $# -ne 2 ]
4 then
5 echo "Usage: $0 <build-mach-triplet> <target-mach-triplet>"
6 exit 1
7 fi
9 build=$1
10 machine=$2
11 target=../fixinc.sh
13 echo constructing ${target} for $machine to run on $build
14 fixincludes="${machine}"
16 # Choose one or two-process fix methodology. Systems that cannot handle
17 # bi-directional pipes must use the two process method.
19 case $build in
20 i?86-*-msdosdjgpp* | \
21 *-*-beos* )
22 MAKE="${MAKE} TARGETS=twoprocess"
23 CFLAGS="${CFLAGS} -DSEPARATE_FIX_PROC"
26 vax-dec-bsd* )
27 CFLAGS="${CFLAGS} -Dexit=xexit -Datexit=xatexit"
28 MAKE="${MAKE} TARGETS=oneprocess"
31 * )
32 MAKE="${MAKE} TARGETS=oneprocess"
34 esac
36 # Check for special fix rules for particular targets
37 case $machine in
38 alpha*-dec-*vms* | \
39 arm-semi-aof | \
40 hppa1.1-*-osf* | \
41 hppa1.1-*-bsd* | \
42 i370-*-openedition | \
43 i?86-moss-msdos* | \
44 i?86-*-moss* | \
45 i?86-*-pe | \
46 i?86-*-cygwin* | \
47 i?86-*-mingw32* | \
48 i?86-*-uwin* | \
49 i?86-*-interix* | \
50 powerpc-*-eabiaix* | \
51 powerpc-*-eabisim* | \
52 powerpc-*-eabi* | \
53 powerpc-*-rtems* | \
54 powerpcle-*-eabisim* | \
55 powerpcle-*-eabi* )
56 # Don't do any fixing.
58 fixincludes=
60 esac
62 # IF there is no include fixing,
63 # THEN create a no-op fixer and exit
65 if test -z "$fixincludes"
66 then
67 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
68 chmod 755 ${target}
69 exit 0
72 # OK. We gotta make the thing.
73 # make and install either the binary or the default script
75 defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBERTY=\"$LIBERTY\""
76 cmd="$MAKE ${defs} install-bin"
77 echo $cmd
78 eval $cmd