1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #! /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 "msys|mingw|cygwin"`
- iswin2=`uname -a | grep -E "msys|mingw|cygwin"`
- if [ "x$iswin1" != "x" -o "x$iswin2" != "x" ]; then
- linkdll="link.dll"
- fi
- ${make} -e all ${linkdll} || exit 1
- ${install} -d $TIGCC/bin || exit 1
- iswin1=`echo $GCC4TIHOST | grep -E "msys|mingw|cygwin"`
- iswin2=`uname -a | grep -E "msys|mingw|cygwin"`
- if [ "x$iswin1" = "x" -a "x$iswin2" = "x" ]; then
- ${install} ld-tigcc $TIGCC/bin || exit 1
- ${install} ar-tigcc $TIGCC/bin || exit 1
- else
- if [ -f "ld-tigcc.exe" ]; then
- ${install} ld-tigcc.exe $TIGCC/bin || exit 1
- else
- ${install} ld-tigcc $TIGCC/bin/ld-tigcc.exe || exit 1
- fi
- if [ -f "ar-tigcc.exe" ]; then
- ${install} ar-tigcc.exe $TIGCC/bin || exit 1
- else
- ${install} ar-tigcc $TIGCC/bin/ar-tigcc.exe || exit 1
- fi
- ${install} link.dll $TIGCC/bin || exit 1
- fi
- ${make} clean
- cd $ORG_PWD/scripts
- echo Done.
- exit 0
|