summaryrefslogtreecommitdiff
path: root/src/configure
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-05-09 21:26:48 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-05-09 21:26:48 (GMT)
commitb3c7318d799282af7a78fdd4587d86c953b70903 (patch)
tree8e0028485e1a21a4180f593fb8fff0772ad949d9 /src/configure
parent9407d2d102b3759f37d1cc45027cf27c39994303 (diff)
lua version is now selectable via configure
Diffstat (limited to 'src/configure')
-rwxr-xr-xsrc/configure21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/configure b/src/configure
index 6cebe01..75ed3e6 100755
--- a/src/configure
+++ b/src/configure
@@ -27,6 +27,7 @@ USE_CLANG=0
LUA_DIR=''
LUA=''
+LUA_VER=''
PREFIX='/usr/local'
BINDIR=''
@@ -41,6 +42,7 @@ print_usage() {
echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc)"
echo " --libdir=<DIR> the path to the lua library directory (default: $PREFIX/lib/rhnop)"
echo " --with-lua=<DIR> use this lua tree instead of system default"
+ echo " --lua-version=nnn set fixed Lua version for automatic detection (501 -> 5.1, 502 -> 5.2)"
echo " --use-clang use clang/llvm as compiler/linker"
}
@@ -68,6 +70,9 @@ do
--with-lua=*)
LUA_DIR=${arg#--with-lua=}
;;
+ --lua-version=*)
+ LUA_VER=${arg#--lua-version=}
+ ;;
--ebuild-compat)
EBUILD_COMPAT=1
;;
@@ -124,15 +129,23 @@ test_lua_version()
if [ -z "$LUA_VERSION_MAJ" ]; then
LUA_VERSION=`cat $1 | grep "#define LUA_VERSION[ ]" | cut -f2- | tr -d '"' | sed -e 's/Lua \([0-9][0-9.]*\)/\1/'`
- LUA_RELEASE=`cat $1 | grep "#define LUA_RELEASE[ ]" | cut -f2-`
+ LUA_RELEASE=`cat $1 | grep "#define LUA_RELEASE[ ]" | cut -f2- | tr -d '"' | sed -e 's/Lua //'`
fi
LUA_VERSION_NUM=`cat $1 | grep "#define LUA_VERSION_NUM" | awk '{ print $3 }'`
- if [ $LUA_VERSION_NUM -ge 501 ]; then
- return 1;
+ if [ -n "$LUA_VER" ]; then
+ if [ "$LUA_VER" -eq $LUA_VERSION_NUM ]; then
+ return 1
+ else
+ return 0
+ fi
else
- return 0;
+ if [ $LUA_VERSION_NUM -ge 501 ]; then
+ return 1
+ else
+ return 0
+ fi
fi
}