#!/bin/sh echo "Get Retro | http://retroforth.org/projects/getretro" echo "===============================================================" if [ $(id -u) != "0" ]; then echo "I am very sorry, but you must be the superuser to install" echo "RetroForth using this script." echo "===============================================================" exit 1 fi if [ $1 ] ; then if [ $1 == "remove" ] ; then echo "Removal of RetroForth will now proceed" rm `which retro` rm `which retro-ffi` echo "===============================================================" exit fi if [ $1 == "help" ] ; then echo "This tool allows for easy installation, update, and removal of" echo "RetroForth on Linux and BSD systems." echo " " echo "To install or update RetroForth: getretro" echo "To remove RetroForth: getretro remove" echo "For help: getretro help" echo " " echo " " echo "RetroForth will be installed to the following locations:" echo " " echo "Linux: /usr/bin" echo "NetBSD: /usr/local/bin" echo "FreeBSD: /usr/local/bin" echo "DragonFly: /usr/local/bin" echo "===============================================================" exit fi fi if [ `uname` == "NetBSD" ] ; then echo "Host is NetBSD" echo "Obtaining via ftp..." ftp -a http://retroforth.org/retroforth/rf-netbsd ftp -a http://retroforth.org/retroforth/rf-generic echo "Linking..." ld -e _start rf-netbsd -o retro gcc rf-generic -o retro-ffi rm -f rf-netbsd rf-generic echo "Installing to /usr/local/bin" mv retro retro-ffi /usr/local/bin/ echo "===============================================================" exit fi if [ `uname` == "Linux" ] ; then echo "Host is Linux" echo "Obtaining via wget..." wget http://retroforth.org/retroforth/rf-linux wget http://retroforth.org/retroforth/rf-generic echo "Linking..." chmod +x rf-linux mv rf-linux retro gcc -ldl rf-generic -o retro-ffi rm rf-generic echo "Installing to /usr/bin" mv retro retro-ffi /usr/bin echo "===============================================================" exit fi if [ `uname` == "FreeBSD" ] ; then echo "Host is FreeBSD" echo "Obtaining via ftp..." ftp -a http://retroforth.org/retroforth/rf-freebsd ftp -a http://retroforth.org/retroforth/rf-generic echo "Linking..." mv rf-freebsd retro chmod +x retro gcc rf-generic -o retro-ffi rm rf-generic echo "Installing to /usr/local/bin" mv retro retro-ffi /usr/local/bin/ echo "===============================================================" exit fi if [ `uname` == "DragonFly" ] ; then echo "Host is DragonFly BSD" echo "Obtaining via ftp..." ftp -a http://retroforth.org/retroforth/rf-freebsd ftp -a http://retroforth.org/retroforth/rf-generic echo "Linking..." mv rf-freebsd retro chmod +x retro gcc rf-generic -o retro-ffi rm rf-generic echo "Installing to /usr/local/bin" mv retro retro-ffi /usr/local/bin/ echo "===============================================================" exit fi echo "We are sorry, but your operating system is not supported" echo "by this script yet. Please send relevant technical information" echo "and/or patches to crc@retroforth.org" echo "==============================================================="