aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPhilipp Janda <siffiejoe@gmx.net>2014-03-26 18:25:16 +0100
committerPhilipp Janda <siffiejoe@gmx.net>2014-03-26 18:25:16 +0100
commiteba0f64344ea14c25cbe7b1054739567cd77ec29 (patch)
treebfb591cda588c51901a8c1ecb1cbf28a9a86f0b0 /configure
parent00b5631f71fcb0db535aded042b51aa58223e6a4 (diff)
downloadluarocks-eba0f64344ea14c25cbe7b1054739567cd77ec29.tar.gz
luarocks-eba0f64344ea14c25cbe7b1054739567cd77ec29.tar.bz2
luarocks-eba0f64344ea14c25cbe7b1054739567cd77ec29.zip
prepare luarocks for lua 5.3
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure27
1 files changed, 16 insertions, 11 deletions
diff --git a/configure b/configure
index e9f5e018..bbdbb5c9 100755
--- a/configure
+++ b/configure
@@ -39,7 +39,7 @@ system's package manager.
39--rocks-tree=DIR Root of the local tree of installed rocks. 39--rocks-tree=DIR Root of the local tree of installed rocks.
40 Default is \$PREFIX 40 Default is \$PREFIX
41 41
42--lua-version=VERSION Use specific Lua version: 5.1 or 5.2 42--lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3
43 Default is "$LUA_VERSION" 43 Default is "$LUA_VERSION"
44--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. 44--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
45 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) 45 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
@@ -177,7 +177,7 @@ do
177 --lua-version) 177 --lua-version)
178 [ -n "$value" ] || die "Missing value in flag $key." 178 [ -n "$value" ] || die "Missing value in flag $key."
179 LUA_VERSION="$value" 179 LUA_VERSION="$value"
180 [ "$LUA_VERSION" = "5.1" -o "$LUA_VERSION" = "5.2" ] || die "Invalid Lua version in flag $key." 180 [ "$LUA_VERSION" = "5.1" -o "$LUA_VERSION" = "5.2" -o "$LUA_VERSION" = "5.3" ] || die "Invalid Lua version in flag $key."
181 LUA_VERSION_SET=yes 181 LUA_VERSION_SET=yes
182 ;; 182 ;;
183 --with-lua) 183 --with-lua)
@@ -234,7 +234,7 @@ fi
234 234
235detect_lua_version() { 235detect_lua_version() {
236 detected_lua=`$1 -e 'print(_VERSION:sub(5))' 2> /dev/null` 236 detected_lua=`$1 -e 'print(_VERSION:sub(5))' 2> /dev/null`
237 if [ "$detected_lua" = "5.1" -o "$detected_lua" = "5.2" ] 237 if [ "$detected_lua" = "5.1" -o "$detected_lua" = "5.2" -o "$detected_lua" = "5.3" ]
238 then 238 then
239 echo "Lua version detected: $detected_lua" 239 echo "Lua version detected: $detected_lua"
240 if [ "$LUA_VERSION_SET" != "yes" ] 240 if [ "$LUA_VERSION_SET" != "yes" ]
@@ -275,8 +275,11 @@ then
275 elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.2" ] 275 elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.2" ]
276 then 276 then
277 suffixes="5.2 52 -5.2 -52" 277 suffixes="5.2 52 -5.2 -52"
278 elif [ "$LUA_VERSION_SET" = "yes" -a "$LUA_VERSION" = "5.3" ]
279 then
280 suffixes="5.3 53 -5.3 -53"
278 else 281 else
279 suffixes="5.2 52 -5.2 -52 5.1 51 -5.1 -51" 282 suffixes="5.3 53 -5.3 -53 5.2 52 -5.2 -52 5.1 51 -5.1 -51"
280 fi 283 fi
281 for suffix in `echo $suffixes` "" 284 for suffix in `echo $suffixes` ""
282 do 285 do
@@ -371,12 +374,14 @@ else
371 die "Could not determine processor architecture. 'uname -m' failed." 374 die "Could not determine processor architecture. 'uname -m' failed."
372fi 375fi
373 376
374if [ "$LUA_VERSION" = "5.2" ] 377for v in 5.1 5.2 5.3; do
375then 378 if [ "$v" != "$LUA_VERSION" ]; then
376 LUA_OTHER_VERSION=5.1 379 if [ -e "$PREFIX/share/lua/$v/luarocks/site_config.lua" ]; then
377else 380 LUA_OTHER_VERSION="$v"
378 LUA_OTHER_VERSION=5.2 381 break
379fi 382 fi
383 fi
384done
380 385
381LUAROCKS_ROCKS_SUBDIR=/lib/luarocks/rocks 386LUAROCKS_ROCKS_SUBDIR=/lib/luarocks/rocks
382if [ "$VERSIONED_ROCKS_DIR" = "yes" ] 387if [ "$VERSIONED_ROCKS_DIR" = "yes" ]
@@ -388,7 +393,7 @@ then
388 echo "Existing installation detected." 393 echo "Existing installation detected."
389 LUAROCKS_ROCKS_SUBDIR=`grep "LUAROCKS_ROCKS_SUBDIR" "$PREFIX/share/lua/$LUA_VERSION/luarocks/site_config.lua" | sed 's,.*=\[\[\(.*\)\]\],\1,'` 394 LUAROCKS_ROCKS_SUBDIR=`grep "LUAROCKS_ROCKS_SUBDIR" "$PREFIX/share/lua/$LUA_VERSION/luarocks/site_config.lua" | sed 's,.*=\[\[\(.*\)\]\],\1,'`
390 echo "Using previously configured rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR" 395 echo "Using previously configured rocks dir: $PREFIX$LUAROCKS_ROCKS_SUBDIR"
391elif [ -e "$PREFIX/share/lua/$LUA_OTHER_VERSION/luarocks/site_config.lua" ] 396elif [ -n "$LUA_OTHER_VERSION" ]
392then 397then
393 echo "Existing installation detected for other Lua version ($LUA_OTHER_VERSION)." 398 echo "Existing installation detected for other Lua version ($LUA_OTHER_VERSION)."
394 LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR-$LUA_VERSION 399 LUAROCKS_ROCKS_SUBDIR=$LUAROCKS_ROCKS_SUBDIR-$LUA_VERSION