export LUA_DIR to find the right LUA_INCLUDE_DIR

This commit is contained in:
Enno Rehling 2018-01-11 17:13:49 +01:00
parent 014cc02c45
commit 041c0fdfaa
1 changed files with 10 additions and 4 deletions

View File

@ -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