12 PREFIX_BIN
=${PREFIX}/bin
13 PREFIX_LIB
=${PREFIX}/lib
/tuxanci
14 PREFIX_DATA
=${PREFIX}/share
/tuxanci
15 PREFIX_DOC
=${PREFIX}/share
/doc
/tuxanci-
${VERSION}
17 PREFIX_LOCALE
=${PREFIX}/share
/locale
18 PREFIX_FONT
=${PREFIX_DATA}/font
28 # Predefined functions
31 echo "Supported options are:"
32 echo "--help print this help and exit"
33 echo "--prefix=<path> final path for the game [/usr/local]"
34 echo "--prefix-bin=<path> path for binaries [\$prefix/bin]"
35 echo "--prefix-lib=<path> path for the modules [\$prefix/lib/tuxanci]"
36 echo "--prefix-data=<path> data path [\$prefix/share/tuxanci]"
37 echo "--prefix-doc=<path> documentation path [\$prefix/share/doc/tuxanci-${VERSION}]"
38 echo "--prefix-conf=<path> configuration files path [/etc]"
39 echo "--prefix-locale=<path> locale path [\$prefix/share/locale]"
40 echo "--prefix-font=<path> fonts path [\$prefix/share/tuxanci/font]"
41 echo "--destdir=<path> useful option for packagers"
43 echo "--disable-debug enables optimization and quiet output [default: no]"
44 echo "--enable-server build server [default: no]"
45 echo "--enable-client build client [default: yes]"
46 echo "--enable-audio build with audio facility [default: yes]"
47 echo "--enable-opengl build with 3D acceleration [default: yes]"
49 echo "--without-gettext English-only version [default: no]"
54 [ "$2" ] && lib
="${lib} $2"
55 [ "$3" ] && lib
="${lib} $3"
56 if [ "`pkg-config --exists --print-errors "${lib}" | grep "No package
'$1' found
"`" != "" ]; then
58 echo "Error: Cannot find ${lib}"
72 v1
=`echo $1 | sed -e "s/\./ /g"`
73 v2
=`echo $2 | sed -e "s/\./ /g"`
76 j1
=`echo $v1 | awk '{ print $1 }'`
77 j2
=`echo $v2 | awk '{ print $1 }'`
78 if [ $j1 -lt $j2 ]; then
80 elif [ $j1 -gt $j2 ]; then
85 n1
=`echo $v1 | awk '{ print $2 }'`
86 n2
=`echo $v2 | awk '{ print $2 }'`
87 if [ $n1 -lt $n2 ]; then
89 elif [ $n1 -gt $n2 ]; then
94 p1
=`echo $v1 | awk '{ print $3 }'`
95 p2
=`echo $v2 | awk '{ print $3 }'`
96 if [ $p1 -lt $p2 ]; then
98 elif [ $p1 -gt $p2 ]; then
109 echo "==> Parsing options"
111 while [ $# -gt 0 ]; do
118 PREFIX
=`echo $1 | sed 's/--prefix=//'`
121 PREFIX_BIN
=`echo $1 | sed 's/--prefix-bin=//'`
124 PREFIX
=`echo $1 | sed 's/--prefix-data=//'`
127 PREFIX
=`echo $1 | sed 's/--prefix-doc=//'`
130 DESTDIR
=`echo $1 | sed 's/--destdir=//'`
133 case ${1#--enable-} in
150 echo "Error: unknown option --enable-$1"
157 case ${1#--disable-} in
174 echo "Error: unknown option --disable-$1"
186 echo "Error: unknown option --with-$1"
198 echo "Error: unknown option --without-$1"
205 echo "Error: unknown option $1"
215 # Check for cmake dependency
217 printf "==> Checking for cmake >= 2.6.0... "
218 cmakebin
=`which cmake`
219 if [ "${cmakebin}" == "" ]; then
221 echo "Error: Cannot find cmake"
224 cmakeversion
=`${cmakebin} --version | sed -e "s/-patch//" | awk '{ print $3, $4 }' | sed -e "s/ /./"`
225 cmakestatus
=`cmpver "2.6.0" ${cmakeversion}`
226 if [ ${cmakestatus} == 1 ] ||
[ ${cmakestatus} == 0 ]; then
230 echo "Error: Cannot find cmake"
237 # Run cmake for client
239 if [ ${CLIENT} == 1 ]; then
240 echo "==> Running cmake stage for client and creating subMakefile"
244 cmakeopts
="-DBUILD_SERVER=0"
246 if [ ${DEBUG} == 1 ]; then cmakeopts
="${cmakeopts} -DENABLE_DEBUG=1"
247 else cmakeopts
="${cmakeopts} -DENABLE_DEBUG=0"; fi
249 if [ ${AUDIO} == 1 ]; then cmakeopts
="${cmakeopts} -DWITH_AUDIO=1"
250 else cmakeopts
="${cmakeopts} -DWITH_AUDIO=0"; fi
252 if [ ${OPENGL} == 1 ]; then cmakeopts
="${cmakeopts} -DWITH_OPENGL=1"
253 else cmakeopts
="${cmakeopts} -DWITH_OPENGL=0"; fi
255 if [ ${GETTEXT} == 1 ]; then cmakeopts
="${cmakeopts} -DWITH_NLS=1"
256 else cmakeopts
="${cmakeopts} -DWITH_NLS=0"; fi
258 cmakecmd
="cmake .. ${cmakeopts}"
259 echo "Executing: ${cmakecmd}"
260 ${cmakecmd} > cmake.log
264 echo "==> Creating main Makefile"
268 echo "==> Configuring successfully finished!"