Metropoli BBS
VIEWER: getapl2 MODE: TEXT (ASCII)
#!/bin/sh
# ----------------------------------------------------------------------------
# Description:
# This is the final compile/link of the CAPLIB2 APL2 Interpreter.
# $HOME should be set to the path to the cap2 subdirectory, e.g. "/home/smitty"
# if it's /home/smitty/cap2.  $PATH should have $HOME/cap2/bat:$HOME/cap2/bin
# at it's front before invoking.
# ----------------------------------------------------------------------------
# Changelog:
# 920101 Created by Smitty.
# 980101 Smitty modified to handle HP-UX and Linux Release 2.
# ----------------------------------------------------------------------------
os=`uname -s`
if [ "$os" = "HP-UX" ]; then
	gcc $1 -I$HOME/cap2/include -o $HOME/cap2/bin/apl2 \
		-lm -Xlinker +n $HOME/cap2/lib/libcap2.a \
		$HOME/cap2/source/apl.c
else
	release=`uname -r | cut -d. -f1`
	case "$release" in
		"1")
			# $1 == -g for debugging
			if [ "$1" = "-g" ]; then
				lib="-lg"
				shr="-non_shared"
			else
				lib="-lc"
				shr=""
			fi
			z $HOME/cap2/source/apl $1
			rc=$?
			if [ $rc -ne 0 ]; then
				echo bad compile
				exit $rc
			fi
			ld $1 -o $HOME/cap2/bin/apl2 -dll-verbose -m486 $shr \
				/usr/lib/crt0.o \
				apl.o \
				$HOME/cap2/lib/libcap2.a \
				-L/usr/lib/gcc-lib/i486-linux/2.6.3 \
				-lcurses -ltermcap -lgcc $lib -lgcc -lm
			rm apl.o
			;;
		*)
			gcc $1 -I$HOME/cap2/include -o $HOME/cap2/bin/apl2 \
				-lm -L$HOME/cap2/lib -lcap2 \
				$HOME/cap2/source/apl.c -lcap2
			;;
	esac
fi
[ RETURN TO DIRECTORY ]