Comparison

configure @ 12570:e6f68b6c87e1

configure: No longer accept Lua 5.1
author Kim Alvefur <zash@zash.se>
date Thu, 30 Jun 2022 17:00:35 +0200
parent 11966:4c5087ce3c2e
child 12822:6b43bf85032b
comparison
equal deleted inserted replaced
12569:b5d9f1829b15 12570:e6f68b6c87e1
43 Default is \$PREFIX/etc/$APP_DIRNAME 43 Default is \$PREFIX/etc/$APP_DIRNAME
44 --libdir=DIR Location where the server files should be stored. 44 --libdir=DIR Location where the server files should be stored.
45 Default is \$PREFIX/lib 45 Default is \$PREFIX/lib
46 --datadir=DIR Location where the server data should be stored. 46 --datadir=DIR Location where the server data should be stored.
47 Default is \$PREFIX/var/lib/$APP_DIRNAME 47 Default is \$PREFIX/var/lib/$APP_DIRNAME
48 --lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3 48 --lua-version=VERSION Use specific Lua version: 5.2, 5.3, or 5.4
49 Default is auto-detected. 49 Default is auto-detected.
50 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames. 50 --lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
51 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...) 51 Default is "$LUA_SUFFIX" (lua$LUA_SUFFIX...)
52 --with-lua=PREFIX Use Lua from given prefix. 52 --with-lua=PREFIX Use Lua from given prefix.
53 Default is auto-detected (the parent directory of \$LUA_BINDIR). 53 Default is auto-detected (the parent directory of \$LUA_BINDIR).
171 LUA_SUFFIX_SET=yes 171 LUA_SUFFIX_SET=yes
172 ;; 172 ;;
173 --lua-version|--with-lua-version) 173 --lua-version|--with-lua-version)
174 [ -n "$value" ] || die "Missing value in flag $key." 174 [ -n "$value" ] || die "Missing value in flag $key."
175 LUA_VERSION="$value" 175 LUA_VERSION="$value"
176 [ "$LUA_VERSION" = "5.1" ] || [ "$LUA_VERSION" = "5.2" ] || [ "$LUA_VERSION" = "5.3" ] || [ "$LUA_VERSION" = "5.4" ] || die "Invalid Lua version in flag $key." 176 [ "$LUA_VERSION" != "5.1" ] || die "Lua 5.1 is no longer supported"
177 [ "$LUA_VERSION" = "5.2" ] || [ "$LUA_VERSION" = "5.3" ] || [ "$LUA_VERSION" = "5.4" ] || die "Invalid Lua version in flag $key."
177 LUA_VERSION_SET=yes 178 LUA_VERSION_SET=yes
178 ;; 179 ;;
179 --with-lua) 180 --with-lua)
180 [ -n "$value" ] || die "Missing value in flag $key." 181 [ -n "$value" ] || die "Missing value in flag $key."
181 LUA_DIR="$value" 182 LUA_DIR="$value"
273 fi 274 fi
274 if [ "$OSPRESET" = "linux" ]; then 275 if [ "$OSPRESET" = "linux" ]; then
275 CFLAGS="$CFLAGS -ggdb" 276 CFLAGS="$CFLAGS -ggdb"
276 fi 277 fi
277 if [ "$OSPRESET" = "freebsd" ] || [ "$OSPRESET" = "openbsd" ]; then 278 if [ "$OSPRESET" = "freebsd" ] || [ "$OSPRESET" = "openbsd" ]; then
278 LUA_INCDIR="/usr/local/include/lua51" 279 LUA_INCDIR="/usr/local/include/lua52"
279 LUA_INCDIR_SET=yes 280 LUA_INCDIR_SET=yes
280 CFLAGS="-Wall -fPIC -I/usr/local/include" 281 CFLAGS="-Wall -fPIC -I/usr/local/include"
281 LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared" 282 LDFLAGS="-I/usr/local/include -L/usr/local/lib -shared"
282 LUA_SUFFIX="51" 283 LUA_SUFFIX="52"
283 LUA_SUFFIX_SET=yes 284 LUA_SUFFIX_SET=yes
284 LUA_DIR=/usr/local 285 LUA_DIR=/usr/local
285 LUA_DIR_SET=yes 286 LUA_DIR_SET=yes
286 CC=cc 287 CC=cc
287 LD=ld 288 LD=ld
289 if [ "$OSPRESET" = "openbsd" ]; then 290 if [ "$OSPRESET" = "openbsd" ]; then
290 LUA_INCDIR="/usr/local/include"; 291 LUA_INCDIR="/usr/local/include";
291 LUA_INCDIR_SET="yes" 292 LUA_INCDIR_SET="yes"
292 fi 293 fi
293 if [ "$OSPRESET" = "netbsd" ]; then 294 if [ "$OSPRESET" = "netbsd" ]; then
294 LUA_INCDIR="/usr/pkg/include/lua-5.1" 295 LUA_INCDIR="/usr/pkg/include/lua-5.2"
295 LUA_INCDIR_SET=yes 296 LUA_INCDIR_SET=yes
296 LUA_LIBDIR="/usr/pkg/lib/lua/5.1" 297 LUA_LIBDIR="/usr/pkg/lib/lua/5.2"
297 LUA_LIBDIR_SET=yes 298 LUA_LIBDIR_SET=yes
298 CFLAGS="-Wall -fPIC -I/usr/pkg/include" 299 CFLAGS="-Wall -fPIC -I/usr/pkg/include"
299 LDFLAGS="-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -shared" 300 LDFLAGS="-L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib -shared"
300 fi 301 fi
301 if [ "$OSPRESET" = "pkg-config" ]; then 302 if [ "$OSPRESET" = "pkg-config" ]; then
302 if [ "$LUA_SUFFIX_SET" != "yes" ]; then 303 if [ "$LUA_SUFFIX_SET" != "yes" ]; then
303 LUA_SUFFIX="5.1"; 304 LUA_SUFFIX="5.4";
304 LUA_SUFFIX_SET=yes 305 LUA_SUFFIX_SET=yes
305 fi 306 fi
306 LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)" 307 LUA_CF="$(pkg-config --cflags-only-I lua$LUA_SUFFIX)"
307 LUA_CF="${LUA_CF#*-I}" 308 LUA_CF="${LUA_CF#*-I}"
308 LUA_CF="${LUA_CF%% *}" 309 LUA_CF="${LUA_CF%% *}"
333 then 334 then
334 LIBDIR=$PREFIX/lib 335 LIBDIR=$PREFIX/lib
335 fi 336 fi
336 337
337 detect_lua_version() { 338 detect_lua_version() {
338 detected_lua=$("$1" -e 'print(_VERSION:match(" (5%.[1234])$"))' 2> /dev/null) 339 detected_lua=$("$1" -e 'print(_VERSION:match(" (5%.[234])$"))' 2> /dev/null)
339 if [ "$detected_lua" != "nil" ] 340 if [ "$detected_lua" != "nil" ]
340 then 341 then
341 if [ "$LUA_VERSION_SET" != "yes" ] 342 if [ "$LUA_VERSION_SET" != "yes" ]
342 then 343 then
343 echo "Lua version detected: $detected_lua" 344 echo "Lua version detected: $detected_lua"
387 } 388 }
388 389
389 lua_interp_found=no 390 lua_interp_found=no
390 if [ "$LUA_SUFFIX_SET" != "yes" ] 391 if [ "$LUA_SUFFIX_SET" != "yes" ]
391 then 392 then
392 if [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.1" ] 393 if [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.2" ]
393 then
394 suffixes="5.1 51 -5.1 -51"
395 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.2" ]
396 then 394 then
397 suffixes="5.2 52 -5.2 -52" 395 suffixes="5.2 52 -5.2 -52"
398 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.3" ] 396 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.3" ]
399 then 397 then
400 suffixes="5.3 53 -5.3 -53" 398 suffixes="5.3 53 -5.3 -53"
401 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.4" ] 399 elif [ "$LUA_VERSION_SET" = "yes" ] && [ "$LUA_VERSION" = "5.4" ]
402 then 400 then
403 suffixes="5.4 54 -5.4 -54" 401 suffixes="5.4 54 -5.4 -54"
404 else 402 else
405 suffixes="5.1 51 -5.1 -51" 403 suffixes="5.2 52 -5.2 -52"
406 suffixes="$suffixes 5.2 52 -5.2 -52"
407 suffixes="$suffixes 5.3 53 -5.3 -53" 404 suffixes="$suffixes 5.3 53 -5.3 -53"
408 suffixes="$suffixes 5.4 54 -5.4 -54" 405 suffixes="$suffixes 5.4 54 -5.4 -54"
409 fi 406 fi
410 for suffix in "" $suffixes 407 for suffix in "" $suffixes
411 do 408 do