OSDN Git Service

* fixinc/mkfixinc.sh: Remove special case code for unsupported
[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-sequent-ptx* | i?86-sequent-sysv[34]*)
46         fixincludes=fixinc.ptx
47         ;;
48
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-*-win32 | \
57     i?86-*-pe | \
58     i?86-*-cygwin* | \
59     i?86-*-mingw32* | \
60     i?86-*-uwin* | \
61     i?86-*-interix* | \
62     powerpc-*-eabiaix* | \
63     powerpc-*-eabisim* | \
64     powerpc-*-eabi*    | \
65     powerpc-*-rtems*   | \
66     powerpcle-*-eabisim* | \
67     powerpcle-*-eabi*  | \
68     powerpcle-*-winnt* | \
69     powerpcle-*-pe | \
70     powerpcle-*-cygwin* | \
71     thumb-*-coff* | \
72     thumbel-*-coff* )
73         #  Don't do any fixing.
74         #
75         fixincludes=
76         ;;
77 esac
78
79 #  IF there is no include fixing,
80 #  THEN create a no-op fixer and exit
81 #
82 if test -z "$fixincludes"
83 then
84     (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
85     chmod 755 ${target}
86     exit 0
87 fi
88
89 #  IF the fixer is supplied in our source directory,
90 #  THEN copy that into place
91 #
92 if test -f ${srcdir}/"${fixincludes}"
93 then
94     echo copying ${srcdir}/$fixincludes to ${target}
95     cp ${srcdir}/$fixincludes ${target}
96     chmod 755 ${target}
97     exit 0
98 fi
99
100 #  OK.  We gotta make the thing.
101 #  make and install either the binary or the default script
102
103 defs="SHELL=\"$SHELL\" CC=\"$CC\" CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBERTY=\"$LIBERTY\""
104 cmd="$MAKE ${defs} install-bin"
105 echo $cmd
106 eval $cmd