PR c++/11808
[official-gcc.git] / gcc / fixinc / mkfixinc.sh
blob03d9b155c71793d99b19555045e4b7ad25e8f40f
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 i?86-*-sysv4.2uw2* )
41 *-*-sysv4* )
42 fixincludes=fixinc.svr4
45 i?86-sequent-ptx* | i?86-sequent-sysv[34]*)
46 fixincludes=fixinc.ptx
49 alpha*-dec-*vms* | \
50 arm-semi-aof | \
51 hppa1.1-*-osf* | \
52 hppa1.1-*-bsd* | \
53 i370-*-openedition | \
54 i?86-moss-msdos* | \
55 i?86-*-moss* | \
56 i?86-*-pe | \
57 i?86-*-cygwin* | \
58 i?86-*-mingw32* | \
59 i?86-*-uwin* | \
60 i?86-*-interix* | \
61 powerpc-*-eabiaix* | \
62 powerpc-*-eabisim* | \
63 powerpc-*-eabi* | \
64 powerpc-*-rtems* | \
65 powerpcle-*-eabisim* | \
66 powerpcle-*-eabi* )
67 # Don't do any fixing.
69 fixincludes=
71 esac
73 # IF there is no include fixing,
74 # THEN create a no-op fixer and exit
76 if test -z "$fixincludes"
77 then
78 (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
79 chmod 755 ${target}
80 exit 0
83 # IF the fixer is supplied in our source directory,
84 # THEN copy that into place
86 if test -f ${srcdir}/"${fixincludes}"
87 then
88 echo copying ${srcdir}/$fixincludes to ${target}
89 cp ${srcdir}/$fixincludes ${target}
90 chmod 755 ${target}
91 exit 0
94 # OK. We gotta make the thing.
95 # make and install either the binary or the default script
97 defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBERTY=\"$LIBERTY\""
98 cmd="$MAKE ${defs} install-bin"
99 echo $cmd
100 eval $cmd