mkfixinc.sh 630 Bytes
Newer Older
1 2
#! /bin/sh

Geoffrey Keating committed
3
if [ $# -ne 1 ]
4
then
Geoffrey Keating committed
5
  echo "Usage: $0 <target-mach-triplet>"
6 7 8
  exit 1
fi

Geoffrey Keating committed
9
machine=$1
10 11 12 13 14
target=fixinc.sh

# Check for special fix rules for particular targets
case $machine in
    i?86-*-cygwin* | \
15 16
    i?86-*-mingw32* | \
    x86_64-*-mingw32* | \
17 18 19 20
    powerpc-*-eabisim* | \
    powerpc-*-eabi*    | \
    powerpc-*-rtems*   | \
    powerpcle-*-eabisim* | \
21 22
    powerpcle-*-eabi* | \
    *-musl* )
23 24 25 26 27 28
	#  IF there is no include fixing,
	#  THEN create a no-op fixer and exit
	(echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
        ;;

    *)
29
	cat < ${srcdir}/fixinc.in > ${target} || exit 1
30 31 32
	;;
esac
chmod 755 ${target}