123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #! /bin/sh
- #
- # Compile and install the GCC4TI linker
- #
- isbsd=`uname -a | grep "BSD"`
- isos=`uname -a | grep "opensolaris"`
- if [ "x$isbsd" = "x" -a "x$isos" = "x" ]; then
- #Assume GNU make
- make=make
- else
- make=gmake
- fi
- if [ "x$isos" = "x" ]; then
- #Assume GNU or BSD install
- install=install
- else
- install=ginstall
- fi
- echo Installing GCC4TI linker...
- ORG_PWD=$PWD/..
- cd "$ORG_PWD/sources/ld-tigcc"
- # OS X requires a switch to enable nested functions. ld-tigcc doesn't actually
- # require an executable stack, but Apple's compiler is not clever enough to
- # make the distinction.
- if [ -z "$CC" ]
- then CC="gcc"
- fi
- if [ -z "$CFLAGS" ]
- then CFLAGS="-Os -s -fno-exceptions"
- fi
- if $CC -v --help 2>/dev/null | grep fnested-functions >/dev/null
- then export CFLAGS="$CFLAGS -fnested-functions"
- fi
- linkdll=
- iswin1=`echo $GCC4TIHOST | grep -E -i "msys|mingw|cygwin"`
- iswin2=`uname -a | grep -E -i "msys|mingw|cygwin"`
- if [ "x$iswin1" != "x" -o "x$iswin2" != "x" ]; then
- linkdll="link.dll"
- fi
- ${make} -e all ${linkdll} || exit 1
- ${install} -d "$PREFIX_GCC4TI/bin" || exit 1
- if [ "x$iswin1" = "x" -a "x$iswin2" = "x" ]; then
- ${install} ld-tigcc "$PREFIX_GCC4TI/bin" || exit 1
- ${install} ar-tigcc "$PREFIX_GCC4TI/bin" || exit 1
- else
- if [ -f "ld-tigcc.exe" ]; then
- ${install} ld-tigcc.exe "$PREFIX_GCC4TI/bin" || exit 1
- else
- ${install} ld-tigcc "$PREFIX_GCC4TI/bin/ld-tigcc.exe" || exit 1
- fi
- if [ -f "ar-tigcc.exe" ]; then
- ${install} ar-tigcc.exe "$PREFIX_GCC4TI/bin" || exit 1
- else
- ${install} ar-tigcc "$PREFIX_GCC4TI/bin/ar-tigcc.exe" || exit 1
- fi
- ${install} link.dll "$PREFIX_GCC4TI/bin" || exit 1
- fi
- ${make} clean
- cd "$ORG_PWD/scripts"
- echo Done.
- exit 0
|