Comparison

configure @ 9658:597653fe8ea4

configure: Recognise 5.4 as a valid Lua version
author Kim Alvefur <zash@zash.se>
date Thu, 29 Nov 2018 16:19:39 +0100
parent 9657:bd75edf0e0e2
child 9678:6178b491fe28
comparison
equal deleted inserted replaced
9657:bd75edf0e0e2 9658:597653fe8ea4
235 LUA_SUFFIX_SET=yes 235 LUA_SUFFIX_SET=yes
236 ;; 236 ;;
237 --lua-version|--with-lua-version) 237 --lua-version|--with-lua-version)
238 [ -n "$value" ] || die "Missing value in flag $key." 238 [ -n "$value" ] || die "Missing value in flag $key."
239 LUA_VERSION="$value" 239 LUA_VERSION="$value"
240 [ "$LUA_VERSION" = "5.1" ] || [ "$LUA_VERSION" = "5.2" ] || [ "$LUA_VERSION" = "5.3" ] || die "Invalid Lua version in flag $key." 240 [ "$LUA_VERSION" = "5.1" ] || [ "$LUA_VERSION" = "5.2" ] || [ "$LUA_VERSION" = "5.3" ] || [ "$LUA_VERSION" = "5.4" ] || die "Invalid Lua version in flag $key."
241 LUA_VERSION_SET=yes 241 LUA_VERSION_SET=yes
242 ;; 242 ;;
243 --with-lua) 243 --with-lua)
244 [ -n "$value" ] || die "Missing value in flag $key." 244 [ -n "$value" ] || die "Missing value in flag $key."
245 LUA_DIR="$value" 245 LUA_DIR="$value"
338 then 338 then
339 LIBDIR=$PREFIX/lib 339 LIBDIR=$PREFIX/lib
340 fi 340 fi
341 341
342 detect_lua_version() { 342 detect_lua_version() {
343 detected_lua=$("$1" -e 'print(_VERSION:match(" (5%.[123])$"))' 2> /dev/null) 343 detected_lua=$("$1" -e 'print(_VERSION:match(" (5%.[1234])$"))' 2> /dev/null)
344 if [ "$detected_lua" != "nil" ] 344 if [ "$detected_lua" != "nil" ]
345 then 345 then
346 if [ "$LUA_VERSION_SET" != "yes" ] 346 if [ "$LUA_VERSION_SET" != "yes" ]
347 then 347 then
348 echo "Lua version detected: $detected_lua" 348 echo "Lua version detected: $detected_lua"
401 then 401 then
402 suffixes="5.2 52 -5.2 -52" 402 suffixes="5.2 52 -5.2 -52"
403 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.3" ] 403 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.3" ]
404 then 404 then
405 suffixes="5.3 53 -5.3 -53" 405 suffixes="5.3 53 -5.3 -53"
406 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.4" ]
407 then
408 suffixes="5.4 54 -5.4 -54"
406 else 409 else
407 suffixes="5.1 51 -5.1 -51" 410 suffixes="5.1 51 -5.1 -51"
408 suffixes="$suffixes 5.2 52 -5.2 -52" 411 suffixes="$suffixes 5.2 52 -5.2 -52"
409 suffixes="$suffixes 5.3 53 -5.3 -53" 412 suffixes="$suffixes 5.3 53 -5.3 -53"
413 suffixes="$suffixes 5.4 54 -5.4 -54"
410 fi 414 fi
411 for suffix in "" $suffixes 415 for suffix in "" $suffixes
412 do 416 do
413 search_interpreter "$suffix" && { 417 search_interpreter "$suffix" && {
414 lua_interp_found=yes 418 lua_interp_found=yes