diff --git a/s/cmake-init b/s/cmake-init index 9d529a433..3d4e073a7 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -38,15 +38,21 @@ ARGS=" -DCMAKE_BUILD_TYPE=$BUILD \ git submodule update --init +LUA_VERSION="5.2" +LUA_DIR=/usr +if [ -d /usr/include/lua5.1 ]; then + LUA_VERSION="5.1" +elif [ -d /usr/local/include/lua5.1 ]; then + LUA_DIR=/usr/local + LUA_VERSION="5.1" +fi +export LUA_DIR + path="$(which tolua)" if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then echo "tolua is not installed, building from source" cd $ROOT if [ ! -d tolua ]; then - LUA_VERSION="5.2" - if [ -d /usr/include/lua5.1 ] || [ -d /usr/local/include/lua5.1 ]; then - LUA_VERSION="5.1" - fi echo "fetching tolua ${LUA_VERSION} from github..." git clone https://github.com/ennorehling/tolua-${LUA_VERSION}.git tolua fi