From cfb1812f247ad5792070693817f1301ce034b581 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Jul 2015 03:08:29 +0200 Subject: [PATCH] fix building on RasPi --- cmake | 2 +- s/build | 2 ++ s/cmake-init | 41 +++++++++++++++++------------------------ src/CMakeLists.txt | 1 + 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/cmake b/cmake index 80fd16533..f1fb3943a 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 80fd16533e8c4b76e1164e5ebf543d832cf3a9f2 +Subproject commit f1fb3943ace59994d90d71a891b80033dc2700a2 diff --git a/s/build b/s/build index 2434f1065..2cf22b135 100755 --- a/s/build +++ b/s/build @@ -25,6 +25,8 @@ if [ ! -d $ROOT/$BUILD ]; then exit fi +git submodule update + if [ -z `which tolua` ]; then echo "build tolua" cd $ROOT/tolua ; make diff --git a/s/cmake-init b/s/cmake-init index 47a58b2e6..3a8408b1a 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -1,5 +1,4 @@ #!/bin/sh -set -e ROOT=$(pwd) while [ ! -d $ROOT/.git ]; do ROOT=$(dirname $ROOT) @@ -34,32 +33,26 @@ if [ -d $HOME/usr ]; then PREFIX_PATH=$HOME/usr:$HOME/usr/local:$PREFIX_PATH fi -path=`which tolua` -echo "TOLUA $path" -if [ "$HAVE_TOLUA" = "0" ] || [ ! -e $path ]; then - echo "tolua is not installed, building from source" - cd $ROOT/tolua ; make - ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua" -fi - -path=`which lua` -if [ -e $path ]; then - path=`dirname $path` # /opt/bin - path=`dirname $path` # /opt - if [ -e $path/include/lua.h ] && [ -d $path/lib ] ; then - echo "lua is installed in $path" - ARGS="$ARGS -DPC_LUA_DIR=$LUA" - fi -fi - -cd $BIN_DIR -cmake .. \ - $ARGS \ - -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules \ +ARGS=" -DCMAKE_MODULE_PATH=$ROOT/cmake/Modules \ -DCMAKE_BUILD_TYPE=$BUILD \ -DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \ -DCMAKE_INCLUDE_PATH=$INCLUDE_PATH \ -DCMAKE_PREFIX_PATH=$PREFIX_PATH \ - -DCMAKE_INSTALL_PREFIX=$HOME/eressea/server $* + -DCMAKE_INSTALL_PREFIX=$HOME/eressea/server" + +path="$(which tolua)" +if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then + echo "tolua is not installed, building from source" + cd $ROOT/tolua ; make + ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua" +else + echo "tolua is $path" +fi +unset path + +set -e + +cd $BIN_DIR +cmake .. $ARGS $* cd $OLDPWD diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 336b9b7cf..de25db3da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,7 @@ include_directories (${CRYPTO_INCLUDE_DIR}) include_directories (${QUICKLIST_INCLUDE_DIR}) include_directories (${CUTEST_INCLUDE_DIR}) include_directories (${LUA_INCLUDE_DIR}) +include_directories (${TOLUA_INCLUDE_DIR}) include_directories (${BSON_INCLUDE_DIR}) include_directories (${INIPARSER_INCLUDE_DIR})