1#!/bin/sh
2# BF_DATA should refer to the directory in which Blood Frontier data files are placed.
3#BF_DATA=~/bloodfrontier
4#BF_DATA=/usr/local/bloodfrontier
5BF_DATA=.
6
7# BF_BIN should refer to the directory in which Blood Frontier executable files are placed.
8BF_BIN=${BF_DATA}/bin
9
10# BF_OPTIONS contains any command line options you would like to start Blood Frontier with.
11BF_OPTIONS="-r"
12
13# SYSTEM_NAME should be set to the name of your operating system.
14#SYSTEM_NAME=Linux
15SYSTEM_NAME=`uname -s`
16
17# MACHINE_NAME should be set to the name of your processor.
18#MACHINE_NAME=i686
19MACHINE_NAME=`uname -m`
20
21case ${SYSTEM_NAME} in
22Linux)
23	SYSTEM_SUFFIX=_linux
24	;;
25*)
26	SYSTEM_SUFFIX=_unknown
27	;;
28esac
29
30case ${MACHINE_NAME} in
31i486|i586|i686)
32	MACHINE_SUFFIX=
33	;;
34x86_64)
35	MACHINE_SUFFIX=_64
36	;;
37*)
38	SYSTEM_SUFFIX=
39	MACHINE_SUFFIX=
40	;;
41esac
42
43if [ -x ${BF_BIN}/bfclient ]
44then
45	SYSTEM_SUFFIX=
46	MACHINE_SUFFIX=
47fi
48
49
50if [ -x ${BF_BIN}/bfclient${SYSTEM_SUFFIX}${MACHINE_SUFFIX} ];
51then
52	cd ${BF_DATA}
53	exec ${BF_BIN}/bfclient${SYSTEM_SUFFIX}${MACHINE_SUFFIX} ${BF_OPTIONS} "$@"
54else
55	echo "Your platform does not have a pre-compiled Blood Frontier client."
56	echo -n "Would you like to build one now? [Yn] "
57	read CC
58	if [ "${CC}" != "n" ]; then
59		cd ${BF_DATA}/src
60		make clean install
61		echo "Build complete, please try running the script again."
62	else
63		echo "Please follow the following steps to build:"
64		echo "1) Ensure you have the SDL, SDL image, SDL mixer, zlib, and OpenGL *DEVELOPMENT* libraries installed."
65		echo "2) Change directory to src/ and type \"make clean install\"."
66		echo "3) If the build succeeds, return to this directory and run this script again."
67		exit 1
68	fi
69fi
70
71