forked from PowerDNS/pdns
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect LuaJIT first, then other implementations. Allows setting `--with-lua` to a specific implementation as well (e.g. `lua51`). Will produce errors appropriately. Fixes PowerDNS#6423.
- Loading branch information
1 parent
db77630
commit 0373298
Showing
14 changed files
with
54 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
AC_DEFUN([PDNS_WITH_LUA],[ | ||
AC_MSG_CHECKING([whether we will be linking in Lua]) | ||
AC_ARG_WITH([lua], | ||
[AS_HELP_STRING([--with-lua], [build Lua Bindings @<:@default=auto@:>@])], | ||
[with_lua=$withval], | ||
[with_lua=auto] | ||
) | ||
AC_MSG_CHECKING([which Lua implementation to use]) | ||
AC_ARG_WITH([lua], [ | ||
AS_HELP_STRING([--with-lua], [select Lua implementation @<:@default=auto@:>@]) | ||
], [ | ||
with_lua=$withval | ||
], [ | ||
with_lua=auto | ||
]) | ||
AC_MSG_RESULT([$with_lua]) | ||
AS_IF([test "x$with_lua" != "xno"],[ | ||
AS_IF([test "x$with_lua" = "xyes" -o "x$with_lua" = "xauto"], | ||
[for LUAPC in lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua; do | ||
PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [ | ||
AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua]) | ||
with_lua=yes | ||
], [LUAPC=""]) # otherwise pkg_check will fail | ||
if test "x$LUA_LIBS" != "x"; then break; fi | ||
done | ||
], | ||
[LUAPC="$with_lua" | ||
PKG_CHECK_MODULES([LUA], $LUAPC >= 5.1, [ | ||
AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua]) | ||
with_lua=yes | ||
AS_IF([test "x$with_lua" = "xno" -a "$1" = "mandatory"], [ | ||
AC_MSG_ERROR([--without-lua specified, but Lua is not optional]) | ||
]) | ||
LUAPC="" | ||
AS_IF([test "x$with_lua" != "xno"], [ | ||
AS_IF([test "x$with_lua" != "xauto"], [ | ||
PKG_CHECK_MODULES([LUA], $with_lua >= 5.1, [ | ||
AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have Lua]) | ||
LUAPC=$with_lua | ||
], [ | ||
AC_MSG_ERROR([Selected Lua not found]) | ||
]) | ||
], [ | ||
PKG_CHECK_MODULES([LUA], [luajit], [LUAPC=luajit], [ : ]) | ||
AS_IF([test -z "$LUAPC"], [ | ||
found_lua=n | ||
m4_foreach_w([luapc], [lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua], [ | ||
AS_IF([test "$found_lua" != "y"], [ | ||
PKG_CHECK_MODULES([LUA], luapc >= 5.1, [ | ||
AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua]) | ||
found_lua=y | ||
LUAPC=luapc | ||
], [ : ]) | ||
]) | ||
]) | ||
]) | ||
AC_MSG_CHECKING([for chosen LUA]) | ||
AS_IF([test "x$LUAPC" = "x"], [ | ||
AS_IF([test "x$with_lua" = "xyes"], | ||
[AC_MSG_ERROR([cannot find lua])], | ||
[AC_MSG_RESULT([not found])] | ||
)],[ | ||
AC_MSG_RESULT([$LUAPC]) | ||
]) | ||
]) | ||
AM_CONDITIONAL([LUA], [test "x$with_lua" = "xyes"]) | ||
]) | ||
AS_IF([test -z "$LUAPC" -a "$1" = "mandatory"], [ | ||
AC_MSG_ERROR([No Lua not found, but is mandatory]) | ||
]) | ||
AM_CONDITIONAL([LUA], [test -n "x$LUAPC"]) | ||
]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.