diff options
author | Reuben Thomas <rrt@sc3d.org> | 2010-09-22 12:45:53 +0100 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2010-09-22 12:45:53 +0100 |
commit | 6cc48ed67f28005e538891f51bd988309321a66d (patch) | |
tree | 1781fd7c3b06405f4213b6567e5c80288a0e6e9c /m4 | |
parent | c9d670b1d7f3d30780996f8ec1bdad2dd98b8592 (diff) | |
download | autoconf-archive-6cc48ed67f28005e538891f51bd988309321a66d.tar.gz |
Change AX_LUA_LIB_VERSION to AX_LUA_HEADERS_VERSION, as that's what we're really checking; add AX_LUA_READLINE.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ax_lua.m4 | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/m4/ax_lua.m4 b/m4/ax_lua.m4 index a9c27fe..d20bd94 100644 --- a/m4/ax_lua.m4 +++ b/m4/ax_lua.m4 @@ -7,8 +7,9 @@ # AX_WITH_LUA # AX_LUA_VERSION (MIN-VERSION, [TOO-BIG-VERSION]) # AX_LUA_HEADERS +# AX_LUA_HEADERS_VERSION (MIN-VERSION, [TOO-BIG-VERSION]) # AX_LUA_LIBS -# AX_LUA_LIB_VERSION (MIN-VERSION, [TOO-BIG-VERSION]) +# AX_LUA_READLINE # # DESCRIPTION # @@ -24,10 +25,13 @@ # HAVE_LUALIB_H if found, and defines LUA_INCLUDE to the preprocessor # flags needed, if any. # +# AX_LUA_HEADERS_VERSION checks that the Lua headers' version is at +# least MIN-VERSION, and less than TOO-BIG-VERSION, if given. +# # AX_LUA_LIBS searches for Lua libraries and defines LUA_LIB if found. # -# AX_LUA_LIB_VERSION checks that the Lua libraries' version is at least -# MIN-VERSION, and less than TOO-BIG-VERSION, if given. +# AX_LUA_READLINE configures Lua to be built with readline support, if +# available. This macro requires AX_LIB_READLINE. # # Versions are specified as three-digit integers whose first digit is the # major version and last two are the minor version (the same format as @@ -42,7 +46,7 @@ # # LICENSE # -# Copyright (c) 2009 Reuben Thomas <rrt@sc3d.org> +# Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org> # Copyright (c) 2009 Matthieu Moy <Matthieu.Moy@imag.fr> # Copyright (c) 2009 Tom Payne <twpayne@gmail.com> # @@ -72,7 +76,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 7 +#serial 8 dnl Helper function to declare extra options AC_DEFUN([_AX_LUA_OPTS], @@ -159,9 +163,9 @@ AC_DEFUN([AX_LUA_LIBS], [], [$LUA_LIB $lua_extra_libs])])dnl -AC_DEFUN([AX_LUA_LIB_VERSION], +AC_DEFUN([AX_LUA_HEADERS_VERSION], [_AX_LUA_OPTS - AC_MSG_CHECKING([liblua version is in range $1 <= v < $2]) + AC_MSG_CHECKING([lua.h version is in range $1 <= v < $2]) _AX_LUA_VERSIONS($1, $2) LUA_OLD_LIBS="$LIBS" LIBS="$LIBS $LUA_LIB" @@ -181,6 +185,12 @@ int main() ]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_FAILURE([Lua libraries version not in desired range])]) + AC_MSG_FAILURE([lua.h version not in desired range])]) LIBS="$LUA_OLD_LIBS" CPPFLAGS="$LUA_OLD_CPPFLAGS"])dnl + +AC_DEFUN([AX_LUA_READLINE], + [AX_LIB_READLINE + if test -n "$ac_cv_header_readline_readline_h" -a -n "$ac_cv_header_readline_history_h"; then + LUA_LIBS_CFLAGS="-DLUA_USE_READLINE $LUA_LIBS_CFLAGS" + fi])dnl |