Commit 0783d303 authored by Dmitrij D. Czarkoff's avatar Dmitrij D. Czarkoff

Update ax_lua.m4

Updated ax_lua.m4 to current version from GNU Autoconf Archive's git
repository with additional patch to support OpenBSD.[1] Regenerated
``configure'' script. DOcumented changes.

---
[1] https://savannah.gnu.org/patch/index.php?8355
parent f50ae8a8
......@@ -65,7 +65,20 @@ Install these ports:
Then build:
$ env CC=clang CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LUA=/usr/local/bin/lua52 LUA_INCLUDE=-I/usr/local/include/lua52 LUA_LIB=-llua-5.2 ./configure
$ env CC=clang CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./configure
$ make
#### OpenBSD
Install these packages (or *ports*):
* libconfig (*devel/libconfig*)
* libexecinfo (*devel/libexecinfo*)
* lua >= 5.2 (*lang/lua/5.2*)
Then build:
$ CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure
$ make
#### Other UNIX
......
......@@ -109,6 +109,7 @@
# * /usr/include/lua/X.Y
# * /usr/include/luaXY
# * /usr/local/include/luaX.Y
# * /usr/local/include/lua-X.Y
# * /usr/local/include/lua/X.Y
# * /usr/local/include/luaXY
#
......@@ -182,7 +183,7 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 20
#serial 21
dnl =========================================================================
dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION],
......@@ -195,7 +196,7 @@ AC_DEFUN([AX_PROG_LUA],
dnl Find a Lua interpreter.
m4_define_default([_AX_LUA_INTERPRETER_LIST],
[lua lua5.2 lua5.1 lua50])
[lua lua5.2 lua52 lua5.1 lua51 lua50])
m4_if([$1], [],
[ dnl No version check is needed. Find any Lua interpreter.
......@@ -259,7 +260,7 @@ AC_DEFUN([AX_PROG_LUA],
AC_CACHE_CHECK([for $ax_display_LUA version], [ax_cv_lua_version],
[ ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
])
AS_IF([test "x$ax_cv_lua_version" = 'x'],
[AC_MSG_ERROR([invalid Lua version number])])
......@@ -364,7 +365,7 @@ dnl =========================================================================
AC_DEFUN([_AX_LUA_CHK_VER],
[
_ax_test_ver=`$1 -e "print(_VERSION)" 2>/dev/null | \
sed "s|^Lua \(.*\)|\1|" | grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
sed "s|^Lua \(.*\)|\1|" | grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
AS_IF([test "x$_ax_test_ver" = 'x'],
[_ax_test_ver='0'])
AX_COMPARE_VERSION([$_ax_test_ver], [ge], [$2])
......@@ -431,6 +432,7 @@ AC_DEFUN([AX_LUA_HEADERS],
/usr/include/lua/$LUA_VERSION \
/usr/include/lua$LUA_SHORT_VERSION \
/usr/local/include/lua$LUA_VERSION \
/usr/local/include/lua-$LUA_VERSION \
/usr/local/include/lua/$LUA_VERSION \
/usr/local/include/lua$LUA_SHORT_VERSION \
])
......@@ -490,7 +492,7 @@ int main(int argc, char ** argv)
],
[ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
],
[ax_cv_lua_header_version='unknown'])
CPPFLAGS=$_ax_lua_saved_cppflags
......@@ -575,7 +577,12 @@ AC_DEFUN([AX_LUA_LIBS],
dnl Try to find the Lua libs.
_ax_lua_saved_libs=$LIBS
LIBS="$LIBS $LUA_LIB"
AC_SEARCH_LIBS([lua_load], [lua$LUA_VERSION lua$LUA_SHORT_VERSION lua],
AC_SEARCH_LIBS([lua_load],
[ lua$LUA_VERSION \
lua$LUA_SHORT_VERSION \
lua-$LUA_VERSION \
lua-$LUA_SHORT_VERSION \
lua],
[_ax_found_lua_libs='yes'],
[_ax_found_lua_libs='no'],
[$_ax_lua_extra_libs])
......
......@@ -2279,6 +2279,7 @@ ac_config_headers="$ac_config_headers config.h"
# * /usr/include/lua/X.Y
# * /usr/include/luaXY
# * /usr/local/include/luaX.Y
# * /usr/local/include/lua-X.Y
# * /usr/local/include/lua/X.Y
# * /usr/local/include/luaXY
#
......@@ -2352,7 +2353,7 @@ ac_config_headers="$ac_config_headers config.h"
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 20
#serial 21
......@@ -4049,7 +4050,7 @@ $as_echo "enabled" >&6; }
if test "x$LUA" = 'x'; then :
for ac_prog in lua lua5.2 lua5.1 lua50
for ac_prog in lua lua5.2 lua52 lua5.1 lua51 lua50
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
......@@ -4126,7 +4127,7 @@ if ${ax_cv_lua_version+:} false; then :
else
ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^[0-9]\+\\.[0-9]\+"`
grep -E -o "^[0-9]+\.[0-9]+"`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lua_version" >&5
......@@ -4290,6 +4291,7 @@ done
/usr/include/lua/$LUA_VERSION \
/usr/include/lua$LUA_SHORT_VERSION \
/usr/local/include/lua$LUA_VERSION \
/usr/local/include/lua-$LUA_VERSION \
/usr/local/include/lua/$LUA_VERSION \
/usr/local/include/lua$LUA_SHORT_VERSION \
; do
......@@ -4363,7 +4365,7 @@ _ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ax_cv_lua_header_version=`./conftest$EXEEXT p | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^[0-9]\+\\.[0-9]\+"`
grep -E -o "^[0-9]+\.[0-9]+"`
else
ax_cv_lua_header_version='unknown'
......@@ -4643,7 +4645,11 @@ return lua_load ();
return 0;
}
_ACEOF
for ac_lib in '' lua$LUA_VERSION lua$LUA_SHORT_VERSION lua; do
for ac_lib in '' lua$LUA_VERSION \
lua$LUA_SHORT_VERSION \
lua-$LUA_VERSION \
lua-$LUA_SHORT_VERSION \
lua; do
if test -z "$ac_lib"; then
ac_res="none required"
else
......@@ -4713,7 +4719,7 @@ $as_echo "enabled" >&6; }
if test "x$LUA" = 'x'; then :
for ac_prog in lua lua5.2 lua5.1 lua50
for ac_prog in lua lua5.2 lua52 lua5.1 lua51 lua50
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
......@@ -4790,7 +4796,7 @@ if ${ax_cv_lua_version+:} false; then :
else
ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^[0-9]\+\\.[0-9]\+"`
grep -E -o "^[0-9]+\.[0-9]+"`
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lua_version" >&5
......@@ -4954,6 +4960,7 @@ done
/usr/include/lua/$LUA_VERSION \
/usr/include/lua$LUA_SHORT_VERSION \
/usr/local/include/lua$LUA_VERSION \
/usr/local/include/lua-$LUA_VERSION \
/usr/local/include/lua/$LUA_VERSION \
/usr/local/include/lua$LUA_SHORT_VERSION \
; do
......@@ -5027,7 +5034,7 @@ _ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ax_cv_lua_header_version=`./conftest$EXEEXT p | \
sed "s|^Lua \(.*\)|\1|" | \
grep -o "^[0-9]\+\\.[0-9]\+"`
grep -E -o "^[0-9]+\.[0-9]+"`
else
ax_cv_lua_header_version='unknown'
......@@ -5307,7 +5314,11 @@ return lua_load ();
return 0;
}
_ACEOF
for ac_lib in '' lua$LUA_VERSION lua$LUA_SHORT_VERSION lua; do
for ac_lib in '' lua$LUA_VERSION \
lua$LUA_SHORT_VERSION \
lua-$LUA_VERSION \
lua-$LUA_SHORT_VERSION \
lua; do
if test -z "$ac_lib"; then
ac_res="none required"
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment