mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[configure.ac] --with-luapkg=name let user choose Lua version
For example: --with-luapkg=luajit or --with-luapkg=lua5.2 etc. If you do not want lua, omit this configure option or pass --with-luapkg= Old --without-lua was removed.
This commit is contained in:
parent
1e54b8caf6
commit
e4b10df949
47
configure.ac
47
configure.ac
@ -878,42 +878,29 @@ fi
|
|||||||
# Check for Lua, optional even if installed.
|
# Check for Lua, optional even if installed.
|
||||||
# ===================================================================
|
# ===================================================================
|
||||||
|
|
||||||
# Do this the long way, as FreeBSD reportedly needs -L<dir> for
|
luapkg=
|
||||||
# anything other than /usr/lib, and Lua is very often in /usr/local/lib.
|
AC_ARG_WITH(luapkg, [ --with-luapkg=name choose Lua version],
|
||||||
|
[luapkg="$withval"])
|
||||||
AC_ARG_WITH(lua, [ --without-lua disable Lua support],
|
|
||||||
[if test "$withval" = no; then disable_lua=yes; fi])
|
|
||||||
AC_MSG_CHECKING([for Lua])
|
AC_MSG_CHECKING([for Lua])
|
||||||
|
|
||||||
EL_SAVE_FLAGS
|
EL_SAVE_FLAGS
|
||||||
cf_result=no
|
cf_result=no
|
||||||
|
|
||||||
if test -z "$disable_lua"; then
|
if test -n "$luapkg" && $PKG_CONFIG "$luapkg"; then
|
||||||
if test ! -d "$withval"; then
|
LUA_CFLAGS=`$PKG_CONFIG --cflags "$luapkg"`
|
||||||
withval="";
|
LUA_LIBS=`$PKG_CONFIG --libs "$luapkg"`
|
||||||
fi
|
CFLAGS="$CFLAGS_X $LUA_CFLAGS"
|
||||||
for luadir in "$withval" "" /usr /usr/local; do
|
CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
|
||||||
for suffix in "" 5.1 51 5.3 53 5.2 52; do
|
LIBS="$LUA_LIBS $LIBS_X"
|
||||||
if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \
|
|
||||||
test -f "$luadir/include/lua$suffix/lua.h" ) ; then
|
|
||||||
LUA_LIBS="-L$luadir/lib -llua$suffix -lm"
|
|
||||||
LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix"
|
|
||||||
|
|
||||||
LIBS="$LUA_LIBS $LIBS_X"
|
# Check that it is a compatible Lua version
|
||||||
CFLAGS="$CFLAGS_X $LUA_CFLAGS"
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lauxlib.h>]
|
||||||
CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS"
|
#include <lua.h>
|
||||||
|
#include <lualib.h>
|
||||||
# Check that it is a compatible Lua version
|
], [[lua_State *L = luaL_newstate();
|
||||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lauxlib.h>]
|
luaL_openlibs(L);
|
||||||
#include <lua.h>
|
lua_pushboolean(L, 1);
|
||||||
#include <lualib.h>
|
lua_close(L);]])],[cf_result=yes],[cf_result=no])
|
||||||
], [[ lua_State *L = luaL_newstate();
|
|
||||||
luaL_openlibs(L);
|
|
||||||
lua_pushboolean(L, 1);
|
|
||||||
lua_close(L);]])],[cf_result=yes],[cf_result=no])
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_RESULT($cf_result)
|
AC_MSG_RESULT($cf_result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user